The Gnome Chemistry Utils 0.13.3
gcp/window.h
Go to the documentation of this file.
00001 /* 
00002  * GChemPaint library
00003  * window.h
00004  *
00005  * Copyright (C) 2006-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 
00024 #ifndef GCP_WINDOW_H
00025 #define GCP_WINDOW_H
00026 
00027 #include "target.h"
00028 #include <gtk/gtkwidget.h>
00029 #include <gtk/gtkuimanager.h>
00030 
00033 namespace gcugtk {
00034 class UIManager;
00035 }
00036 
00037 namespace gcp {
00038 
00039 class Application;
00040 class Document;
00041 
00046 class Window: public Target
00047 {
00048 friend class WindowPrivate;
00049 public:
00069         Window (gcp::Application *app, char const *theme = NULL, char const *extra_ui = NULL) throw (std::runtime_error);
00070         virtual ~Window ();
00071 
00075         void OnFileNew ();
00079         void OnFileOpen ();
00083         void OnProperties ();
00087         void SetActive (gcp::Document* pDoc, GtkWidget* w);
00091         void OnUndo ();
00095         void OnRedo ();
00099         void OnSelectAll ();
00103         void OnPasteSelection ();
00107         void OnCutSelection ();
00111         void OnCopySelection ();
00115         void OnDeleteSelection ();
00119         void OnPreferences ();
00125         void Zoom (double zoom);
00129         void ClearStatus ();
00135         void SetStatusText (const char* text);
00139         void Show ();
00143         bool OnKeyPressed (GtkWidget* widget, GdkEventKey* ev);
00148         bool OnKeyReleased (GtkWidget* widget, GdkEventKey* ev);
00152         bool Close ();
00153 
00157         virtual void OnSave ();
00161         virtual char const *GetDefaultTitle ();
00162 
00166         void Destroy ();
00172         void SetTitle (char const *title);
00185         void ActivateActionWidget (char const *path, bool activate); 
00193         bool VerifySaved ();
00197         void OnPageSetup ();
00198 
00199 protected:
00203         gcugtk::UIManager* m_UIManager;
00204 
00205 private:
00206         GtkWidget* m_Bar;       //GtkStatusBar
00207         unsigned m_statusId;
00208         unsigned m_MessageId; //currently displayed message in the status bar
00209 };
00210 
00211 }       // namespace gcp
00212 
00213 #endif  //      GCP_WINDOW_H