Changeset View
Changeset View
Standalone View
Standalone View
src/part/simpleprintingcommand.h
Show All 26 Lines | |||||
27 | 27 | | |||
28 | #ifndef KGVSIMPLEPRINTINGCOMMAND_H | 28 | #ifndef KGVSIMPLEPRINTINGCOMMAND_H | ||
29 | #define KGVSIMPLEPRINTINGCOMMAND_H | 29 | #define KGVSIMPLEPRINTINGCOMMAND_H | ||
30 | 30 | | |||
31 | #include "simpleprintingengine.h" | 31 | #include "simpleprintingengine.h" | ||
32 | #include <dotgraphview.h> | 32 | #include <dotgraphview.h> | ||
33 | #include <kgraphviewer_part.h> | 33 | #include <kgraphviewer_part.h> | ||
34 | 34 | | |||
35 | namespace KGraphViewer | 35 | namespace KGraphViewer { | ||
36 | { | | |||
37 | class KGVSimplePrintPreviewWindow; | 36 | class KGVSimplePrintPreviewWindow; | ||
38 | 37 | | |||
39 | /*! @short A command for simple printing and print preview. | 38 | /*! @short A command for simple printing and print preview. | ||
40 | This class is instantiated in KGVMainWindowImpl so there's: | 39 | This class is instantiated in KGVMainWindowImpl so there's: | ||
41 | - a single print preview window per part item regardless of a way how user invoked | 40 | - a single print preview window per part item regardless of a way how user | ||
42 | the 'print preview' command (using 'File->Print Preview' command or 'Print Preview' button | 41 | invoked the 'print preview' command (using 'File->Print Preview' command or | ||
43 | of the 'Page Setup' dialog) | 42 | 'Print Preview' button of the 'Page Setup' dialog) | ||
44 | - a single printing engine per part item regardless of a way how user started | 43 | - a single printing engine per part item regardless of a way how user started | ||
45 | (using 'File->Print' command or 'Print' button of the 'Page Setup' dialog) | 44 | (using 'File->Print' command or 'Print' button of the 'Page Setup' dialog) | ||
46 | */ | 45 | */ | ||
47 | class KGVSimplePrintingCommand : public QObject | 46 | class KGVSimplePrintingCommand : public QObject { | ||
48 | { | | |||
49 | Q_OBJECT | 47 | Q_OBJECT | ||
50 | 48 | | |||
51 | public: | 49 | public: | ||
52 | KGVSimplePrintingCommand(DotGraphView* mainWin, int objectId, | 50 | KGVSimplePrintingCommand(DotGraphView *mainWin, int objectId, | ||
53 | QObject* parent = nullptr); | 51 | QObject *parent = nullptr); | ||
54 | ~KGVSimplePrintingCommand(); | 52 | ~KGVSimplePrintingCommand(); | ||
55 | 53 | | |||
56 | inline KGVSimplePrintingEngine* engine() {return m_previewEngine;} | 54 | inline KGVSimplePrintingEngine *engine() { return m_previewEngine; } | ||
57 | 55 | | |||
58 | void hidePageSetup(); | 56 | void hidePageSetup(); | ||
59 | void hidePrintPreview(); | 57 | void hidePrintPreview(); | ||
60 | 58 | | |||
61 | public Q_SLOTS: | 59 | public Q_SLOTS: | ||
62 | bool print(const QString& aTitleText = QString()); | 60 | bool print(const QString &aTitleText = QString()); | ||
63 | bool showPrintPreview(const QString& aTitleText = QString(), bool reload = false); | 61 | bool showPrintPreview(const QString &aTitleText = QString(), | ||
62 | bool reload = false); | ||||
64 | void showPageSetup(const QString& aTitleText = QString()); | 63 | void showPageSetup(const QString &aTitleText = QString()); | ||
65 | 64 | | |||
66 | Q_SIGNALS: | 65 | Q_SIGNALS: | ||
67 | //! connected to KGV Main Window | 66 | //! connected to KGV Main Window | ||
68 | void showPageSetupRequested(); | 67 | void showPageSetupRequested(); | ||
69 | 68 | | |||
70 | protected Q_SLOTS: | 69 | protected Q_SLOTS: | ||
71 | void slotShowPageSetupRequested(); | 70 | void slotShowPageSetupRequested(); | ||
72 | 71 | | |||
73 | protected: | 72 | protected: | ||
74 | bool init(const QString& aTitleText = QString()); | 73 | bool init(const QString &aTitleText = QString()); | ||
75 | 74 | | |||
76 | KGVSimplePrintingEngine* m_previewEngine; | 75 | KGVSimplePrintingEngine *m_previewEngine; | ||
77 | DotGraphView* m_graphView; | 76 | DotGraphView *m_graphView; | ||
78 | int m_objectId; | 77 | int m_objectId; | ||
79 | KGVSimplePrintingSettings* m_settings; | 78 | KGVSimplePrintingSettings *m_settings; | ||
80 | KGVSimplePrintPreviewWindow *m_previewWindow; | 79 | KGVSimplePrintPreviewWindow *m_previewWindow; | ||
81 | bool m_printPreviewNeedsReloading : 1; | 80 | bool m_printPreviewNeedsReloading : 1; | ||
82 | QDialog* m_pageSetupDialog; | 81 | QDialog *m_pageSetupDialog; | ||
83 | }; | 82 | }; | ||
84 | 83 | | |||
85 | } | 84 | } // namespace KGraphViewer | ||
86 | 85 | | |||
87 | #endif | 86 | #endif |