annotate src/VisVim/Commands.h @ 1088:c3ba2dcc4cf4 v7.0.214

updated for version 7.0-214
author vimboss
date Thu, 08 Mar 2007 17:12:08 +0000
parents 3fc0f57ecb91
children
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
rev   line source
7
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
1 // Commands.h : header file
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
2 //
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
3
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
4 #if !defined(AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED_)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
5 #define AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED_
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
6
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
7 #include "vsvtypes.h"
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
8
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
9 class CCommands :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
10 public CComDualImpl < ICommands,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
11 &IID_ICommands,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
12 &LIBID_VisVim >,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
13 public CComObjectRoot,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
14 public CComCoClass < CCommands,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
15 &CLSID_Commands >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
16 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
17 protected:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
18 IApplication * m_pApplication;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
19
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
20 public:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
21 CCommands ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
22 ~CCommands ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
23 void SetApplicationObject (IApplication * m_pApplication);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
24 IApplication *GetApplicationObject ()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
25 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
26 return m_pApplication;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
27 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
28 void UnadviseFromEvents ();
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
29
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
30 BEGIN_COM_MAP (CCommands)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
31 COM_INTERFACE_ENTRY (IDispatch)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
32 COM_INTERFACE_ENTRY (ICommands)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
33 END_COM_MAP ()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
34 DECLARE_NOT_AGGREGATABLE (CCommands)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
35
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
36 protected:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
37 // This class template is used as the base class for the Application
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
38 // event handler object and the Debugger event handler object,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
39 // which are declared below.
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
40 template < class IEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
41 const IID * piidEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
42 const GUID * plibid,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
43 class XEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
44 const CLSID * pClsidEvents >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
45 class XEventHandler :
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
46 public CComDualImpl < IEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
47 piidEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
48 plibid >,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
49 public CComObjectRoot,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
50 public CComCoClass < XEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
51 pClsidEvents >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
52 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
53 public:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
54 BEGIN_COM_MAP (XEvents)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
55 COM_INTERFACE_ENTRY (IDispatch)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
56 COM_INTERFACE_ENTRY_IID (*piidEvents, IEvents)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
57 END_COM_MAP ()
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
58 DECLARE_NOT_AGGREGATABLE (XEvents)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
59 void Connect (IUnknown * pUnk)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
60 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
61 VERIFY (SUCCEEDED (AtlAdvise (pUnk, this, *piidEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
62 &m_dwAdvise)));
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
63 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
64 void Disconnect (IUnknown * pUnk)
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
65 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
66 AtlUnadvise (pUnk, *piidEvents, m_dwAdvise);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
67 }
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
68
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
69 CCommands *m_pCommands;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
70
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
71 protected:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
72 DWORD m_dwAdvise;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
73 };
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
74
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
75 // This object handles events fired by the Application object
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
76 class XApplicationEvents : public XEventHandler < IApplicationEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
77 &IID_IApplicationEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
78 &LIBID_VisVim,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
79 XApplicationEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
80 &CLSID_ApplicationEvents >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
81 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
82 public:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
83 // IApplicationEvents methods
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
84 STDMETHOD (BeforeBuildStart) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
85 STDMETHOD (BuildFinish) (THIS_ long nNumErrors, long nNumWarnings);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
86 STDMETHOD (BeforeApplicationShutDown) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
87 STDMETHOD (DocumentOpen) (THIS_ IDispatch * theDocument);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
88 STDMETHOD (BeforeDocumentClose) (THIS_ IDispatch * theDocument);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
89 STDMETHOD (DocumentSave) (THIS_ IDispatch * theDocument);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
90 STDMETHOD (NewDocument) (THIS_ IDispatch * theDocument);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
91 STDMETHOD (WindowActivate) (THIS_ IDispatch * theWindow);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
92 STDMETHOD (WindowDeactivate) (THIS_ IDispatch * theWindow);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
93 STDMETHOD (WorkspaceOpen) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
94 STDMETHOD (WorkspaceClose) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
95 STDMETHOD (NewWorkspace) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
96 };
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
97 typedef CComObject < XApplicationEvents > XApplicationEventsObj;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
98 XApplicationEventsObj *m_pApplicationEventsObj;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
99
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
100 // This object handles events fired by the Application object
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
101 class XDebuggerEvents : public XEventHandler < IDebuggerEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
102 &IID_IDebuggerEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
103 &LIBID_VisVim,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
104 XDebuggerEvents,
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
105 &CLSID_DebuggerEvents >
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
106 {
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
107 public:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
108 // IDebuggerEvents method
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
109 STDMETHOD (BreakpointHit) (THIS_ IDispatch * pBreakpoint);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
110 };
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
111 typedef CComObject < XDebuggerEvents > XDebuggerEventsObj;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
112 XDebuggerEventsObj *m_pDebuggerEventsObj;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
113
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
114 public:
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
115 // ICommands methods
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
116 STDMETHOD (VisVimDialog) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
117 STDMETHOD (VisVimEnable) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
118 STDMETHOD (VisVimDisable) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
119 STDMETHOD (VisVimToggle) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
120 STDMETHOD (VisVimLoad) (THIS);
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
121 };
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
122
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
123 typedef CComObject < CCommands > CCommandsObj;
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
124
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
125 //{{AFX_INSERT_LOCATION}}
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
126
3fc0f57ecb91 updated for version 7.0001
vimboss
parents:
diff changeset
127 #endif // !defined(AFX_COMMANDS_H__AC726717_2977_11D1_B2F3_006008040780__INCLUDED)