~ubuntu-branches/ubuntu/oneiric/qwt/oneiric-proposed

« back to all changes in this revision

Viewing changes to qwt-5.1.1/designer/qwt_designer_plugin.h

  • Committer: Bazaar Package Importer
  • Author(s): Fathi Boudra
  • Date: 2008-05-26 10:26:31 UTC
  • mfrom: (1.1.3 upstream) (2.1.1 lenny)
  • Revision ID: james.westby@ubuntu.com-20080526102631-bp95mfccnrb957nx
Tags: 5.1.1-1
New upstream release.

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/* -*- mode: C++ ; c-file-style: "stroustrup" -*- *****************************
 
2
 * Qwt Widget Library
 
3
 * Copyright (C) 1997   Josef Wilgen
 
4
 * Copyright (C) 2002   Uwe Rathmann
 
5
 *
 
6
 * This library is free software; you can redistribute it and/or
 
7
 * modify it under the terms of the Qwt License, Version 1.0
 
8
 *****************************************************************************/
 
9
 
 
10
#ifndef QWT_DESIGNER_PLUGIN_H
 
11
#define QWT_DESIGNER_PLUGIN_H
 
12
 
 
13
#include <qglobal.h>
 
14
 
 
15
#if QT_VERSION < 0x040000
 
16
 
 
17
#ifdef __GNUC__
 
18
#error This code is Qt4 only
 
19
#endif
 
20
 
 
21
#endif
 
22
 
 
23
#include <QDesignerCustomWidgetInterface>
 
24
#include <QDesignerTaskMenuExtension>
 
25
#include <QExtensionFactory>
 
26
 
 
27
namespace QwtDesignerPlugin
 
