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

Plasma

extenderitem.h

Go to the documentation of this file.
00001 /*
00002  * Copyright 2008, 2009 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 ExtenderGroup;
00036 class ExtenderItemPrivate;
00037 
00080 class PLASMA_EXPORT ExtenderItem : public QGraphicsWidget
00081 {
00082     Q_OBJECT
00083     Q_PROPERTY(QGraphicsItem * widget READ widget WRITE setWidget)
00084     Q_PROPERTY(QString title READ title WRITE setTitle)
00085     Q_PROPERTY(QString name READ name WRITE setName)
00086     Q_PROPERTY(QIcon icon READ icon WRITE setIcon)
00087     Q_PROPERTY(Extender * extender READ extender WRITE setExtender)
00088     Q_PROPERTY(bool collapsed READ isCollapsed WRITE setCollapsed)
00089     Q_PROPERTY(bool detached READ isDetached)
00090     Q_PROPERTY(uint autoExpireDelay READ autoExpireDelay WRITE setAutoExpireDelay)
00091 
00092     public:
00099         explicit ExtenderItem(Extender *hostExtender, uint extenderItemId = 0);
00100 
00101         ~ExtenderItem();
00102 
00107         KConfigGroup config() const;
00108 
00112         void setWidget(QGraphicsItem *widget);
00113 
00117         QGraphicsItem *widget() const;
00118 
00124         void setTitle(const QString &title);
00125 
00129         QString title() const;
00130 
00137         void setName(const QString &name);
00138 
00142         QString name() const;
00143 
00150         void setIcon(const QString &icon);
00151 
00156         void setIcon(const QIcon &icon);
00157 
00161         QIcon icon() const;
00162 
00168         void setExtender(Extender *extender, const QPointF &pos = QPointF(-1, -1));
00169 
00173         Extender *extender() const;
00174 
00180         void setGroup(ExtenderGroup *group);
00181 
00186         ExtenderGroup *group() const;
00187 
00192         bool isGroup() const;
00193 
00198         void setAutoExpireDelay(uint time);
00199 
00203         uint autoExpireDelay() const;
00204 
00208         bool isDetached() const;
00209 
00213         bool isCollapsed() const;
00214 
00220         void addAction(const QString &name, QAction *action);
00221 
00227         QAction *action(const QString &name) const;
00228 
00229     public Q_SLOTS:
00234         void destroy();
00235 
00239         void setCollapsed(bool collapsed);
00240 
00244         void returnToSource();
00245 
00250         void showCloseButton();
00251 
00255         void hideCloseButton();
00256 
00257     protected:
00258         void paint(QPainter *painter, const QStyleOptionGraphicsItem *option, QWidget *widget);
00259 
00260         void moveEvent(QGraphicsSceneMoveEvent *event);
00261         void resizeEvent(QGraphicsSceneResizeEvent *event);
00262 
00263         void mousePressEvent(QGraphicsSceneMouseEvent *event);
00264         void mouseDoubleClickEvent(QGraphicsSceneMouseEvent *event);
00265         void mouseMoveEvent(QGraphicsSceneMouseEvent *event);
00266         void mouseReleaseEvent(QGraphicsSceneMouseEvent *event);
00267 
00268         void hoverMoveEvent(QGraphicsSceneHoverEvent *event);
00269         void hoverLeaveEvent(QGraphicsSceneHoverEvent *event);
00270 
00271         bool sceneEventFilter(QGraphicsItem *watched, QEvent *event);
00272 
00273     private:
00274         Q_PRIVATE_SLOT(d, void toggleCollapse())
00275         Q_PRIVATE_SLOT(d, void updateToolBox())
00276         Q_PRIVATE_SLOT(d, void themeChanged())
00277         Q_PRIVATE_SLOT(d, void sourceAppletRemoved())
00278         Q_PRIVATE_SLOT(d, void actionDestroyed(QObject*))
00279 
00280         ExtenderItemPrivate * const d;
00281 
00282         friend class Extender;
00283         friend class ExtenderPrivate;
00284         friend class ExtenderItemPrivate;
00285 };
00286 } // namespace Plasma
00287 #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
  • KPty
  • Kross
  • KUtils
  • Nepomuk
  • Plasma
  • Solid
  • Sonnet
  • ThreadWeaver
Generated for kdelibs by doxygen 1.6.1
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