00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011 #pragma once
00012
00013 #include "..\..\iFnPub.h"
00014 #include "..\..\GetCOREInterface.h"
00015
00016
00017 class IVisualMSMgr;
00018 class IVisualMSForm;
00019 class IVisualMSItem;
00020 class IVisualMSCallback;
00021
00022
00023 class IVisualMSMgr : public FPStaticInterface
00024 {
00025 public:
00026 virtual IVisualMSForm* CreateForm()=0;
00027 virtual IVisualMSForm* CreateFormFromFile(MCHAR* fname)=0;
00028
00029
00030 enum { createForm,
00031 createFormFromFile,
00032 };
00033 };
00034
00035 #define VISUALMS_MGR_INTERFACE Interface_ID(0x423d2cf2, 0x526706b5)
00036 inline IVisualMSMgr* GetVisualMSMgr() { return (IVisualMSMgr*)GetCOREInterface(VISUALMS_MGR_INTERFACE); }
00037
00038
00039 class IVisualMSForm : public FPMixinInterface
00040 {
00041 public:
00042 virtual void Open(IVisualMSCallback* cb=NULL, MCHAR* source=NULL)=0;
00043 virtual void Close()=0;
00044
00045 virtual void InitForm(MCHAR* formType, MCHAR* formName, MCHAR* caption)=0;
00046 virtual void SetWidth(int w)=0;
00047 virtual void SetHeight(int h)=0;
00048 virtual IVisualMSItem* AddItem(MCHAR* itemType, MCHAR* itemName, MCHAR* text, int src_from=-1, int src_to=-1)=0;
00049 virtual IVisualMSItem* AddCode(MCHAR* code, int src_from=-1, int src_to=-1)=0;
00050 virtual IVisualMSItem* FindItem(MCHAR* itemName)=0;
00051 virtual BOOL GenScript(MSTR& script, MCHAR* indent=NULL)=0;
00052
00053 virtual BOOL HasSourceBounds(int& from, int& to)=0;
00054 virtual void SetSourceBounds(int from, int to)=0;
00055
00056 FPInterfaceDesc* GetDesc();
00057
00058
00059 enum { open,
00060 close,
00061 genScript,
00062 };
00063
00064
00065 BEGIN_FUNCTION_MAP
00066 VFN_0(open, Open);
00067 VFN_0(close, Close);
00068 FN_1( genScript, TYPE_BOOL, GenScript, TYPE_TSTR_BR);
00069 END_FUNCTION_MAP
00070
00071 };
00072
00073 #define VISUALMS_FORM_INTERFACE Interface_ID(0x446b6824, 0x39502f75)
00074
00075
00076 class IVisualMSItem : public FPMixinInterface
00077 {
00078 public:
00079 virtual void SetPropery(MCHAR* propName, float f)=0;
00080 virtual void SetPropery(MCHAR* propName, int i)=0;
00081 virtual void SetPropery(MCHAR* propName, bool b)=0;
00082 virtual void SetPropery(MCHAR* propName, MCHAR* s)=0;
00083 virtual void SetProperyLit(MCHAR* propName, MCHAR* s)=0;
00084 virtual void SetPropery(MCHAR* propName, Point2 pt)=0;
00085 virtual void SetPropery(MCHAR* propName, Point3 pt)=0;
00086 virtual void SetPropery(MCHAR* propName, Tab<MCHAR*>* sa)=0;
00087
00088 virtual void SetHandler(MCHAR* eventName, MCHAR* source, int arg_start, int arg_end, int body_start, int body_end)=0;
00089
00090 virtual void GetShape(int& left, int& top, int& width, int& height)=0;
00091 virtual void SetShape(int left, int top, int width, int height)=0;
00092
00093 virtual void AddComment(MCHAR* code, int src_from, int src_to)=0;
00094
00095 FPInterfaceDesc* GetDesc();
00096 };
00097
00098 #define VISUALMS_ITEM_INTERFACE Interface_ID(0x13a403e4, 0x5f920eed)
00099
00100
00101
00102
00103
00104 #define VISUALMS_CALLBACK_INTERFACE Interface_ID(0x612b70df, 0xef77884)
00105
00106 class IVisualMSCallback : public FPMixinInterface
00107 {
00108 public:
00109 virtual void Save() { }
00110 virtual void Close() { }
00111
00112 virtual void DeleteThis() { }
00113
00114 virtual HWND GetEditBox() { return NULL; }
00115
00116 FPInterfaceDesc* GetDesc() { return (FPInterfaceDesc*)GetCOREInterface(VISUALMS_CALLBACK_INTERFACE); }
00117
00118
00119 enum
00120 {
00121 save,
00122 close,
00123 };
00124
00125
00126 #pragma warning(push)
00127 #pragma warning(disable:4100)
00128 BEGIN_FUNCTION_MAP
00129 VFN_0(save, Save);
00130 VFN_0(close, Close);
00131 END_FUNCTION_MAP
00132 #pragma warning(pop)
00133 };
00134