Libksieve

sieveeditortextmodewidget.h
1 /* SPDX-FileCopyrightText: 2013-2021 Laurent Montel <[email protected]>
2  *
3  * SPDX-License-Identifier: LGPL-2.0-or-later
4  */
5 
6 #pragma once
7 
8 #include "ksieveui_export.h"
9 #include "sieveeditorabstractwidget.h"
10 class QSplitter;
11 namespace KPIMTextEdit
12 {
13 class SlideContainer;
14 class TextGoToLineWidget;
15 class PlainTextEditFindBar;
16 class PlainTextEditor;
17 class PlainTextEditorWidget;
18 class TextToSpeechWidget;
19 }
20 
21 namespace KSieveUi
22 {
23 class SieveTextEdit;
24 class SieveEditorWarning;
25 class SieveEditorParsingMissingFeatureWarning;
26 class SieveEditorTabWidget;
27 class SieveTemplateWidget;
28 /**
29  * @brief The SieveEditorTextModeWidget class
30  * @author Laurent Montel <[email protected]>
31  */
32 class KSIEVEUI_EXPORT SieveEditorTextModeWidget : public SieveEditorAbstractWidget
33 {
34  Q_OBJECT
35 public:
36  explicit SieveEditorTextModeWidget(QWidget *parent = nullptr);
37  ~SieveEditorTextModeWidget() override;
38 
39  void setSieveCapabilities(const QStringList &capabilities);
40  void setReadOnly(bool b);
41 
42  Q_REQUIRED_RESULT QString script() const;
43  void setScript(const QString &script, bool clearUndoRedo = false);
44 
45  void setDebugScript(const QString &debug);
46 
47  Q_REQUIRED_RESULT QString currentscript() override;
48  void setImportScript(const QString &script) override;
49 
50  void createRulesGraphically();
51  void generateXml();
52 
53  void showEditorWarning();
54  void hideEditorWarning();
55 
56  void showParsingEditorWarning();
57 
58  void setParsingEditorWarningError(const QString &script, const QString &error);
59  void replace();
60  void find();
61  void undo();
62  void redo();
63  void paste();
64  void cut();
65  void copy();
66  void checkSpelling();
67  void comment();
68  void uncomment();
69 
70  bool isUndoAvailable() const;
71  bool isRedoAvailable() const;
72  bool hasSelection() const;
73 
74  void selectAll();
75  void upperCase();
76  void lowerCase();
77  void sentenceCase();
78  void reverseCase();
79  void zoomIn();
80  void zoomOut();
81  Q_REQUIRED_RESULT QString currentHelpTitle() const;
82  Q_REQUIRED_RESULT QUrl currentHelpUrl() const;
83  void openBookmarkUrl(const QUrl &url);
84  void debugSieveScript();
85  void zoomReset();
86  void wordWrap(bool state);
87  Q_REQUIRED_RESULT bool isWordWrap() const;
88  void print();
89  void printPreview();
90  Q_REQUIRED_RESULT bool printSupportEnabled() const;
91  Q_REQUIRED_RESULT bool isTextEditor() const;
92  Q_REQUIRED_RESULT SieveEditorTabWidget *tabWidget() const;
93 
94  void setListOfIncludeFile(const QStringList &listOfIncludeFile);
95  Q_REQUIRED_RESULT QStringList sieveCapabilities() const;
96 
97 Q_SIGNALS:
98  void enableButtonOk(bool);
99  void switchToGraphicalMode();
100  void valueChanged();
101  void undoAvailable(bool);
102  void redoAvailable(bool);
103  void copyAvailable(bool);
104  void sieveEditorTabCurrentChanged();
105 
106 public Q_SLOTS:
107  void slotShowGoToLine();
108 
109 private:
110  void slotTextChanged();
111  void slotFind();
112  void slotReplace();
113  void slotGoToLine(int line);
114  void readConfig();
115  void writeConfig();
116  void slotEditRule(const QString &selectedText);
117  void slotInsertRule();
118  void insertRequires(const QStringList &needToAddRequire);
119  Q_REQUIRED_RESULT QStringList insertNecessaryRequires(const QStringList &requireModules);
120  QString mOriginalScript;
121  QStringList mSieveCapabilities;
122  QStringList mListOfIncludeFile;
123  SieveTextEdit *mTextEdit = nullptr;
124  KPIMTextEdit::PlainTextEditorWidget *mDebugTextEdit = nullptr;
125  KPIMTextEdit::PlainTextEditFindBar *mFindBar = nullptr;
126  KPIMTextEdit::TextToSpeechWidget *mTextToSpeechWidget = nullptr;
127  QSplitter *mMainSplitter = nullptr;
128  QSplitter *mTemplateSplitter = nullptr;
129  SieveEditorWarning *mSieveEditorWarning = nullptr;
130  SieveEditorParsingMissingFeatureWarning *mSieveParsingWarning = nullptr;
131  SieveEditorTabWidget *mTabWidget = nullptr;
132  KPIMTextEdit::TextGoToLineWidget *mGoToLine = nullptr;
133  KPIMTextEdit::SlideContainer *mGotoLineSliderContainer = nullptr;
134  KPIMTextEdit::SlideContainer *mSliderContainer = nullptr;
135  SieveTemplateWidget *mSieveTemplateWidget = nullptr;
136  QWidget *mEditorWidget = nullptr;
137 };
138 }
139 
The SieveEditorTextModeWidget class.
The SieveTextEdit class.
Definition: sievetextedit.h:20
The SieveEditorTabWidget class.
This file is part of the KDE documentation.
Documentation copyright © 1996-2021 The KDE developers.
Generated on Fri Apr 16 2021 23:09:34 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.