00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
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 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;
00079 unsigned m_statusId;
00080 unsigned m_MessageId;
00081 };
00082
00083 }
00084
00085 #endif // GCP_WINDOW_H