The Gnome Chemistry Utils  0.13.6
cmd-context.h
00001 /*
00002  * Gnome Chemistry Utils
00003  * cmd-context.h
00004  *
00005  * Copyright (C) 2007-2011 Jean Bréfort <jean.brefort@normalesup.org>
00006  *
00007  * This program is free software; you can redistribute it and/or
00008  * modify it under the terms of the GNU General Public License as
00009  * published by the Free Software Foundation; either version 2 of the
00010  * License, or (at your option) any later version.
00011  *
00012  * This program is distributed in the hope that it will be useful,
00013  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00014  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00015  * GNU General Public License for more details.
00016  *
00017  * You should have received a copy of the GNU General Public License
00018  * along with this program; if not, write to the Free Software
00019  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00020  * USA
00021  */
00022 
00023 #ifndef GCU_CMD_CONTEXT_H
00024 #define GCU_CMD_CONTEXT_H
00025 
00026 #include "macros.h"
00027 #include <goffice/goffice.h>
00028 
00029 namespace gcu {
00030 
00031 class Application;
00032 
00042 class CmdContext {
00043 public:
00044         friend class Application;
00050         CmdContext (Application *App);
00051 
00055         virtual ~CmdContext ();
00056 
00063         typedef enum {
00067                 ResponseDefault,
00071                 ResponseOK = 1 << 0,
00075                 ResponseCancel = 1 << 1,
00079                 ResponseYes = 1 << 2,
00083                 ResponseNo = 1 << 3,
00087                 ResponseClose = 1 << 4
00088         } Response;
00089 
00095         typedef enum {
00099                 SeverityMessage,
00103                 SeverityWarning,
00107                 SeverityError
00108         } Severity;
00109 
00119         virtual Response GetResponse (char const *message, int responses) = 0;
00120 
00129         virtual void Message (char const *message, Severity severity, bool modal) = 0;
00130 
00136         GOIOContext *GetNewGOIOContext ();
00137 
00144 GCU_PROT_PROP (GOCmdContext *, GOCmdContext)
00145 
00146 
00152 GCU_PROT_POINTER_PROP (Application, App)
00153 };
00154 
00155 }       //      namespace gcu
00156 
00157 #endif //       GCU_CMD_CONTEXT_H