• Skip to content
  • Skip to link menu
KDE 4.2 API Reference
  • KDE API Reference
  • kdelibs
  • Sitemap
  • Contact Us
 

Plasma

extenderitem.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2008 by Rob Scheepmaker <r.scheepmaker@student.utwente.nl>
00003  *
00004  * This library is free software; you can redistribute it and/or
00005  * modify it under the terms of the GNU Lesser General Public
00006  * License as published by the Free Software Foundation; either
00007  * version 2.1 of the License, or (at your option) any later version.
00008  *
00009  * This library is distributed in the hope that it will be useful,
00010  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00011  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012  * Lesser General Public License for more details.
00013  *
00014  * You should have received a copy of the GNU Lesser General Public
00015  * License along with this library; if not, write to the Free Software
00016  * Foundation, Inc., 51 Franklin St, Fifth Floor,
00017  * Boston, MA  02110-1301  USA
00018  */
00019 
00020 #ifndef PLASMA_EXTENDERITEM_H
00021 #define PLASMA_EXTENDERITEM_H
00022 
00023 #include <QtGui/QGraphicsWidget>
00024 
00025 #include <kconfiggroup.h>
00026 #include <kicon.h>
00027 
00028 #include "plasma/plasma_export.h"
00029 
00030 namespace Plasma
00031 {
00032 
00033 class Applet;
00034 class Extender;
00035 class ExtenderItemPrivate;
00036 
00074 class PLASMA_EXPORT ExtenderItem : public QGraphicsWidget
00075 {
00076     Q_OBJECT
00077     Q_PROPERTY(QGraphicsItem * widget READ widget WRITE setWidget)
00078     Q_PROPERTY(QString title READ title WRITE setTitle)
00079     Q_PROPERTY(QString name READ name WRITE setName)
00080     Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
00081     Q_PROPERTY(Extender * extender READ extender WRITE setExtender)
00082     Q_PROPERTY(bool collapsed READ isCollapsed WRITE setCollapsed)
00083     Q_PROPERTY(bool detached READ isDetached)
00084     Q_PROPERTY(uint autoExpireDelay WRITE setAutoExpireDelay)
00085 
00086     public:
00093         explicit ExtenderItem(Extender *hostExtender, uint extenderItemId = 0);
00094 
00095         ~ExtenderItem();
00096 
00101         KConfigGroup config() const;
00102 
00106         void setWidget(QGraphicsItem *widget);
00107 
00111         QGraphicsItem *widget() const;
00112 
00118         void setTitle(const QString &title);
00119 
00123         QString title() const;
00124 
00131         void setName(const QString &name);
00132 
00136         QString name() const;
00137 
00144         void setIcon(const QString &icon);
00145 
00150         void setIcon(const QIcon &icon);
00151 
00155         QIcon icon() const;
00156 
00162         void setExtender(Extender *extender, const QPointF &pos = QPointF(-1, -1));
00163 
00167         Extender *extender() const;
00168 
00173         void setAutoExpireDelay(uint time);
00174 
00178         uint autoExpireDelay() const;
00179 
00183         bool isDetached() const;
00184 
00188         bool isCollapsed() const;
00189 
00195         void addAction(const QString &name, QAction *action);
00196 
00202         QAction *action(const QString &name) const;
00203 
00204     public Q_SLOTS:
00209         void destroy();
00210 
00214         void setCollapsed(bool collapsed);
00215 
00219         void returnToSource();
00220 
00225         void showCloseButton();
00226 
00230         void hideCloseButton();
00231 
00232     protected:
00233         void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
00234 
00235         void moveEvent(QGraphicsSceneMoveEvent *event);
00236         void resizeEvent(QGraphicsSceneResizeEvent *event);
00237 
00238         void mousePressEvent(QGraphicsSceneMouseEvent *event);
00239         void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
00240         void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
00241         void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
00242 
00243         void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
00244         void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
00245 
00246     private:
00247         Q_PRIVATE_SLOT(d, void toggleCollapse())
00248         Q_PRIVATE_SLOT(d, void updateToolBox())
00249         Q_PRIVATE_SLOT(d, void themeChanged())
00250         Q_PRIVATE_SLOT(d, void sourceAppletRemoved())
00251         Q_PRIVATE_SLOT(d, void previousTargetExtenderDestroyed(QObject*))
00252         Q_PRIVATE_SLOT(d, void actionDestroyed(QObject*))
00253 
00254         ExtenderItemPrivate * const d;
00255 
00256         friend class Extender;
00257         friend class ExtenderPrivate;
00258 };
00259 } // namespace Plasma
00260 #endif // PLASMA_EXTENDERITEM_H

Plasma

Skip menu "Plasma"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

kdelibs

Skip menu "kdelibs"
  • DNSSD
  • Interfaces
  •   KHexEdit
  •   KMediaPlayer
  •   KSpeech
  •   KTextEditor
  • Kate
  • kconf_update
  • KDE3Support
  •   KUnitTest
  • KDECore
  • KDED
  • KDEsu
  • KDEUI
  • KDocTools
  • KFile
  • KHTML
  • KImgIO
  • KInit
  • kio
  • KIOSlave
  • KJS
  •   KJS-API
  •   WTF
  • kjsembed
  • KNewStuff
  • KParts
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.5.7
This website is maintained by Adriaan de Groot and Allen Winter.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. | Legal