KDE3Support
k3panelapplet.h
Go to the documentation of this file.00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024 #ifndef __kpanelapplet_h__
00025 #define __kpanelapplet_h__
00026
00027 #include <kde3support_export.h>
00028 #include <QtGui/QFrame>
00029
00030 #include <ksharedconfig.h>
00031
00032 class QMenu;
00033
00098 class KDE3SUPPORT_EXPORT K3PanelApplet : public QFrame
00099 {
00100 Q_OBJECT
00101
00102 public:
00103 enum Type { Normal = 0, Stretch };
00104 enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
00105 enum Position { Left = 0, Right, Up, Down, Top = Up, Bottom = Down, Floating };
00106 enum Alignment { LeftTop = 0, Center, RightBottom };
00107
00117 explicit K3PanelApplet(const QString& configFile, Type t = Normal,
00118 int actions = 0, QWidget *parent = 0, Qt::WFlags f = 0);
00119
00123 ~K3PanelApplet();
00124
00144 virtual int widthForHeight(int height) const { return height; }
00145
00165 virtual int heightForWidth(int width) const { return width; }
00166
00176 KConfig* config() const;
00177 KSharedConfig::Ptr sharedConfig() const;
00178
00183 Type type() const;
00184
00189 int actions() const;
00190
00201 virtual void action( Action a );
00202
00207 const QMenu* customMenu() const;
00208
00212 void setPosition( Position p );
00216 void setAlignment( Alignment a );
00217
00218 Q_SIGNALS:
00233 void updateLayout();
00234
00239 void requestFocus();
00240
00249 void requestFocus(bool focus);
00250
00251 protected:
00252
00260 virtual void about() {}
00261
00269 virtual void help() {}
00270
00278 virtual void preferences() {}
00279
00288 virtual void reportBug() {}
00289
00293 Qt::Orientation orientation() const;
00297 Position position() const;
00301 Alignment alignment() const;
00302
00308 virtual void positionChange( Position p );
00309
00315 virtual void alignmentChange( Alignment ) {}
00316
00326 void setCustomMenu(const QMenu*);
00327
00334 void watchForFocus(QWidget* widget, bool watch = true);
00335
00341 void needsFocus(bool focus);
00342
00349
00350 virtual KDE_DEPRECATED void orientationChange( Qt::Orientation ) {}
00351
00356 Position popupDirection();
00357
00364
00365 virtual KDE_DEPRECATED void popupDirectionChange( Position ) {}
00366
00367 bool eventFilter(QObject *, QEvent *);
00368
00369 protected:
00370 class Private;
00371 Private *d;
00372 };
00373
00374 #endif