synfig-studio
1.0.3
Main Page
Related Pages
Namespaces
Classes
Files
File List
File Members
src
synfigapp
uimanager.h
Go to the documentation of this file.
1
/* === S Y N F I G ========================================================= */
21
/* ========================================================================= */
22
23
/* === S T A R T =========================================================== */
24
25
#ifndef __SYNFIG_APP_UIMANAGER_H
26
#define __SYNFIG_APP_UIMANAGER_H
27
28
/* === H E A D E R S ======================================================= */
29
30
#include <ETL/handle>
31
#include <synfig/general.h>
32
#include <synfig/string.h>
33
#include <sigc++/object.h>
34
35
/* === M A C R O S ========================================================= */
36
37
/* === T Y P E D E F S ===================================================== */
38
39
/* === C L A S S E S & S T R U C T S ======================================= */
40
41
namespace
synfigapp {
42
43
class
UIInterface
:
public
etl::shared_object,
public
synfig::ProgressCallback,
public
sigc::trackable
44
{
45
public
:
46
enum
Response
47
{
48
RESPONSE_CANCEL
= -1,
49
RESPONSE_NO
= 0,
50
RESPONSE_YES
= 1,
51
RESPONSE_OK
= 2
52
};
53
virtual
~UIInterface
() { }
54
virtual
Response
confirmation
(
55
const
std::string &message,
56
const
std::string &details,
57
const
std::string &confirm,
58
const
std::string &cancel,
59
Response
dflt =
RESPONSE_OK
60
) = 0;
61
62
63
virtual
Response
yes_no_cancel
(
64
const
std::string &message,
65
const
std::string &details,
66
const
std::string &button1,
67
const
std::string &button2,
68
const
std::string &button3,
69
Response
dflt=
RESPONSE_YES
70
) = 0;
71
};
72
73
class
DefaultUIInterface
:
public
UIInterface
74
{
75
public
:
76
Response
confirmation
(
77
const
std::string &
/*message*/
,
78
const
std::string &
/*details*/
,
79
const
std::string &
/*confirm*/
,
80
const
std::string &
/*cancel*/
,
81
Response
dflt
82
)
83
{
return
dflt; }
84
85
86
Response
yes_no_cancel
(
87
const
std::string &
/*message*/
,
88
const
std::string &
/*details*/
,
89
const
std::string &
/*button1*/
,
90
const
std::string &
/*button2*/
,
91
const
std::string &
/*button3*/
,
92
Response
dflt
93
)
94
{
return
dflt; }
95
96
97
bool
task
(
const
std::string &
/*task*/
)
98
{
return
true
; }
99
bool
error
(
const
std::string &
/*task*/
)
100
{
return
true
; }
101
bool
warning
(
const
std::string &
/*task*/
)
102
{
return
true
; }
103
bool
amount_complete
(
int
/*current*/
,
int
/*total*/
)
104
{
return
true
; }
105
};
106
107
class
ConfidentUIInterface
:
public
UIInterface
108
{
109
public
:
110
Response
confirmation
(
111
const
std::string &
/*message*/
,
112
const
std::string &
/*details*/
,
113
const
std::string &
/*confirm*/
,
114
const
std::string &
/*cancel*/
,
115
Response
/*dflt*/
116
)
117
{
return
RESPONSE_OK
; }
118
119
120
Response
yes_no_cancel
(
121
const
std::string &
/*message*/
,
122
const
std::string &
/*details*/
,
123
const
std::string &
/*button1*/
,
124
const
std::string &
/*button2*/
,
125
const
std::string &
/*button3*/
,
126
Response
/*dflt*/
127
)
128
{
return
RESPONSE_YES
; }
129
130
131
bool
task
(
const
std::string &
/*task*/
)
132
{
return
true
; }
133
bool
error
(
const
std::string &
/*task*/
)
134
{
return
true
; }
135
bool
warning
(
const
std::string &
/*task*/
)
136
{
return
true
; }
137
bool
amount_complete
(
int
/*current*/
,
int
/*total*/
)
138
{
return
true
; }
139
};
140
141
class
ConsoleUIInterface
:
public
UIInterface
142
{
143
public
:
144
Response
confirmation
(
145
const
std::string &message,
146
const
std::string &details,
147
const
std::string &confirm,
148
const
std::string &cancel,
149
Response
dflt
150
);
151
152
153
Response
yes_no_cancel
(
154
const
std::string &message,
155
const
std::string &details,
156
const
std::string &button1,
157
const
std::string &button2,
158
const
std::string &button3,
159
Response
dflt
160
);
161
162
163
bool
task
(
const
std::string &
task
);
164
bool
error
(
const
std::string &task);
165
bool
warning
(
const
std::string &task);
166
bool
amount_complete
(
int
current,
int
total);
167
};
168
169
};
// END of namespace synfigapp
170
171
/* === E N D =============================================================== */
172
173
#endif
Generated on Mon Nov 16 2015 15:36:54 for synfig-studio by
1.8.1.2