summaryrefslogtreecommitdiffstats
path: root/globals.h
blob: c8037fe56889c7282de8abac9d08e233fd9ebdb8 (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
#ifndef GLOBALS_H
#define GLOBALS_H

#include <QObject>
#include <QHash>
#include <QVector>

class QAction;
class Viewer;
class QTreeView;

class Globals : public QObject {
    Q_OBJECT
    public:
        enum ActionType { QuitAction = 0, ConfigAction = 1 };
        static Globals *instance();
        void addAction(QAction *a);
        void addView(QTreeView *v);
        const QVector<QTreeView*> views() { return mViews; }
        QAction *action(int actionType);
        Viewer *viewer();

    private:
        Globals();
        Globals(const Globals &other);
        Globals &operator=(const Globals &other);
        static Globals *mInstance;
        QHash<int, QAction*> mActions;
        Viewer *mViewer;
        QVector<QTreeView*> mViews;
};

#endif // GLOBALS_H