Changeset View
Changeset View
Standalone View
Standalone View
ui/annotationwidgets.h
Show All 11 Lines | |||||
12 | 12 | | |||
13 | #include <qwidget.h> | 13 | #include <qwidget.h> | ||
14 | 14 | | |||
15 | #include "core/annotations.h" | 15 | #include "core/annotations.h" | ||
16 | 16 | | |||
17 | class QCheckBox; | 17 | class QCheckBox; | ||
18 | class QComboBox; | 18 | class QComboBox; | ||
19 | class QDoubleSpinBox; | 19 | class QDoubleSpinBox; | ||
20 | class QFormLayout; | ||||
20 | class QLabel; | 21 | class QLabel; | ||
21 | class QWidget; | 22 | class QWidget; | ||
22 | class KColorButton; | 23 | class KColorButton; | ||
23 | class QSpinBox; | 24 | class QSpinBox; | ||
24 | class KFontRequester; | 25 | class KFontRequester; | ||
25 | class AnnotationWidget; | 26 | class AnnotationWidget; | ||
26 | 27 | | |||
27 | class PixmapPreviewSelector | 28 | class PixmapPreviewSelector | ||
▲ Show 20 Lines • Show All 55 Lines • ▼ Show 20 Line(s) | 75 | public: | |||
83 | virtual void applyChanges(); | 84 | virtual void applyChanges(); | ||
84 | 85 | | |||
85 | Q_SIGNALS: | 86 | Q_SIGNALS: | ||
86 | void dataChanged(); | 87 | void dataChanged(); | ||
87 | 88 | | |||
88 | protected: | 89 | protected: | ||
89 | QWidget * createAppearanceWidget(); | 90 | QWidget * createAppearanceWidget(); | ||
90 | 91 | | |||
91 | virtual QWidget * createStyleWidget(); | 92 | virtual void createStyleWidget(QFormLayout * formLayout); | ||
92 | virtual QWidget * createExtraWidget(); | 93 | virtual QWidget * createExtraWidget(); | ||
93 | 94 | | |||
94 | private: | 95 | private: | ||
95 | virtual bool hasColorButton() const { return true; } | 96 | virtual bool hasColorButton() const { return true; } | ||
96 | virtual bool hasOpacityBox() const { return true; } | 97 | virtual bool hasOpacityBox() const { return true; } | ||
97 | 98 | | |||
98 | Okular::Annotation * m_ann; | 99 | Okular::Annotation * m_ann; | ||
99 | QWidget * m_appearanceWidget { nullptr }; | 100 | QWidget * m_appearanceWidget { nullptr }; | ||
100 | QWidget * m_extraWidget { nullptr }; | 101 | QWidget * m_extraWidget { nullptr }; | ||
101 | KColorButton *m_colorBn { nullptr }; | 102 | KColorButton *m_colorBn { nullptr }; | ||
102 | QSpinBox *m_opacity { nullptr }; | 103 | QSpinBox *m_opacity { nullptr }; | ||
103 | }; | 104 | }; | ||
104 | 105 | | |||
105 | class QVBoxLayout; | 106 | class QVBoxLayout; | ||
106 | class QGridLayout; | 107 | class QFormLayout; | ||
107 | 108 | | |||
108 | class TextAnnotationWidget | 109 | class TextAnnotationWidget | ||
109 | : public AnnotationWidget | 110 | : public AnnotationWidget | ||
110 | { | 111 | { | ||
111 | Q_OBJECT | 112 | Q_OBJECT | ||
112 | 113 | | |||
113 | public: | 114 | public: | ||
114 | explicit TextAnnotationWidget( Okular::Annotation * ann ); | 115 | explicit TextAnnotationWidget( Okular::Annotation * ann ); | ||
115 | 116 | | |||
116 | void applyChanges() override; | 117 | void applyChanges() override; | ||
117 | 118 | | |||
118 | protected: | 119 | protected: | ||
119 | QWidget * createStyleWidget() override; | 120 | void createStyleWidget(QFormLayout * formlayout) override; | ||
120 | 121 | | |||
121 | private: | 122 | private: | ||
122 | virtual bool hasColorButton() const override; | 123 | virtual bool hasColorButton() const override; | ||
123 | virtual bool hasOpacityBox() const override; | 124 | virtual bool hasOpacityBox() const override; | ||
124 | 125 | | |||
125 | void createPopupNoteStyleUi( QWidget * widget, QVBoxLayout * layout ); | 126 | void createPopupNoteStyleUi( QWidget * widget, QFormLayout * formlayout ); | ||
126 | void createInlineNoteStyleUi( QWidget * widget, QVBoxLayout * layout ); | 127 | void createInlineNoteStyleUi( QWidget * widget, QFormLayout * formlayout ); | ||
127 | void createTypewriterStyleUi( QWidget * widget, QVBoxLayout * layout ); | 128 | void createTypewriterStyleUi( QWidget * widget, QFormLayout * formlayout ); | ||
128 | void addPixmapSelector( QWidget * widget, QLayout * layout ); | 129 | void addPixmapSelector( QWidget * widget, QFormLayout * formlayout ); | ||
129 | void addFontRequester( QWidget * widget, QGridLayout * layout ); | 130 | void addFontRequester( QWidget * widget, QFormLayout * formlayout ); | ||
130 | void addTextColorButton( QWidget * widget, QGridLayout * layout ); | 131 | void addTextColorButton( QWidget * widget, QFormLayout * formlayout ); | ||
131 | void addTextAlignComboBox( QWidget * widget, QGridLayout * layout ); | 132 | void addTextAlignComboBox( QWidget * widget, QFormLayout * formlayout ); | ||
132 | void addWidthSpinBox( QWidget * widget, QGridLayout * layout ); | 133 | void addWidthSpinBox( QWidget * widget, QFormLayout * formlayout ); | ||
133 | 134 | | |||
134 | inline bool isTypewriter() const { return ( m_textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter ); } | 135 | inline bool isTypewriter() const { return ( m_textAnn->inplaceIntent() == Okular::TextAnnotation::TypeWriter ); } | ||
135 | 136 | | |||
136 | Okular::TextAnnotation * m_textAnn; | 137 | Okular::TextAnnotation * m_textAnn; | ||
137 | PixmapPreviewSelector * m_pixmapSelector { nullptr }; | 138 | PixmapPreviewSelector * m_pixmapSelector { nullptr }; | ||
138 | KFontRequester * m_fontReq { nullptr }; | 139 | KFontRequester * m_fontReq { nullptr }; | ||
139 | KColorButton *m_textColorBn { nullptr }; | 140 | KColorButton *m_textColorBn { nullptr }; | ||
140 | QComboBox * m_textAlign { nullptr }; | 141 | QComboBox * m_textAlign { nullptr }; | ||
141 | QDoubleSpinBox * m_spinWidth { nullptr }; | 142 | QDoubleSpinBox * m_spinWidth { nullptr }; | ||
142 | }; | 143 | }; | ||
143 | 144 | | |||
144 | class StampAnnotationWidget | 145 | class StampAnnotationWidget | ||
145 | : public AnnotationWidget | 146 | : public AnnotationWidget | ||
146 | { | 147 | { | ||
147 | Q_OBJECT | 148 | Q_OBJECT | ||
148 | 149 | | |||
149 | public: | 150 | public: | ||
150 | explicit StampAnnotationWidget( Okular::Annotation * ann ); | 151 | explicit StampAnnotationWidget( Okular::Annotation * ann ); | ||
151 | 152 | | |||
152 | void applyChanges() override; | 153 | void applyChanges() override; | ||
153 | 154 | | |||
154 | protected: | 155 | protected: | ||
155 | QWidget * createStyleWidget() override; | 156 | void createStyleWidget(QFormLayout * formlayout) override; | ||
156 | 157 | | |||
157 | private: | 158 | private: | ||
158 | Okular::StampAnnotation * m_stampAnn; | 159 | Okular::StampAnnotation * m_stampAnn; | ||
159 | PixmapPreviewSelector * m_pixmapSelector; | 160 | PixmapPreviewSelector * m_pixmapSelector; | ||
160 | }; | 161 | }; | ||
161 | 162 | | |||
162 | class LineAnnotationWidget | 163 | class LineAnnotationWidget | ||
163 | : public AnnotationWidget | 164 | : public AnnotationWidget | ||
164 | { | 165 | { | ||
165 | Q_OBJECT | 166 | Q_OBJECT | ||
166 | 167 | | |||
167 | public: | 168 | public: | ||
168 | explicit LineAnnotationWidget( Okular::Annotation * ann ); | 169 | explicit LineAnnotationWidget( Okular::Annotation * ann ); | ||
169 | 170 | | |||
170 | void applyChanges() override; | 171 | void applyChanges() override; | ||
171 | 172 | | |||
172 | protected: | 173 | protected: | ||
173 | QWidget * createStyleWidget() override; | 174 | void createStyleWidget(QFormLayout * formlayout) override; | ||
174 | 175 | | |||
175 | private: | 176 | private: | ||
176 | Okular::LineAnnotation * m_lineAnn; | 177 | Okular::LineAnnotation * m_lineAnn; | ||
177 | int m_lineType; | 178 | int m_lineType; | ||
178 | QDoubleSpinBox * m_spinLL { nullptr }; | 179 | QDoubleSpinBox * m_spinLL { nullptr }; | ||
179 | QDoubleSpinBox * m_spinLLE { nullptr }; | 180 | QDoubleSpinBox * m_spinLLE { nullptr }; | ||
180 | QCheckBox * m_useColor { nullptr }; | 181 | QCheckBox * m_useColor { nullptr }; | ||
181 | KColorButton * m_innerColor { nullptr }; | 182 | KColorButton * m_innerColor { nullptr }; | ||
182 | QDoubleSpinBox * m_spinSize { nullptr }; | 183 | QDoubleSpinBox * m_spinSize { nullptr }; | ||
183 | QComboBox * m_startStyleCombo { nullptr }; | 184 | QComboBox * m_startStyleCombo { nullptr }; | ||
184 | QComboBox * m_endStyleCombo { nullptr }; | 185 | QComboBox * m_endStyleCombo { nullptr }; | ||
185 | }; | 186 | }; | ||
186 | 187 | | |||
187 | class HighlightAnnotationWidget | 188 | class HighlightAnnotationWidget | ||
188 | : public AnnotationWidget | 189 | : public AnnotationWidget | ||
189 | { | 190 | { | ||
190 | Q_OBJECT | 191 | Q_OBJECT | ||
191 | 192 | | |||
192 | public: | 193 | public: | ||
193 | explicit HighlightAnnotationWidget( Okular::Annotation * ann ); | 194 | explicit HighlightAnnotationWidget( Okular::Annotation * ann ); | ||
194 | 195 | | |||
195 | void applyChanges() override; | 196 | void applyChanges() override; | ||
196 | 197 | | |||
197 | protected: | 198 | protected: | ||
198 | QWidget * createStyleWidget() override; | 199 | void createStyleWidget(QFormLayout * formlayout) override; | ||
199 | 200 | | |||
200 | private: | 201 | private: | ||
201 | Okular::HighlightAnnotation * m_hlAnn; | 202 | Okular::HighlightAnnotation * m_hlAnn; | ||
202 | QComboBox * m_typeCombo; | 203 | QComboBox * m_typeCombo; | ||
203 | }; | 204 | }; | ||
204 | 205 | | |||
205 | class GeomAnnotationWidget | 206 | class GeomAnnotationWidget | ||
206 | : public AnnotationWidget | 207 | : public AnnotationWidget | ||
207 | { | 208 | { | ||
208 | Q_OBJECT | 209 | Q_OBJECT | ||
209 | 210 | | |||
210 | public: | 211 | public: | ||
211 | explicit GeomAnnotationWidget( Okular::Annotation * ann ); | 212 | explicit GeomAnnotationWidget( Okular::Annotation * ann ); | ||
212 | 213 | | |||
213 | void applyChanges() override; | 214 | void applyChanges() override; | ||
214 | 215 | | |||
215 | protected: | 216 | protected: | ||
216 | QWidget * createStyleWidget() override; | 217 | void createStyleWidget(QFormLayout * formlayout) override; | ||
217 | 218 | | |||
218 | private: | 219 | private: | ||
219 | Okular::GeomAnnotation * m_geomAnn; | 220 | Okular::GeomAnnotation * m_geomAnn; | ||
220 | QComboBox * m_typeCombo; | 221 | QComboBox * m_typeCombo; | ||
221 | QCheckBox * m_useColor; | 222 | QCheckBox * m_useColor; | ||
222 | KColorButton * m_innerColor; | 223 | KColorButton * m_innerColor; | ||
223 | QDoubleSpinBox * m_spinSize; | 224 | QDoubleSpinBox * m_spinSize; | ||
224 | }; | 225 | }; | ||
225 | 226 | | |||
226 | class FileAttachmentAnnotationWidget | 227 | class FileAttachmentAnnotationWidget | ||
227 | : public AnnotationWidget | 228 | : public AnnotationWidget | ||
228 | { | 229 | { | ||
229 | Q_OBJECT | 230 | Q_OBJECT | ||
230 | 231 | | |||
231 | public: | 232 | public: | ||
232 | explicit FileAttachmentAnnotationWidget( Okular::Annotation * ann ); | 233 | explicit FileAttachmentAnnotationWidget( Okular::Annotation * ann ); | ||
233 | 234 | | |||
234 | void applyChanges() override; | 235 | void applyChanges() override; | ||
235 | 236 | | |||
236 | protected: | 237 | protected: | ||
237 | QWidget * createStyleWidget() override; | 238 | void createStyleWidget(QFormLayout * formlayout) override; | ||
238 | QWidget * createExtraWidget() override; | 239 | QWidget * createExtraWidget() override; | ||
239 | 240 | | |||
240 | private: | 241 | private: | ||
241 | Okular::FileAttachmentAnnotation * m_attachAnn; | 242 | Okular::FileAttachmentAnnotation * m_attachAnn; | ||
242 | PixmapPreviewSelector * m_pixmapSelector; | 243 | PixmapPreviewSelector * m_pixmapSelector; | ||
243 | }; | 244 | }; | ||
244 | 245 | | |||
245 | class CaretAnnotationWidget | 246 | class CaretAnnotationWidget | ||
246 | : public AnnotationWidget | 247 | : public AnnotationWidget | ||
247 | { | 248 | { | ||
248 | Q_OBJECT | 249 | Q_OBJECT | ||
249 | 250 | | |||
250 | public: | 251 | public: | ||
251 | explicit CaretAnnotationWidget( Okular::Annotation * ann ); | 252 | explicit CaretAnnotationWidget( Okular::Annotation * ann ); | ||
252 | 253 | | |||
253 | void applyChanges() override; | 254 | void applyChanges() override; | ||
254 | 255 | | |||
255 | protected: | 256 | protected: | ||
256 | QWidget * createStyleWidget() override; | 257 | void createStyleWidget(QFormLayout * formlayout) override; | ||
257 | 258 | | |||
258 | private: | 259 | private: | ||
259 | Okular::CaretAnnotation * m_caretAnn; | 260 | Okular::CaretAnnotation * m_caretAnn; | ||
260 | PixmapPreviewSelector * m_pixmapSelector; | 261 | PixmapPreviewSelector * m_pixmapSelector; | ||
261 | }; | 262 | }; | ||
262 | 263 | | |||
263 | class InkAnnotationWidget | 264 | class InkAnnotationWidget | ||
264 | : public AnnotationWidget | 265 | : public AnnotationWidget | ||
265 | { | 266 | { | ||
266 | Q_OBJECT | 267 | Q_OBJECT | ||
267 | 268 | | |||
268 | public: | 269 | public: | ||
269 | explicit InkAnnotationWidget( Okular::Annotation * ann ); | 270 | explicit InkAnnotationWidget( Okular::Annotation * ann ); | ||
270 | 271 | | |||
271 | void applyChanges() override; | 272 | void applyChanges() override; | ||
272 | 273 | | |||
273 | protected: | 274 | protected: | ||
274 | QWidget * createStyleWidget() override; | 275 | void createStyleWidget(QFormLayout * formlayout) override; | ||
275 | 276 | | |||
276 | private: | 277 | private: | ||
277 | Okular::InkAnnotation * m_inkAnn; | 278 | Okular::InkAnnotation * m_inkAnn; | ||
278 | QDoubleSpinBox * m_spinSize; | 279 | QDoubleSpinBox * m_spinSize; | ||
279 | }; | 280 | }; | ||
280 | 281 | | |||
281 | #endif | 282 | #endif |