kdeui
kpanelextension.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 __kpanelextension_h__
00025 #define __kpanelextension_h__
00026
00027 class QPopupMenu;
00028 class KConfig;
00029 class KPanelExtensionPrivate;
00030
00031 #include <qframe.h>
00032
00033 #include <kdelibs_export.h>
00034
00098 class KDEUI_EXPORT KPanelExtension : public QFrame
00099 {
00100 Q_OBJECT
00101
00102 public:
00103
00105 enum Type { Normal = 0, Stretch };
00106
00108 enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
00109 enum Position { Left = 0, Right, Top, Bottom, Floating };
00110 enum Alignment { LeftTop = 0, Center, RightBottom };
00112 enum Size { SizeTiny = 0, SizeSmall, SizeNormal, SizeLarge, SizeCustom };
00113
00123 KPanelExtension(const QString& configFile, Type t = Normal,
00124 int actions = 0, QWidget *parent = 0, const char *name = 0);
00125
00129 ~KPanelExtension();
00130
00140 virtual QSize sizeHint(Position , QSize maxsize) const { return maxsize; }
00141
00151 KConfig* config() const { return _config; }
00152
00157 Type type() const { return _type; }
00158
00163 int actions() const { return _actions; }
00164
00175 virtual void action( Action a );
00176
00177
00184 virtual Position preferedPosition() const { return Bottom; }
00185
00189 void setPosition( Position p );
00193 void setAlignment( Alignment a );
00198 void setSize( Size size, int customSize );
00199
00204 Size sizeSetting() const;
00205
00210 int customSize() const;
00211
00217 QPopupMenu* customMenu() const;
00218
00225 bool reserveStrut() const;
00226
00227 signals:
00233 void updateLayout();
00234
00239 void maintainFocus(bool);
00240
00241 protected:
00242
00250 virtual void about() {}
00251
00259 virtual void help() {}
00260
00268 virtual void preferences() {}
00269
00278 virtual void reportBug() {}
00279
00283 Position position() const { return _position; }
00284
00288 Alignment alignment() const { return _alignment; }
00289
00293 Orientation orientation();
00294
00299 int sizeInPixels() const;
00300
00306 virtual void positionChange( Position ) {}
00307
00313 virtual void alignmentChange( Alignment ) {}
00314
00325 void setCustomMenu(QPopupMenu*);
00326
00332 void setReserveStrut(bool shouldUseStrut);
00333
00334 private:
00335 Type _type;
00336 Position _position;
00337 Alignment _alignment;
00338 KConfig* _config;
00339 int _actions;
00340 protected:
00341 virtual void virtual_hook( int id, void* data );
00342 private:
00343 KPanelExtensionPrivate *d;
00344 };
00345
00346 #endif