The Gnome Chemistry Utils  0.13.6
gcugtk/application.h
Go to the documentation of this file.
00001 // -*- C++ -*-
00002 
00003 /*
00004  * Gnome Chemistry Utils
00005  * gcugtk/application.h
00006  *
00007  * Copyright (C) 2005-2012 Jean Bréfort <jean.brefort@normalesup.org>
00008  *
00009  * This program is free software; you can redistribute it and/or
00010  * modify it under the terms of the GNU General Public License as
00011  * published by the Free Software Foundation; either version 2 of the
00012  * License, or (at your option) any later version.
00013  *
00014  * This program is distributed in the hope that it will be useful,
00015  * but WITHOUT ANY WARRANTY; without even the implied warranty of
00016  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
00017  * GNU General Public License for more details.
00018  *
00019  * You should have received a copy of the GNU General Public License
00020  * along with this program; if not, write to the Free Software
00021  * Foundation, Inc., 51 Franklin St, Fifth Floor, Boston, MA  02110-1301
00022  * USA
00023  */
00024 
00025 #ifndef GCU_GTK_APPLICATION_H
00026 #define GCU_GTK_APPLICATION_H
00027 
00028 #include <gcu/application.h>
00029 
00030 namespace gcu {
00031 class Object;
00032 }
00033 
00041 namespace gcugtk {
00042 
00043 class Object;
00044 class CmdContextGtk;
00045 
00049 typedef struct {
00053         std::string name;
00058         std::string uri;
00059 } Database;
00060 
00064 typedef enum {
00068         NormalWindowState,
00072         MaximizedWindowState,
00076         MinimizedWindowState,
00080         FullScreenWindowState
00081 } WindowState;
00082 
00086 class Application: public gcu::Application
00087 {
00088 friend class ApplicationPrivate;
00089 public:
00102         Application (std::string name, std::string datadir = DATADIR, char const *help_name = NULL, char const *icon_name = NULL, CmdContextGtk *cc = NULL);
00106         virtual ~Application ();
00107 
00111         static WindowState GetDefaultWindowState () {return DefaultWindowState;}
00112 
00117         GtkWidget *GetImageResolutionWidget ();
00118 
00123         GtkWidget *GetImageSizeWidget ();
00124 
00133         virtual void ReceiveTargets (G_GNUC_UNUSED GtkClipboard *clipboard, G_GNUC_UNUSED GtkSelectionData *selection_data) {;}
00134 
00143         static void OnReceiveTargets (GtkClipboard *clipboard, GtkSelectionData *selection_data, Application *App)
00144                 {
00145                         App->ReceiveTargets (clipboard, selection_data);
00146                 }
00147 
00148 protected:
00149 
00155         virtual void NoMoreDocsEvent () {gtk_main_quit ();}
00156 
00160         void CreateDefaultCmdContext ();
00161 
00165         bool LoopRunning () {return (gtk_main_level ());}
00166 
00167 private:
00168         static WindowState DefaultWindowState;
00169 
00173 GCU_RO_PROP (GtkRecentManager*, RecentManager)
00174 };
00175 
00176 }       // namespace gcugtk
00177 
00178 #endif // GCU_GTK_APPLICATION_H