~ubuntu-branches/ubuntu/wily/tora/wily-proposed

« back to all changes in this revision

Viewing changes to doc/help/api/tolinechart_h.html

  • Committer: Bazaar Package Importer
  • Author(s): Michael Meskes
  • Date: 2009-04-07 13:16:05 UTC
  • mfrom: (1.2.7 upstream) (3.1.3 sid)
  • Revision ID: james.westby@ubuntu.com-20090407131605-u422yigfv7jgg0l0
Tags: 2.0.0-3
* Cleaned up packaging a little bit.
* Added homepage information to control file.
* Bumped Standards-Version to 3.8.1.
* Released to unstable.

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
<HTML>
2
 
<HEAD>
3
 
<TITLE>Source: tolinechart.h</TITLE>
4
 
 
5
 
<META NAME="Generator" CONTENT="KDOC ">
6
 
</HEAD>
7
 
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
8
 
<TABLE WIDTH="100%" BORDER="0">
9
 
<TR>
10
 
<TD>
11
 
        <TABLE BORDER="0">
12
 
                <TR><TD valign="top" align="left" cellspacing="10">
13
 
                <h1>Source: tolinechart.h</h1>
14
 
                </TD>
15
 
                <TD valign="top" align="right" colspan="1"></TD></TR>
16
 
        </TABLE>
17
 
        <HR>
18
 
        <TABLE BORDER="0">
19
 
                
20
 
        </TABLE>
21
 
        </TD>
22
 
<TD align="right"><TABLE BORDER="0"><TR><TD><small><A HREF="index-long.html">Annotated List</A></small></TD></TR>
23
 
<TR><TD><small><A HREF="header-list.html">Files</A></small></TD></TR>
24
 
<TR><TD><small><A HREF="all-globals.html">Globals</A></small></TD></TR>
25
 
<TR><TD><small><A HREF="hier.html">Hierarchy</A></small></TD></TR>
26
 
<TR><TD><small><A HREF="index.html">Index</A></small></TD></TR>
27
 
</TABLE></TD></TR></TABLE>
28
 
<pre>
29
 
/*****
30
 
 *
31
 
 * TOra - An Oracle Toolkit for DBA's and developers
32
 
 * Copyright (C) 2003-2005 Quest Software, Inc
33
 
 * Portions Copyright (C) 2005 Other Contributors
34
 
 * 
35
 
 * This program is free software; you can redistribute it and/or
36
 
 * modify it under the terms of the GNU General Public License
37
 
 * as published by the Free Software Foundation;  only version 2 of
38
 
 * the License is valid for this program.
39
 
 * 
40
 
 * This program is distributed in the hope that it will be useful,
41
 
 * but WITHOUT ANY WARRANTY; without even the implied warranty of
42
 
 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
43
 
 * GNU General Public License for more details.
44
 
 * 
45
 
 * You should have received a copy of the GNU General Public License
46
 
 * along with this program; if not, write to the Free Software
47
 
 * Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
48
 
 *
49
 
 *      As a special exception, you have permission to link this program
50
 
 *      with the Oracle Client libraries and distribute executables, as long
51
 
 *      as you follow the requirements of the GNU GPL in regard to all of the
52
 
 *      software in the executable aside from Oracle client libraries.
53
 
 *
54
 
 *      Specifically you are not permitted to link this program with the
55
 
 *      Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
56
 
 *      And you are not permitted to distribute binaries compiled against
57
 
 *      these libraries without written consent from Quest Software, Inc.
58
 
 *      Observe that this does not disallow linking to the Qt Free Edition.
59
 
 *
60
 
 *      You may link this product with any GPL'd Qt library such as Qt/Free
61
 
 *
62
 
 * All trademarks belong to their respective owners.
63
 
 *
64
 
 *****/
65
 
 
66
 
#ifndef TOLINECHART_H
67
 
#define TOLINECHART_H
68
 
 
69
 
#include <list>
70
 
#include <map>
71
 
 
72
 
#include <qwidget.h>
73
 
 
74
 
class QPopupMenu;
75
 
class QScrollBar;
76
 
 
77
 
/** A widget that displays a linechart with optional background throbber (Not implemented yet).
78
 
 */
79
 
 
80
 
class toLineChart : public QWidget {
81
 
  Q_OBJECT
82
 
 
83
 
  QPopupMenu *Menu;
84
 
 
85
 
  QScrollBar *Horizontal;
86
 
  QScrollBar *Vertical;
87
 
 
88
 
protected:
89
 
  std::list<std::list<double> > Values;
90
 
  std::list<QString> XValues;
91
 
  std::list<QString> Labels;
92
 
  std::list<bool> Enabled;
93
 
  bool Legend;
94
 
  bool Last;
95
 
  int Grid;
96
 
  bool AxisText;
97
 
  double MinValue;
98
 
  bool MinAuto;
99
 
  double MaxValue;
100
 
  bool MaxAuto;
101
 
