The Gnome Chemistry Utils  0.14.0
cmd-context.h
1 /*
2  * Gnome Chemistry Utils
3  * cmd-context.h
4  *
5  * Copyright (C) 2007-2011 Jean Bréfort <jean.brefort@normalesup.org>
6  *
7  * This program is free software; you can redistribute it and/or
8  * modify it under the terms of the GNU General Public License as
9  * published by the Free Software Foundation; either version 3 of the
10  * License, or (at your option) any later version.
11  *
12  * This program is distributed in the hope that it will be useful,
13  * but WITHOUT ANY WARRANTY; without even the implied warranty of
14  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
15  * GNU General Public License for more details.
16  *
17  * You should have received a copy of the GNU General Public License
18  * along with this program; if not, write to the Free Software
19  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA 02110-1301
20  * USA
21  */
22 
23 #ifndef GCU_CMD_CONTEXT_H
24 #define GCU_CMD_CONTEXT_H
25 
26 #include "macros.h"
27 #include <goffice/goffice.h>
28 
29 namespace gcu {
30 
31 class Application;
32 
42 class CmdContext {
43 public:
44  friend class Application;
50  CmdContext (Application *App);
51 
55  virtual ~CmdContext ();
56 
63  typedef enum {
71  ResponseOK = 1 << 0,
75  ResponseCancel = 1 << 1,
79  ResponseYes = 1 << 2,
83  ResponseNo = 1 << 3,
87  ResponseClose = 1 << 4
88  } Response;
89 
95  typedef enum {
108  } Severity;
109 
119  virtual Response GetResponse (char const *message, int responses) = 0;
120 
129  virtual void Message (char const *message, Severity severity, bool modal) = 0;
130 
136  GOIOContext *GetNewGOIOContext ();
137 
144 GCU_PROT_PROP (GOCmdContext *, GOCmdContext)
145 
146 
153 };
154 
155 } // namespace gcu
156 
157 #endif // GCU_CMD_CONTEXT_H