00001
00002
00003
00004 #ifndef __GDOCAPP_H
00005 #define __GDOCAPP_H
00006
00007 #include <stdio.h>
00008
00009 #include "Lgi.h"
00010 #include "GXml.h"
00011 #include "GMru.h"
00012
00014
00015
00016
00017 #define IDM_SAVE 15002
00018 #define IDM_CLOSE 15003
00019 #define IDM_EXIT 15004
00020
00021
00022 #define MainWnd ((AppWnd*)GApp::ObjInstance()->AppWnd)
00023
00025 class GDocApp :
00026 public GWindow,
00027 public GMru
00028 {
00029 private:
00030 class GDocAppPrivate *d;
00031
00032 void _Close();
00033
00034 protected:
00036 bool _LoadMenu(char *Resource = 0);
00038 bool _Create();
00040 bool _Destroy();
00042 bool _OpenFile(char *File);
00044 bool _SaveFile(char *File);
00045
00046 bool _DoSerialize(bool Write);
00047 bool _SerializeFile(GFile &f, bool Write);
00048
00049
00050 GSubMenu *_FileMenu;
00051
00052 public:
00054 GDocApp
00055 (
00057 char *appname = 0,
00059 char *icon = 0
00060 );
00061 ~GDocApp();
00062
00064 void SetCurFile(char *f);
00066 char *GetCurFile();
00068 bool SetDirty(bool Dirty);
00070 bool GetDirty();
00072 ObjProperties *GetOptions();
00074 char *GetAppName();
00075
00077 virtual void Empty() {}
00079 virtual bool SerializeOptions(ObjProperties *Options, bool Write) { return false; }
00081 virtual void OnDirty(bool NewValue) {}
00082
00083
00084 void OnReceiveFiles(List<char> &Files);
00085 bool OnRequestClose(bool OsShuttingDown);
00086 int OnCommand(int Cmd, int Event, OsView Window);
00087 int OnEvent(GMessage *m);
00088 };
00089
00090 #endif