  QString YPostfix;
102
 
  int Samples;
103
 
  QString Title;
104
 
 
105
 
  QRect Chart;
106
 
  QPoint MousePoint[2];
107
 
  int SkipSamples;
108
 
  int UseSamples;
109
 
  int DisplaySamples;
110
 
  bool Zooming;
111
 
  double zMinValue;
112
 
  double zMaxValue;
113
 
 
114
 
  static double round(double round,bool up);
115
 
  QRect fixRect(QPoint p1,QPoint p2);
116
 
  virtual void mouseReleaseEvent(QMouseEvent *e);
117
 
  virtual void mouseMoveEvent(QMouseEvent *e);
118
 
  virtual void mouseDoubleClickEvent(QMouseEvent *e);
119
 
  virtual void mousePressEvent(QMouseEvent *e);
120
 
 
121
 
  int countSamples(void);
122
 
  void clearZoom(void);
123
 
 
124
 
  virtual void paintLegend(QPainter *p,QRect &rect);
125
 
  virtual void paintTitle(QPainter *p,QRect &rect);
126
 
  virtual void paintAxis(QPainter *p,QRect &rect);
127
 
  virtual void paintChart(QPainter *p,QRect &rect);
128
 
public:
129
 
  /** Create a new linechart.
130
 
   * @param parent Parent widget.
131
 
   * @param name Name of widget.
132
 
   * @param f Widget flags.
133
 
   */
134
 
  toLineChart(QWidget *parent=NULL,const char *name=NULL,WFlags f=0);
135
 
 
136
 
  /** Create a new chart by copying all the data from another chart.
137
 
   * @param chart Chart to copy data from.
138
 
   * @param parent Parent widget.
139
 
   * @param name Name of widget.
140
 
   * @param f Widget flags.
141
 
   */
142
 
  toLineChart(toLineChart *chart,QWidget *parent=NULL,const char *name=NULL,WFlags f=0);
143
 
 
144
 
  /** Destroy chart
145
 
   */
146
 
  ~toLineChart();
147
 
 
148
 
  /** Specify if legend should be displayed to the right of the graph, default is on.
149
 
   * @param on Whether to display legend or not.
150
 
   */
151
 
  void showLegend(bool on)
152
 
  { Legend=on; update(); }
153
 
  /** Check if legend is displayed or not.
154
 
   * @return If legend is displayed or not.
155
 
   */
156
 
  bool legend(void) const
157
 
  { return Legend; }
158
 
 
159
 
  /** Show most recent value on top of graph
160
 
   * @param on Whether to display or not.
161
 
   */
162
 
  void showLast(bool on)
163
 
  { Last=on; update(); }
164
 
  /** Check if last value is displayed or not.
165
 
   * @return If value is displayed or not.
166
 
   */
167
 
  bool last(void) const
168
 
  { return Last; }
169
 
 
170
 
  /** Set title of the chart. Set to empty string to not display title.
171
 
   * @param title Title of chart.
172
 
   */
173
 
  void setTitle(const QString &title=QString::null)
174
 
  { Title=title; setCaption(title); update(); }
175
 
  /** Get title of chart.
176
 
   * @return Title of chart.
177
 
   */
178
 
  const QString &title(void)
179
 
  { return Title; }
180
 
 
181
 
  /** Specify if a grid should be displayed in the graph, default is on.
182
 
   * @param div Number of parts to divide grid into.
183
 
   */
184
 
  void showGrid(int div=0)
185
 
  { Grid=div; update(); }
186
 
  /** Check if grid is displayed or not.
187
 
   * @return Number of parts to divide grid into.
188
 
   */
189
 
  int grid(void) const
190
 
  { return Grid; }
191
 
 
192
 
  /** Specify if a y-axis legend should be displayed in the graph, default is on.
193
 
   * @param on Whether to display legend or not.
194
 
   */
195
 
  void showAxisLegend(bool on)
196
 
  { AxisText=on; update(); }
197
 
  /** Check if y-axis legend is displayed or not.
198
 
   * @return If legend is displayed or not.
199
 
   */
200
 
  bool axisLegend(void) const
201
 
  { return AxisText; }
202
 
 
203
 
  /** Set y postfix value. This will be appended to the values in the axis legend.
204
 
   * @param postfix The string to append.
205
 
   */
206
 
  void setYPostfix(const QString &postfix)
207
 
  { YPostfix=postfix; update(); }
208
 
  /** Set max value on y-axis to auto.
209
 
   */
210
 
  void setMaxValueAuto(void)
211
 
  { MaxAuto=true; update(); }
212
 
  /** Set min value on y-axis to auto.
213
 
   */
214
 
  void setMinValueAuto(void)
215
 
  { MinAuto=true; update(); }
216
 
  /** Set max value on y-axis.
217
 
   * @param val Max value on y-axis.
218
 
   */
219
 
  void setMaxValue(double maxVal)
220
 
