SVN_SILENT made messages (.desktop file)
[kdepim.git] / sieveeditor / sieveeditormainwidget.h
blob1d32f44cbf9584cdc63e404f7b2e0634cdfda8bf
1 /*
2 Copyright (c) 2013, 2014 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
17 02110-1301, USA.
21 #ifndef SIEVEEDITORMAINWIDGET_H
22 #define SIEVEEDITORMAINWIDGET_H
24 #include <QSplitter>
25 #include <KUrl>
26 #include "ksieveui/editor/sieveeditorwidget.h"
27 class KTabWidget;
28 class SieveEditorTabWidget;
29 class SieveEditorScriptManagerWidget;
30 class SieveEditorPageWidget;
31 class SieveEditorMainWidget : public QSplitter
33 Q_OBJECT
34 public:
35 explicit SieveEditorMainWidget(QWidget *parent=0);
36 ~SieveEditorMainWidget();
38 void createNewScript();
39 void deleteScript();
40 void updateServerList();
41 void editScript();
42 void desactivateScript();
43 void refreshList();
44 void saveScript();
45 bool needToSaveScript();
47 KTabWidget *tabWidget() const;
49 KSieveUi::SieveEditorWidget::EditorMode pageMode() const;
50 public Q_SLOTS:
51 void slotGoToLine();
53 Q_SIGNALS:
54 void updateButtons(bool newScriptAction, bool editScriptAction, bool deleteScriptAction, bool desactivateScriptAction);
55 void updateScriptList();
56 void modeEditorChanged(KSieveUi::SieveEditorWidget::EditorMode);
58 private slots:
59 void slotCreateScriptPage(const KUrl &url, const QStringList &capabilities, bool isNewScript);
60 void slotScriptDeleted(const KUrl &url);
61 void slotScriptModified(bool modified, SieveEditorPageWidget *page);
62 void slotGeneralPaletteChanged();
63 void slotTabCloseRequested(int index);
64 void slotTabRemoveAllExclude(int index);
65 private:
66 QWidget *hasExistingPage(const KUrl &url);
67 QColor mModifiedScriptColor;
68 QColor mScriptColor;
69 SieveEditorTabWidget *mTabWidget;
70 SieveEditorScriptManagerWidget *mScriptManagerWidget;
74 #endif // SIEVEEDITORMAINWIDGET_H