sieveeditormainwindow.h 3.69 KB
Newer Older
Laurent Montel's avatar
Laurent Montel committed
1
/*
Laurent Montel's avatar
Laurent Montel committed
2
   Copyright (C) 2013-2020 Laurent Montel <montel@kde.org>
Laurent Montel's avatar
Laurent Montel committed
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17

   This program is free software; you can redistribute it and/or
   modify it under the terms of the GNU General Public
   License as published by the Free Software Foundation; either
   version 2 of the License, or (at your option) any later version.

   This program is distributed in the hope that it will be useful,
   but WITHOUT ANY WARRANTY; without even the implied warranty of
   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
   General Public License for more details.

   You should have received a copy of the GNU General Public License
   along with this program; see the file COPYING.  If not, write to
   the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
   Boston, MA 02110-1301, USA.
Laurent Montel's avatar
Laurent Montel committed
18
19
20
21
22
23
*/

#ifndef SIEVEEDITORMAINWINDOW_H
#define SIEVEEDITORMAINWINDOW_H

#include <KXmlGuiWindow>
24
#include "libsieveeditor_export.h"
Laurent Montel's avatar
Laurent Montel committed
25
class QAction;
Laurent Montel's avatar
Laurent Montel committed
26
class SieveEditorCentralWidget;
Laurent Montel's avatar
Laurent Montel committed
27
class QLabel;
Laurent Montel's avatar
Laurent Montel committed
28
class SieveEditorBookmarks;
Laurent Montel's avatar
Laurent Montel committed
29
class KActionMenu;
Laurent Montel's avatar
Laurent Montel committed
30
namespace PimCommon {
Laurent Montel's avatar
Laurent Montel committed
31
32
class KActionMenuChangeCase;
}
Laurent Montel's avatar
Laurent Montel committed
33
class LIBSIEVEEDITOR_EXPORT SieveEditorMainWindow : public KXmlGuiWindow
Laurent Montel's avatar
Laurent Montel committed
34
35
36
{
    Q_OBJECT
public:
Laurent Montel's avatar
Laurent Montel committed
37
    explicit SieveEditorMainWindow(QWidget *parent = nullptr);
Laurent Montel's avatar
Laurent Montel committed
38
    ~SieveEditorMainWindow() override;
Laurent Montel's avatar
Laurent Montel committed
39

Laurent Montel's avatar
Laurent Montel committed
40
41
    Q_REQUIRED_RESULT QString currentHelpTitle() const;
    Q_REQUIRED_RESULT QUrl currentHelpUrl() const;
Laurent Montel's avatar
Laurent Montel committed
42

Laurent Montel's avatar
Laurent Montel committed
43
protected:
44
    void closeEvent(QCloseEvent *e) override;
Laurent Montel's avatar
Laurent Montel committed
45

Laurent Montel's avatar
Laurent Montel committed
46
private:
47
    void slotConfigure();
Laurent Montel's avatar
Laurent Montel committed
48
    void slotAddServerSieve();
Laurent Montel's avatar
Laurent Montel committed
49
50
    void slotCreateNewScript();
    void slotDeleteScript();
Laurent Montel's avatar
Laurent Montel committed
51
    void slotUpdateButtons(bool newScriptAction, bool editScriptAction, bool deleteScriptAction, bool desactivateScriptAction);
Laurent Montel's avatar
Laurent Montel committed
52
    void slotEditScript();
53
    void slotDesactivateScript();
Laurent Montel's avatar
Laurent Montel committed
54
    void slotRefreshList();
Laurent Montel's avatar
Laurent Montel committed
55
    void slotUploadScript();
Laurent Montel's avatar
Laurent Montel committed
56
    void slotUpdateActions();
57
    void slotSystemNetworkOnlineStateChanged(bool state);
58
59
    void slotUndoAvailable(bool);
    void slotRedoAvailable(bool);
Laurent Montel's avatar
Laurent Montel committed
60
    void slotCopyAvailable(bool b);
Laurent Montel's avatar
Laurent Montel committed
61
    void slotOpenBookmarkUrl(const QUrl &url);
62
    void slotImportImapSettings();
Laurent Montel's avatar
Laurent Montel committed
63
private:
Laurent Montel's avatar
Laurent Montel committed
64
    void initStatusBar();
Laurent Montel's avatar
Laurent Montel committed
65
66
    void readConfig();
    void setupActions();
Laurent Montel's avatar
Laurent Montel committed
67
    QString currentText() const;
68

Laurent Montel's avatar
Laurent Montel committed
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
    SieveEditorCentralWidget *mMainWidget = nullptr;
    QAction *mDeleteScript = nullptr;
    QAction *mNewScript = nullptr;
    QAction *mEditScript = nullptr;
    QAction *mDesactivateScript = nullptr;
    QAction *mRefreshList = nullptr;
    QAction *mUploadScript = nullptr;
    QAction *mGoToLine = nullptr;
    QAction *mFindAction = nullptr;
    QAction *mReplaceAction = nullptr;
    QAction *mUndoAction = nullptr;
    QAction *mRedoAction = nullptr;
    QAction *mCopyAction = nullptr;
    QAction *mPasteAction = nullptr;
    QAction *mCutAction = nullptr;
    QAction *mSelectAllAction = nullptr;
    QAction *mSaveAsAction = nullptr;
    QAction *mImportAction = nullptr;
    QAction *mShareAction = nullptr;
    QAction *mSpellCheckAction = nullptr;
    QAction *mCheckSyntaxAction = nullptr;
    QAction *mCreateRulesGraphicallyAction = nullptr;
    QAction *mCommentAction = nullptr;
    QAction *mUncommentAction = nullptr;
    QAction *mZoomInAction = nullptr;
    QAction *mZoomOutAction = nullptr;
    QAction *mZoomResetAction = nullptr;
    QAction *mDebugSieveScriptAction = nullptr;
    QAction *mWrapTextAction = nullptr;
    QAction *mPrintAction = nullptr;
    QAction *mPrintPreviewAction = nullptr;
Laurent Montel's avatar
Laurent Montel committed
100
    QAction *mShareHotNewStuffAction = nullptr;
Laurent Montel's avatar
Laurent Montel committed
101
    PimCommon::KActionMenuChangeCase *mMenuChangeCaseAction = nullptr;
Laurent Montel's avatar
Laurent Montel committed
102

Laurent Montel's avatar
Laurent Montel committed
103
104
105
106
    QLabel *mStatusBarInfo = nullptr;
    SieveEditorBookmarks *mSieveEditorBookmarks = nullptr;
    KActionMenu *mBookmarkMenu = nullptr;
    bool mNetworkIsDown = false;
Laurent Montel's avatar
Laurent Montel committed
107
108
109
};

#endif // SIEVEEDITORMAINWINDOW_H