The Gnome Chemistry Utils  0.13.7
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 3 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/gtk.h>
00029 
00032 namespace gcugtk {
00033 class UIManager;
00034 }
00035 
00036 namespace gcp {
00037 
00038 class Application;
00039 class Document;
00040 
00045 class Window: public Target
00046 {
00047 friend class WindowPrivate;
00048 public:
00068         Window (gcp::Application *app, char const *theme = NULL, char const *extra_ui = NULL) throw (std::runtime_error);
00069         virtual ~Window ();
00070 
00074         void OnFileNew ();
00078         void OnFileOpen ();
00082         void OnProperties ();
00086         void SetActive (gcp::Document* pDoc, GtkWidget* w);
00090         void OnUndo ();
00094         void OnRedo ();
00098         void OnSelectAll ();
00102         void OnPasteSelection ();
00106         void OnCutSelection ();
00110         void OnCopySelection ();
00114         void OnDeleteSelection ();
00118         void OnPreferences ();
00124         void Zoom (double zoom);
00128         void ClearStatus ();
00134         void SetStatusText (const char* text);
00138         void Show ();
00142         bool OnKeyPressed (GtkWidget* widget, GdkEventKey* ev);
00147         bool OnKeyReleased (GtkWidget* widget, GdkEventKey* ev);
00151         bool Close ();
00152 
00156         virtual void OnSave ();
00160         virtual char const *GetDefaultTitle ();
00161 
00165         void Destroy ();
00171         void SetTitle (char const *title);
00179         bool VerifySaved ();
00183         void OnPageSetup ();
00184 
00185 private:
00186         GtkWidget* m_Bar;       //GtkStatusBar
00187         unsigned m_statusId;
00188         unsigned m_MessageId; //currently displayed message in the status bar
00189 };
00190 
00191 }       // namespace gcp
00192 
00193 #endif  //      GCP_WINDOW_H