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

#include <QObject>
#include <QHash>

class QAction;
class Viewer;

class Globals : public QObject {
    Q_OBJECT
    public:
        enum ActionType { QuitAction = 0, ConfigAction = 1 };
        static Globals *instance();
        void addAction(QAction *a);
        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;
};

#endif // GLOBALS_H