Libksieve

sieveeditormenubar.h
1 /*
2  SPDX-FileCopyrightText: 2015-2021 Laurent Montel <[email protected]>
3 
4  SPDX-License-Identifier: GPL-2.0-only
5 */
6 
7 #pragma once
8 
9 #include <QMenuBar>
10 
11 class QAction;
12 class QMenu;
13 namespace KSieveUi
14 {
15 class SieveEditorTextModeWidget;
16 class SieveEditorMenuBar : public QMenuBar
17 {
18  Q_OBJECT
19 public:
20  explicit SieveEditorMenuBar(QWidget *parent = nullptr);
21  ~SieveEditorMenuBar() override;
22 
23  Q_REQUIRED_RESULT QAction *goToLineAction() const;
24  Q_REQUIRED_RESULT QAction *findAction() const;
25  Q_REQUIRED_RESULT QAction *replaceAction() const;
26  Q_REQUIRED_RESULT QAction *undoAction() const;
27  Q_REQUIRED_RESULT QAction *redoAction() const;
28  Q_REQUIRED_RESULT QAction *copyAction() const;
29  Q_REQUIRED_RESULT QAction *pasteAction() const;
30  Q_REQUIRED_RESULT QAction *cutAction() const;
31  Q_REQUIRED_RESULT QAction *selectAllAction() const;
32 
33  Q_REQUIRED_RESULT QMenu *editorMenu() const;
34  Q_REQUIRED_RESULT QMenu *toolsMenu() const;
35  Q_REQUIRED_RESULT QMenu *fileMenu() const;
36  Q_REQUIRED_RESULT QMenu *viewMenu() const;
37 
38  Q_REQUIRED_RESULT QAction *commentCodeAction() const;
39 
40  Q_REQUIRED_RESULT QAction *uncommentCodeAction() const;
41 
42  Q_REQUIRED_RESULT QAction *zoomInAction() const;
43  Q_REQUIRED_RESULT QAction *zoomOutAction() const;
44  Q_REQUIRED_RESULT QAction *debugSieveScriptAction() const;
45 
46  Q_REQUIRED_RESULT QAction *zoomResetAction() const;
47  Q_REQUIRED_RESULT QAction *wordWrapAction() const;
48  Q_REQUIRED_RESULT QAction *printPreviewAction() const;
49 
50  Q_REQUIRED_RESULT QAction *printAction() const;
51 
52  void setTextModeWidget(KSieveUi::SieveEditorTextModeWidget *textModeWidget);
53 
54 public Q_SLOTS:
55  void setEditorMode(bool editorMode);
56  void slotUndoAvailable(bool b);
57  void slotRedoAvailable(bool b);
58  void slotCopyAvailable(bool b);
59 Q_SIGNALS:
60  void gotoLine();
61  void find();
62  void replace();
63  void undo();
64  void redo();
65  void copy();
66  void paste();
67  void cut();
68  void selectAll();
69  void comment();
70  void uncomment();
71  void zoomIn();
72  void zoomOut();
73  void debugSieveScript();
74  void zoomReset();
75  void wordWrap(bool state);
76  void print();
77  void printPreview();
78 
79 private:
80  void initActions();
81  void initMenus();
82  void slotUpdateActions();
83  QAction *mGoToLine = nullptr;
84  QAction *mFindAction = nullptr;
85  QAction *mReplaceAction = nullptr;
86  QAction *mUndoAction = nullptr;
87  QAction *mRedoAction = nullptr;
88  QAction *mCopyAction = nullptr;
89  QAction *mPasteAction = nullptr;
90  QAction *mCutAction = nullptr;
91  QAction *mSelectAllAction = nullptr;
92  QAction *mCommentCodeAction = nullptr;
93  QAction *mUncommentCodeAction = nullptr;
94  QAction *mZoomInAction = nullptr;
95  QAction *mZoomOutAction = nullptr;
96  QAction *mZoomResetAction = nullptr;
97  QAction *mDebugSieveAction = nullptr;
98  QAction *mWordWrapAction = nullptr;
99  QAction *mPrintAction = nullptr;
100  QAction *mPrintPreviewAction = nullptr;
101 
102  QMenu *mEditorMenu = nullptr;
103  QMenu *mToolsMenu = nullptr;
104  QMenu *mFileMenu = nullptr;
105  QMenu *mViewMenu = nullptr;
106  KSieveUi::SieveEditorTextModeWidget *mTextModeWidget = nullptr;
107 };
108 }
109 
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-2021 The KDE developers.
Generated on Sun Apr 11 2021 23:09:36 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.