  { MaxAuto=false; MaxValue=maxVal; update(); }
221
 
  /** Set min value on y-axis.
222
 
   * @param val Min value on y-axis.
223
 
   */
224
 
  void setMinValue(double minVal)
225
 
  { MinAuto=false; MinValue=minVal; update(); }
226
 
  /** Get minimum value on y-axis. Will not return the automatically determinned minimum value.
227
 
   * @return Minimum value on y-axis.
228
 
   */
229
 
  double minValue(void) const
230
 
  { return MinValue; }
231
 
  /** Get maximum value on y-axis. Will not return the automatically determinned maximum value.
232
 
   * @return Maximum value on y-axis.
233
 
   */
234
 
  double maxValue(void) const
235
 
  { return MaxValue; }
236
 
 
237
 
  /** Set the number of samples on the x-axis. Setting samples to -1 will keep all entries.
238
 
   * @param samples Number of samples.
239
 
   */
240
 
  void setSamples(int samples=-1);
241
 
  /** Get the maximum number of samples on the x-axis.
242
 
   * @return Max number of samples.
243
 
   */
244
 
  int samples(void) const
245
 
  { return Samples; }
246
 
 
247
 
  /** Set the labels on the chart lines.
248
 
   * @param labels Labels of the lines. Empty labels will not show up in the legend.
249
 
   */
250
 
  void setLabels(const std::list<QString> &labels)
251
 
  { Labels=labels; update(); }
252
 
  /** Get the labels of the chart lines.
253
 
   * @return List of labels.
254
 
   */
255
 
  std::list<QString> &labels(void)
256
 
  { return Labels; }
257
 
 
258
 
  /** Add a new value set to the chart.
259
 
   * @param value New values for charts (One for each line).
260
 
   * @param label X-value on these values.
261
 
   */
262
 
  virtual void addValues(std::list<double> &value,const QString &xValues);
263
 
 
264
 
  /** Get list of labels
265
 
   * @return List of labels
266
 
   */
267
 
  std::list<QString> &xValues(void)
268
 
  { return XValues; }
269
 
 
270
 
  /** Get list of values.
271
 
   * @return Values in piechart.
272
 
   */
273
 
  std::list<std::list<double> > &values(void)
274
 
  { return Values; }
275
 
 
276
 
  /** Export chart to a map.
277
 
   * @param data A map that can be used to recreate the data of a chart.
278
 
   * @param prefix Prefix to add to the map.
279
 
   */
280
 
  virtual void exportData(std::map<QCString,QString> &data,const QCString &prefix);
281
 
  /** Import data
282
 
   * @param data Data to read from a map.
283
 
   * @param prefix Prefix to read data from.
284
 
   */
285
 
  virtual void importData(std::map<QCString,QString> &data,const QCString &prefix);
286
 
 
287
 
  /** Get enabled datavalues. Values in this list with false are not drawn in the chart.
288
 
   * Could be an empty list if everything is enabled.
289
 
   */
290
 
  std::list<bool> enabledCharts(void)
291
 
  { return Enabled; }
292
 
  /** Set enabled datavalues. Values in this list with false are not drawn in the chart.
293
 
   */
294
 
  void setEnabledCharts(std::list<bool> &enabled)
295
 
  { Enabled=enabled; update(); }
296
 
  /** Open chart in new window.
297
 
   */
298
 
  virtual toLineChart *openCopy(QWidget *parent);
299
 
signals:
300
 
  /** A new value set was added to the chart.
301
 
   * @param value New values for charts (One for each line).
302
 
   * @param label X-value on these values.
303
 
   */
304
 
  virtual void valueAdded(std::list<double> &value,const QString &xValues);
305
 
public slots:
306
 
  /** Clear the values from the chart.
307
 
   */
308
 
  virtual void clear(void)
309
 
  { Values.clear(); XValues.clear(); update(); }
310
 
 
311
 
  /** Setup values of charts.
312
 
   */
313
 
  virtual void setup(void);
314
 
 
315
 
  /** Print the chart.
316
 
   */
317
 
  virtual void editPrint(void);
318
 
 
319
 
  void openCopy(void)
320
 
  { openCopy(NULL); }
321
 
protected:
322
 
  /** Reimplemented for internal reasons.
323
 
   */
324
 
  virtual void paintEvent(QPaintEvent *e);
325
 
  /** Reimplemented for internal reasons.
326
 
   */
327
 
  virtual void addMenues(QPopupMenu *)
328
 
  { }
329
 
private slots:
330
 
  void horizontalChange(int);
331
 
  void verticalChange(int);
332
 
  void chartSetup(void);
333
 
};
334
 
 
335
 
#endif
336
 
</pre>
337
 
<HR>
338
 
        <table>
339
 
        <tr><td><small>Generated by: nneul on skyhawk on Wed Feb 23 19:49:58 2005, using kdoc 2.0a54.</small></td></tr>
340
 
        </table>
341
 
</BODY>
342
 
</HTML>