Welcome to mirror list, hosted at ThFree Co, Russian Federation.

fb2main.hpp « source - github.com/lintest/fb2edit.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
blob: 49b62d55eac0b7d58999684e25784d2910cc5c71 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
#ifndef FB2MAIN_H
#define FB2MAIN_H

#include <QMainWindow>
#include <QDockWidget>
#include <QListView>
#include <QXmlParseException>

QT_BEGIN_NAMESPACE
class QAction;
class QFile;
class QMenu;
class QModelIndex;
class QTextEdit;
class QTreeView;
class QWebInspector;
QT_END_NAMESPACE

class FbLogDock;

class FbMainDock;

#include "fb2logs.hpp"

class FbMainWindow : public QMainWindow
{
    Q_OBJECT

public:
    enum ViewMode { FB2, XML };
    explicit FbMainWindow(const QString &filename = QString(), ViewMode mode = FB2);

protected:
    void closeEvent(QCloseEvent *event);

signals:
    void showInspectorChecked(bool);

public slots:
    void warning(int row, int col, const QString &msg);
    void error(int row, int col, const QString &msg);
    void fatal(int row, int col, const QString &msg);
    void logMessage(QtMsgType type, const QString &message);
    void status(const QString &text);

private slots:
    void fileNew();
    void fileOpen();
    bool fileSave();
    bool fileSaveAs();

    void about();
    void documentWasModified();
    void logDestroyed();

    void openSettings();

private:
    QString appTitle() const;

private:
    void createHead();
    void createTree();
    void createImgs();
    void createActions();
    void createStatusBar();
    void readSettings();
    void writeSettings();
    void setModified(bool modified);
    bool maybeSave();
    bool saveFile(const QString &fileName, const QString &codec = QString());
    void setCurrentFile(const QString &fileName = QString());
    FbMainWindow *findFbMainWindow(const QString &fileName);

    FbMainDock *mainDock;
    QTextEdit *noteEdit;
    QToolBar *toolEdit;
    FbLogDock *logDock;
    QString curFile;
    bool isSwitched;
    bool isUntitled;
};

#endif // FB2MAIN_H