28
{
 
29
 
 
30
class CustomWidgetInterface: public QObject, 
 
31
    public QDesignerCustomWidgetInterface
 
32
{
 
33
    Q_OBJECT
 
34
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
35
 
 
36
public:
 
37
    CustomWidgetInterface(QObject *parent);
 
38
 
 
39
    virtual bool isContainer() const;
 
40
    virtual bool isInitialized() const;
 
41
    virtual QIcon icon() const;
 
42
    virtual QString codeTemplate() const;
 
43
    virtual QString domXml() const;
 
44
    virtual QString group() const;
 
45
    virtual QString includeFile() const;
 
46
    virtual QString name() const;
 
47
    virtual QString toolTip() const;
 
48
    virtual QString whatsThis() const;
 
49
    virtual void initialize(QDesignerFormEditorInterface *);
 
50
 
 
51
protected:
 
52
    QString d_name; 
 
53
    QString d_include; 
 
54
    QString d_toolTip; 
 
55
    QString d_whatsThis; 
 
56
    QString d_domXml; 
 
57
    QString d_codeTemplate;
 
58
    QIcon d_icon;
 
59
 
 
60
private:
 
61
    bool d_isInitialized;
 
62
};
 
63
 
 
64
class CustomWidgetCollectionInterface: public QObject,
 
65
    public QDesignerCustomWidgetCollectionInterface
 
66
{
 
67
    Q_OBJECT
 
68
    Q_INTERFACES(QDesignerCustomWidgetCollectionInterface)
 
69
 
 
70
public:
 
71
    CustomWidgetCollectionInterface(QObject *parent = NULL);
 
72
 
 
73
    virtual QList<QDesignerCustomWidgetInterface*> customWidgets() const;
 
74
 
 
75
private:
 
76
    QList<QDesignerCustomWidgetInterface*> d_plugins;
 
77
};
 
78
 
 
79
#ifndef NO_QWT_PLOT
 
80
class PlotInterface: public CustomWidgetInterface 
 
81
{
 
82
    Q_OBJECT
 
83
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
84
 
 
85
public:
 
86
    PlotInterface(QObject *parent);
 
87
    virtual QWidget *createWidget(QWidget *parent);
 
88
};
 
89
#endif
 
90
 
 
91
#ifndef NO_QWT_WIDGETS
 
92
class AnalogClockInterface: public CustomWidgetInterface 
 
93
{
 
94
    Q_OBJECT
 
95
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
96
 
 
97
public:
 
98
    AnalogClockInterface(QObject *parent);
 
99
    virtual QWidget *createWidget(QWidget *parent);
 
100
};
 
101
#endif
 
102
 
 
103
#ifndef NO_QWT_WIDGETS
 
104
class CompassInterface: public CustomWidgetInterface 
 
105
{
 
106
    Q_OBJECT
 
107
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
108
 
 
109
public:
 
110
    CompassInterface(QObject *parent);
 
111
    virtual QWidget *createWidget(QWidget *parent);
 
112
};
 
113
#endif
 
114
 
 
115
#ifndef NO_QWT_WIDGETS
 
116
class CounterInterface: public CustomWidgetInterface 
 
117
{
 
118
    Q_OBJECT
 
119
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
120
 
 
121
public:
 
122
    CounterInterface(QObject *parent);
 
123
    virtual QWidget *createWidget(QWidget *parent);
 
124
};
 
125
#endif
 
126
 
 
127
#ifndef NO_QWT_WIDGETS
 
128
class DialInterface: public CustomWidgetInterface 
 
129
{
 
130
    Q_OBJECT
 
131
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
132
 
 
133
public:
 
134
    DialInterface(QObject *parent);
 
135
    virtual QWidget *createWidget(QWidget *parent);
 
136
};
 
137
#endif
 
138
 
 
139
#ifndef NO_QWT_WIDGETS
 
140
class KnobInterface: public CustomWidgetInterface 
 
141
{
 
142
    Q_OBJECT
 
143
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
144
 
 
145
public:
 
146
    KnobInterface(QObject *parent);
 
147
    virtual QWidget *createWidget(QWidget *parent);
 
148
};
 
149
#endif
 
150
 
 
151
#ifndef NO_QWT_PLOT
 
152
class ScaleWidgetInterface: public CustomWidgetInterface 
 
153
{
 
154
    Q_OBJECT
 
155
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
156
 
 
157
public:
 
158
    ScaleWidgetInterface(QObject *parent);
 
159
    virtual QWidget *createWidget(QWidget *parent);
 
160
};
 
161
#endif
 
162
 
 
163
#ifndef NO_QWT_WIDGETS
 
164
class SliderInterface: public CustomWidgetInterface 
 
165
{
 
166
    Q_OBJECT
 
167
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
168
 
 
169
public:
 
170
    SliderInterface(QObject *parent);
 
171
    virtual QWidget *createWidget(QWidget *parent);
 
172
};
 
173
#endif
 
174
 
 
175
class TextLabelInterface: public CustomWidgetInterface 
 
176
{
 
177
    Q_OBJECT
 
178
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
179
 
 
180
public:
 
181
    TextLabelInterface(QObject *parent);
 
182
    virtual QWidget *createWidget(QWidget *parent);
 
183
};
 
184
 
 
185
#ifndef NO_QWT_WIDGETS
 
186
class ThermoInterface: public CustomWidgetInterface 
 
187
{
 
188
    Q_OBJECT
 
189
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
190
 
 
191
public:
 
192
    ThermoInterface(QObject *parent);
 
193
    virtual QWidget *createWidget(QWidget *parent);
 
194
};
 
195
#endif
 
196
 
 
197
#ifndef NO_QWT_WIDGETS
 
198
class WheelInterface: public CustomWidgetInterface 
 
199
{
 
200
    Q_OBJECT
 
201
    Q_INTERFACES(QDesignerCustomWidgetInterface)
 
202
 
 
203
public:
 
204
    WheelInterface(QObject *parent);
 
205
    virtual QWidget *createWidget(QWidget *parent);
 
206
};
 
207
#endif
 
208
 
 
209
class TaskMenuFactory: public QExtensionFactory
 
210
{
 
211
    Q_OBJECT
 
212
 
 
213
public:
 
214
    TaskMenuFactory(QExtensionManager *parent = 0);
 
215
 
 
216
protected:
 
217
    QObject *createExtension(QObject *object, 
 
218
        const QString &iid, QObject *parent) const;
 
219
};
 
220
 
 
221
class TaskMenuExtension: public QObject,
 
222
            public QDesignerTaskMenuExtension
 
223
{
 
224
    Q_OBJECT
 
225
    Q_INTERFACES(QDesignerTaskMenuExtension)
 
226
 
 
227
public:
 
228
    TaskMenuExtension(QWidget *widget, QObject *parent);
 
229
 
 
230
    QAction *preferredEditAction() const;
 
231
    QList<QAction *> taskActions() const;
 
232
 
 
233
private slots:
 
234
    void editProperties();
 
235
    void applyProperties(const QString &);
 
236
 
 
237
private:
 
238
    QAction *d_editAction;
 
239
    QWidget *d_widget;
 
240
};
 
241
 
 
242
};
 
243
 
 
244
#endif