1/***************************************************************************
2 kimedialogs.h - description
3 -------------------
4 begin : Tue Apr 17 2001
5 copyright : (C) 2001 by Jan Schäfer
6 email : janschaefer@users.sourceforge.net
7 ***************************************************************************/
8
9/***************************************************************************
10 * *
11 * This program is free software; you can redistribute it and/or modify *
12 * it under the terms of the GNU General Public License as published by *
13 * the Free Software Foundation; either version 2 of the License, or *
14 * (at your option) any later version. *
15 * *
16 ***************************************************************************/
17
18#ifndef KIMEDIALOGS_H
19#define KIMEDIALOGS_H
20
21#include <QLabel>
22#include <QLinkedList>
23
24#include <kdialog.h>
25#include <kurl.h>
26
27#include "kimagemapeditor.h"
28#include "kdeversion.h"
29
30
31class QLineEdit;
32class QSpinBox;
33
34
35class CoordsEdit : public QWidget {
36Q_OBJECT
37 public :
38 CoordsEdit(QWidget *parent, Area* a);
39 virtual ~CoordsEdit();
40 virtual void applyChanges();
41 protected:
42 Area *area; // The working area
43 protected slots:
44 void slotTriggerUpdate();
45 signals:
46 void update();
47};
48
49class RectCoordsEdit : public CoordsEdit {
50 public:
51 RectCoordsEdit(QWidget *parent, Area* a);
52 virtual void applyChanges();
53 private:
54 QSpinBox *topXSpin;
55 QSpinBox *topYSpin;
56 QSpinBox *widthSpin;
57 QSpinBox *heightSpin;
58};
59
60class CircleCoordsEdit : public CoordsEdit {
61 public:
62 CircleCoordsEdit(QWidget *parent, Area* a);
63 virtual void applyChanges();
64 private:
65 QSpinBox *centerXSpin;
66 QSpinBox *centerYSpin;
67 QSpinBox *radiusSpin;
68};
69
70class QTableWidget;
71
72class PolyCoordsEdit : public CoordsEdit {
73Q_OBJECT
74 public:
75 PolyCoordsEdit(QWidget *parent, Area* a);
76 ~PolyCoordsEdit();
77 virtual void applyChanges();
78 private:
79 QTableWidget *coordsTable;
80 void updatePoints();
81 protected slots:
82 void slotAddPoint();
83 void slotRemovePoint();
84 void slotHighlightPoint(int);
85
86};
87
88class SelectionCoordsEdit : public CoordsEdit {
89Q_OBJECT
90 public:
91 SelectionCoordsEdit(QWidget *parent, Area* a);
92 virtual void applyChanges();
93 private:
94 QSpinBox *topXSpin;
95 QSpinBox *topYSpin;
96
97};
98
99
100class QCheckBox;
101
102class AreaDialog : public KDialog {
103Q_OBJECT
104 private:
105 Area *area;
106 Area *oldArea; // Only for drawing reasons
107 Area *areaCopy; // A copy for restoring the original area if user press cancel
108 QLineEdit *hrefEdit;
109 QLineEdit *altEdit;
110 QLineEdit *targetEdit;
111 QLineEdit *titleEdit;
112
113 QLineEdit *onClickEdit;
114 QLineEdit *onDblClickEdit;
115 QLineEdit *onMouseDownEdit;
116 QLineEdit *onMouseUpEdit;
117 QLineEdit *onMouseOverEdit;
118 QLineEdit *onMouseMoveEdit;
119 QLineEdit *onMouseOutEdit;
120
121 CoordsEdit *coordsEdit;
122 CoordsEdit* createCoordsEdit(QWidget *parent, Area *a);
123 QCheckBox *defaultAreaChk;
124 KImageMapEditor *_document;
125
126
127 public:
128 AreaDialog(KImageMapEditor* parent,Area * a);
129 ~AreaDialog();
130 protected slots:
131 virtual void slotOk();
132 virtual void slotApply();
133 virtual void slotCancel();
134 void slotChooseHref();
135 void slotUpdateArea();
136
137 QLineEdit* createLineEdit(QWidget* parent, QGridLayout *layout, int y, const QString & value, const QString & name);
138 QWidget* createGeneralPage();
139 QWidget* createCoordsPage();
140 QWidget* createJavascriptPage();
141 signals:
142 void areaChanged(Area* a);
143};
144
145
146
147
148class KConfig;
149
150class PreferencesDialog : public KDialog {
151Q_OBJECT
152 public:
153 PreferencesDialog(QWidget *parent,KConfig*);
154 ~PreferencesDialog();
155 protected slots:
156 virtual void slotDefault( void );
157 virtual void slotOk( void );
158 virtual void slotApply( void );
159 private:
160 QSpinBox *rowHeightSpinBox;
161 QSpinBox *undoSpinBox;
162 QSpinBox *redoSpinBox;
163// QCheckBox *colorizeAreaChk;
164// QCheckBox *showAltChk;
165 QCheckBox *startWithCheck;
166 KConfig *config;
167 signals:
168 void preferencesChanged();
169};
170
171class KHTMLPart;
172class KTemporaryFile;
173
174class HTMLPreviewDialog : public KDialog{
175 public:
176 HTMLPreviewDialog(QWidget *, const KUrl &, const QString &);
177 ~HTMLPreviewDialog();
178 private:
179 KHTMLPart* htmlPart;
180 KTemporaryFile* tempFile;
181};
182
183#endif
184