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.

1244 lines
38 KiB

  1. /*++
  2. Copyright (c) 1996 Microsoft Corporation
  3. Module Name:
  4. inode.h
  5. Abstract:
  6. This file contains partial implementation of
  7. the node abstract base class.
  8. Environment:
  9. WIN32 User Mode
  10. Author:
  11. Darwin Ouyang (t-darouy) 30-Sept-1997
  12. --*/
  13. /*++
  14. To create a new node type, create a new class that inheits from CInternalNode.
  15. Implement all the methods in the Mandatory CInternalNode category listed in the
  16. header file for this class. They are marked as pure virtual, to insure your class
  17. will not compile unless these methods are implemented.
  18. To add other functionality to the node, override the default implementation
  19. included below.
  20. TODO: add a default implemention of InsertItem so that the new node knows how to
  21. insert itself into a result or scope pane view, instead of the parent
  22. node having an InsertItem method.
  23. --*/
  24. #include "stdafx.h"
  25. #include "inode.h"
  26. #include "faxsnapin.h" // snapin base
  27. #include "faxdataobj.h" // dataobject
  28. #include "faxhelper.h" // ole helper functions
  29. #include "faxstrt.h" // string table
  30. #pragma hdrstop
  31. ////////////////////////////////////////////////////////////////////////////////////////////////////
  32. ////////////////////////////////////////////////////////////////////////////////////////////////////
  33. ////////////////////////////////////////////////////////////////////////////////////////////////////
  34. ////////////////////////////////////////////////////////////////////////////////////////////////////
  35. //
  36. //
  37. // Default mandatory CInternalNode implementations.
  38. //
  39. //
  40. const LPTSTR
  41. CInternalNode::GetNodeDescription()
  42. /*++
  43. Routine Description:
  44. Returns a const TSTR pointer to the node's display description. You must not
  45. free this string, it is internally used.
  46. Arguments:
  47. None.
  48. Return Value:
  49. A const pointer to a TSTR.
  50. --*/
  51. {
  52. return ::GlobalStringTable->GetString( IDS_GENERIC_NODE );
  53. }
  54. ////////////////////////////////////////////////////////////////////////////////////////////////////
  55. ////////////////////////////////////////////////////////////////////////////////////////////////////
  56. ////////////////////////////////////////////////////////////////////////////////////////////////////
  57. ////////////////////////////////////////////////////////////////////////////////////////////////////
  58. //
  59. //
  60. // IComponentData default implementation.
  61. //
  62. //
  63. HRESULT STDMETHODCALLTYPE
  64. CInternalNode::ScopeNotify(
  65. IN CFaxComponentData * pCompData,
  66. IN CFaxDataObject * pDO,
  67. IN MMC_NOTIFY_TYPE event,
  68. IN LPARAM arg,
  69. IN LPARAM param)
  70. /*++
  71. Routine Description:
  72. This routine dispatches scope pane events to their respective handlers.
  73. Do not override this procedure, instead override the individual event handlers
  74. declared below.
  75. Arguments:
  76. pCompData - a pointer to the IComponentData associated with this node.
  77. pDO - a pointer to the IDataObject associated with this node
  78. event - the MMC event
  79. arg, param - the event parameters
  80. Return Value:
  81. HRESULT indicating SUCCEEDED() or FAILED()
  82. --*/
  83. {
  84. DebugPrint(( TEXT("Trace: CInternalNode::ScopeNotify") ));
  85. HRESULT hr;
  86. if( pDO != NULL ) {
  87. switch(event) {
  88. case MMCN_EXPAND:
  89. ATLTRACE(_T(" ****ScopeNotify event: MMCN_EXPAND\n"));
  90. hr = ScopeOnExpand(pCompData, pDO, arg, param);
  91. break;
  92. case MMCN_DELETE:
  93. ATLTRACE(_T(" ****ScopeNotify event: MMCN_DELETE\n"));
  94. hr = ScopeOnDelete(pCompData, pDO, arg, param);
  95. break;
  96. case MMCN_RENAME:
  97. ATLTRACE(_T(" ****ScopeNotify event: MMCN_RENAME\n"));
  98. hr = ScopeOnRename(pCompData, pDO, arg, param);
  99. break;
  100. // if we need more events later on for the scope pane, they MUST
  101. // be added HERE, as well as default handlers added below
  102. default:
  103. ATLTRACE(_T(" ****ScopeNotify event: unimplemented event %x\n"), event);
  104. hr = S_FALSE;
  105. break;
  106. }
  107. } else {
  108. if( event == MMCN_PROPERTY_CHANGE ) {
  109. ATLTRACE(_T(" ****ScopeNotify event: MMCN_PROPERTY_CHANGE\n"));
  110. hr = ScopeOnPropertyChange(pCompData, pDO, arg, param);
  111. } else {
  112. assert( FALSE );
  113. hr = E_UNEXPECTED;
  114. }
  115. }
  116. return hr;
  117. }
  118. HRESULT
  119. STDMETHODCALLTYPE
  120. CInternalNode::ScopeGetDisplayInfo(
  121. IN CFaxComponentData * pCompData,
  122. IN OUT SCOPEDATAITEM __RPC_FAR *pScopeDataItem)
  123. /*++
  124. Routine Description:
  125. This routine dispatches scope pane GetDisplayInfo requests to the appropriate handlers
  126. in the mandatory implementations of the node.
  127. Override this method if you want more specific behavior to a GetDisplayInfo call, otherwise
  128. just call the mandatory methods.
  129. Arguments:
  130. pCompData - a pointer to the IComponentData associated with this node.
  131. pScopeDataItem - a pointer to the SCOPEDATAITEM struct which needs to be filled in.
  132. Return Value:
  133. HRESULT indicating SUCCEEDED() or FAILED()
  134. --*/
  135. {
  136. // DebugPrint(( TEXT("Trace: CInternalNode::ScopeGetDisplayInfo") ));
  137. // override this method if you need more selective display info in
  138. // the scope pane.
  139. assert(pScopeDataItem != NULL);
  140. if( pScopeDataItem->mask & SDI_STR ) {
  141. pScopeDataItem->displayname = GetNodeDisplayName();
  142. }
  143. if( pScopeDataItem->mask & SDI_IMAGE ) {
  144. pScopeDataItem->nImage = GetNodeDisplayImage();
  145. }
  146. if( pScopeDataItem->mask & SDI_OPENIMAGE ) {
  147. pScopeDataItem->nOpenImage = GetNodeDisplayOpenImage();
  148. }
  149. return S_OK;
  150. }
  151. HRESULT
  152. STDMETHODCALLTYPE
  153. CInternalNode::ScopeQueryDataObject(
  154. IN CFaxComponentData * pCompData,
  155. IN MMC_COOKIE cookie,
  156. IN DATA_OBJECT_TYPES type,
  157. OUT LPDATAOBJECT __RPC_FAR *ppDataObject)
  158. /*++
  159. Routine Description:
  160. This routine creates and returns a IDataObject containing context information for the current node.
  161. Arguments:
  162. pCompData - a pointer to the IComponentData associated with this node.
  163. cookie - the cookie of the target node
  164. type - indicates the the node type IE scope, result, etc.
  165. ppDataobject - store the pointer to the new data object here.
  166. Return Value:
  167. HRESULT indicating SUCCEEDED() or FAILED()
  168. --*/
  169. {
  170. // DebugPrint(( TEXT("Trace: CInternalNode::ScopeQueryDataObject") ));
  171. HRESULT hr = S_OK;
  172. INT iResult;
  173. CFaxDataObject *pdoNew = NULL;
  174. do {
  175. pdoNew = new CComObject< CFaxDataObject >;
  176. if(!pdoNew) {
  177. hr = E_OUTOFMEMORY;
  178. assert( m_pCompData->m_pConsole != NULL );
  179. if ( m_pCompData->m_pConsole != NULL ) {
  180. m_pCompData->m_pConsole->MessageBox(::GlobalStringTable->GetString(IDS_OUT_OF_MEMORY) ,
  181. ::GlobalStringTable->GetString(IDS_ERR_TITLE),
  182. MB_OK, &iResult);
  183. }
  184. break;
  185. }
  186. pdoNew->SetCookie( GetCookie() );
  187. pdoNew->SetOwner( GetThis() );
  188. pdoNew->SetContext( type );
  189. *ppDataObject = pdoNew;
  190. // addref it **** is this needed???!?
  191. (*ppDataObject)->AddRef();
  192. } while(0);
  193. return hr;
  194. }
  195. ////////////////////////////////////////////////////////////////////////////////////////////////////
  196. ////////////////////////////////////////////////////////////////////////////////////////////////////
  197. ////////////////////////////////////////////////////////////////////////////////////////////////////
  198. ////////////////////////////////////////////////////////////////////////////////////////////////////
  199. //
  200. //
  201. // IComponent default implementation.
  202. //
  203. //
  204. HRESULT
  205. STDMETHODCALLTYPE
  206. CInternalNode::ResultNotify(
  207. IN CFaxComponent * pComp,
  208. IN CFaxDataObject * pDO,
  209. IN MMC_NOTIFY_TYPE event,
  210. IN LPARAM arg,
  211. IN LPARAM param)
  212. /*++
  213. Routine Description:
  214. This routine dispatches result pane events to their respective handlers.
  215. Do not override this procedure, instead override the individual event handlers
  216. declared below.
  217. Arguments:
  218. pComp - a pointer to the IComponent associated with this node.
  219. pDO - a pointer to the IDataObject associated with this node
  220. event - the MMC event
  221. arg, param - the event parameters
  222. Return Value:
  223. HRESULT indicating SUCCEEDED() or FAILED()
  224. --*/
  225. {
  226. DebugPrint(( TEXT("Trace: CInternalNode::ResultNotify") ));
  227. HRESULT hr;
  228. if( pDO != NULL ) {
  229. switch(event) {
  230. case MMCN_ACTIVATE:
  231. ATLTRACE(_T(" ****ResultNotify event: MMCN_ACTIVATE\n"));
  232. hr = ResultOnActivate(pComp, pDO, arg, param);
  233. break;
  234. case MMCN_ADD_IMAGES:
  235. ATLTRACE(_T(" ****ResultNotify event: MMCN_ADD_IMAGES\n"));
  236. hr = ResultOnAddImages(pComp, pDO, arg, param);
  237. break;
  238. case MMCN_BTN_CLICK:
  239. ATLTRACE(_T(" ****ResultNotify event: MMCN_BTN_CLICK\n"));
  240. hr = ResultOnButtonClick(pComp, pDO, arg, param);
  241. break;
  242. case MMCN_CLICK:
  243. ATLTRACE(_T(" ****ResultNotify event: MMCN_CLICK\n"));
  244. hr = ResultOnClick(pComp, pDO, arg, param);
  245. break;
  246. case MMCN_DBLCLICK:
  247. ATLTRACE(_T(" ****ResultNotify event: MMCN_DBLCLICK\n"));
  248. hr = ResultOnDoubleClick(pComp, pDO, arg, param);
  249. break;
  250. case MMCN_DELETE:
  251. ATLTRACE(_T(" ****ResultNotify event: MMCN_DELETE\n"));
  252. hr = ResultOnDelete(pComp, pDO, arg, param);
  253. break;
  254. case MMCN_EXPAND:
  255. ATLTRACE(_T(" ****ResultNotify event: MMCN_EXPAND\n"));
  256. hr = ResultOnExpand(pComp, pDO, arg, param);
  257. break;
  258. case MMCN_MINIMIZED:
  259. ATLTRACE(_T(" ****ResultNotify event: MMCN_MINIMIZED\n"));
  260. hr = ResultOnMinimized(pComp, pDO, arg, param);
  261. break;
  262. case MMCN_QUERY_PASTE:
  263. ATLTRACE(_T(" ****ResultNotify event: MMCN_MINIMIZED\n"));
  264. hr = ResultOnQueryPaste(pComp, pDO, arg, param);
  265. break;
  266. case MMCN_REMOVE_CHILDREN:
  267. ATLTRACE(_T(" ****ResultNotify event: MMCN_REMOVE_CHILDREN\n"));
  268. hr = ResultOnRemoveChildren(pComp, pDO, arg, param);
  269. break;
  270. case MMCN_RENAME:
  271. ATLTRACE(_T(" ****ResultNotify event: MMCN_RENAME\n"));
  272. hr = ResultOnRename(pComp, pDO, arg, param);
  273. break;
  274. case MMCN_SELECT:
  275. ATLTRACE(_T(" ****ResultNotify event: MMCN_SELECT"));
  276. #ifdef DEBUG
  277. if( HIWORD( arg ) == TRUE ) {
  278. ATLTRACE(_T(" select\n"));
  279. } else {
  280. ATLTRACE(_T(" unselect\n"));
  281. }
  282. #endif
  283. hr = ResultOnSelect(pComp, pDO, arg, param);
  284. break;
  285. case MMCN_SHOW:
  286. ATLTRACE(_T(" ****ResultNotify event: MMCN_SHOW\n"));
  287. hr = ResultOnShow(pComp, pDO, arg, param);
  288. break;
  289. case MMCN_VIEW_CHANGE:
  290. ATLTRACE(_T(" ****ResultNotify event: MMCN_VIEW_CHANGE\n"));
  291. hr = ResultOnViewChange(pComp, pDO, arg, param);
  292. break;
  293. // if we need more events later on for the result pane, they MUST
  294. // be added HERE, as well as default handlers added below
  295. default:
  296. ATLTRACE(_T(" ****ResultNotify event: unimplemented event %x\n"), event);
  297. hr = S_FALSE;
  298. break;
  299. }
  300. } else {
  301. // some events do not return a data object
  302. if( event == MMCN_PROPERTY_CHANGE ) {
  303. ATLTRACE(_T(" ****ResultNotify event: MMCN_PROPERTY_CHANGE\n"));
  304. hr = ResultOnPropertyChange(pComp, pDO, arg, param);
  305. } else {
  306. hr = E_UNEXPECTED;
  307. }
  308. }
  309. return hr;
  310. }
  311. HRESULT
  312. STDMETHODCALLTYPE
  313. CInternalNode::ResultGetDisplayInfo(
  314. IN CFaxComponent * pComp,
  315. IN OUT RESULTDATAITEM __RPC_FAR *pResultDataItem)
  316. /*++
  317. Routine Description:
  318. This routine dispatches result pane GetDisplayInfo requests to the appropriate handlers
  319. in the mandatory implementations of the node.
  320. Override this method if you want more specific behavior to a GetDisplayInfo call, otherwise
  321. just call the mandatory methods.
  322. Arguments:
  323. pComp - a pointer to the IComponent associated with this node.
  324. pResultDataItem - a pointer to the RESULTDATAITEM struct which needs to be filled in.
  325. Return Value:
  326. HRESULT indicating SUCCEEDED() or FAILED()
  327. NOTE:
  328. // **********************************************************************
  329. // **********************************************************************
  330. // default implementation only works for ** scope folders **
  331. // scope folders show up in the BOTH PANES
  332. // YOU MUST OVERRIDE THIS METHOD IF YOU WANT TO DISPLAY INFO FOR
  333. // RESULT PANE METHODS AND REMOVE THE CHECK FOR bScopeIteim == TRUE.
  334. // **********************************************************************
  335. // **********************************************************************
  336. --*/
  337. {
  338. // DebugPrint(( TEXT("Trace: CInternalNode::ResultGetDisplayInfo") ));
  339. assert(pResultDataItem != NULL);
  340. if( pResultDataItem->bScopeItem == TRUE ) {
  341. if( pResultDataItem->mask & RDI_STR ) {
  342. if( pResultDataItem->nCol == 0 ) {
  343. pResultDataItem->str = GetNodeDisplayName();
  344. }
  345. if( pResultDataItem->nCol == 1 ) {
  346. pResultDataItem->str = GetNodeDescription();
  347. }
  348. }
  349. if( pResultDataItem->mask & RDI_IMAGE ) {
  350. pResultDataItem->nImage = GetNodeDisplayImage();
  351. }
  352. } else {
  353. DebugPrint(( TEXT("******** Trace: CInternalNode::ResultGetDisplayInfo") ));
  354. DebugPrint(( TEXT(" DID YOU FORGET TO OVERRIDE ME!!!!") ));
  355. }
  356. return S_OK;
  357. }
  358. HRESULT
  359. STDMETHODCALLTYPE
  360. CInternalNode::ResultGetResultViewType(
  361. IN CFaxComponent * pComp,
  362. IN MMC_COOKIE cookie,
  363. OUT LPOLESTR __RPC_FAR *ppViewType,
  364. OUT long __RPC_FAR *pViewOptions)
  365. /*++
  366. Routine Description:
  367. This routine dispatches result pane events to their respective handlers.
  368. Do not override this procedure, instead override the individual event handlers
  369. declared below.
  370. Arguments:
  371. pComp - a pointer to the IComponent associated with this node.
  372. cookie - the cookie of the target node
  373. ppViewType - returns the requested view type
  374. pViewOptions - returns the requested view options
  375. Return Value:
  376. None.
  377. --*/
  378. {
  379. // DebugPrint(( TEXT("Trace: CInternalNode::ResultGetResultViewType") ));
  380. *pViewOptions = MMC_VIEW_OPTIONS_NONE; // request default view.
  381. return S_FALSE;
  382. }
  383. HRESULT
  384. STDMETHODCALLTYPE
  385. CInternalNode::ResultQueryDataObject(
  386. IN CFaxComponent * pComp,
  387. IN MMC_COOKIE cookie,
  388. IN DATA_OBJECT_TYPES type,
  389. OUT LPDATAOBJECT __RPC_FAR *ppDataObject)
  390. /*++
  391. Routine Description:
  392. This routine creates and returns a IDataObject containing context information for the current node.
  393. Arguments:
  394. pCompData - a pointer to the IComponentData associated with this node.
  395. cookie - the cookie of the target node
  396. type - indicates the the node type IE scope, result, etc.
  397. ppDataobject - store the pointer to the new data object here.
  398. Return Value:
  399. HRESULT indicating SUCCEEDED() or FAILED()
  400. --*/
  401. {
  402. // DebugPrint(( TEXT("Trace: CInternalNode::ResultQueryDataObject") ));
  403. // delegate to the implementation in ScopeQueryDataObject
  404. return ScopeQueryDataObject( pComp->GetOwner(), cookie, type, ppDataObject );
  405. }
  406. ////////////////////////////////////////////////////////////////////////////////////////////////////
  407. ////////////////////////////////////////////////////////////////////////////////////////////////////
  408. ////////////////////////////////////////////////////////////////////////////////////////////////////
  409. ////////////////////////////////////////////////////////////////////////////////////////////////////
  410. //
  411. //
  412. // IExtendPropertySheet event handlers - default implementations
  413. //
  414. //
  415. // ExtendPropertySheet event handlers - default implementations
  416. // we need seperate versions for IComponentData and IComponent
  417. // in your code if you want differing behavior
  418. // in the scope and results panes.
  419. //
  420. // You can simply delegate one implementation to the other
  421. // if you want the same behavior in both panes
  422. // ***********************************************************
  423. // IExtendPropertySheet for IComponentData
  424. HRESULT
  425. STDMETHODCALLTYPE
  426. CInternalNode::ComponentDataPropertySheetCreatePropertyPages(
  427. IN CFaxComponentData * pCompData,
  428. IN LPPROPERTYSHEETCALLBACK lpProvider,
  429. IN LONG_PTR handle,
  430. IN CFaxDataObject * lpIDataObject)
  431. /*++
  432. Routine Description:
  433. The default implementation of this routine returns S_FALSE and does not add
  434. any pages to the property sheet.
  435. Arguments:
  436. pCompData - a pointer to the IComponentData associated with this node.
  437. lpProvider - a pointer to the IPropertySheetCallback used to insert pages
  438. handle - a handle to route messages with
  439. lpIDataobject - pointer to the dataobject associated with this node
  440. Return Value:
  441. HRESULT indicating SUCCEEDED() or FAILED()
  442. --*/
  443. {
  444. DebugPrint(( TEXT("Trace: CInternalNode::ComponentDataPropertySheetCreatePropertyPages") ));
  445. return S_FALSE; // no pages added
  446. }
  447. HRESULT
  448. STDMETHODCALLTYPE
  449. CInternalNode::ComponentDataPropertySheetQueryPagesFor(
  450. IN CFaxComponentData * pCompData,
  451. IN CFaxDataObject * lpDataObject)
  452. /*++
  453. Routine Description:
  454. The default implementation of this routine returns S_FALSE to indicate there are no
  455. property pages to be added to the property sheet.
  456. Arguments:
  457. pCompData - a pointer to the IComponentData associated with this node.
  458. lpDataobject - pointer to the dataobject associated with this node
  459. Return Value:
  460. HRESULT indicating SUCCEEDED() or FAILED()
  461. --*/
  462. {
  463. DebugPrint(( TEXT("Trace: CInternalNode::ComponentDataPropertySheetQueryPagesFor") ));
  464. return S_FALSE; // no pages for this object
  465. }
  466. // ***********************************************************
  467. // IExtendPropertySheet for IComponent
  468. HRESULT
  469. STDMETHODCALLTYPE
  470. CInternalNode::ComponentPropertySheetCreatePropertyPages(
  471. IN CFaxComponent * pComp,
  472. IN LPPROPERTYSHEETCALLBACK lpProvider,
  473. IN LONG_PTR handle,
  474. IN CFaxDataObject * lpIDataObject)
  475. /*++
  476. Routine Description:
  477. The default implementation of this routine returns S_FALSE and does not add
  478. any pages to the property sheet.
  479. Arguments:
  480. pComp - a pointer to the IComponent associated with this node.
  481. lpProvider - a pointer to the IPropertySheetCallback used to insert pages
  482. handle - a handle to route messages with
  483. lpIDataobject - pointer to the dataobject associated with this node
  484. Return Value:
  485. HRESULT indicating SUCCEEDED() or FAILED()
  486. --*/
  487. {
  488. DebugPrint(( TEXT("Trace: CInternalNode::ComponentPropertySheetCreatePropertyPages") ));
  489. return S_FALSE; // no pages added
  490. }
  491. HRESULT
  492. STDMETHODCALLTYPE
  493. CInternalNode::ComponentPropertySheetQueryPagesFor(
  494. IN CFaxComponent * pComp,
  495. IN CFaxDataObject * lpDataObject)
  496. /*++
  497. Routine Description:
  498. The default implementation of this routine returns S_FALSE to indicate there are no
  499. property pages to be added to the property sheet.
  500. Arguments:
  501. pComp - a pointer to the IComponent associated with this node.
  502. lpDataobject - pointer to the dataobject associated with this node
  503. Return Value:
  504. HRESULT indicating SUCCEEDED() or FAILED()
  505. --*/
  506. {
  507. DebugPrint(( TEXT("Trace: CInternalNode::ComponentPropertySheetQueryPagesFor") ));
  508. return S_FALSE; // no pages for this object
  509. }
  510. ////////////////////////////////////////////////////////////////////////////////////////////////////
  511. ////////////////////////////////////////////////////////////////////////////////////////////////////
  512. ////////////////////////////////////////////////////////////////////////////////////////////////////
  513. ////////////////////////////////////////////////////////////////////////////////////////////////////
  514. //
  515. //
  516. // IExtendContextMenu event handlers - default implementations
  517. //
  518. //
  519. // ExtendContextMenu event handlers - default implementations
  520. // we need seperate versions for IComponentData and IComponent
  521. // in your code if you want differing behavior
  522. // in the scope and results panes.
  523. //
  524. // You can simply delegate one implementation to the other
  525. // if you want the same behavior in both panes
  526. // ***********************************************************
  527. // IExtendContextMenu for IComponentData
  528. HRESULT
  529. STDMETHODCALLTYPE
  530. CInternalNode::ComponentDataContextMenuAddMenuItems(
  531. IN CFaxComponentData * pCompData,
  532. IN CFaxDataObject * piDataObject,
  533. IN LPCONTEXTMENUCALLBACK piCallback,
  534. IN OUT long __RPC_FAR *pInsertionAllowed )
  535. /*++
  536. Routine Description:
  537. The default implementation of this routine not add
  538. any items to the context menu.
  539. Arguments:
  540. pCompData - a pointer to the IComponentData associated with this node.
  541. piDataObject - pointer to the dataobject associated with this node
  542. piCallback - a pointer to the IContextMenuCallback used to insert pages
  543. pInsertionAllowed - a set of flag indicating whether insertion is allowed.
  544. Return Value:
  545. HRESULT indicating SUCCEEDED() or FAILED()
  546. --*/
  547. {
  548. DebugPrint(( TEXT("Trace: CInternalNode::ComponentDataContextMenuAddMenuItems") ));
  549. return S_OK;
  550. }
  551. HRESULT
  552. STDMETHODCALLTYPE
  553. CInternalNode::ComponentDataContextMenuCommand(
  554. IN CFaxComponentData * pCompData,
  555. IN long lCommandID,
  556. IN CFaxDataObject * piDataObject)
  557. /*++
  558. Routine Description:
  559. The default implementation of the context menu handler does not do anything.
  560. Arguments:
  561. pCompData - a pointer to the IComponentData associated with this node.
  562. lCommandID - the command ID
  563. piDataObject - pointer to the dataobject associated with this node
  564. Return Value:
  565. HRESULT indicating SUCCEEDED() or FAILED()
  566. --*/
  567. {
  568. DebugPrint(( TEXT("Trace: CInternalNode::ComponentDataContextMenuCommand") ));
  569. return S_OK;
  570. }
  571. // ***********************************************************
  572. // IExtendContextMenu for IComponent
  573. HRESULT
  574. STDMETHODCALLTYPE
  575. CInternalNode::ComponentContextMenuAddMenuItems(
  576. IN CFaxComponent * pComp,
  577. IN CFaxDataObject * piDataObject,
  578. IN LPCONTEXTMENUCALLBACK piCallback,
  579. IN OUT long __RPC_FAR *pInsertionAllowed)
  580. /*++
  581. Routine Description:
  582. The default implementation of this routine not add
  583. any items to the context menu.
  584. Arguments:
  585. pComp - a pointer to the IComponent associated with this node.
  586. piDataObject - pointer to the dataobject associated with this node
  587. piCallback - a pointer to the IContextMenuCallback used to insert pages
  588. pInsertionAllowed - a set of flag indicating whether insertion is allowed.
  589. Return Value:
  590. HRESULT indicating SUCCEEDED() or FAILED()
  591. --*/
  592. {
  593. DebugPrint(( TEXT("Trace: CInternalNode::ComponentContextMenuAddMenuItems") ));
  594. return S_OK;
  595. }
  596. HRESULT
  597. STDMETHODCALLTYPE
  598. CInternalNode::ComponentContextMenuCommand(
  599. IN CFaxComponent * pComp,
  600. IN long lCommandID,
  601. IN CFaxDataObject * piDataObject)
  602. /*++
  603. Routine Description:
  604. The default implementation of the context menu handler does not do anything.
  605. Arguments:
  606. pComp - a pointer to the IComponent associated with this node.
  607. lCommandID - the command ID
  608. piDataObject - pointer to the dataobject associated with this node
  609. Return Value:
  610. HRESULT indicating SUCCEEDED() or FAILED()
  611. --*/
  612. {
  613. DebugPrint(( TEXT("Trace: CInternalNode::ComponentContextMenuCommand") ));
  614. return S_OK;
  615. }
  616. ////////////////////////////////////////////////////////////////////////////////////////////////////
  617. ////////////////////////////////////////////////////////////////////////////////////////////////////
  618. ////////////////////////////////////////////////////////////////////////////////////////////////////
  619. ////////////////////////////////////////////////////////////////////////////////////////////////////
  620. //
  621. //
  622. // IExtendControlbar - default implementations
  623. //
  624. //
  625. // if we need more events later on for the controlbar, a
  626. // default handler MUST be added here.
  627. //
  628. // these are for IComponent (result pane nodes)
  629. //
  630. HRESULT
  631. CInternalNode::ControlBarOnBtnClick(
  632. IN CFaxComponent* pComp,
  633. IN CFaxDataObject * lpDataObject,
  634. IN LPARAM param )
  635. /*++
  636. Routine Description:
  637. Handles a click on a toolbar button.
  638. Arguments:
  639. pComp - a pointer to the IComponent associated with this node.
  640. lpDataObject - pointer to the dataobject associated with this node
  641. param - the parameter for the message
  642. Return Value:
  643. HRESULT indicating SUCCEEDED() or FAILED()
  644. --*/
  645. {
  646. // handle a command event here
  647. return S_OK;
  648. }
  649. HRESULT
  650. CInternalNode::ControlBarOnSelect(
  651. IN CFaxComponent* pComp,
  652. IN LPARAM arg,
  653. IN CFaxDataObject * lpDataObject )
  654. /*++
  655. Routine Description:
  656. Add the toolbar here.
  657. Arguments:
  658. pComp - a pointer to the IComponent associated with this node.
  659. arg - the parameter for the message
  660. lpDataObject - pointer to the dataobject associated with this node
  661. Return Value:
  662. HRESULT indicating SUCCEEDED() or FAILED()
  663. --*/
  664. {
  665. // add and remove any custom control bars here depending on arg
  666. // if adding the first time, don't forget to CREATE the toolbars first
  667. // after the first time, just use attach and detach dependin on what you get for arg
  668. // you need the pComp->m_pControlbar interface pointer to set these things up.
  669. return S_OK;
  670. }
  671. //
  672. // these are for IComponentData (scope pane nodes)
  673. // MAY NOT WORK! (I don't use them.)
  674. //
  675. HRESULT
  676. CInternalNode::ControlBarOnBtnClick2(
  677. IN CFaxComponentData* pCompData,
  678. IN CFaxDataObject * lpDataObject,
  679. IN LPARAM param )
  680. /*++
  681. Routine Description:
  682. Handles a click on a toolbar button.
  683. Arguments:
  684. pCompData - a pointer to the IComponentData associated with this node.
  685. lpDataObject - pointer to the dataobject associated with this node
  686. param - the parameter for the message
  687. Return Value:
  688. HRESULT indicating SUCCEEDED() or FAILED()
  689. --*/
  690. {
  691. // handle a command event here
  692. return S_OK;
  693. }
  694. HRESULT
  695. CInternalNode::ControlBarOnSelect2(
  696. IN CFaxComponentData* pCompData,
  697. IN LPARAM arg,
  698. IN CFaxDataObject * lpDataObject )
  699. /*++
  700. Routine Description:
  701. Add the toolbar here.
  702. Arguments:
  703. pCompData - a pointer to the IComponentData associated with this node.
  704. arg - the parameter for the message
  705. lpDataObject - pointer to the dataobject associated with this node
  706. Return Value:
  707. HRESULT indicating SUCCEEDED() or FAILED()
  708. --*/
  709. {
  710. // add and remove any custom control bars here depending on arg
  711. // if adding the first time, don't forget to CREATE the toolbars first
  712. // after the first time, just use attach and detach dependin on what you get for arg
  713. // you need the pCompData->m_pControlbar interface pointer to set these things up.
  714. return S_OK;
  715. }
  716. ////////////////////////////////////////////////////////////////////////////////////////////////////
  717. ////////////////////////////////////////////////////////////////////////////////////////////////////
  718. ////////////////////////////////////////////////////////////////////////////////////////////////////
  719. ////////////////////////////////////////////////////////////////////////////////////////////////////
  720. //
  721. //
  722. // IDataObject special custom clipboard format handlers - default implementations
  723. //
  724. //
  725. HRESULT
  726. CInternalNode::DataObjectRegisterFormats()
  727. /*++
  728. Routine Description:
  729. Register custom clipboard formats that are specific to this
  730. node.
  731. The default implementation does nothing.
  732. Arguments:
  733. None.
  734. Return Value:
  735. HRESULT indicating SUCCEEDED() or FAILED()
  736. --*/
  737. {
  738. return S_OK;
  739. }
  740. HRESULT
  741. CInternalNode::DataObjectGetDataHere(
  742. IN FORMATETC __RPC_FAR *pFormatEtc,
  743. IN IStream * pstm )
  744. /*++
  745. Routine Description:
  746. Handles GetDataHere for custom clipboard formats specific to this
  747. particular node.
  748. The default implementation asserts since there should be no unhandled
  749. formats.
  750. Arguments:
  751. pFormatEtc - the FORMATETC struction indicating where and what the
  752. client is requesting
  753. pstm - the stream to write the data to.
  754. Return Value:
  755. HRESULT indicating SUCCEEDED() or FAILED()
  756. --*/
  757. {
  758. assert(FALSE);
  759. return DV_E_FORMATETC;
  760. }
  761. ////////////////////////////////////////////////////////////////////////////////////////////////////
  762. ////////////////////////////////////////////////////////////////////////////////////////////////////
  763. ////////////////////////////////////////////////////////////////////////////////////////////////////
  764. ////////////////////////////////////////////////////////////////////////////////////////////////////
  765. //
  766. //
  767. // Scope Pane event handlers - default implementations
  768. //
  769. //
  770. // Override these methods in your descendent classes in to handle scope pane events.
  771. // if we need more events later on for the scope pane, a
  772. // default handler MUST be added here.
  773. HRESULT
  774. CInternalNode::ScopeOnExpand(
  775. IN CFaxComponentData * pCompData,
  776. IN CFaxDataObject * lpDataObject,
  777. IN LPARAM arg,
  778. IN LPARAM param)
  779. {
  780. return S_FALSE;
  781. }
  782. HRESULT
  783. CInternalNode::ScopeOnDelete(
  784. IN CFaxComponentData * pCompData,
  785. IN CFaxDataObject * lpDataObject,
  786. IN LPARAM arg,
  787. IN LPARAM param)
  788. {
  789. return S_FALSE;
  790. }
  791. HRESULT
  792. CInternalNode::ScopeOnRename(
  793. IN CFaxComponentData * pCompData,
  794. IN CFaxDataObject * lpDataObject,
  795. IN LPARAM arg,
  796. IN LPARAM param)
  797. {
  798. return S_FALSE;
  799. }
  800. HRESULT
  801. CInternalNode::ScopeOnPropertyChange(
  802. IN CFaxComponentData * pCompData,
  803. IN CFaxDataObject * lpDataObject,
  804. IN LPARAM arg,
  805. IN LPARAM param)
  806. {
  807. return S_FALSE;
  808. }
  809. ////////////////////////////////////////////////////////////////////////////////////////////////////
  810. ////////////////////////////////////////////////////////////////////////////////////////////////////
  811. ////////////////////////////////////////////////////////////////////////////////////////////////////
  812. ////////////////////////////////////////////////////////////////////////////////////////////////////
  813. //
  814. //
  815. // Result Pane event handlers - default implementations
  816. //
  817. //
  818. // Override these methods in your descendent classes in to handle result pane events.
  819. // if we need more events later on for the result pane, a
  820. // default handler MUST be added here.
  821. HRESULT
  822. CInternalNode::ResultOnActivate(
  823. IN CFaxComponent* pComp,
  824. IN CFaxDataObject * lpDataObject,
  825. IN LPARAM arg,
  826. IN LPARAM param)
  827. {
  828. return S_FALSE;
  829. }
  830. HRESULT
  831. CInternalNode::ResultOnAddImages(
  832. IN CFaxComponent* pComp,
  833. IN CFaxDataObject * lpDataObject,
  834. IN LPARAM arg,
  835. IN LPARAM param)
  836. {
  837. return S_FALSE;
  838. }
  839. HRESULT
  840. CInternalNode::ResultOnButtonClick(
  841. IN CFaxComponent* pComp,
  842. IN CFaxDataObject * lpDataObject,
  843. IN LPARAM arg,
  844. IN LPARAM param)
  845. {
  846. return S_FALSE;
  847. }
  848. HRESULT
  849. CInternalNode::ResultOnClick(
  850. IN CFaxComponent* pComp,
  851. IN CFaxDataObject * lpDataObject,
  852. IN LPARAM arg,
  853. IN LPARAM param)
  854. {
  855. return S_FALSE;
  856. }
  857. HRESULT
  858. CInternalNode::ResultOnDoubleClick(
  859. IN CFaxComponent* pComp,
  860. IN CFaxDataObject * lpDataObject,
  861. IN LPARAM arg,
  862. IN LPARAM param)
  863. {
  864. return S_FALSE;
  865. }
  866. HRESULT
  867. CInternalNode::ResultOnDelete(
  868. IN CFaxComponent* pComp,
  869. IN CFaxDataObject * lpDataObject,
  870. IN LPARAM arg,
  871. IN LPARAM param)
  872. {
  873. return S_FALSE;
  874. }
  875. HRESULT
  876. CInternalNode::ResultOnExpand(
  877. IN CFaxComponent* pComp,
  878. IN CFaxDataObject * lpDataObject,
  879. IN LPARAM arg,
  880. IN LPARAM param)
  881. {
  882. return S_FALSE;
  883. }
  884. HRESULT
  885. CInternalNode::ResultOnMinimized(
  886. IN CFaxComponent* pComp,
  887. IN CFaxDataObject * lpDataObject,
  888. IN LPARAM arg,
  889. IN LPARAM param)
  890. {
  891. return S_FALSE;
  892. }
  893. HRESULT
  894. CInternalNode::ResultOnPropertyChange(
  895. IN CFaxComponent* pComp,
  896. IN CFaxDataObject * lpDataObject,
  897. IN LPARAM arg,
  898. IN LPARAM param)
  899. {
  900. return S_FALSE;
  901. }
  902. HRESULT
  903. CInternalNode::ResultOnQueryPaste(
  904. IN CFaxComponent* pComp,
  905. IN CFaxDataObject * lpDataObject,
  906. IN LPARAM arg,
  907. IN LPARAM param)
  908. {
  909. return S_FALSE;
  910. }
  911. HRESULT
  912. CInternalNode::ResultOnRemoveChildren(
  913. IN CFaxComponent* pComp,
  914. IN CFaxDataObject * lpDataObject,
  915. IN LPARAM arg,
  916. IN LPARAM param)
  917. {
  918. return S_FALSE;
  919. }
  920. HRESULT
  921. CInternalNode::ResultOnRename(
  922. IN CFaxComponent* pComp,
  923. IN CFaxDataObject * lpDataObject,
  924. IN LPARAM arg,
  925. IN LPARAM param)
  926. {
  927. return S_FALSE;
  928. }
  929. HRESULT
  930. CInternalNode::ResultOnSelect(
  931. IN CFaxComponent* pComp,
  932. IN CFaxDataObject * lpDataObject,
  933. IN LPARAM arg,
  934. IN LPARAM param)
  935. {
  936. // set the default verb to OPEN
  937. pComp->m_pConsoleVerb->SetDefaultVerb( MMC_VERB_OPEN );
  938. return S_FALSE;
  939. }
  940. HRESULT
  941. CInternalNode::ResultOnShow(
  942. IN CFaxComponent* pComp,
  943. IN CFaxDataObject * lpDataObject,
  944. IN LPARAM arg,
  945. IN LPARAM param)
  946. {
  947. // note this method needs to insert the images EVERY TIME IT IS CALLED.
  948. // if you override this method YOU MUST REMEMBER TO DO THIS OR YOUR ICONS WILL NOT SHOW UP.
  949. HRESULT hr = S_OK;
  950. // setup my images in the imagelist
  951. if( arg == TRUE ) {
  952. // showing result pane
  953. hr = pComp->InsertIconsIntoImageList();
  954. }
  955. return hr;
  956. }
  957. HRESULT
  958. CInternalNode::ResultOnViewChange(
  959. IN CFaxComponent* pComp,
  960. IN CFaxDataObject * lpDataObject,
  961. IN LPARAM arg,
  962. IN LPARAM param)
  963. {
  964. return S_FALSE;
  965. }