Changeset View
Changeset View
Standalone View
Standalone View
karbon/ui/KarbonView.h
Show All 28 Lines | |||||
29 | * along with this library; see the file COPYING.LIB. If not, write to | 29 | * along with this library; see the file COPYING.LIB. If not, write to | ||
30 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | 30 | * the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, | ||
31 | * Boston, MA 02110-1301, USA. | 31 | * Boston, MA 02110-1301, USA. | ||
32 | */ | 32 | */ | ||
33 | 33 | | |||
34 | #ifndef __KARBON_VIEW__ | 34 | #ifndef __KARBON_VIEW__ | ||
35 | #define __KARBON_VIEW__ | 35 | #define __KARBON_VIEW__ | ||
36 | 36 | | |||
37 | #include <KoView.h> | 37 | #include <KoPAView.h> | ||
38 | #include <KoShapeAlignCommand.h> | 38 | #include <KoShapeAlignCommand.h> | ||
39 | #include <KoShapeDistributeCommand.h> | 39 | #include <KoShapeDistributeCommand.h> | ||
40 | #include <karbonui_export.h> | 40 | #include <karbonui_export.h> | ||
41 | #include "KarbonBooleanCommand.h" | 41 | #include "KarbonBooleanCommand.h" | ||
42 | 42 | | |||
43 | class QDropEvent; | 43 | class QDropEvent; | ||
44 | class QResizeEvent; | 44 | class QResizeEvent; | ||
45 | class QLayout; | ||||
45 | 46 | | |||
46 | class KarbonDocument; | 47 | class KarbonDocument; | ||
47 | 48 | | |||
48 | class KoColor; | 49 | class KoColor; | ||
49 | class KoUnit; | 50 | class KoUnit; | ||
50 | 51 | | |||
51 | 52 | | |||
53 | class KarbonPaletteBarWidget; | ||||
52 | class KarbonPart; | 54 | class KarbonPart; | ||
53 | class KarbonCanvas; | | |||
54 | 55 | | |||
55 | class KARBONUI_EXPORT KarbonView : public KoView | 56 | class KoPACanvas; | ||
57 | class KoCanvasResourceManager; | ||||
58 | | ||||
59 | class KARBONUI_EXPORT KarbonView : public KoPAView | ||||
56 | { | 60 | { | ||
57 | Q_OBJECT | 61 | Q_OBJECT | ||
58 | 62 | | |||
59 | public: | 63 | public: | ||
60 | KarbonView(KarbonPart *part, KarbonDocument* doc, QWidget* parent = 0); | 64 | KarbonView(KarbonPart *part, KarbonDocument* doc, QWidget* parent = 0); | ||
61 | virtual ~KarbonView(); | 65 | virtual ~KarbonView(); | ||
62 | 66 | | |||
63 | /// Returns the view is attached to | 67 | /// Returns the view is attached to | ||
64 | KarbonDocument * part() const; | 68 | KarbonDocument * part() const; | ||
65 | 69 | | |||
66 | /// Returns the canvas widget of this view | 70 | /// Returns the canvas widget of this view | ||
67 | KarbonCanvas * canvasWidget() const; | 71 | KoPACanvas *canvasWidget() const; | ||
68 | 72 | | |||
69 | void reorganizeGUI(); | 73 | void reorganizeGUI(); | ||
70 | void setNumberOfRecentFiles(uint number); | 74 | void setNumberOfRecentFiles(uint number); | ||
71 | 75 | | |||
72 | /// Reimplemented from QWidget | 76 | /// Reimplemented from QWidget | ||
73 | virtual void setCursor(const QCursor &); | 77 | virtual void setCursor(const QCursor &); | ||
74 | /// Reimplemented from QWidget | 78 | /// Reimplemented from QWidget | ||
75 | virtual void dropEvent(QDropEvent *e); | 79 | virtual void dropEvent(QDropEvent *e); | ||
76 | /// Reimplemented from KoView | | |||
77 | virtual KoZoomController *zoomController() const; | | |||
78 | 80 | | |||
79 | 81 | | |||
82 | KoCanvasResourceManager *resourceManager() const; | ||||
83 | | ||||
84 | KarbonPaletteBarWidget *colorBar() const; | ||||
85 | | ||||
80 | public Q_SLOTS: | 86 | public Q_SLOTS: | ||
81 | // editing: | 87 | // editing: | ||
82 | void editSelectAll(); | 88 | void editSelectAll(); | ||
83 | void editDeselectAll(); | 89 | void editDeselectAll(); | ||
84 | void editDeleteSelection(); | 90 | void editDeleteSelection(); | ||
85 | 91 | | |||
86 | void selectionDuplicate(); | 92 | void selectionDuplicate(); | ||
87 | void selectionDistributeHorizontalCenter(); | 93 | void selectionDistributeHorizontalCenter(); | ||
Show All 20 Lines | |||||
108 | 114 | | |||
109 | void intersectPaths(); | 115 | void intersectPaths(); | ||
110 | void subtractPaths(); | 116 | void subtractPaths(); | ||
111 | void unitePaths(); | 117 | void unitePaths(); | ||
112 | void excludePaths(); | 118 | void excludePaths(); | ||
113 | 119 | | |||
114 | void pathSnapToGrid(); | 120 | void pathSnapToGrid(); | ||
115 | 121 | | |||
116 | void configure(); | | |||
117 | | ||||
118 | void configurePageLayout(); | | |||
119 | | ||||
120 | void selectionChanged(); | 122 | void selectionChanged(); | ||
121 | 123 | | |||
122 | void togglePageMargins(bool); | | |||
123 | void showRuler(); | | |||
124 | void showGuides(); | | |||
125 | void editGuides(); | 124 | void editGuides(); | ||
126 | void snapToGrid(); | | |||
127 | void showPalette(); | 125 | void showPalette(); | ||
128 | 126 | | |||
129 | protected Q_SLOTS: | 127 | protected Q_SLOTS: | ||
130 | // Object related operations. | 128 | // Object related operations. | ||
131 | 129 | | |||
132 | // View | 130 | // View | ||
133 | void viewModeChanged(bool); | 131 | void viewModeChanged(bool); | ||
134 | void zoomSelection(); | 132 | void zoomSelection(); | ||
135 | void zoomDrawing(); | 133 | void zoomDrawing(); | ||
136 | 134 | | |||
137 | void mousePositionChanged(const QPoint &position); | 135 | void mousePositionChanged(const QPoint &position); | ||
138 | void pageOffsetChanged(); | | |||
139 | | ||||
140 | void updateUnit(const KoUnit &unit); | | |||
141 | 136 | | |||
142 | void applyFillToSelection(); | 137 | void applyFillToSelection(); | ||
143 | void applyStrokeToSelection(); | 138 | void applyStrokeToSelection(); | ||
144 | void applyPaletteColor(const KoColor &color); | 139 | void applyPaletteColor(const KoColor &color); | ||
145 | 140 | | |||
146 | protected: | 141 | protected: | ||
142 | /// Use own configuaration dialog | ||||
143 | virtual void openConfiguration(); | ||||
144 | | ||||
147 | virtual void updateReadWrite(bool readwrite); | 145 | virtual void updateReadWrite(bool readwrite); | ||
148 | virtual void resizeEvent(QResizeEvent* event); | 146 | virtual void resizeEvent(QResizeEvent* event); | ||
149 | virtual void dragEnterEvent(QDragEnterEvent * event); | 147 | virtual void dragEnterEvent(QDragEnterEvent * event); | ||
150 | virtual void addImages(const QVector<QImage> &imageList, const QPoint &insertAt); | | |||
151 | 148 | | |||
152 | void createLayersTabDock(); | | |||
153 | void createStrokeDock(); | 149 | void createStrokeDock(); | ||
154 | void createColorDock(); | 150 | void createColorDock(); | ||
155 | 151 | | |||
156 | virtual KoPrintJob * createPrintJob(); | | |||
157 | virtual KoPrintJob * createPdfPrintJob(); | | |||
158 | | ||||
159 | private: | 152 | private: | ||
160 | void initActions(); | 153 | void initActions(); | ||
161 | void updateRuler(); | 154 | void updateRuler(); | ||
162 | 155 | | |||
163 | void selectionDistribute(KoShapeDistributeCommand::Distribute distribute); | 156 | void selectionDistribute(KoShapeDistributeCommand::Distribute distribute); | ||
164 | void booleanOperation(KarbonBooleanCommand::BooleanOperation operation); | 157 | void booleanOperation(KarbonBooleanCommand::BooleanOperation operation); | ||
165 | void selectionFlip(bool horizontally, bool vertically); | 158 | void selectionFlip(bool horizontally, bool vertically); | ||
166 | 159 | | |||
Show All 9 Lines |