3
<TITLE>Source: toresultcontent.h</TITLE>
5
<META NAME="Generator" CONTENT="KDOC ">
7
<BODY bgcolor="#ffffff" text="#000000" link="#0000ff" vlink="#000099" alink= "#ffffff">
8
<TABLE WIDTH="100%" BORDER="0">
12
<TR><TD valign="top" align="left" cellspacing="10">
13
<h1>Source: toresultcontent.h</h1>
15
<TD valign="top" align="right" colspan="1"></TD></TR>
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>
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
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.
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.
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.
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.
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.
60
* You may link this product with any GPL'd Qt library such as Qt/Free
62
* All trademarks belong to their respective owners.
66
#ifndef TORESULTCONTENT_H
67
#define TORESULTCONTENT_H
69
#include "tobackground.h"
70
#include "toconnection.h"
71
#include "toeditwidget.h"
72
#include "tomemoeditor.h"
85
class toResultContent;
86
class toSearchReplace;
88
/** Implement memo editor in result content editor. Only for internal use.
92
class toResultContentMemo : public toMemoEditor {
95
toResultContentEditor *contentEditor();
97
toResultContentMemo(QWidget *parent,const QString &data,int row,int col,
100
virtual void firstColumn();
101
virtual void nextColumn();
102
virtual void previousColumn();
103
virtual void lastColumn();
105
virtual void changePosition(int row,int cols);
108
/** This widget is used for single record view in the content editor. Only for internal use.
112
class toResultContentSingle : public QScrollView {
117
std::list<QCheckBox *> Null;
118
std::list<QLineEdit *> Value;
120
toResultContentSingle(QWidget *parent);
122
void changeSource(QTable *table);
123
void changeRow(QTable *table,int row);
124
void saveRow(QTable *table,int row);
126
virtual void showMemo(int row);
129
/** This widget allows the user to browse the contents of a table and also edit
130
* the content. The table is specified by the first and second parameter in the query.
131
* The sql is not used in the query. Only for internal use.
134
class toResultContentEditor : public QTable,public toEditWidget {
137
/** Single record form.
139
toResultContentSingle *SingleEdit;
146
/** The SQL used to read the data.
149
/** Original values of rows currently being edited.
151
std::list<QString> OrigValues;
152
/** Original values of rows currently being edited.
155
/** Stream to read data from.
157
toNoBlockQuery *Query;
159
toQDescList Description;
164
/** Number of rows read from stream.
167
/** Current row of editing.
170
/** Current row of editing.
173
/** Used to detect drag.
177
/** Popup menu if available.
180
/** Column of item selected when popup menu displayed.
183
/** Row of item selected when popup menu displayed.
187
/** Current sorting row.
190
/** Indicate if sorting ascending or descending.
194
/** Use filter for all tables.
197
/** Filter selection criteria
199
static std::map<QCString,QString> Criteria;
200
/** Filter retrieve order
202
static std::map<QCString,QString> Order;
203
/** Current filter name in map
206
/** Never use returning.
210
/** Throw an exception about wrong usage.
212
void wrongUsage(void);
215
/** Reimplemented for internal reasons.
217
virtual void drawContents(QPainter * p,int cx,int cy,int cw,int ch);
218
/** Reimplemented for internal reasons.
220
virtual QWidget *beginEdit(int row,int col,bool replace);
221
virtual void endEdit(int row,int col,bool accept,bool replace);
223
/** Reimplemented for internal reasons.
225
virtual void paintCell(QPainter *p,int row,int col,const QRect &cr,bool selected);
226
/** Reimplemented for internal reasons.
228
virtual bool eventFilter(QObject *o,QEvent *e);
229
/** Reimplemented for internal reasons.
231
virtual void keyPressEvent(QKeyEvent *e);
232
/** Reimplemented for internal reasons.
234
virtual void activateNextCell();
236
/** Reimplemented for internal reasons.
238
virtual void dragEnterEvent(QDragEnterEvent *event);
239
/** Reimplemented for internal reasons.
241
virtual void dropEvent(QDropEvent *event);
242
/** Reimplemented for internal reasons.
244
virtual void contentsMousePressEvent(QMouseEvent *e);
245
/** Reimplemented for internal reasons.
247
virtual void contentsMouseReleaseEvent(QMouseEvent *e);
248
/** Reimplemented for internal reasons.
250
virtual void contentsMouseMoveEvent (QMouseEvent *e);
251
/** Reimplemented for internal reasons.
253
virtual void focusInEvent (QFocusEvent *e);
254
/** A setCurrentCell() replacement; makes sure that we have focus.
256
virtual void setCurrentCellFocus(int row, int col);
262
toConnection &connection();
263
QLineEdit *CurrentEditor;
267
class contentItem : public QTableItem {
269
contentItem(QTable *table,const QString &text);
270
virtual QString key(void) const;
273
toListView *copySelection(bool);
275
/** Indicate that editor should never use returning clauses even if this is oracle.
277
void useNoReturning(bool use)
278
{ NoUseReturning=use; }
279
/** Create the widget.
280
* @param parent Parent widget.
281
* @param name Name of widget.
283
toResultContentEditor(QWidget *parent,const char *name=NULL);
286
~toResultContentEditor();
287
/** Reimplemented for internal reasons.
289
virtual void query(const QString &,const toQList &);
290
/** Reimplemented for internal reasons.
292
virtual void changeParams(const QString &Param1,const QString &Param2)
293
{ toQList pars; pars.insert(pars.end(),Param1); pars.insert(pars.end(),Param2); query(QString::null,pars); }
295
/** Print this editor.
297
virtual void editPrint(void);
298
/** Reimplemented for internal reasons.
300
virtual bool editSave(bool ask);
301
/** Reimplemented for internal reasons.
303
virtual void editReadAll(void);
304
/** Select all contents. Default NOP.
306
virtual void editSelectAll(void);
308
/** Reimplemented for internal reasons.
310
virtual void setText(int row,int col,const QString &text);
312
/** Set a new filter setting.
313
* @param all Apply filter to all tables, otherwise only for this table.
314
* @param criteria Criteria to filter on.
315
* @param order Order to read data on.
317
void changeFilter(bool all,const QString &criteria,const QString &order);
319
/** Get information about if filter affect all tables.
322
{ return AllFilter; }
324
friend class contentItem;
325
friend class toResultContent;
327
/** Export data to a map.
328
* @param data A map that can be used to recreate the data of a chart.
329
* @param prefix Prefix to add to the map.
331
virtual void exportData(std::map<QCString,QString> &data,const QCString &prefix);
333
* @param data Data to read from a map.
334
* @param prefix Prefix to read data from.
336
virtual void importData(std::map<QCString,QString> &data,const QCString &prefix);
338
/** Erase last parameters
340
virtual void clearParams(void)
341
{ Owner=Table=QString::null; }
342
/** Change sorting column
343
* @param col Column selected to change as sorting.
345
virtual void changeSort(int col);
346
/** Current cell changed.
347
* @param row New row.
348
* @param col New column.
350
void changePosition(int row,int col);
352
/** Display popup menu
353
* @param p Point to display popup at.
355
virtual void displayMenu(const QPoint &p);
356
/** Display editable memo viewer at current position.
358
virtual void displayMemo(void);
359
/** Save unsaved changes in the editor
361
virtual void saveUnsaved(void);
362
/** Delete the current row from the table.
364
virtual void deleteCurrent(void);
365
/** Add a new record to the table.
367
virtual void addRecord(void);
368
/** Duplicate a new record for editing.
370
virtual void duplicateRecord(void);
371
/** Discard the changes made to the table.
373
virtual void cancelEdit(void);
374
/** Goto the last record in the table.
376
virtual void gotoLastRecord(void);
377
/** Goto the first record in the table.
379
virtual void gotoFirstRecord(void);
380
/** Goto the previous record in the table.
382
virtual void gotoPreviousRecord(void);
383
/** Goto the next record in the table.
385
virtual void gotoNextRecord(void);
386
/** Display single record form.
388
virtual void singleRecordForm(bool display);
390
/** Move to top of data
392
virtual void searchTop(void)
393
{ setCurrentCell(0,0); }
394
/** Search for next entry
395
* @return True if found, should select the found text.
397
virtual bool searchNext(toSearchReplace *search);
398
/** Replace entry with new data
400
virtual void searchReplace(const QString &newData);
401
/** Check if data can be modified by search
402
* @param all If true can replace all, otherwise can replace right now.
404
virtual bool searchCanReplace(bool all);
406
/** Emitted to indicate wether a filter is used.
408
void filterEnabled(bool);
409
//* Emitted when changes were saved.
412
/** Callback from popup menu.
413
* @param cmd Command ID.
415
virtual void menuCallback(int cmd);
416
/** Change data at specified position.
417
* @param row Row to change.
418
* @param col Column to change.
419
* @param data New contents of data.
421
virtual void changeData(int row,int col,const QString &data);
423
virtual void poll(void);
426
/** This widget allows the user to browse the contents of a table and also edit
427
* the content. The table is specified by the first and second parameter in the query.
428
* The sql is not used in the query.
431
class toResultContent : public QVBox, public toResult {
434
toResultContentEditor *Editor;
436
/** Create the widget.
437
* @param parent Parent widget.
438
* @param name Name of widget.
440
toResultContent(QWidget *parent,const char *name=NULL);
442
/** Get content editor table widget
443
* @return Pointer to editor.
445
toResultContentEditor *editor(void)
448
/** Read all rows from the table.
450
virtual void editReadAll(void)
451
{ Editor->editReadAll(); }
452
/** Print the contents.
454
virtual void editPrint(void)
455
{ Editor->editPrint(); }
456
/** Export contents to file.
458
virtual void editSave(bool ask)
459
{ Editor->editSave(ask); }
461
/** Export data to a map.
462
* @param data A map that can be used to recreate the data of a chart.
463
* @param prefix Prefix to add to the map.
465
virtual void exportData(std::map<QCString,QString> &data,const QCString &prefix)
466
{ Editor->exportData(data,prefix); }
468
* @param data Data to read from a map.
469
* @param prefix Prefix to read data from.
471
virtual void importData(std::map<QCString,QString> &data,const QCString &prefix)
472
{ Editor->importData(data,prefix); }
473
/** Indicate that editor should never use returning clauses even if this is oracle.
475
void useNoReturning(bool use)
476
{ Editor->useNoReturning(use); }
478
void changeFilter(void);
479
void removeFilter(void);
481
//* Emitted when changes were saved.
482
void changesSaved(void);
484
/** Erase last parameters
486
virtual void clearParams(void)
487
{ toResult::clearParams(); Editor->clearParams(); }
488
/** Reimplemented for internal reasons.
490
virtual void refresh(void)
491
{ toResult::refresh(); }
492
/** Reimplemented for internal reasons.
494
virtual void query(const QString &sql,const toQList ¶m)
495
{ if (!setSQLParams(sql,param)) return; Editor->query(sql,param); }
496
/** Reimplemented for internal reasons.
498
virtual void changeParams(const QString &Param1)
499
{ toResult::changeParams(Param1); }
500
/** Reimplemented for internal reasons.
502
virtual void changeParams(const QString &Param1,const QString &Param2)
503
{ toResult::changeParams(Param1,Param2); }
504
/** Reimplemented for internal reasons.
506
virtual void changeParams(const QString &Param1,const QString &Param2,const QString &Param3)
507
{ toResult::changeParams(Param1,Param2,Param3); }
508
/** Save unsaved changes in the editor
510
virtual void saveUnsaved(void)
511
{ Editor->saveUnsaved(); }
512
/** Commit connection
513
* @param conn Connection commit is made on.
514
* @param cmt If commit or rollback
516
virtual void saveUnsaved(toConnection &conn,bool cmt);
518
/** Handle all databases
520
virtual bool canHandle(toConnection &);
527
<tr><td><small>Generated by: nneul on skyhawk on Wed Feb 23 19:49:58 2005, using kdoc 2.0a54.</small></td></tr>