-
Notifications
You must be signed in to change notification settings - Fork 1
/
userview.hpp
81 lines (63 loc) · 2.36 KB
/
userview.hpp
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
/* session.h -- session and stream abstraction
*
* Ryan McDougall
*/
#ifndef USERVIEW_H_
#define USERVIEW_H_
class QWidget;
class QAction;
class QKeySequence;
class QGraphicsView;
namespace Scaffold
{
namespace View
{
class Notification
{
public:
typedef std::vector <Notification> List;
// depending on type, QWidget is expected to be
// QProgressBar, QGroupBox, QLineEdit
enum Type { MESSAGE, PROGRESS, CHOICE, INPUT };
Notification (Type type, QString message, QWidget *widget = 0);
Type type () const;
QString message () const;
QWidget *widget () const;
private:
Type type_;
QString message_;
QWidget *widget_;
};
class Action
{
public:
typedef std::vector <Action> List;
// name is used in keybinding, location gives a placement hint
Action (const string &name, const string &location, QAction *action);
string name () const;
string location () const;
QAction *widget () const;
private:
string name_;
string location_;
QAction *action_;
};
typedef std::list <string, QKeySequence> KeyBinding;
// Notify the user of important events
typedef Service::Manager <Notification, void> NotificationManager;
typedef NotificationManager::ProviderType NotificationProvider;
// Display invokable actions in menus or docks
typedef Service::Manager <Action, void> ActionManager;
typedef ActionManager::ProviderType ActionProvider;
// Change key bindings for invokable actions
typedef Service::Manager <KeyBinding, void> KeyBindingManager;
typedef KeyBindingManager::ProviderType KeyBindingProvider;
// Display custom settings widgets for user configuration
typedef Service::Manager <QWidget *, void> SettingsManager;
typedef SettingsManager::ProviderType SettingsProvider;
// Access to named 2D UI views
typedef Service::Manager <string, QWidget *> ViewManager;
typedef ViewManager::ProviderType ViewProvider;
}
}
#endif //_MODULE_H_