gcp/window.h

00001 /* 
00002  * GChemPaint library
00003  * window.h
00004  *
00005  * Copyright (C) 2006 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., 59 Temple Place, Suite 330, Boston, MA 02111-1307
00020  * USA
00021  */
00022 
00023 
00024 #ifndef GCP_WINDOW_H
00025 #define GCP_WINDOW_H
00026 #include <gtk/gtkwidget.h>
00027 #include <gtk/gtkwindow.h>
00028 #include <gtk/gtkuimanager.h>
00029 
00030 class gcp::Application;
00031 class gcp::Document;
00032 
00033 namespace gcp {
00034 
00035 class Window
00036 {
00037 public:
00038         Window (gcp::Application *App, char const *Theme = NULL, char const *extra_ui = NULL);
00039         virtual ~Window ();
00040 
00041         void OnFileNew ();
00042         void OnFileOpen ();
00043         void OnProperties ();
00044         void OnPrint ();
00045         void SetActive (gcp::Document* pDoc, GtkWidget* w);
00046         void OnUndo ();
00047         void OnRedo ();
00048         void OnSelectAll ();
00049         void OnPasteSelection ();
00050         void OnCutSelection ();
00051         void OnCopySelection ();
00052         void OnDeleteSelection ();
00053         void OnPreferences ();
00054         void Zoom (double zoom);
00055         void ClearStatus ();
00056         void SetStatusText (const char* text);
00057         void Show ();
00058         bool OnKeyPressed (GtkWidget* widget, GdkEventKey* ev);
00059         bool OnKeyReleased (GtkWidget* widget, GdkEventKey* ev);
00060         bool Close ();
00061         GtkWindow *GetWindow () {return m_Window;}
00062 
00063         virtual void OnSave ();
00064         virtual char const *GetDefaultTitle ();
00065 
00066         gcp::Application *GetApplication () {return m_App;}
00067         gcp::Document *GetDocument () {return m_Doc;}
00068 
00069         void Destroy ();
00070         void SetTitle (char const *title);
00071         void ActivateActionWidget (char const *path, bool activate); 
00072         bool VerifySaved ();
00073 
00074 protected:
00075         gcp::Application *m_App;
00076         gcp::Document *m_Doc;
00077         GtkUIManager* m_UIManager;
00078 
00079 private:
00080         GtkWindow* m_Window;
00081         GtkWidget* m_Bar;       //GtkStatusBar
00082         unsigned m_statusId;
00083         unsigned m_MessageId; //currently displayed message in the status bar
00084 };
00085 
00086 }       // namespace gcp
00087 
00088 #endif  //      GCP_WINDOW_H

Generated on Thu Jun 28 09:02:01 2007 for The Gnome Chemistry Utils by  doxygen 1.5.2