kpanelapplet.h
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 class KConfig;
00028
00029 #include <qframe.h>
00030
00096 class KPanelApplet : public QFrame
00097 {
00098 Q_OBJECT
00099
00100 public:
00101
00105 enum Type { Normal = 0, Stretch };
00110 enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
00111
00112 enum Position { pLeft = 0, pRight, pTop, pBottom };
00113 enum Alignment { LeftTop = 0, Center, RightBottom };
00114
00115 enum Direction { Up = 0, Down, Left, Right };
00116
00126 KPanelApplet(const QString& configFile, Type t = Normal,
00127 int actions = 0, QWidget *parent = 0, const char *name = 0,
00128 WFlags f = 0);
00129
00133 ~KPanelApplet();
00134
00154 virtual int widthForHeight(int height) const { return height; }
00155
00175 virtual int heightForWidth(int width) const { return width; }
00176
00186 KConfig* config() const { return _config; }
00187
00192 Type type() const { return _type; }
00193
00198 int actions() const { return _actions; }
00199
00210 virtual void action( Action a );
00211
00215 void setPosition( Position p );
00219 void setAlignment( Alignment a );
00220
00221 signals:
00236 void updateLayout();
00237
00241 void requestFocus();
00242
00243 protected:
00244
00252 virtual void about() {}
00253
00261 virtual void help() {}
00262
00270 virtual void preferences() {}
00271
00280 virtual void reportBug() {}
00281
00285 Orientation orientation() const;
00289 Position position() const { return _position; }
00293 Alignment alignment() const { return _alignment; }
00294
00300 virtual void positionChange( Position p );
00301
00307 virtual void alignmentChange( Alignment ) {};
00308
00315
00316 virtual void orientationChange( Orientation ) {}
00317
00325
00326 Direction popupDirection();
00327
00334
00335 virtual void popupDirectionChange( Direction ) {}
00336
00337 private:
00338 Type _type;
00339 Position _position;
00340 Alignment _alignment;
00341 KConfig* _config;
00342 int _actions;
00343 protected:
00344 virtual void virtual_hook( int id, void* data );
00345 class KPanelAppletPrivate;
00346 KPanelAppletPrivate *d;
00347 };
00348
00349 #endif
This file is part of the documentation for kdelibs Version 3.1.0.