The Gnome Chemistry Utils 0.13.3
|
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 00033 class CmdContext { 00034 public: 00035 friend class Application; 00036 CmdContext (Application *App); 00037 virtual ~CmdContext (); 00038 00039 typedef enum { 00040 ResponseDefault, 00041 ResponseOK = 1 << 0, 00042 ResponseCancel = 1 << 1, 00043 ResponseYes = 1 << 2, 00044 ResponseNo = 1 << 3, 00045 ResponseClose = 1 << 4 00046 } Response; 00047 00048 typedef enum { 00049 SeverityMessage, 00050 SeverityWarning, 00051 SeverityError 00052 } Severity; 00053 00054 virtual Response GetResponse (char const *message, int responses) = 0; 00055 virtual void Message (char const *message, Severity severity, bool modal) = 0; 00056 00057 GOIOContext *GetNewGOIOContext (); 00058 00059 GCU_PROT_PROP (GOCmdContext *, GOCmdContext) 00060 GCU_PROT_POINTER_PROP (Application, App) 00061 }; 00062 00063 } // namespace gcu 00064 00065 #endif // GCU_CMD_CONTEXT_H