Libksieve

sieveeditormenubar.h
1 /*
2  Copyright (C) 2015-2020 Laurent Montel <[email protected]>
3 
4  This program is free software; you can redistribute it and/or modify it
5  under the terms of the GNU General Public License, version 2, as
6  published by the Free Software Foundation.
7 
8  This program is distributed in the hope that it will be useful, but
9  WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  General Public License for more details.
12 
13  You should have received a copy of the GNU General Public License along
14  with this program; if not, write to the Free Software Foundation, Inc.,
15  51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
16 */
17 
18 #ifndef SIEVEEDITORMENUBAR_H
19 #define SIEVEEDITORMENUBAR_H
20 
21 #include <QMenuBar>
22 
23 class QAction;
24 class QMenu;
25 namespace KSieveUi {
26 class SieveEditorTextModeWidget;
27 class SieveEditorMenuBar : public QMenuBar
28 {
29  Q_OBJECT
30 public:
31  explicit SieveEditorMenuBar(QWidget *parent = nullptr);
32  ~SieveEditorMenuBar();
33 
34  Q_REQUIRED_RESULT QAction *goToLineAction() const;
35  Q_REQUIRED_RESULT QAction *findAction() const;
36  Q_REQUIRED_RESULT QAction *replaceAction() const;
37  Q_REQUIRED_RESULT QAction *undoAction() const;
38  Q_REQUIRED_RESULT QAction *redoAction() const;
39  Q_REQUIRED_RESULT QAction *copyAction() const;
40  Q_REQUIRED_RESULT QAction *pasteAction() const;
41  Q_REQUIRED_RESULT QAction *cutAction() const;
42  Q_REQUIRED_RESULT QAction *selectAllAction() const;
43 
44  Q_REQUIRED_RESULT QMenu *editorMenu() const;
45  Q_REQUIRED_RESULT QMenu *toolsMenu() const;
46  Q_REQUIRED_RESULT QMenu *fileMenu() const;
47  Q_REQUIRED_RESULT QMenu *viewMenu() const;
48 
49  Q_REQUIRED_RESULT QAction *commentCodeAction() const;
50 
51  Q_REQUIRED_RESULT QAction *uncommentCodeAction() const;
52 
53  Q_REQUIRED_RESULT QAction *zoomInAction() const;
54  Q_REQUIRED_RESULT QAction *zoomOutAction() const;
55  Q_REQUIRED_RESULT QAction *debugSieveScriptAction() const;
56 
57  Q_REQUIRED_RESULT QAction *zoomResetAction() const;
58  Q_REQUIRED_RESULT QAction *wordWrapAction() const;
59  Q_REQUIRED_RESULT QAction *printPreviewAction() const;
60 
61  Q_REQUIRED_RESULT QAction *printAction() const;
62 
63  void setTextModeWidget(KSieveUi::SieveEditorTextModeWidget *textModeWidget);
64 
65 public Q_SLOTS:
66  void setEditorMode(bool editorMode);
67  void slotUndoAvailable(bool b);
68  void slotRedoAvailable(bool b);
69  void slotCopyAvailable(bool b);
70 Q_SIGNALS:
71  void gotoLine();
72  void find();
73  void replace();
74  void undo();
75  void redo();
76  void copy();
77  void paste();
78  void cut();
79  void selectAll();
80  void comment();
81  void uncomment();
82  void zoomIn();
83  void zoomOut();
84  void debugSieveScript();
85  void zoomReset();
86  void wordWrap(bool state);
87  void print();
88  void printPreview();
89 
90 private:
91  void initActions();
92  void initMenus();
93  void slotUpdateActions();
94  QAction *mGoToLine = nullptr;
95  QAction *mFindAction = nullptr;
96  QAction *mReplaceAction = nullptr;
97  QAction *mUndoAction = nullptr;
98  QAction *mRedoAction = nullptr;
99  QAction *mCopyAction = nullptr;
100  QAction *mPasteAction = nullptr;
101  QAction *mCutAction = nullptr;
102  QAction *mSelectAllAction = nullptr;
103  QAction *mCommentCodeAction = nullptr;
104  QAction *mUncommentCodeAction = nullptr;
105  QAction *mZoomInAction = nullptr;
106  QAction *mZoomOutAction = nullptr;
107  QAction *mZoomResetAction = nullptr;
108  QAction *mDebugSieveAction = nullptr;
109  QAction *mWordWrapAction = nullptr;
110  QAction *mPrintAction = nullptr;
111  QAction *mPrintPreviewAction = nullptr;
112 
113  QMenu *mEditorMenu = nullptr;
114  QMenu *mToolsMenu = nullptr;
115  QMenu *mFileMenu = nullptr;
116  QMenu *mViewMenu = nullptr;
117  KSieveUi::SieveEditorTextModeWidget *mTextModeWidget = nullptr;
118 };
119 }
120 
121 #endif // SIEVEEDITORMENUBAR_H
const QList< QKeySequence > & redo()
The SieveEditorTextModeWidget class.
Q_SIGNALSQ_SIGNALS
const QList< QKeySequence > & cut()
KIOCORE_EXPORT CopyJob * copy(const QUrl &src, const QUrl &dest, JobFlags flags=DefaultFlags)
const QList< QKeySequence > & undo()
Q_OBJECTQ_OBJECT
const QList< QKeySequence > & zoomOut()
KIOWIDGETS_EXPORT PasteJob * paste(const QMimeData *mimeData, const QUrl &destDir, JobFlags flags=DefaultFlags)
const QList< QKeySequence > & print()
const QList< QKeySequence > & replace()
QWidget * find(WId id)
QAction * printPreview(const QObject *recvr, const char *slot, QObject *parent)
const QList< QKeySequence > & selectAll()
Q_SLOTSQ_SLOTS
const QList< QKeySequence > & zoomIn()
const QList< QKeySequence > & gotoLine()
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Fri Aug 7 2020 23:06:35 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.