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 class QPopupMenu;
00029
00030 #include <qframe.h>
00031 #include <kconfig.h>
00032
00097 class KDEUI_EXPORT KPanelApplet : public QFrame
00098 {
00099 Q_OBJECT
00100
00101 public:
00102
00106 enum Type { Normal = 0, Stretch };
00111
00112 enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
00113 enum Position { pLeft = 0, pRight, pTop, pBottom };
00114 enum Alignment { LeftTop = 0, Center, RightBottom };
00115 enum Direction { Up = 0, Down, Left, Right };
00116
00127 KPanelApplet(const QString& configFile, Type t = Normal,
00128 int actions = 0, QWidget *parent = 0, const char *name = 0,
00129 WFlags f = 0);
00130
00134 ~KPanelApplet();
00135
00155 virtual int widthForHeight(int height) const { return height; }
00156
00176 virtual int heightForWidth(int width) const { return width; }
00177
00187 KConfig* config() const { return _config; }
00188 KSharedConfig::Ptr sharedConfig() const;
00189
00194 Type type() const { return _type; }
00195
00200 int actions() const { return _actions; }
00201
00212 virtual void action( Action a );
00213
00218 const QPopupMenu* customMenu() const;
00219
00223 void setPosition( Position p );
00227 void setAlignment( Alignment a );
00228
00229 signals:
00244 void updateLayout();
00245
00250 void requestFocus();
00251
00252
00253 protected:
00254
00262 virtual void about() {}
00263
00271 virtual void help() {}
00272
00280 virtual void preferences() {}
00281
00290 virtual void reportBug() {}
00291
00295 Orientation orientation() const;
00299 Position position() const { return _position; }
00303 Alignment alignment() const { return _alignment; }
00304
00310 virtual void positionChange( Position p );
00311
00317 virtual void alignmentChange( Alignment ) {};
00318
00328 void setCustomMenu(const QPopupMenu*);
00329
00330
00337
00338 virtual KDE_DEPRECATED void orientationChange( Orientation ) {}
00339
00344 Direction popupDirection();
00345
00352
00353 virtual KDE_DEPRECATED void popupDirectionChange( Direction ) {}
00354
00355
00356 private:
00357 Type _type;
00358 Position _position;
00359 Alignment _alignment;
00360 KConfig* _config;
00361 int _actions;
00362 protected:
00363 virtual void virtual_hook( int id, void* data );
00364 class KPanelAppletPrivate;
00365 KPanelAppletPrivate *d;
00366 };
00367
00368 #endif
This file is part of the documentation for kdeui Library Version 3.3.90.