2 Copyright (c) 2013-2016 Montel Laurent <montel@kde.org>
4 This library is free software; you can redistribute it and/or modify it
5 under the terms of the GNU Library General Public License as published by
6 the Free Software Foundation; either version 2 of the License, or (at your
7 option) any later version.
9 This library is distributed in the hope that it will be useful, but WITHOUT
10 ANY WARRANTY; without even the implied warranty of MERCHANTABILITY or
11 FITNESS FOR A PARTICULAR PURPOSE. See the GNU Library General Public
12 License for more details.
14 You should have received a copy of the GNU Library General Public License
15 along with this library; see the file COPYING.LIB. If not, write to the
16 Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA
21 #ifndef SIEVEEDITORMAINWIDGET_H
22 #define SIEVEEDITORMAINWIDGET_H
26 #include "ksieveui/sieveeditorwidget.h"
29 class SieveEditorTabWidget
;
30 class SieveEditorScriptManagerWidget
;
31 class SieveEditorPageWidget
;
32 class SieveEditorEmptyTabWidgetLabel
;
33 class SieveEditorMainWidget
: public QSplitter
37 explicit SieveEditorMainWidget(QWidget
*parent
= Q_NULLPTR
);
38 ~SieveEditorMainWidget();
40 void createNewScript();
42 void updateServerList();
44 void desactivateScript();
47 bool needToSaveScript();
49 QTabWidget
*tabWidget() const;
51 KSieveUi::SieveEditorWidget::EditorMode
pageMode() const;
52 bool isUndoAvailable() const;
53 bool isRedoAvailable() const;
54 bool isWordWrap() const;
56 bool hasSelection() const;
57 QString
currentHelpTitle() const;
58 QUrl
currentHelpUrl() const;
59 void openBookmarkUrl(const QUrl
&url
);
61 void slotDebugSieveScript();
70 void slotCheckSpelling();
73 void slotAutoGenerateScript();
74 void slotCheckSyntax();
78 void slotSentenceCase();
80 void slotReverseCase();
84 void slotWordWrap(bool);
87 void updateButtons(bool newScriptAction
, bool editScriptAction
, bool deleteScriptAction
, bool desactivateScriptAction
);
88 void updateScriptList();
89 void modeEditorChanged(KSieveUi::SieveEditorWidget::EditorMode
);
90 void serverSieveFound(bool);
91 void undoAvailable(bool);
92 void redoAvailable(bool);
93 void copyAvailable(bool);
96 void slotCreateScriptPage(const QUrl
&url
, const QStringList
&capabilities
, bool isNewScript
);
97 void slotScriptDeleted(const QUrl
&url
);
98 void slotScriptModified(bool modified
, SieveEditorPageWidget
*page
);
99 void slotGeneralPaletteChanged();
100 void slotTabCloseRequested(int index
);
101 void slotTabRemoveAllExclude(int index
);
104 void slotSelectAll();
105 void slotTabCloseAllRequested();
107 void updateStackedWidget();
108 QWidget
*hasExistingPage(const QUrl
&url
);
109 QColor mModifiedScriptColor
;
111 SieveEditorTabWidget
*mTabWidget
;
112 SieveEditorScriptManagerWidget
*mScriptManagerWidget
;
113 QStackedWidget
*mStackedWidget
;
114 SieveEditorEmptyTabWidgetLabel
*mEditorEmptyLabel
;
117 #endif // SIEVEEDITORMAINWIDGET_H