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

Plasma

extender.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_EXTENDER_H
00021 #define PLASMA_EXTENDER_H
00022 
00023 #include <QtGui/QGraphicsWidget>
00024 
00025 #include "plasma/framesvg.h"
00026 #include "plasma/plasma_export.h"
00027 
00028 namespace Plasma
00029 {
00030 
00031 class ExtenderGroup;
00032 class ExtenderPrivate;
00033 class ExtenderItem;
00034 class Applet;
00035 
00065 class PLASMA_EXPORT Extender : public QGraphicsWidget
00066 {
00067     Q_OBJECT
00068     Q_PROPERTY(QString emptyExtenderMessage READ emptyExtenderMessage WRITE setEmptyExtenderMessage)
00069 
00070     public:
00074         enum Appearance {
00075             NoBorders = 0,  
00078             BottomUpStacked = 1, 
00084             TopDownStacked = 2 
00090         };
00091 
00102         explicit Extender(Applet *applet);
00103 
00104         ~Extender();
00105 
00109         void setEmptyExtenderMessage(const QString &message);
00110 
00114         QString emptyExtenderMessage() const;
00115 
00120         QList<ExtenderItem*> items() const;
00121 
00125         QList<ExtenderItem*> attachedItems() const;
00126 
00130         QList<ExtenderItem*> detachedItems() const;
00131 
00139         ExtenderItem *item(const QString &name) const;
00140 
00147         ExtenderGroup *group(const QString &name) const;
00148 
00157         bool hasItem(const QString &name) const;
00158 
00163         bool isEmpty() const;
00164 
00171         void setAppearance(Appearance appearance);
00172 
00176         Appearance appearance() const;
00177 
00182         QList<ExtenderGroup*> groups() const;
00183 
00184     protected:
00193         virtual void itemAddedEvent(ExtenderItem *item, const QPointF &pos = QPointF(-1, -1));
00194 
00200         virtual void itemRemovedEvent(ExtenderItem *item);
00201 
00206         virtual void itemHoverEnterEvent(ExtenderItem *item);
00207 
00217         virtual void itemHoverMoveEvent(ExtenderItem *item, const QPointF &pos);
00218 
00223         virtual void itemHoverLeaveEvent(ExtenderItem *item);
00224 
00231         virtual void saveState();
00232 
00239         virtual FrameSvg::EnabledBorders enabledBordersForItem(ExtenderItem *item) const;
00240 
00244         QVariant itemChange(GraphicsItemChange change, const QVariant &value);
00245 
00249         void resizeEvent(QGraphicsSceneResizeEvent *event);
00250 
00254         void mousePressEvent(QGraphicsSceneMouseEvent *event);
00255 
00259         void dragEnterEvent(QGraphicsSceneDragDropEvent *event);
00260 
00264         void dragMoveEvent(QGraphicsSceneDragDropEvent *event);
00265 
00269         void dragLeaveEvent(QGraphicsSceneDragDropEvent *event);
00270 
00274         void dropEvent(QGraphicsSceneDragDropEvent *event);
00275 
00276     Q_SIGNALS:
00280         void itemAttached(Plasma::ExtenderItem *);
00281 
00285         void itemDetached(Plasma::ExtenderItem *);
00286 
00290         void geometryChanged();
00291 
00292     private:
00293         ExtenderPrivate *const d;
00294 
00295         friend class ExtenderPrivate;
00296         friend class ExtenderGroup;
00297         friend class ExtenderGroupPrivate;
00298         friend class ExtenderItem;
00299         friend class ExtenderItemPrivate;
00300         //dialog needs access to the extender's applet location.
00301         friend class DialogPrivate;
00302         //applet should be able to call saveState();
00303         friend class Applet;
00304 
00305     };
00306 } // Plasma namespace
00307 
00308 #endif //PLASMA_EXTENDER_H
00309 

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