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

« back to all changes in this revision

Viewing changes to src/toresultfield.h

  • Committer: Bazaar Package Importer
  • Author(s): Albin Tonnerre
  • Date: 2007-05-29 13:13:36 UTC
  • mfrom: (1.2.4 upstream)
  • Revision ID: james.westby@ubuntu.com-20070529131336-85ygaddivvmkd3xc
Tags: 1.3.21pre22-1ubuntu1
* Merge from Debian unstable. Remaining Ubuntu changes:
  - debian/rules: call dh_iconcache
  - Remove g++ build dependency
* Modify Maintainer value to match Debian-Maintainer-Field Spec

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/*****
 
2
*
 
3
* TOra - An Oracle Toolkit for DBA's and developers
 
4
* Copyright (C) 2003-2005 Quest Software, Inc
 
5
* Portions Copyright (C) 2005 Other Contributors
 
6
 
7
* This program is free software; you can redistribute it and/or
 
8
* modify it under the terms of the GNU General Public License
 
9
* as published by the Free Software Foundation;  only version 2 of
 
10
* the License is valid for this program.
 
11
 
12
* This program is distributed in the hope that it will be useful,
 
13
* but WITHOUT ANY WARRANTY; without even the implied warranty of
 
14
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
 
15
* GNU General Public License for more details.
 
16
 
17
* You should have received a copy of the GNU General Public License
 
18
* along with this program; if not, write to the Free Software
 
19
* Foundation, Inc., 59 Temple Place - Suite 330, Boston, MA  02111-1307, USA.
 
20
*
 
21
*      As a special exception, you have permission to link this program
 
22
*      with the Oracle Client libraries and distribute executables, as long
 
23
*      as you follow the requirements of the GNU GPL in regard to all of the
 
24
*      software in the executable aside from Oracle client libraries.
 
25
*
 
26
*      Specifically you are not permitted to link this program with the
 
27
*      Qt/UNIX, Qt/Windows or Qt Non Commercial products of TrollTech.
 
28
*      And you are not permitted to distribute binaries compiled against
 
29
*      these libraries without written consent from Quest Software, Inc.
 
30
*      Observe that this does not disallow linking to the Qt Free Edition.
 
31
*
 
32
*      You may link this product with any GPL'd Qt library such as Qt/Free
 
33
*
 
34
* All trademarks belong to their respective owners.
 
35
*
 
36
*****/
 
37
 
 
38
#ifndef TORESULTFIELD_H
 
39
#define TORESULTFIELD_H
 
40
 
 
41
#include "config.h"
 
42
#include "tobackground.h"
 
43
#include "tohighlightedtext.h"
 
44
#include "toresult.h"
 
45
 
 
46
class toNoBlockQuery;
 
47
class toSQL;
 
48
 
 
49
/** This widget displays the result of a query where each item in the stream
 
50
 * is added as a line in a text editer.
 
51
 */
 
52
 
 
53
class toResultField : public toHighlightedText, public toResult
 
54
{
 
55
    Q_OBJECT
 
56
 
 
57
    QString Unapplied;
 
58
    toNoBlockQuery *Query;
 
59
    toBackground Poll;
 
60
 
 
61
public:
 
62
    /** Create the widget.
 
63
     * @param parent Parent widget.
 
64
     * @param name Name of widget.
 
65
     */
 
66
    toResultField(QWidget *parent, const char *name = NULL);
 
67
    /** Destruct object
 
68
     */
 
69
    ~toResultField();
 
70
 
 
71
    /** Reimplemented for internal reasons.
 
72
     */
 
73
    virtual void query(const QString &sql, const toQList &param);
 
74
 
 
75
    /** Handle any connection by default
 
76
     */
 
77
    virtual bool canHandle(toConnection &)
 
78
    {
 
79
        return true;
 
80
    }
 
81
 
 
82
    // Why are these needed?
 
83
#if 1
 
84
    /** Set the SQL statement of this list
 
85
     * @param sql String containing statement.
 
86
     */
 
87
    void setSQL(const QString &sql)
 
88
    {
 
89
        toResult::setSQL(sql);
 
90
    }
 
91
    /** Set the SQL statement of this list. This will also affect @ref Name.
 
92
     * @param sql SQL containing statement.
 
93
     */
 
94
    void setSQL(const toSQL &sql)
 
95
    {
 
96
        toResult::setSQL(sql);
 
97
    }
 
98
    /** Set new SQL and run query.
 
99
     * @param sql New sql.
 
100
     * @see setSQL
 
101
     */
 
102
    void query(const QString &sql)
 
103
    {
 
104
        toResult::query(sql);
 
105
    }
 
106
    /** Set new SQL and run query.
 
107
     * @param sql New sql.
 
108
     * @see setSQL
 
109
     */
 
110
    void query(const toSQL &sql)
 
111
    {
 
112
        toResult::query(sql);
 
113
    }
 
114
    /** Set new SQL and run query.
 
115
     * @param sql New sql.
 
116
     * @see setSQL
 
117
     */
 
118
    void query(const toSQL &sql, toQList &par)
 
119
    {
 
120
        toResult::query(sql, par);
 
121
    }
 
122
#endif
 
123
public slots:
 
124
    /** Reimplemented for internal reasons.
 
125
     */
 
126
    virtual void refresh(void)
 
127
    {
 
128
        toResult::refresh();
 
129
    }
 
130
    /** Reimplemented for internal reasons.
 
131
     */
 
132
    virtual void changeParams(const QString &Param1)
 
133
    {
 
134
        toResult::changeParams(Param1);
 
135
    }
 
136
    /** Reimplemented For internal reasons.
 
137
     */
 
138
    virtual void changeParams(const QString &Param1, const QString &Param2)
 
139
    {
 
140
        toResult::changeParams(Param1, Param2);
 
141
    }
 
142
    /** Reimplemented for internal reasons.
 
143
     */
 
144
    virtual void changeParams(const QString &Param1, const QString &Param2, const QString &Param3)
 
145
    {
 
146
        toResult::changeParams(Param1, Param2, Param3);
 
147
    }
 
148
private slots:
 
149
    void poll(void);
 
150
};
 
151
 
 
152
#endif