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 namespace gcp {
00032 
00033 class Application;
00034 class Document;
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 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 
00062         virtual void OnSave ();
00063         virtual char const *GetDefaultTitle ();
00064 
00065         gcp::Application *GetApplication () {return m_App;}
00066 
00067         void Destroy ();
00068         void SetTitle (char const *title);
00069         void ActivateActionWidget (char const *path, bool activate); 
00070         bool VerifySaved ();
00071         void OnPageSetup ();
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 Jun 22 13:26:05 2008 for The Gnome Chemistry Utils by  doxygen 1.5.6