2
KSysGuard, the KDE System Guard
4
Copyright (c) 1999 - 2002 Chris Schlaeger <cs@kde.org>
6
This program is free software; you can redistribute it and/or
7
modify it under the terms of the GNU General Public
8
License version 2 or at your option version 3 as published by
9
the Free Software Foundation.
11
This program is distributed in the hope that it will be useful,
12
but WITHOUT ANY WARRANTY; without even the implied warranty of
13
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14
GNU General Public License for more details.
16
You should have received a copy of the GNU General Public License
17
along with this program; if not, write to the Free Software
18
Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301, USA.
22
#ifndef KSG_WORKSHEET_H
23
#define KSG_WORKSHEET_H
28
#include <SensorDisplay.h>
29
#include "SharedSettings.h"
32
class QDragEnterEvent;
39
A WorkSheet contains the displays to visualize the sensor results. When
40
creating the WorkSheet you must specify the number of columns. Displays
41
can be added and removed on the fly. The grid layout will handle the
42
layout. The number of columns can not be changed. Displays are added by
43
dragging a sensor from the sensor browser over the WorkSheet.
45
class WorkSheet : public QWidget
50
explicit WorkSheet( QWidget* parent);
51
WorkSheet( int rows, int columns, float interval, QWidget* parent);
54
bool load( const QString &fileName );
55
bool save( const QString &fileName );
56
bool exportWorkSheet( const QString &fileName );
62
void setFileName( const QString &fileName );
63
QString fileName() const;
65
QString fullFileName() const;
67
bool isLocked() const {return mSharedSettings.locked;}
69
QString title() const;
70
QString translatedTitle() const;
73
KSGRD::SensorDisplay* addDisplay( const QString &hostname,
74
const QString &monitor,
75
const QString &sensorType,
76
const QString &sensorDescr,
80
float updateInterval() const;
83
void showPopupMenu( KSGRD::SensorDisplay *display );
84
void setTitle( const QString &title );
88
void titleChanged( QWidget *sheet );
92
virtual void changeEvent( QEvent * event );
93
virtual QSize sizeHint() const;
94
virtual void dragMoveEvent( QDragMoveEvent* );
95
virtual void dragEnterEvent( QDragEnterEvent* );
96
void dropEvent( QDropEvent* );
97
bool event( QEvent* );
98
void setUpdateInterval( float interval);
101
void removeDisplay( KSGRD::SensorDisplay *display );
103
bool replaceDisplay( int index, QDomElement& element );
105
void replaceDisplay( int index,
106
KSGRD::SensorDisplay* display = 0 );
108
void collectHosts( QStringList &list );
110
void createGrid( int rows, int columns );
112
void resizeGrid( int rows, int columns );
114
KSGRD::SensorDisplay* currentDisplay( int *index = NULL);
118
QString currentDisplayAsXML();
123
QGridLayout* mGridLayout;
125
QString mFullFileName;
127
QString mTranslatedTitle;
129
SharedSettings mSharedSettings;
133
enum DisplayType { DisplayDummy, DisplayFancyPlotter, DisplayMultiMeter, DisplayDancingBars, DisplaySensorLogger, DisplayListView, DisplayLogFile, DisplayProcessControllerRemote, DisplayProcessControllerLocal };
135
KSGRD::SensorDisplay* insertDisplay( DisplayType displayType, QString displayTitle, int index);
137
This two dimensional array stores the pointers to the sensor displays
138
or if no sensor is present at a position a pointer to a dummy widget.
139
The size of the array corresponds to the size of the grid layout.
141
QList <KSGRD::SensorDisplay*> mDisplayList;