Changeset View
Changeset View
Standalone View
Standalone View
kimagemapeditor.h
Show All 22 Lines | |||||
23 | #include <QObject> | 23 | #include <QObject> | ||
24 | #include <QHash> | 24 | #include <QHash> | ||
25 | #include <QImage> | 25 | #include <QImage> | ||
26 | #include <QPixmap> | 26 | #include <QPixmap> | ||
27 | #include <QTextStream> | 27 | #include <QTextStream> | ||
28 | 28 | | |||
29 | #include <KConfig> | 29 | #include <KConfig> | ||
30 | #include <KParts/ReadWritePart> | 30 | #include <KParts/ReadWritePart> | ||
31 | #include <kurl.h> | 31 | #include <QUrl> | ||
32 | 32 | | |||
33 | #include "kimearea.h" | 33 | #include "kimearea.h" | ||
34 | 34 | | |||
35 | /** | 35 | /** | ||
36 | *@author Jan Schaefer | 36 | *@author Jan Schaefer | ||
37 | */ | 37 | */ | ||
38 | 38 | | |||
39 | // #define WITH_TABWIDGET | 39 | // #define WITH_TABWIDGET | ||
▲ Show 20 Lines • Show All 151 Lines • ▼ Show 20 Line(s) | 127 | public : | |||
191 | */ | 191 | */ | ||
192 | virtual void setModified(bool); | 192 | virtual void setModified(bool); | ||
193 | 193 | | |||
194 | /** | 194 | /** | ||
195 | * Opens the given file. | 195 | * Opens the given file. | ||
196 | * If it's an HTML file openURL is called | 196 | * If it's an HTML file openURL is called | ||
197 | * If it's an Image, the image is added to the image list | 197 | * If it's an Image, the image is added to the image list | ||
198 | */ | 198 | */ | ||
199 | void openFile(const KUrl &); | 199 | void openFile(const QUrl &); | ||
200 | 200 | | |||
201 | /** | 201 | /** | ||
202 | * Opens the last URL the user worked with. | 202 | * Opens the last URL the user worked with. | ||
203 | * Sets also, the last map and the last image | 203 | * Sets also, the last map and the last image | ||
204 | */ | 204 | */ | ||
205 | void openLastURL(const KConfigGroup &); | 205 | void openLastURL(const KConfigGroup &); | ||
206 | 206 | | |||
207 | void readConfig(const KConfigGroup &); | 207 | void readConfig(const KConfigGroup &); | ||
208 | void writeConfig(KConfigGroup &); | 208 | void writeConfig(KConfigGroup &); | ||
209 | 209 | | |||
210 | 210 | | |||
211 | protected: | 211 | protected: | ||
212 | void init(); | 212 | void init(); | ||
213 | bool openHTMLFile(const KUrl &); | 213 | bool openHTMLFile(const QUrl &); | ||
214 | void saveImageMap(const KUrl &); | 214 | void saveImageMap(const QUrl &); | ||
215 | 215 | | |||
216 | /** | 216 | /** | ||
217 | * Returns a language dependent background picture, with | 217 | * Returns a language dependent background picture, with | ||
218 | * the text : Drop an image or html file | 218 | * the text : Drop an image or html file | ||
219 | */ | 219 | */ | ||
220 | QImage getBackgroundImage(); | 220 | QImage getBackgroundImage(); | ||
221 | 221 | | |||
222 | 222 | | |||
223 | /** | 223 | /** | ||
224 | * Saves information to restore the last working state | 224 | * Saves information to restore the last working state | ||
225 | */ | 225 | */ | ||
226 | void saveLastURL(KConfigGroup&); | 226 | void saveLastURL(KConfigGroup&); | ||
227 | 227 | | |||
228 | 228 | | |||
229 | private: | 229 | private: | ||
230 | // Stores the hole html file in a List | 230 | // Stores the hole html file in a List | ||
231 | // The entries are either a MapTag an ImageTag or a QString | 231 | // The entries are either a MapTag an ImageTag or a QString | ||
232 | HtmlContent _htmlContent; | 232 | HtmlContent _htmlContent; | ||
233 | 233 | | |||
234 | // the url of the working image; | 234 | // the url of the working image; | ||
235 | KUrl _imageUrl; | 235 | QUrl _imageUrl; | ||
236 | QString _mapName; | 236 | QString _mapName; | ||
237 | QImage _backgroundImage; | 237 | QImage _backgroundImage; | ||
238 | 238 | | |||
239 | bool backupFileCreated; | 239 | bool backupFileCreated; | ||
240 | 240 | | |||
241 | KImageMapEditor::ToolType _currentToolType; | 241 | KImageMapEditor::ToolType _currentToolType; | ||
242 | AreaList *areas; | 242 | AreaList *areas; | ||
243 | AreaSelection *currentSelected; | 243 | AreaSelection *currentSelected; | ||
▲ Show 20 Lines • Show All 86 Lines • ▼ Show 20 Line(s) | |||||
330 | void setMap(MapTag*); | 330 | void setMap(MapTag*); | ||
331 | void addMap(const QString &); | 331 | void addMap(const QString &); | ||
332 | 332 | | |||
333 | // Returns the entire html file as a String | 333 | // Returns the entire html file as a String | ||
334 | HtmlElement* findHtmlElement(const QString &); | 334 | HtmlElement* findHtmlElement(const QString &); | ||
335 | HtmlImgElement* findHtmlImgElement(ImageTag*); | 335 | HtmlImgElement* findHtmlImgElement(ImageTag*); | ||
336 | HtmlMapElement* findHtmlMapElement(const QString &); | 336 | HtmlMapElement* findHtmlMapElement(const QString &); | ||
337 | void deleteAllMaps(); | 337 | void deleteAllMaps(); | ||
338 | void addImage(const KUrl &); | 338 | void addImage(const QUrl &); | ||
339 | void setImageActionsEnabled(bool); | 339 | void setImageActionsEnabled(bool); | ||
340 | void setMapActionsEnabled(bool); | 340 | void setMapActionsEnabled(bool); | ||
341 | 341 | | |||
342 | void saveAreasToMapTag(MapTag*); | 342 | void saveAreasToMapTag(MapTag*); | ||
343 | void showPopupMenu(const QPoint &, const QString &); | 343 | void showPopupMenu(const QPoint &, const QString &); | ||
344 | void drawToCenter(QPainter* p, const QString & str, int y, int width); | 344 | void drawToCenter(QPainter* p, const QString & str, int y, int width); | ||
345 | 345 | | |||
346 | public slots: | 346 | public slots: | ||
347 | virtual bool openURL(const QUrl & url); | 347 | virtual bool openURL(const QUrl & url); | ||
348 | void slotChangeStatusCoords(int x,int y); | 348 | void slotChangeStatusCoords(int x,int y); | ||
349 | void slotUpdateSelectionCoords(); | 349 | void slotUpdateSelectionCoords(); | ||
350 | void slotUpdateSelectionCoords( const QRect &); | 350 | void slotUpdateSelectionCoords( const QRect &); | ||
351 | void slotAreaChanged(Area *); | 351 | void slotAreaChanged(Area *); | ||
352 | void slotShowMainPopupMenu(const QPoint &); | 352 | void slotShowMainPopupMenu(const QPoint &); | ||
353 | void slotShowMapPopupMenu(const QPoint &); | 353 | void slotShowMapPopupMenu(const QPoint &); | ||
354 | void slotShowImagePopupMenu(const QPoint &); | 354 | void slotShowImagePopupMenu(const QPoint &); | ||
355 | void slotConfigChanged(); | 355 | void slotConfigChanged(); | ||
356 | void setPicture(const KUrl & url); | 356 | void setPicture(const QUrl & url); | ||
357 | void setMap(const QString &); | 357 | void setMap(const QString &); | ||
358 | void setMapName(const QString & s); | 358 | void setMapName(const QString & s); | ||
359 | 359 | | |||
360 | 360 | | |||
361 | protected slots: | 361 | protected slots: | ||
362 | // overridden from KReadWritePart | 362 | // overridden from KReadWritePart | ||
363 | virtual bool openFile(); | 363 | virtual bool openFile(); | ||
364 | 364 | | |||
▲ Show 20 Lines • Show All 82 Lines • Show Last 20 Lines |