File indexing completed on 2024-12-01 07:06:46
0001 /*************************************************************************** 0002 kimedialogs.h - description 0003 ------------------- 0004 begin : Tue Apr 17 2001 0005 copyright : (C) 2001 by Jan Schäfer 0006 email : janschaefer@users.sourceforge.net 0007 ***************************************************************************/ 0008 0009 /*************************************************************************** 0010 * * 0011 * This program is free software; you can redistribute it and/or modify * 0012 * it under the terms of the GNU General Public License as published by * 0013 * the Free Software Foundation; either version 2 of the License, or * 0014 * (at your option) any later version. * 0015 * * 0016 ***************************************************************************/ 0017 0018 #ifndef KIMEDIALOGS_H 0019 #define KIMEDIALOGS_H 0020 0021 #include <QDialog> 0022 #include <QFormLayout> 0023 #include <QLabel> 0024 #include <QWebEngineView> 0025 0026 #include "kimagemapeditor.h" 0027 0028 class QLineEdit; 0029 class QSpinBox; 0030 0031 0032 class CoordsEdit : public QWidget { 0033 Q_OBJECT 0034 public : 0035 CoordsEdit(QWidget *parent, Area* a); 0036 ~CoordsEdit() override; 0037 virtual void applyChanges(); 0038 protected: 0039 Area *area; // The working area 0040 protected slots: 0041 void slotTriggerUpdate(); 0042 signals: 0043 void update(); 0044 }; 0045 0046 class RectCoordsEdit : public CoordsEdit { 0047 public: 0048 RectCoordsEdit(QWidget *parent, Area* a); 0049 void applyChanges() override; 0050 private: 0051 QSpinBox *topXSpin; 0052 QSpinBox *topYSpin; 0053 QSpinBox *widthSpin; 0054 QSpinBox *heightSpin; 0055 }; 0056 0057 class CircleCoordsEdit : public CoordsEdit { 0058 public: 0059 CircleCoordsEdit(QWidget *parent, Area* a); 0060 void applyChanges() override; 0061 private: 0062 QSpinBox *centerXSpin; 0063 QSpinBox *centerYSpin; 0064 QSpinBox *radiusSpin; 0065 }; 0066 0067 class QTableWidget; 0068 0069 class PolyCoordsEdit : public CoordsEdit { 0070 Q_OBJECT 0071 public: 0072 PolyCoordsEdit(QWidget *parent, Area* a); 0073 ~PolyCoordsEdit() override; 0074 void applyChanges() override; 0075 private: 0076 QTableWidget *coordsTable; 0077 void updatePoints(); 0078 protected slots: 0079 void slotAddPoint(); 0080 void slotRemovePoint(); 0081 void slotHighlightPoint(int); 0082 0083 }; 0084 0085 class SelectionCoordsEdit : public CoordsEdit { 0086 Q_OBJECT 0087 public: 0088 SelectionCoordsEdit(QWidget *parent, Area* a); 0089 void applyChanges() override; 0090 private: 0091 QSpinBox *topXSpin; 0092 QSpinBox *topYSpin; 0093 0094 }; 0095 0096 0097 class QCheckBox; 0098 0099 class AreaDialog : public QDialog { 0100 Q_OBJECT 0101 private: 0102 Area *area; 0103 Area *oldArea; // Only for drawing reasons 0104 Area *areaCopy; // A copy for restoring the original area if user press cancel 0105 QLineEdit *hrefEdit; 0106 QLineEdit *altEdit; 0107 QLineEdit *targetEdit; 0108 QLineEdit *titleEdit; 0109 0110 QLineEdit *onClickEdit; 0111 QLineEdit *onDblClickEdit; 0112 QLineEdit *onMouseDownEdit; 0113 QLineEdit *onMouseUpEdit; 0114 QLineEdit *onMouseOverEdit; 0115 QLineEdit *onMouseMoveEdit; 0116 QLineEdit *onMouseOutEdit; 0117 0118 CoordsEdit *coordsEdit; 0119 CoordsEdit* createCoordsEdit(QWidget *parent, Area *a); 0120 QCheckBox *defaultAreaChk; 0121 KImageMapEditor *_document; 0122 0123 0124 public: 0125 AreaDialog(KImageMapEditor* parent,Area * a); 0126 ~AreaDialog() override; 0127 protected slots: 0128 virtual void slotOk(); 0129 virtual void slotApply(); 0130 virtual void slotCancel(); 0131 void slotChooseHref(); 0132 void slotUpdateArea(); 0133 0134 QLineEdit* createLineEdit(QFormLayout *layout, const QString &value, const QString &name); 0135 QWidget* createGeneralPage(); 0136 QWidget* createCoordsPage(); 0137 QWidget* createJavascriptPage(); 0138 signals: 0139 void areaChanged(Area* a); 0140 }; 0141 0142 0143 0144 0145 class KConfig; 0146 0147 class PreferencesDialog : public QDialog { 0148 Q_OBJECT 0149 public: 0150 PreferencesDialog(QWidget *parent,KConfig*); 0151 ~PreferencesDialog() override; 0152 protected slots: 0153 virtual void slotDefault( void ); 0154 virtual void slotOk( void ); 0155 virtual void slotApply( void ); 0156 private: 0157 QSpinBox *rowHeightSpinBox; 0158 QSpinBox *undoSpinBox; 0159 QSpinBox *redoSpinBox; 0160 // QCheckBox *colorizeAreaChk; 0161 // QCheckBox *showAltChk; 0162 QCheckBox *startWithCheck; 0163 KConfig *config; 0164 signals: 0165 void preferencesChanged(); 0166 }; 0167 0168 class KHTMLPart; 0169 class QTemporaryFile; 0170 0171 class HTMLPreviewDialog : public QDialog{ 0172 public: 0173 HTMLPreviewDialog(QWidget *, const QString &); 0174 ~HTMLPreviewDialog() override; 0175 private: 0176 QWebEngineView* htmlPart; 0177 QTemporaryFile* tempFile; 0178 }; 0179 0180 #endif