Source code of Windows XP (NT5)
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

1060 lines
34 KiB

  1. /*++
  2. Copyright (C) 1993-1999 Microsoft Corporation
  3. Module Name:
  4. polyline.h
  5. Abstract:
  6. Definitions and function prototypes
  7. --*/
  8. #ifndef _POLYLINE_H_
  9. #define _POLYLINE_H_
  10. #define GUIDS_FROM_TYPELIB
  11. #include "inole.h"
  12. #include "isysmon.h" //From MKTYPLIB
  13. // *** TodoMultiLogHandle: Temporary pdh.h include. Remove when trace file post-processing supports multiple
  14. // open files.
  15. #include <pdh.h>
  16. #include <objsafe.h>
  17. //Prevent duplicate definition of IPolylineAdviseSink10 in ipoly10.h
  18. #define OMIT_POLYLINESINK
  19. #include "ipoly10.h"
  20. //Forward class references
  21. class CImpIPolyline;
  22. typedef class CImpIPolyline *PCImpIPolyline;
  23. class CPolyline;
  24. typedef class CPolyline *PCPolyline;
  25. class CImpIObjectSafety;
  26. typedef class CImpIObjectSafety* PCImpIObjectSafety;
  27. class CImpIPersistStorage;
  28. typedef class CImpIPersistStorage *PCImpIPersistStorage;
  29. class CImpIPersistStreamInit;
  30. typedef class CImpIPersistStreamInit *PCImpIPersistStreamInit;
  31. class CImpIPersistPropertyBag;
  32. typedef class CImpIPersistPropertyBag *PCImpIPersistPropertyBag;
  33. class CImpIPerPropertyBrowsing;
  34. typedef class CImpIPerPropertyBrowsing *PCImpIPerPropertyBrowsing;
  35. class CImpIDataObject;
  36. typedef class CImpIDataObject *PCImpIDataObject;
  37. class CImpIOleObject;
  38. typedef class CImpIOleObject *PCImpIOleObject;
  39. class CImpIViewObject;
  40. typedef class CImpIViewObject *PCImpIViewObject;
  41. class CImpIRunnableObject;
  42. typedef class CImpIRunnableObject *PCImpIRunnableObject;
  43. class CImpIExternalConnection;
  44. typedef class CImpIExternalConnection *PCImpIExternalConnection;
  45. class CImpIOleInPlaceObject;
  46. typedef class CImpIOleInPlaceObject *PCImpIOleInPlaceObject;
  47. class CImpIOleInPlaceActiveObject;
  48. typedef class CImpIOleInPlaceActiveObject *PCImpIOleInPlaceActiveObject;
  49. class CImpISpecifyPP;
  50. typedef CImpISpecifyPP *PCImpISpecifyPP;
  51. class CImpIProvideClassInfo;
  52. typedef CImpIProvideClassInfo *PCImpIProvideClassInfo;
  53. class CImpIDispatch;
  54. typedef CImpIDispatch *PCImpIDispatch;
  55. class CImpISystemMonitor;
  56. typedef CImpISystemMonitor *PCImpISystemMonitor;
  57. class CImpIOleControl;
  58. typedef CImpIOleControl *PCImpIOleControl;
  59. class CAdviseRouter;
  60. typedef CAdviseRouter *PCAdviseRouter;
  61. class CGraphItem;
  62. typedef CGraphItem *PCGraphItem;
  63. #include "resource.h"
  64. #include "cntrtree.h"
  65. #include "iconnpt.h"
  66. #include "stepper.h"
  67. #include "graph.h"
  68. #include "scale.h"
  69. #include "grphitem.h"
  70. #include "report.h"
  71. #include "grphdsp.h"
  72. #include "legend.h"
  73. #include "smonctrl.h"
  74. #include "globals.h"
  75. #include "winhelpr.h"
  76. #include "utils.h"
  77. #include "strids.h"
  78. #include "hatchwnd.h"
  79. #include "logfiles.h"
  80. #include "counters.h"
  81. #define LCID_SCRIPT 0x0409
  82. //Stream Name that holds the data
  83. #define SZSTREAM OLESTR("CONTENTS")
  84. //Magic number to add to aspects returned from IViewObject::Freeze
  85. #define FREEZE_KEY_OFFSET 0x0723
  86. #define HIMETRIC_PER_INCH 2540
  87. #define ID_HATCHWINDOW 2000
  88. //DLLPOLY.CPP
  89. INT PASCAL LibMain(HINSTANCE, WORD, WORD, LPSTR);
  90. //This class factory object creates Polyline objects.
  91. class CPolylineClassFactory : public IClassFactory
  92. {
  93. protected:
  94. ULONG m_cRef;
  95. public:
  96. CPolylineClassFactory(void);
  97. virtual ~CPolylineClassFactory(void);
  98. //IUnknown members
  99. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  100. STDMETHODIMP_(ULONG) AddRef(void);
  101. STDMETHODIMP_(ULONG) Release(void);
  102. //IClassFactory members
  103. STDMETHODIMP CreateInstance(LPUNKNOWN, REFIID
  104. , PPVOID);
  105. STDMETHODIMP LockServer(BOOL);
  106. };
  107. typedef CPolylineClassFactory *PCPolylineClassFactory;
  108. //POLYWIN.CPP
  109. LRESULT APIENTRY PolylineWndProc(HWND, UINT, WPARAM, LPARAM);
  110. #ifdef WIN32
  111. #define PROP_POINTER TEXT("Pointer")
  112. #else
  113. #define PROP_SELECTOR "Selector"
  114. #define PROP_OFFSET "Offset"
  115. #endif
  116. // Polyline Class
  117. class CPolyline : public IUnknown
  118. {
  119. // friend LRESULT APIENTRY PolylineWndProc(HWND, UINT, WPARAM, LPARAM);
  120. // friend BOOL APIENTRY PolyDlgProc(HWND, UINT, WPARAM, LPARAM);
  121. // friend LRESULT APIENTRY GraphDispWndProc (HWND, UINT, WPARAM, LPARAM );
  122. friend LRESULT APIENTRY SysmonCtrlWndProc (HWND, UINT, WPARAM, LPARAM);
  123. friend class CImpIObjectSafety;
  124. friend class CImpIPolyline;
  125. friend class CImpIConnPtCont;
  126. friend class CImpIConnectionPoint;
  127. friend class CImpIPersistStorage;
  128. friend class CImpIPersistStreamInit;
  129. friend class CImpIPersistPropertyBag;
  130. friend class CImpIPerPropertyBrowsing;
  131. friend class CImpIDataObject;
  132. friend class CImpIOleObject;
  133. friend class CImpIViewObject;
  134. friend class CImpIRunnableObject;
  135. friend class CImpIExternalConnection;
  136. friend class CImpIOleInPlaceObject;
  137. friend class CImpIOleInPlaceActiveObject;
  138. friend class CSysmonControl;
  139. friend class CSysmonToolbar;
  140. friend class CGraphDisp;
  141. friend class CImpICounters;
  142. friend class CImpILogFiles;
  143. friend class CImpISpecifyPP;
  144. friend class CImpIProvideClassInfo;
  145. friend class CImpIDispatch;
  146. friend class CImpISystemMonitor;
  147. friend class CImpIOleControl;
  148. friend class CAdviseRouter;
  149. protected:
  150. ULONG m_cRef; //Object reference count
  151. LPUNKNOWN m_pUnkOuter; //Controlling Unknown
  152. PFNDESTROYED m_pfnDestroy; //Function called on closure
  153. BOOL m_fDirty; //Have we changed?
  154. GRAPHDATA m_Graph; //Graph data
  155. PSYSMONCTRL m_pCtrl; //Sysmon Control object
  156. RECT m_RectExt; //Extent rectangle
  157. //Contained interfaces
  158. PCImpIPolyline m_pImpIPolyline;
  159. PCImpIConnPtCont m_pImpIConnPtCont;
  160. PCImpIPersistStorage m_pImpIPersistStorage;
  161. PCImpIPersistStreamInit m_pImpIPersistStreamInit;
  162. PCImpIPersistPropertyBag m_pImpIPersistPropertyBag;
  163. PCImpIPerPropertyBrowsing m_pImpIPerPropertyBrowsing;
  164. PCImpIDataObject m_pImpIDataObject;
  165. // Connection point holders (direct & dispatch)
  166. CImpIConnectionPoint m_ConnectionPoint[CONNECTION_POINT_CNT];
  167. CLIPFORMAT m_cf; //Object clipboard format
  168. CLSID m_clsID; //Current CLSID
  169. //We have to hold these for IPersistStorage::Save
  170. LPSTORAGE m_pIStorage;
  171. LPSTREAM m_pIStream;
  172. LPDATAADVISEHOLDER m_pIDataAdviseHolder;
  173. //These are default handler interfaces we use
  174. LPUNKNOWN m_pDefIUnknown;
  175. LPVIEWOBJECT2 m_pDefIViewObject;
  176. LPPERSISTSTORAGE m_pDefIPersistStorage;
  177. LPDATAOBJECT m_pDefIDataObject;
  178. //Implemented and used interfaces
  179. PCImpIObjectSafety m_pImpIObjectSafety;
  180. PCImpIOleObject m_pImpIOleObject; //Implemented
  181. LPOLEADVISEHOLDER m_pIOleAdviseHolder; //Used
  182. LPOLECLIENTSITE m_pIOleClientSite; //Used
  183. PCImpIViewObject m_pImpIViewObject; //Implemented
  184. LPADVISESINK m_pIAdviseSink; //Used
  185. DWORD m_dwFrozenAspects; //Freeze
  186. DWORD m_dwAdviseAspects; //SetAdvise
  187. DWORD m_dwAdviseFlags; //SetAdvise
  188. PCImpIRunnableObject m_pImpIRunnableObject; //Implemented
  189. BOOL m_bIsRunning; // Running?
  190. HWND m_hDlg; //Editing window
  191. PCImpIExternalConnection m_pImpIExternalConnection; //Implemented
  192. BOOL m_fLockContainer;
  193. DWORD m_dwRegROT;
  194. LPOLEINPLACESITE m_pIOleIPSite;
  195. LPOLEINPLACEFRAME m_pIOleIPFrame;
  196. LPOLEINPLACEUIWINDOW m_pIOleIPUIWindow;
  197. PCImpIOleInPlaceObject m_pImpIOleIPObject;
  198. PCImpIOleInPlaceActiveObject m_pImpIOleIPActiveObject;
  199. HMENU m_hMenuShared;
  200. HOLEMENU m_hOLEMenu;
  201. PCHatchWin m_pHW;
  202. BOOL m_fAllowInPlace;
  203. BOOL m_fUIActive;
  204. BOOL m_fContainerKnowsInsideOut;
  205. PCImpISpecifyPP m_pImpISpecifyPP;
  206. PCImpIProvideClassInfo m_pImpIProvideClassInfo;
  207. PCImpIDispatch m_pImpIDispatch;
  208. PCImpISystemMonitor m_pImpISystemMonitor;
  209. PCImpIOleControl m_pImpIOleControl;
  210. PCImpICounters m_pImpICounters;
  211. PCImpILogFiles m_pImpILogFiles;
  212. //Our own type lib for the object
  213. ITypeLib *m_pITypeLib;
  214. //From the container;
  215. IOleControlSite *m_pIOleControlSite;
  216. IDispatch *m_pIDispatchAmbients;
  217. BOOL m_fFreezeEvents;
  218. CONTROLINFO m_ctrlInfo;
  219. //Other ambients
  220. BOOL m_fHatch;
  221. protected:
  222. void PointScale(LPRECT, LPPOINTS, BOOL);
  223. void Draw(HDC, HDC, BOOL, BOOL, LPRECT);
  224. void SendAdvise(UINT);
  225. void SendEvent(UINT, DWORD);
  226. void RectConvertMappings(LPRECT, BOOL);
  227. /*
  228. * These members pulled from IPolyline now serve as a
  229. * central store for this functionality to be used from
  230. * other interfaces like IPersistStorage and IDataObject.
  231. * Other interfaces later may also use them.
  232. */
  233. STDMETHODIMP RenderBitmap(HBITMAP *, HDC hAttribDC);
  234. STDMETHODIMP RenderMetafilePict(HGLOBAL *, HDC hAttribDC);
  235. public:
  236. static RegisterWndClass(HINSTANCE hInst);
  237. CPolyline(LPUNKNOWN, PFNDESTROYED);
  238. virtual ~CPolyline(void);
  239. BOOL Init(void);
  240. //Non-delegating object IUnknown
  241. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  242. STDMETHODIMP_(ULONG) AddRef(void);
  243. STDMETHODIMP_(ULONG) Release(void);
  244. HRESULT InPlaceActivate(LPOLECLIENTSITE, BOOL);
  245. void InPlaceDeactivate(void);
  246. HRESULT UIActivate(void);
  247. void UIDeactivate(void);
  248. BOOL AmbientGet(DISPID, VARIANT *);
  249. void AmbientsInitialize(DWORD);
  250. };
  251. typedef CPolyline *PCPolyline;
  252. //Codes for CPolyline::SendAdvise
  253. //......Code.....................Method called in CPolyline::SendAdvise
  254. #define OBJECTCODE_SAVED 0 //IOleAdviseHolder::SendOnSave
  255. #define OBJECTCODE_CLOSED 1 //IOleAdviseHolder::SendOnClose
  256. #define OBJECTCODE_RENAMED 2 //IOleAdviseHolder::SendOnRename
  257. #define OBJECTCODE_SAVEOBJECT 3 //IOleClientSite::SaveObject
  258. #define OBJECTCODE_DATACHANGED 4 //IDataAdviseHolder::SendOnDataChange
  259. #define OBJECTCODE_SHOWWINDOW 5 //IOleClientSite::OnShowWindow(TRUE)
  260. #define OBJECTCODE_HIDEWINDOW 6 //IOleClientSite::OnShowWindow(FALSE)
  261. #define OBJECTCODE_SHOWOBJECT 7 //IOleClientSite::ShowObject
  262. //Flags for AmbientsInitialize
  263. enum
  264. {
  265. INITAMBIENT_SHOWHATCHING = 0x00000001,
  266. INITAMBIENT_UIDEAD = 0x00000002,
  267. INITAMBIENT_BACKCOLOR = 0x00000004,
  268. INITAMBIENT_FORECOLOR = 0x00000008,
  269. INITAMBIENT_FONT = 0x00000010,
  270. INITAMBIENT_APPEARANCE = 0x00000020,
  271. INITAMBIENT_USERMODE = 0x00000040,
  272. INITAMBIENT_ALL = 0xFFFFFFFF
  273. };
  274. //Interface implementation contained in the Polyline.
  275. class CImpIPolyline : public IPolyline10
  276. {
  277. protected:
  278. ULONG m_cRef; //Interface reference count
  279. PCPolyline m_pObj; //Back pointer to object
  280. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  281. public:
  282. CImpIPolyline(PCPolyline, LPUNKNOWN);
  283. virtual ~CImpIPolyline(void);
  284. //IUnknown members.
  285. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  286. STDMETHODIMP_(ULONG) AddRef(void);
  287. STDMETHODIMP_(ULONG) Release(void);
  288. //Manipulation members:
  289. STDMETHODIMP Init(HWND, LPRECT, DWORD, UINT);
  290. STDMETHODIMP New(void);
  291. STDMETHODIMP Undo(void);
  292. STDMETHODIMP Window(HWND *);
  293. STDMETHODIMP RectGet(LPRECT);
  294. STDMETHODIMP SizeGet(LPRECT);
  295. STDMETHODIMP RectSet(LPRECT, BOOL);
  296. STDMETHODIMP SizeSet(LPRECT, BOOL);
  297. };
  298. class CImpIObjectSafety : public IObjectSafety
  299. {
  300. protected:
  301. ULONG m_cRef; //Interface reference count
  302. PCPolyline m_pObj; //Back pointer to object
  303. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  304. private:
  305. BOOL m_fMessageDisplayed;
  306. VOID SetupSecurityPolicy();
  307. public:
  308. CImpIObjectSafety(PCPolyline, LPUNKNOWN);
  309. virtual ~CImpIObjectSafety(void);
  310. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  311. STDMETHODIMP_(ULONG) AddRef(void);
  312. STDMETHODIMP_(ULONG) Release(void);
  313. STDMETHODIMP GetInterfaceSafetyOptions(REFIID riid,
  314. DWORD* pdwSupportedOptions,
  315. DWORD* pdwEnabledOptions);
  316. STDMETHODIMP SetInterfaceSafetyOptions(REFIID riid,
  317. DWORD dwOptionSetMask,
  318. DWORD dwEnabledOptions);
  319. };
  320. class CImpIPersistStorage : public IPersistStorage
  321. {
  322. protected:
  323. ULONG m_cRef; //Interface reference count
  324. PCPolyline m_pObj; //Back pointer to object
  325. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  326. PSSTATE m_psState; //Storage state
  327. public:
  328. CImpIPersistStorage(PCPolyline, LPUNKNOWN);
  329. virtual ~CImpIPersistStorage(void);
  330. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  331. STDMETHODIMP_(ULONG) AddRef(void);
  332. STDMETHODIMP_(ULONG) Release(void);
  333. STDMETHODIMP GetClassID(LPCLSID);
  334. STDMETHODIMP IsDirty(void);
  335. STDMETHODIMP InitNew(LPSTORAGE);
  336. STDMETHODIMP Load(LPSTORAGE);
  337. STDMETHODIMP Save(LPSTORAGE, BOOL);
  338. STDMETHODIMP SaveCompleted(LPSTORAGE);
  339. STDMETHODIMP HandsOffStorage(void);
  340. };
  341. //IPERSTMI.CPP
  342. class CImpIPersistStreamInit : public IPersistStreamInit
  343. {
  344. protected:
  345. ULONG m_cRef; //Interface reference count
  346. PCPolyline m_pObj; //Back pointer to object
  347. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  348. public:
  349. CImpIPersistStreamInit(PCPolyline, LPUNKNOWN);
  350. virtual ~CImpIPersistStreamInit(void);
  351. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  352. STDMETHODIMP_(ULONG) AddRef(void);
  353. STDMETHODIMP_(ULONG) Release(void);
  354. STDMETHODIMP GetClassID(LPCLSID);
  355. STDMETHODIMP IsDirty(void);
  356. STDMETHODIMP Load(LPSTREAM);
  357. STDMETHODIMP Save(LPSTREAM, BOOL);
  358. STDMETHODIMP GetSizeMax(ULARGE_INTEGER *);
  359. STDMETHODIMP InitNew(void);
  360. };
  361. //IPERPBAG.CPP
  362. class CImpIPersistPropertyBag : public IPersistPropertyBag
  363. {
  364. protected:
  365. ULONG m_cRef; //Interface reference count
  366. PCPolyline m_pObj; //Back pointer to object
  367. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  368. public:
  369. CImpIPersistPropertyBag(PCPolyline, LPUNKNOWN);
  370. virtual ~CImpIPersistPropertyBag(void);
  371. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  372. STDMETHODIMP_(ULONG) AddRef(void);
  373. STDMETHODIMP_(ULONG) Release(void);
  374. STDMETHODIMP GetClassID(LPCLSID);
  375. STDMETHODIMP InitNew(void);
  376. STDMETHODIMP Load(IPropertyBag*, IErrorLog*);
  377. STDMETHODIMP Save(IPropertyBag*, BOOL, BOOL);
  378. };
  379. //IPRPBRWS.CPP
  380. class CImpIPerPropertyBrowsing : public IPerPropertyBrowsing
  381. {
  382. protected:
  383. ULONG m_cRef; //Interface reference count
  384. PCPolyline m_pObj; //Back pointer to object
  385. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  386. public:
  387. CImpIPerPropertyBrowsing(PCPolyline, LPUNKNOWN);
  388. virtual ~CImpIPerPropertyBrowsing(void);
  389. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  390. STDMETHODIMP_(ULONG) AddRef(void);
  391. STDMETHODIMP_(ULONG) Release(void);
  392. STDMETHODIMP GetClassID(LPCLSID);
  393. STDMETHODIMP GetDisplayString( DISPID, BSTR* );
  394. STDMETHODIMP GetPredefinedStrings( DISPID, CALPOLESTR*, CADWORD* );
  395. STDMETHODIMP GetPredefinedValue( DISPID, DWORD, VARIANT* );
  396. STDMETHODIMP MapPropertyToPage( DISPID, CLSID* );
  397. };
  398. //IDATAOBJ.CPP
  399. class CImpIDataObject : public IDataObject
  400. {
  401. private:
  402. ULONG m_cRef; //Interface reference count
  403. PCPolyline m_pObj; //Back pointer to object
  404. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  405. public:
  406. CImpIDataObject(PCPolyline, LPUNKNOWN);
  407. virtual ~CImpIDataObject(void);
  408. //IUnknown members that delegate to m_pUnkOuter.
  409. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  410. STDMETHODIMP_(ULONG) AddRef(void);
  411. STDMETHODIMP_(ULONG) Release(void);
  412. //IDataObject members
  413. STDMETHODIMP GetData(LPFORMATETC, LPSTGMEDIUM);
  414. STDMETHODIMP GetDataHere(LPFORMATETC, LPSTGMEDIUM);
  415. STDMETHODIMP QueryGetData(LPFORMATETC);
  416. STDMETHODIMP GetCanonicalFormatEtc(LPFORMATETC,LPFORMATETC);
  417. STDMETHODIMP SetData(LPFORMATETC, LPSTGMEDIUM, BOOL);
  418. STDMETHODIMP EnumFormatEtc(DWORD, LPENUMFORMATETC *);
  419. STDMETHODIMP DAdvise(LPFORMATETC, DWORD, LPADVISESINK
  420. , DWORD *);
  421. STDMETHODIMP DUnadvise(DWORD);
  422. STDMETHODIMP EnumDAdvise(LPENUMSTATDATA *);
  423. };
  424. //IENUMFE.CPP
  425. class CEnumFormatEtc : public IEnumFORMATETC
  426. {
  427. private:
  428. ULONG m_cRef;
  429. LPUNKNOWN m_pUnkRef;
  430. ULONG m_iCur;
  431. ULONG m_cfe;
  432. LPFORMATETC m_prgfe;
  433. public:
  434. CEnumFormatEtc(LPUNKNOWN, ULONG, LPFORMATETC);
  435. virtual ~CEnumFormatEtc(void);
  436. //IUnknown members that delegate to m_pUnkRef.
  437. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  438. STDMETHODIMP_(ULONG) AddRef(void);
  439. STDMETHODIMP_(ULONG) Release(void);
  440. //IEnumFORMATETC members
  441. STDMETHODIMP Next(ULONG, LPFORMATETC, ULONG *);
  442. STDMETHODIMP Skip(ULONG);
  443. STDMETHODIMP Reset(void);
  444. STDMETHODIMP Clone(IEnumFORMATETC **);
  445. };
  446. typedef CEnumFormatEtc *PCEnumFormatEtc;
  447. //Our own properties verb
  448. #define POLYLINEVERB_PROPERTIES 1
  449. class CImpIOleObject : public IOleObject
  450. {
  451. private:
  452. ULONG m_cRef;
  453. PCPolyline m_pObj;
  454. LPUNKNOWN m_pUnkOuter;
  455. public:
  456. CImpIOleObject(PCPolyline, LPUNKNOWN);
  457. virtual ~CImpIOleObject(void);
  458. //IUnknown members that delegate to m_pUnkOuter.
  459. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  460. STDMETHODIMP_(ULONG) AddRef(void);
  461. STDMETHODIMP_(ULONG) Release(void);
  462. //IOleObject members
  463. STDMETHODIMP SetClientSite(LPOLECLIENTSITE);
  464. STDMETHODIMP GetClientSite(LPOLECLIENTSITE *);
  465. STDMETHODIMP SetHostNames(LPCOLESTR, LPCOLESTR);
  466. STDMETHODIMP Close(DWORD);
  467. STDMETHODIMP SetMoniker(DWORD, LPMONIKER);
  468. STDMETHODIMP GetMoniker(DWORD, DWORD, LPMONIKER *);
  469. STDMETHODIMP InitFromData(LPDATAOBJECT, BOOL, DWORD);
  470. STDMETHODIMP GetClipboardData(DWORD, LPDATAOBJECT *);
  471. STDMETHODIMP DoVerb(LONG, LPMSG, LPOLECLIENTSITE, LONG
  472. , HWND, LPCRECT);
  473. STDMETHODIMP EnumVerbs(LPENUMOLEVERB *);
  474. STDMETHODIMP Update(void);
  475. STDMETHODIMP IsUpToDate(void);
  476. STDMETHODIMP GetUserClassID(CLSID *);
  477. STDMETHODIMP GetUserType(DWORD, LPOLESTR *);
  478. STDMETHODIMP SetExtent(DWORD, LPSIZEL);
  479. STDMETHODIMP GetExtent(DWORD, LPSIZEL);
  480. STDMETHODIMP Advise(LPADVISESINK, DWORD *);
  481. STDMETHODIMP Unadvise(DWORD);
  482. STDMETHODIMP EnumAdvise(LPENUMSTATDATA *);
  483. STDMETHODIMP GetMiscStatus(DWORD, DWORD *);
  484. STDMETHODIMP SetColorScheme(LPLOGPALETTE);
  485. };
  486. //IVIEWOBJ.CPP
  487. class CImpIViewObject : public IViewObject2
  488. {
  489. private:
  490. ULONG m_cRef;
  491. PCPolyline m_pObj;
  492. LPUNKNOWN m_pUnkOuter;
  493. public:
  494. CImpIViewObject(PCPolyline, LPUNKNOWN);
  495. virtual ~CImpIViewObject(void);
  496. //IUnknown members that delegate to m_pUnkOuter.
  497. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  498. STDMETHODIMP_(ULONG) AddRef(void);
  499. STDMETHODIMP_(ULONG) Release(void);
  500. //IViewObject members
  501. STDMETHODIMP Draw(
  502. DWORD,
  503. LONG,
  504. LPVOID,
  505. DVTARGETDEVICE *,
  506. HDC,
  507. HDC,
  508. LPCRECTL,
  509. LPCRECTL,
  510. BOOL (CALLBACK *)(DWORD_PTR),
  511. DWORD_PTR );
  512. STDMETHODIMP GetColorSet(DWORD, LONG, LPVOID
  513. , DVTARGETDEVICE *, HDC, LPLOGPALETTE *);
  514. STDMETHODIMP Freeze(DWORD, LONG, LPVOID, LPDWORD);
  515. STDMETHODIMP Unfreeze(DWORD);
  516. STDMETHODIMP SetAdvise(DWORD, DWORD, LPADVISESINK);
  517. STDMETHODIMP GetAdvise(LPDWORD, LPDWORD, LPADVISESINK *);
  518. STDMETHODIMP GetExtent(DWORD, LONG, DVTARGETDEVICE *
  519. , LPSIZEL);
  520. };
  521. class CImpIRunnableObject : public IRunnableObject
  522. {
  523. protected:
  524. ULONG m_cRef;
  525. PCPolyline m_pObj;
  526. LPUNKNOWN m_pUnkOuter;
  527. public:
  528. CImpIRunnableObject(PCPolyline, LPUNKNOWN);
  529. virtual ~CImpIRunnableObject(void);
  530. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  531. STDMETHODIMP_(ULONG) AddRef(void);
  532. STDMETHODIMP_(ULONG) Release(void);
  533. STDMETHODIMP GetRunningClass(LPCLSID);
  534. STDMETHODIMP Run(LPBINDCTX);
  535. STDMETHODIMP_(BOOL) IsRunning(void);
  536. STDMETHODIMP LockRunning(BOOL, BOOL);
  537. STDMETHODIMP SetContainedObject(BOOL);
  538. };
  539. class CImpIExternalConnection : public IExternalConnection
  540. {
  541. protected:
  542. ULONG m_cRef;
  543. PCPolyline m_pObj;
  544. LPUNKNOWN m_pUnkOuter;
  545. DWORD m_cLockStrong;
  546. public:
  547. CImpIExternalConnection(PCPolyline, LPUNKNOWN);
  548. virtual ~CImpIExternalConnection(void);
  549. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  550. STDMETHODIMP_(ULONG) AddRef(void);
  551. STDMETHODIMP_(ULONG) Release(void);
  552. STDMETHODIMP_(DWORD) AddConnection(DWORD, DWORD);
  553. STDMETHODIMP_(DWORD) ReleaseConnection(DWORD, DWORD, BOOL);
  554. };
  555. class CImpIOleInPlaceObject : public IOleInPlaceObject
  556. {
  557. protected:
  558. ULONG m_cRef;
  559. PCPolyline m_pObj;
  560. LPUNKNOWN m_pUnkOuter;
  561. public:
  562. CImpIOleInPlaceObject(PCPolyline, LPUNKNOWN);
  563. virtual ~CImpIOleInPlaceObject(void);
  564. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  565. STDMETHODIMP_(ULONG) AddRef(void);
  566. STDMETHODIMP_(ULONG) Release(void);
  567. STDMETHODIMP GetWindow(HWND *);
  568. STDMETHODIMP ContextSensitiveHelp(BOOL);
  569. STDMETHODIMP InPlaceDeactivate(void);
  570. STDMETHODIMP UIDeactivate(void);
  571. STDMETHODIMP SetObjectRects(LPCRECT, LPCRECT);
  572. STDMETHODIMP ReactivateAndUndo(void);
  573. };
  574. class CImpIOleInPlaceActiveObject
  575. : public IOleInPlaceActiveObject
  576. {
  577. protected:
  578. ULONG m_cRef;
  579. PCPolyline m_pObj;
  580. LPUNKNOWN m_pUnkOuter;
  581. public:
  582. CImpIOleInPlaceActiveObject(PCPolyline, LPUNKNOWN);
  583. virtual ~CImpIOleInPlaceActiveObject(void);
  584. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  585. STDMETHODIMP_(ULONG) AddRef(void);
  586. STDMETHODIMP_(ULONG) Release(void);
  587. STDMETHODIMP GetWindow(HWND *);
  588. STDMETHODIMP ContextSensitiveHelp(BOOL);
  589. STDMETHODIMP TranslateAccelerator(LPMSG);
  590. STDMETHODIMP OnFrameWindowActivate(BOOL);
  591. STDMETHODIMP OnDocWindowActivate(BOOL);
  592. STDMETHODIMP ResizeBorder(LPCRECT, LPOLEINPLACEUIWINDOW
  593. , BOOL);
  594. STDMETHODIMP EnableModeless(BOOL);
  595. };
  596. class CImpISpecifyPP : public ISpecifyPropertyPages
  597. {
  598. protected:
  599. ULONG m_cRef; //Interface reference count
  600. PCPolyline m_pObj; //Backpointer to the object
  601. LPUNKNOWN m_pUnkOuter; //For delegation
  602. public:
  603. CImpISpecifyPP(PCPolyline, LPUNKNOWN);
  604. virtual ~CImpISpecifyPP(void);
  605. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  606. STDMETHODIMP_(ULONG) AddRef(void);
  607. STDMETHODIMP_(ULONG) Release(void);
  608. STDMETHODIMP GetPages(CAUUID *);
  609. };
  610. class CImpIProvideClassInfo : public IProvideClassInfo
  611. {
  612. protected:
  613. ULONG m_cRef; //Interface reference count
  614. PCPolyline m_pObj; //Backpointer to the object
  615. LPUNKNOWN m_pUnkOuter; //For delegation
  616. public:
  617. CImpIProvideClassInfo(PCPolyline, LPUNKNOWN);
  618. virtual ~CImpIProvideClassInfo(void);
  619. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  620. STDMETHODIMP_(ULONG) AddRef(void);
  621. STDMETHODIMP_(ULONG) Release(void);
  622. STDMETHODIMP GetClassInfo(LPTYPEINFO *);
  623. };
  624. class CImpIDispatch : public IDispatch
  625. {
  626. public:
  627. private:
  628. ULONG m_cRef; //For debugging
  629. LPUNKNOWN m_pObj;
  630. LPUNKNOWN m_pUnkOuter;
  631. LPUNKNOWN m_pInterface;
  632. IID m_DIID;
  633. ITypeInfo *m_pITI; //Type information
  634. public:
  635. CImpIDispatch(LPUNKNOWN, LPUNKNOWN);
  636. virtual ~CImpIDispatch(void);
  637. void SetInterface(REFIID, LPUNKNOWN);
  638. //IUnknown members that delegate to m_pUnkOuter.
  639. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  640. STDMETHODIMP_(ULONG) AddRef(void);
  641. STDMETHODIMP_(ULONG) Release(void);
  642. //IDispatch members
  643. STDMETHODIMP GetTypeInfoCount(UINT *);
  644. STDMETHODIMP GetTypeInfo(UINT, LCID, ITypeInfo **);
  645. STDMETHODIMP GetIDsOfNames(REFIID, OLECHAR **, UINT, LCID
  646. , DISPID *);
  647. STDMETHODIMP Invoke(DISPID, REFIID, LCID, WORD
  648. , DISPPARAMS *, VARIANT *, EXCEPINFO *, UINT *);
  649. };
  650. class CImpISystemMonitor : public ISystemMonitor
  651. {
  652. protected:
  653. ULONG m_cRef; //Interface reference count
  654. PCPolyline m_pObj; //Back pointer to object
  655. LPUNKNOWN m_pUnkOuter; //Controlling unknown
  656. public:
  657. CImpISystemMonitor(PCPolyline, LPUNKNOWN);
  658. virtual ~CImpISystemMonitor(void);
  659. //IUnknown members.
  660. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  661. STDMETHODIMP_(ULONG) AddRef(void);
  662. STDMETHODIMP_(ULONG) Release(void);
  663. //Manipulation members:
  664. STDMETHODIMP put_Appearance(INT);
  665. STDMETHODIMP get_Appearance(INT*);
  666. STDMETHODIMP put_BackColor(OLE_COLOR);
  667. STDMETHODIMP get_BackColor(OLE_COLOR*);
  668. STDMETHODIMP put_BorderStyle(INT);
  669. STDMETHODIMP get_BorderStyle(INT*);
  670. STDMETHODIMP put_ForeColor(OLE_COLOR);
  671. STDMETHODIMP get_ForeColor(OLE_COLOR*);
  672. STDMETHODIMP put_BackColorCtl(OLE_COLOR);
  673. STDMETHODIMP get_BackColorCtl(OLE_COLOR*);
  674. STDMETHODIMP put_GridColor(OLE_COLOR);
  675. STDMETHODIMP get_GridColor(OLE_COLOR*);
  676. STDMETHODIMP put_TimeBarColor(OLE_COLOR);
  677. STDMETHODIMP get_TimeBarColor(OLE_COLOR*);
  678. STDMETHODIMP putref_Font(IFontDisp *pFont);
  679. STDMETHODIMP get_Font(IFontDisp **ppFont);
  680. STDMETHODIMP put_ShowVerticalGrid(VARIANT_BOOL);
  681. STDMETHODIMP get_ShowVerticalGrid(VARIANT_BOOL*);
  682. STDMETHODIMP put_ShowHorizontalGrid(VARIANT_BOOL);
  683. STDMETHODIMP get_ShowHorizontalGrid(VARIANT_BOOL*);
  684. STDMETHODIMP put_ShowLegend(VARIANT_BOOL);
  685. STDMETHODIMP get_ShowLegend(VARIANT_BOOL*);
  686. STDMETHODIMP put_ShowToolbar(VARIANT_BOOL);
  687. STDMETHODIMP get_ShowToolbar(VARIANT_BOOL*);
  688. STDMETHODIMP put_ShowValueBar(VARIANT_BOOL);
  689. STDMETHODIMP get_ShowValueBar(VARIANT_BOOL*);
  690. STDMETHODIMP put_ShowScaleLabels(VARIANT_BOOL);
  691. STDMETHODIMP get_ShowScaleLabels(VARIANT_BOOL*);
  692. STDMETHODIMP put_MaximumScale(INT);
  693. STDMETHODIMP get_MaximumScale(INT*);
  694. STDMETHODIMP put_MinimumScale(INT);
  695. STDMETHODIMP get_MinimumScale(INT*);
  696. STDMETHODIMP put_UpdateInterval(FLOAT);
  697. STDMETHODIMP get_UpdateInterval(FLOAT*);
  698. STDMETHODIMP put_DisplayFilter(INT);
  699. STDMETHODIMP get_DisplayFilter(INT*);
  700. STDMETHODIMP put_DisplayType(DisplayTypeConstants);
  701. STDMETHODIMP get_DisplayType(DisplayTypeConstants*);
  702. STDMETHODIMP put_ManualUpdate(VARIANT_BOOL);
  703. STDMETHODIMP get_ManualUpdate(VARIANT_BOOL*);
  704. STDMETHODIMP put_YAxisLabel(BSTR);
  705. STDMETHODIMP get_YAxisLabel(BSTR*);
  706. STDMETHODIMP put_GraphTitle(BSTR);
  707. STDMETHODIMP get_GraphTitle(BSTR*);
  708. STDMETHODIMP put_SqlDsnName(BSTR);
  709. STDMETHODIMP get_SqlDsnName(BSTR*);
  710. STDMETHODIMP put_SqlLogSetName(BSTR);
  711. STDMETHODIMP get_SqlLogSetName(BSTR*);
  712. STDMETHODIMP put_LogFileName(BSTR);
  713. STDMETHODIMP get_LogFileName(BSTR*);
  714. STDMETHODIMP get_LogFiles(ILogFiles**);
  715. STDMETHODIMP put_DataSourceType(DataSourceTypeConstants);
  716. STDMETHODIMP get_DataSourceType(DataSourceTypeConstants*);
  717. STDMETHODIMP put_LogViewStart(DATE);
  718. STDMETHODIMP get_LogViewStart(DATE*);
  719. STDMETHODIMP put_LogViewStop(DATE);
  720. STDMETHODIMP get_LogViewStop(DATE*);
  721. STDMETHODIMP put_Highlight(VARIANT_BOOL);
  722. STDMETHODIMP get_Highlight(VARIANT_BOOL*);
  723. STDMETHODIMP put_ReadOnly(VARIANT_BOOL);
  724. STDMETHODIMP get_ReadOnly(VARIANT_BOOL*);
  725. STDMETHODIMP put_ReportValueType(ReportValueTypeConstants);
  726. STDMETHODIMP get_ReportValueType(ReportValueTypeConstants*);
  727. STDMETHODIMP put_MonitorDuplicateInstances(VARIANT_BOOL);
  728. STDMETHODIMP get_MonitorDuplicateInstances(VARIANT_BOOL*);
  729. STDMETHODIMP get_Counters(ICounters**);
  730. STDMETHODIMP CollectSample(void);
  731. STDMETHODIMP BrowseCounters(void);
  732. STDMETHODIMP DisplayProperties(void);
  733. STDMETHODIMP Counter(INT iIndex, ICounterItem**);
  734. STDMETHODIMP AddCounter(BSTR bsPath, ICounterItem**);
  735. STDMETHODIMP DeleteCounter(ICounterItem *pItem);
  736. STDMETHODIMP LogFile ( INT iIndex, ILogFileItem** );
  737. STDMETHODIMP AddLogFile ( BSTR bsPath, ILogFileItem** );
  738. STDMETHODIMP DeleteLogFile ( ILogFileItem *pItem );
  739. STDMETHODIMP UpdateGraph(void);
  740. STDMETHODIMP Paste(void);
  741. STDMETHODIMP Copy(void);
  742. STDMETHODIMP Reset(void);
  743. // methods not exposed by ISystemMonitor
  744. void SetLogFileRange(LONGLONG llBegin, LONGLONG LLEnd);
  745. void GetLogFileRange(LONGLONG *pllBegin, LONGLONG *pLLEnd);
  746. HRESULT SetLogViewTempRange(LONGLONG llStart, LONGLONG llStop);
  747. void GetVisuals(
  748. OLE_COLOR *prgbColor,
  749. INT *piColorIndex,
  750. INT *piWidthIndex,
  751. INT *piStyleIndex);
  752. void SetVisuals(
  753. OLE_COLOR rgbColor,
  754. INT iColorIndex,
  755. INT iWidthIndex,
  756. INT iStyleIndex);
  757. STDMETHODIMP GetSelectedCounter(ICounterItem**);
  758. HLOG GetDataSourceHandle ( void );
  759. // *** TodoMultiLogHandle: Temporary private method. Remove when trace file
  760. // post-processing supports multiple open files.
  761. HQUERY GetQueryHandle ( void );
  762. };
  763. class CImpIOleControl : public IOleControl
  764. {
  765. protected:
  766. ULONG m_cRef; //Interface reference count
  767. PCPolyline m_pObj; //Backpointer to the object
  768. LPUNKNOWN m_pUnkOuter; //For delegation
  769. public:
  770. CImpIOleControl(PCPolyline, LPUNKNOWN);
  771. virtual ~CImpIOleControl(void);
  772. STDMETHODIMP QueryInterface(REFIID, LPVOID *);
  773. STDMETHODIMP_(ULONG) AddRef(void);
  774. STDMETHODIMP_(ULONG) Release(void);
  775. STDMETHODIMP GetControlInfo(LPCONTROLINFO);
  776. STDMETHODIMP OnMnemonic(LPMSG);
  777. STDMETHODIMP OnAmbientPropertyChange(DISPID);
  778. STDMETHODIMP FreezeEvents(BOOL);
  779. };
  780. /*****************************************
  781. class CAdviseRouter : public ISystemMonitorEvents
  782. {
  783. private:
  784. ULONG m_cRef;
  785. PCPolyline m_pObj;
  786. IDispatch *m_pIDispatch;
  787. public:
  788. CAdviseRouter(IDispatch *, PCPolyline);
  789. virtual ~CAdviseRouter(void);
  790. void Invoke(DISPID dispId, INT iParam);
  791. //IUnknown members
  792. STDMETHODIMP QueryInterface(REFIID, PPVOID);
  793. STDMETHODIMP_(ULONG) AddRef(void);
  794. STDMETHODIMP_(ULONG) Release(void);
  795. //Advise members.
  796. STDMETHODIMP_(void) OnCounterSelected(INT iIndex);
  797. STDMETHODIMP_(void) OnCounterAdded(INT iIndex);
  798. STDMETHODIMP_(void) OnCounterDeleted(INT iIndex);
  799. };
  800. //These values match the ID's in smonctrl.odl
  801. enum
  802. {
  803. EVENT_ONCOUNTERSELECTED=1,
  804. EVENT_ONCOUNTERADDED=2,
  805. EVENT_ONCOUNTERDELETED=3,
  806. };
  807. ***************************************/
  808. #endif //_POLYLINE_H_