00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
00025 #ifndef KSG_KSYSGUARDAPPLET_H
00026 #define KSG_KSYSGUARDAPPLET_H
00027
00028 #include <kpanelapplet.h>
00029
00030 namespace KSGRD
00031 {
00032 class SensorBoard;
00033 class SensorDisplay;
00034 }
00035
00036 class TQDragEnterEvent;
00037 class TQDropEvent;
00038 class TQPoint;
00039 class KSGAppletSettings;
00040
00041 class KSysGuardApplet : public KPanelApplet, public KSGRD::SensorBoard
00042 {
00043 Q_OBJECT
00044
00045 public:
00046 KSysGuardApplet( const TQString& configFile, Type type = Normal,
00047 int actions = 0, TQWidget *parent = 0,
00048 const char *name = 0 );
00049 virtual ~KSysGuardApplet();
00050
00051 virtual int heightForWidth( int width ) const;
00052 virtual int widthForHeight( int height ) const;
00053
00054 virtual void preferences();
00055
00056 protected:
00057 void resizeEvent( TQResizeEvent* );
00058 void dragEnterEvent( TQDragEnterEvent* );
00059 void dropEvent( TQDropEvent* );
00060 void customEvent( TQCustomEvent* );
00061
00062
00063 private slots:
00064 void applySettings();
00065 void sensorDisplayModified( bool );
00066 void preferencesFinished();
00067
00068 private:
00069 void layout();
00070 void resizeDocks( uint newDockCount );
00071 void addEmptyDisplay( TQWidget **dock, uint pos );
00072
00073 bool load();
00074 bool save();
00075
00076 int findDock( const TQPoint& );
00077 void removeDisplay( KSGRD::SensorDisplay* );
00078
00079 double mSizeRatio;
00080 uint mDockCount;
00081 KSGAppletSettings* mSettingsDlg;
00082 TQWidget** mDockList;
00083 };
00084
00085 #endif