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 <kdemacros.h>
00032 #include <kconfig.h>
00033 
00099 class KPanelApplet : public QFrame
00100 {
00101     Q_OBJECT
00102 
00103 public:
00104 
00108     enum Type { Normal = 0, Stretch };
00113     enum Action { About = 1, Help = 2, Preferences = 4, ReportBug = 8 };
00114     
00115     enum Position { pLeft = 0, pRight, pTop, pBottom };
00116     enum Alignment { LeftTop = 0, Center, RightBottom };
00117     
00118     enum Direction { Up = 0, Down, Left, Right };
00119 
00130     KPanelApplet(const QString& configFile, Type t = Normal,
00131                  int actions = 0, QWidget *parent = 0, const char *name = 0,
00132                  WFlags f = 0);
00133 
00137     ~KPanelApplet();
00138 
00158     virtual int widthForHeight(int height) const { return height; }
00159 
00179     virtual int heightForWidth(int width) const { return width; }
00180 
00190     KConfig* config() const { return _config; }
00191     KSharedConfig::Ptr sharedConfig() const;
00192 
00197     Type type() const { return _type; }
00198 
00203     int actions() const { return _actions; }
00204 
00215     virtual void action( Action a );
00216 
00221     const QPopupMenu* customMenu() const;
00222 
00226     void setPosition( Position p );
00230     void setAlignment( Alignment a );
00231 
00232 signals:
00247     void updateLayout();
00248 
00252     void requestFocus();
00253 
00254 protected:
00255 
00263     virtual void about() {}
00264 
00272     virtual void help() {}
00273 
00281     virtual void preferences() {}
00282 
00291    virtual void reportBug() {}
00292 
00296     Orientation orientation() const;
00300     Position position() const { return _position; }
00304     Alignment alignment() const { return _alignment; }
00305 
00311     virtual void positionChange( Position p );
00312 
00318     virtual void alignmentChange( Alignment  ) {};
00319 
00329     void setCustomMenu(const QPopupMenu*);
00330 
00337     
00338     virtual KDE_DEPRECATED void orientationChange( Orientation ) {}
00339 
00347     
00348     Direction popupDirection() KDE_DEPRECATED;
00349 
00356     
00357     virtual KDE_DEPRECATED void popupDirectionChange( Direction  ) {}
00358 
00359 private:
00360     Type         _type;
00361     Position     _position;
00362     Alignment    _alignment;
00363     KConfig*     _config;
00364     int          _actions;
00365 protected:
00366     virtual void virtual_hook( int id, void* data );
00367     class KPanelAppletPrivate;
00368     KPanelAppletPrivate *d;
00369 };
00370 
00371 #endif
 
This file is part of the documentation for kdeui Library Version 3.2.0.