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 
00027 #include "target.h"
00028 #include <gtk/gtkwidget.h>
00029 #include <gtk/gtkuimanager.h>
00030 
00031 class gcp::Application;
00032 class gcp::Document;
00033 
00034 namespace gcp {
00035         
00036 class Window: public Target
00037 {
00038 public:
00039         Window (gcp::Application *App, char const *Theme = NULL, char const *extra_ui = NULL);
00040         virtual ~Window ();
00041 
00042         void OnFileNew ();
00043         void OnFileOpen ();
00044         void OnProperties ();
00045         void OnPrint ();
00046         void SetActive (gcp::Document* pDoc, GtkWidget* w);
00047         void OnUndo ();
00048         void OnRedo ();
00049         void OnSelectAll ();
00050         void OnPasteSelection ();
00051         void OnCutSelection ();
00052         void OnCopySelection ();
00053         void OnDeleteSelection ();
00054         void OnPreferences ();
00055         void Zoom (double zoom);
00056         void ClearStatus ();
00057         void SetStatusText (const char* text);
00058         void Show ();
00059         bool OnKeyPressed (GtkWidget* widget, GdkEventKey* ev);
00060         bool OnKeyReleased (GtkWidget* widget, GdkEventKey* ev);
00061         bool Close ();
00062 
00063         virtual void OnSave ();
00064         virtual char const *GetDefaultTitle ();
00065 
00066         gcp::Application *GetApplication () {return m_App;}
00067 
00068         void Destroy ();
00069         void SetTitle (char const *title);
00070         void ActivateActionWidget (char const *path, bool activate); 
00071         bool VerifySaved ();
00072 
00073 protected:
00074         gcp::Application *m_App;
00075         GtkUIManager* m_UIManager;
00076 
00077 private:
00078         GtkWidget* m_Bar;       //GtkStatusBar
00079         unsigned m_statusId;
00080         unsigned m_MessageId; //currently displayed message in the status bar
00081 };
00082 
00083 }       // namespace gcp
00084 
00085 #endif  //      GCP_WINDOW_H

Generated on Sun Sep 16 14:21:56 2007 for The Gnome Chemistry Utils by  doxygen 1.5.3