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 KSG_WORKSHEET_H
00025 #define KSG_WORKSHEET_H
00026
00027 #include <tqwidget.h>
00028
00029 #include <SensorDisplay.h>
00030
00031 class TQDomElement;
00032 class TQDragEnterEvent;
00033 class TQDropEvent;
00034 class TQGridLayout;
00035 class TQString;
00036 class TQStringList;
00037
00045 class WorkSheet : public TQWidget, public KSGRD::SensorBoard
00046 {
00047 Q_OBJECT
00048
00049 public:
00050 WorkSheet( TQWidget* parent, const char *name = 0 );
00051 WorkSheet( uint rows, uint columns, uint interval, TQWidget* parent,
00052 const char *name = 0 );
00053 ~WorkSheet();
00054
00055 bool load( const TQString &fileName );
00056 bool save( const TQString &fileName );
00057
00058 void cut();
00059 void copy();
00060 void paste();
00061
00062 void setFileName( const TQString &fileName );
00063 const TQString& fileName() const;
00064
00065 bool modified() const;
00066
00067 void setTitle( const TQString &title );
00068 TQString title() const;
00069
00070 KSGRD::SensorDisplay* addDisplay( const TQString &hostname,
00071 const TQString &monitor,
00072 const TQString &sensorType,
00073 const TQString &sensorDescr,
00074 uint rows, uint columns );
00075
00076
00077 KSGRD::SensorDisplay *display( uint row, uint column );
00078
00079 void settings();
00080
00081 void setIsOnTop( bool onTop );
00082
00083 public slots:
00084 void showPopupMenu( KSGRD::SensorDisplay *display );
00085 void setModified( bool mfd );
00086 void applyStyle();
00087
00088 signals:
00089 void sheetModified( TQWidget *sheet );
00090 void titleChanged( TQWidget *sheet );
00091
00092 protected:
00093 virtual TQSize sizeHint() const;
00094 void dragEnterEvent( TQDragEnterEvent* );
00095 void dropEvent( TQDropEvent* );
00096 void customEvent( TQCustomEvent* );
00097
00098 private:
00099 void removeDisplay( KSGRD::SensorDisplay *display );
00100
00101 bool replaceDisplay( uint row, uint column, TQDomElement& element );
00102
00103 void replaceDisplay( uint row, uint column,
00104 KSGRD::SensorDisplay* display = 0 );
00105
00106 void collectHosts( TQStringList &list );
00107
00108 void createGrid( uint rows, uint columns );
00109
00110 void resizeGrid( uint rows, uint columns );
00111
00112 KSGRD::SensorDisplay* currentDisplay( uint* row = 0, uint* column = 0 );
00113
00114 void fixTabOrder();
00115
00116 TQString currentDisplayAsXML();
00117
00118 bool mModified;
00119
00120 uint mRows;
00121 uint mColumns;
00122
00123 TQGridLayout* mGridLayout;
00124 TQString mFileName;
00125 TQString mTitle;
00126
00132 KSGRD::SensorDisplay*** mDisplayList;
00133 };
00134
00135 #endif