dcapi.idl 68 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192939495969798991001011021031041051061071081091101111121131141151161171181191201211221231241251261271281291301311321331341351361371381391401411421431441451461471481491501511521531541551561571581591601611621631641651661671681691701711721731741751761771781791801811821831841851861871881891901911921931941951961971981992002012022032042052062072082092102112122132142152162172182192202212222232242252262272282292302312322332342352362372382392402412422432442452462472482492502512522532542552562572582592602612622632642652662672682692702712722732742752762772782792802812822832842852862872882892902912922932942952962972982993003013023033043053063073083093103113123133143153163173183193203213223233243253263273283293303313323333343353363373383393403413423433443453463473483493503513523533543553563573583593603613623633643653663673683693703713723733743753763773783793803813823833843853863873883893903913923933943953963973983994004014024034044054064074084094104114124134144154164174184194204214224234244254264274284294304314324334344354364374384394404414424434444454464474484494504514524534544554564574584594604614624634644654664674684694704714724734744754764774784794804814824834844854864874884894904914924934944954964974984995005015025035045055065075085095105115125135145155165175185195205215225235245255265275285295305315325335345355365375385395405415425435445455465475485495505515525535545555565575585595605615625635645655665675685695705715725735745755765775785795805815825835845855865875885895905915925935945955965975985996006016026036046056066076086096106116126136146156166176186196206216226236246256266276286296306316326336346356366376386396406416426436446456466476486496506516526536546556566576586596606616626636646656666676686696706716726736746756766776786796806816826836846856866876886896906916926936946956966976986997007017027037047057067077087097107117127137147157167177187197207217227237247257267277287297307317327337347357367377387397407417427437447457467477487497507517527537547557567577587597607617627637647657667677687697707717727737747757767777787797807817827837847857867877887897907917927937947957967977987998008018028038048058068078088098108118128138148158168178188198208218228238248258268278288298308318328338348358368378388398408418428438448458468478488498508518528538548558568578588598608618628638648658668678688698708718728738748758768778788798808818828838848858868878888898908918928938948958968978988999009019029039049059069079089099109119129139149159169179189199209219229239249259269279289299309319329339349359369379389399409419429439449459469479489499509519529539549559569579589599609619629639649659669679689699709719729739749759769779789799809819829839849859869879889899909919929939949959969979989991000100110021003100410051006100710081009101010111012101310141015101610171018101910201021102210231024102510261027102810291030103110321033103410351036103710381039104010411042104310441045104610471048104910501051105210531054105510561057105810591060106110621063106410651066106710681069107010711072107310741075107610771078107910801081108210831084108510861087108810891090109110921093109410951096109710981099110011011102110311041105110611071108110911101111111211131114111511161117111811191120112111221123112411251126112711281129113011311132113311341135113611371138113911401141114211431144114511461147114811491150115111521153115411551156115711581159116011611162116311641165116611671168116911701171117211731174117511761177117811791180118111821183118411851186118711881189119011911192119311941195119611971198119912001201120212031204120512061207120812091210121112121213121412151216121712181219122012211222122312241225122612271228122912301231123212331234123512361237123812391240124112421243124412451246124712481249125012511252125312541255125612571258125912601261126212631264126512661267126812691270127112721273127412751276127712781279128012811282128312841285128612871288128912901291129212931294129512961297129812991300130113021303130413051306130713081309131013111312131313141315131613171318131913201321132213231324132513261327132813291330133113321333133413351336133713381339134013411342134313441345134613471348134913501351135213531354135513561357135813591360136113621363136413651366136713681369137013711372137313741375137613771378137913801381138213831384138513861387138813891390139113921393139413951396139713981399140014011402140314041405140614071408140914101411141214131414141514161417141814191420142114221423142414251426142714281429143014311432143314341435143614371438143914401441144214431444144514461447144814491450145114521453145414551456145714581459146014611462146314641465146614671468146914701471147214731474147514761477147814791480148114821483148414851486148714881489149014911492149314941495149614971498149915001501150215031504150515061507150815091510151115121513151415151516151715181519152015211522152315241525152615271528152915301531153215331534153515361537153815391540154115421543154415451546154715481549155015511552155315541555155615571558155915601561156215631564156515661567156815691570157115721573157415751576157715781579158015811582158315841585
  1. //
  2. //
  3. //////////////////////////////////////////////////////////////////////////////
  4. //
  5. // Copyright 2015 Autodesk, Inc. All rights reserved.
  6. //
  7. // Use of this software is subject to the terms of the Autodesk license
  8. // agreement provided at the time of installation or download, or which
  9. // otherwise accompanies this software in either electronic or hard copy form.
  10. //
  11. //////////////////////////////////////////////////////////////////////////////
  12. //
  13. //
  14. // dcapi.idl : IDL source for Design Center API
  15. //
  16. // NOTES:
  17. // The methods of IAcDcContentBrowser and IAcDcContentView have disp ids
  18. // assigned even though they are not dual or derived from IDispatch
  19. // currently. This is purely for future possibilities.
  20. //
  21. // For all VARIANT parameters, the valid data member is given in
  22. // parenthesis to indicate the valid member. For example: HRESULT
  23. // AddPaletteItem(... VARIANT varImageIndex // index of image(VT_I4)..);
  24. // indicates lVal member of varImageIndex would have valid value.
  25. //
  26. // A typical component that wants to provide its content to DesignCenter
  27. // implements IAcDcContentView and optionally IAcDcContentFinder. Some
  28. // miscellaneous aspects that a component may have to do:
  29. //
  30. // 1. Write a comparison function to sort the items that it gives to DC. This
  31. // function will be called for each item when DC sorts the items.
  32. // 2. Correctly handle the errors by returning valid HRESULTs. It may want to
  33. // return specific custom error codes by implementing an error object that
  34. // implements IErrorInfo.
  35. //
  36. import "oaidl.idl";
  37. import "ocidl.idl";
  38. #include "dcconst.idl"
  39. #include "dcdispid.h"
  40. [
  41. object,
  42. uuid(9F8AB2D8-D57F-11D1-A92C-0060B0A1F6BB),
  43. helpstring("IAcDcContentBrowser Interface"),
  44. pointer_default(unique)
  45. ]
  46. // IAcDcContentBrowser interface
  47. interface IAcDcContentBrowser : IUnknown
  48. {
  49. //
  50. // Adds an item to DesignCenter palette.
  51. //
  52. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  53. //
  54. // bstrText
  55. // A BSTR that specifies the item text.
  56. // varImageIndex
  57. // int nImageIndex = varImageIndex.lVal;
  58. //
  59. // A VARIANT that specifies the image index of the icon in the component's
  60. // image list. The component should have called SetPaletteImageList or
  61. // SetNavigatorImageList on the given IAcDcContentBrowser object of
  62. // DesignCenter in Initialize to set its small and large image lists.
  63. // pvarItemData
  64. // A pointer to a VARIANT that specifies the component-defined data that
  65. // has be associated with the item. The component can provide any
  66. // 32-bit data for the data. This is typically used in sorting the
  67. // items in the palette with a component defined comparison function.
  68. // The data contained in this VARIANT is meaningful only to the
  69. // component. The memory for this has to be allocated on heap so that
  70. // the data is available at the time of sorting. DesignCenter will
  71. // supply this pointer back to the component in DeleteItemData method
  72. // when all the items provided by the component are being deleted. The
  73. // component should delete all the memory allocated for this variable in
  74. // that method.
  75. // pvarAddedItemIndex
  76. // int nAddedItemIndex = pvarAddedItemIndex->lVal;
  77. //
  78. // A pointer a VARIANT that will contain the index of the added item.
  79. //
  80. // Components can use this method to add an item to DesignCenter palette. The
  81. // items will show up with item texts with appropriate icons provided for each
  82. // item. This function returns the index of the added item in pvarAddedItemIndex.
  83. //
  84. [id(DISPID_IAcDcContentBrowser_AddPaletteItem), helpstring("method AddPaletteItem")]
  85. HRESULT AddPaletteItem(
  86. [in, string] BSTR bstrText // text of item
  87. , [in] VARIANT varImageIndex // index of image(VT_I4)
  88. , [in] VARIANT *pvarItemData // item specific data
  89. , [out, retval] VARIANT *pvarAddedItemIndex // index of added item(VT_I4)
  90. );
  91. //
  92. // Adds a node in the navigator of DesignCenter. This is valid only in case of
  93. // components which participate in custom view of DesignCenter.
  94. //
  95. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  96. //
  97. // varhRelativeNode
  98. // HTREEITEM hItem = (HTREEITEM)(varhRelativeNode.lVal);
  99. //
  100. // A VARIANT that specifies the HTREEITEM of a relative node with reference to
  101. // which DesignCenter should create a new navigator node in the tree.
  102. // sRelationship
  103. // A flag that is taken from dcNavNodeRelation enumeration that indicates what
  104. // type of relationship does the new node would have with reference to
  105. // varhRelativeNode.
  106. // bstrText
  107. // A BSTR that specifies the text of the node.
  108. // varIconIndex
  109. // int nIconIndex = varIconIndex.lVal;
  110. //
  111. // A VARIANT that specifies the index of the unselected state icon to be used
  112. // for the new node.
  113. // varSelectedIconIndex
  114. // int nSelIconIndex = varSelectedIconIndex.lVal;
  115. //
  116. // A VARIANT that specifies the index of the selected state icon to be used for
  117. // the new node.
  118. // varbMayhaveChildren
  119. // bool bMayHaveChildren = varbMayhaveChildren.boolVal;
  120. //
  121. // A VARIANT to indicate if the new node may have children or not. If the
  122. // component plans to add children nodes to the newly created node, this
  123. // VARIANT should have a TRUE value in boolVal.
  124. // pvarAddedNodeID
  125. // HTREEITEM hAddedNode = (HTREEITEM)pvarAddedNodeID->lVal;
  126. //
  127. // A pointer a VARIANT that contains the handle to HTREEITEM of the newly
  128. // created node. This node handle can be used to create other nodes.
  129. //
  130. // Components which participate in custom content view typically call this to add
  131. // nodes to the navigator view of DesignCenter. This function returns a handle to
  132. // the added node in pvarAddedNodeID.
  133. //
  134. [id(DISPID_IAcDcContentBrowser_AddNavigatorNode), helpstring("method AddNavigatorNode")]
  135. HRESULT AddNavigatorNode(
  136. [in] VARIANT varhRelativeNode // relative node id(VT_I4)
  137. , [in] dcNavNodeRelation sRelationship // relationship to relative(lVal)
  138. , [in, string] BSTR bstrText // text of the node
  139. , [in] VARIANT varIconIndex // icon index(VT_I4)
  140. , [in] VARIANT varSelectedIconIndex // selected icon index(VT_I4)
  141. , [in] VARIANT varbMayhaveChildren // possibly a non-leaf node(VT_BOOL)
  142. , [out, retval] VARIANT *pvarAddedNodeID // added node id(VT_I4)
  143. );
  144. //
  145. // Gets the handle to the window of DesignCenter frame. This handle is READ-ONLY -
  146. // it should never be destroyed.
  147. //
  148. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  149. //
  150. // pvarhFrameWindow
  151. // HWND hDCFrame = (HWND)(pvarhFrameWindow->lVal);
  152. //
  153. // A pointer to a VARIANT that contains the handle to DesignCenter frame
  154. // window.
  155. //
  156. // Components should never destroy the handle returned by this function. This
  157. // handle is typically used when a component wants to display a context menu for
  158. // any item that it is displaying in DesignCenter. This function returns the
  159. // Windows handle of DesignCenter frame in pvarhFrameWindow.
  160. //
  161. [id(DISPID_IAcDcContentBrowser_GetDCFrameWindow), helpstring("method GetDCFrameWindow")]
  162. HRESULT GetDCFrameWindow(
  163. // handle to DC frame window(VT_I4); typecast it to HWND
  164. [out, retval] VARIANT *pvarhFrameWindow
  165. );
  166. //
  167. // Sets the description text for an item selected in palette.
  168. //
  169. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  170. //
  171. // bstrDescription
  172. // A BSTR that specifies the description of an item that is selected in the
  173. // palette of DesignCenter
  174. //
  175. // Components use this function to show the description of a selected item in the
  176. // description pane of DesignCenter. The components need to cache the selected
  177. // item during IAcDcContentView::PaletteMouseDown or
  178. // IAcDcContentView::PaletteMouseUp notifications. When the user opens the
  179. // description pane in DesignCenter, the description of the component item would be
  180. // shown.
  181. //
  182. [id(DISPID_IAcDcContentBrowser_SetItemDescription), helpstring("method SetItemDescription")]
  183. HRESULT SetItemDescription(
  184. [in, string] BSTR bstrDescription // description
  185. );
  186. //
  187. // Sets the image list which contain icons for items in the palette; this image
  188. // list will be used by DesignCenter when displaying the images of the contents
  189. // supplied by a component with calls to AddPaletteItem.
  190. //
  191. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  192. //
  193. // varhImageList
  194. // HIMAGELIST hImageList = (HImageList)(varhImageList.lVal);
  195. //
  196. // A VARIANT that contains a handle to a small/large image list depending on
  197. // the flag in varbLarge. If varbLarge is TRUE, then the handle is expected to
  198. // be of large image list of the component. If varbLarge is FALSE, then the
  199. // handle is expected to be of small image list of the component.
  200. // varbLarge
  201. // bool bLargeImageList = varbLarge.boolVal;
  202. //
  203. // A VARIANT that specifies whether varhImageList is that of a small or a large
  204. // image list.
  205. //
  206. // Components should call this function before adding any items to the palette of
  207. // DesignCenter by calls to AddPaletteItem. This enables DesignCenter to fetch the
  208. // correct icon indices for the items when it displays them.
  209. //
  210. [id(DISPID_IAcDcContentBrowser_SetPaletteImageList), helpstring("method SetPaletteImageList")]
  211. HRESULT SetPaletteImageList(
  212. [in] VARIANT varhImageList // HIMAGELIST of image list(VT_I4)
  213. , [in] VARIANT varbLarge // is the image list large?(VT_BOOL)
  214. );
  215. //
  216. // Sets the image list to be used for icons of nodes in the navigator; valid only
  217. // for components which display their contents in the custom view of DesignCenter.
  218. //
  219. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  220. //
  221. // varhImageList
  222. // HIMAGELIST hImageList = (HImageList)(varhImageList.lVal);
  223. //
  224. // A VARIANT that contains a handle to small image list that contains icons for
  225. // nodes that the component has added in the DesignCenter custom view.
  226. // pvarImageListOffset
  227. // int nImageOffset = pvarImageListOffset->lVal;
  228. //
  229. // A VARIANT that will contain the offset of the first icon in varhImageList in
  230. // the small image list maintained by DesignCenter
  231. //
  232. // Components should call this function before adding any nodes to custom view of
  233. // DesignCenter. The icons in the imagelist would be used to display the nodes in
  234. // DesignCenter custom view. This function returns the offset of the first icon in
  235. // varhImageList in pvarImageListOffset. This function has to be called
  236. // only once(in IAcDcContentView::SetImageLists method).
  237. //
  238. [id(DISPID_IAcDcContentBrowser_SetNavigatorImageList), helpstring("method SetNavigatorImageList")]
  239. HRESULT SetNavigatorImageList(
  240. [in] VARIANT varhImageList, // HIMAGELIST of image list(VT_I4)
  241. [out, retval] VARIANT *pvarImageListOffset // offset of the component image
  242. // list in global image list(VT_I4)
  243. );
  244. //
  245. // Sets the palette of DC to allow selection of multiple items.
  246. //
  247. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  248. //
  249. // varbMultiSelect
  250. // bool bMultiSelect = (bool)varbMultiSelect.boolVal;
  251. //
  252. // A VARIANT that contains a boolean to indicate whether multiple selection
  253. // should be allowed or not
  254. //
  255. // Components can call this function to allow multiple selections of items in the
  256. // palette of DC. By default, the palette of DC allows selection of only one item
  257. // at a time.
  258. //
  259. [id(DISPID_IAcDcContentBrowser_SetPaletteMultiSelect), helpstring("method SetPaletteMultiSelect")]
  260. HRESULT SetPaletteMultiSelect(
  261. [in] VARIANT varbMultiSelect // should allow multi selection(VT_BOOL)
  262. );
  263. //
  264. // Inserts a column in the detail view of palette of DC.
  265. //
  266. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  267. //
  268. // varIndex
  269. // int nColumnIndex = varIndex.lVal;
  270. //
  271. // A VARIANT which contains the index of the column to insert. The column
  272. // indices should begin with 1.
  273. // bstrText
  274. // A BSTR which contains the name of the column. This name would appear as a
  275. // header of the column being inserted in the detail view of DC.
  276. // eFormat
  277. // A flag taken from dcPalColAlignment enums to indicate how the inserted
  278. // column is to be justified.
  279. //
  280. // Components can call this function to insert a column in the details view of DC
  281. // palette. This column is typically used to show the subitems of an item in DC
  282. // palette using SetPaletteSubItem().
  283. //
  284. [id(DISPID_IAcDcContentBrowser_InsertPaletteColumn), helpstring("method InsertPaletteColumn")]
  285. HRESULT InsertPaletteColumn(
  286. [in] VARIANT varIndex // column index(VT_I4)
  287. , [in] BSTR bstrText // column text
  288. , [in] dcPalColAlignment eFormat // format: left, right, center aligned(VT_I4)
  289. );
  290. //
  291. // Deletes all the items which are currently shown in DC palette.
  292. //
  293. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  294. //
  295. // Components can call this function in response to either
  296. // IAcDcContentView::Refresh() call by DC or any other situation that requires a
  297. // modification of items that are shown in DC palette. Components should call
  298. // RestorePaletteSelection after they fill all the new items in DC palette. A
  299. // typical sequence would be:
  300. // ...
  301. // // delete all the items in the palette
  302. // m_pContentBrowser->DeleteAllPaletteItems();
  303. // // fill the palette with new items in DC palette(component defined)
  304. // FillDCPalette(); // refer to an example in NavigatorNodeClick
  305. // // ask DC to restore the previously selected item
  306. // m_pContentBrowser->RestorePaletteSelection();
  307. //
  308. [id(DISPID_IAcDcContentBrowser_DeleteAllPaletteItems), helpstring("method DeleteAllPaletteItems")]
  309. HRESULT DeleteAllPaletteItems();
  310. //
  311. // Gets the current node text of the current view of DC.
  312. //
  313. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  314. //
  315. // bstrText
  316. // A pointer to a BSTR that would contain the text of the currently selected
  317. // node. The component is responsible for freeing the memory allocated for
  318. // this variable by calling ::SysFreeString function.
  319. //
  320. // Components can call this function to get the complete qualified path of the
  321. // currently selected node text in the current view of DC. A component typically
  322. // calls this to make sure the contents of a node for which it is going to refresh
  323. // the items in is the same as the one it expects. The text is returned in
  324. // bstrText.
  325. //
  326. [id(DISPID_IAcDcContentBrowser_GetSelectedNavNodeText), helpstring("method GetSelectedNavNodeText")]
  327. HRESULT GetSelectedNavNodeText([out, string] BSTR* bstrText);
  328. //
  329. // Gets the current mode of DC.
  330. //
  331. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  332. //
  333. // psMode
  334. // A pointer to a dcContentMode enum that indicates the view mode that DC is
  335. // currently in.
  336. //
  337. // Components can call this function to get the current view mode of DC. There are
  338. // three views of DC -- desktop, open drawings and custom view. The enum values
  339. // of dcContentMode indicate this modes. The current mode is returned in psMode.
  340. //
  341. [id(DISPID_IAcDcContentBrowser_GetCurrentViewMode), helpstring("method GetCurrentViewMode")]
  342. HRESULT GetCurrentViewMode(
  343. [out, retval] dcContentMode *psMode // DC mode
  344. );
  345. //
  346. // Sets the subitems of an already existing palette item in DC.
  347. //
  348. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  349. //
  350. // varItemIndex
  351. // int nItemIndex = varItemIndex.lVal;
  352. //
  353. // A VARIANT that contains the index of the item for which the sub item is
  354. // being set.
  355. // varColumnIndex
  356. // int nColumnIndex = varColumnIndex.lVal;
  357. //
  358. // A VARIANT that contains the column index the sub item belongs to.
  359. // bstrSubItemText
  360. // A BSTR that contains the text of the sub item. This text appears in the
  361. // column varColumnIndex in details view of DC palette.
  362. //
  363. // Components call this function to add sub items to items already added in DC
  364. // palette via AddPaletteItem(). These sub items will appear in separate columns
  365. // in detail view of DC.
  366. //
  367. // set the subitems of a palette item; this can be used to add sub items to
  368. // an already existing item via calls to AddPaletteItem.
  369. //
  370. [id(DISPID_IAcDcContentBrowser_SetPaletteSubItem), helpstring("method SetPaletteSubItem")]
  371. HRESULT SetPaletteSubItem(
  372. [in] VARIANT varItemIndex // item index
  373. , [in] VARIANT varColumnIndex // column index
  374. , [in] BSTR bstrSubItemText // sub item text
  375. );
  376. //
  377. // Sorts the palette items according to a component given function.
  378. //
  379. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  380. //
  381. // varpfnFunction
  382. // PFNLVCOMPARE pfnCompareFunc = (PFNLVCOMPARE)(varpfnFunction.lVal);
  383. //
  384. // A VARIANT that contains a 32-bit pointer to the address of a function that
  385. // has the following signature:
  386. //
  387. // int CALLBACK CompareFunc(LPARAM lParam1, LPARAM lParam2, LPARAM
  388. // lParamSort);
  389. //
  390. // This function(CompareFunc) is a function that is similar to Windows List
  391. // control comparison function.
  392. //
  393. // The comparison function must return a negative value if the first item
  394. // should precede the second, a positive value if the first item should follow
  395. // the second, or zero if the two items are equivalent.
  396. //
  397. // The lParam1 and lParam2 parameters specify the item data for the two items
  398. // being compared. The lParamSort parameter is the same as varSortData
  399. // explained next.
  400. //
  401. // See NavigatorNodeClick for an example of this function.
  402. // varSortData
  403. // A VARIANT that contains the component defined 32-bit data that is meaningful
  404. // to the comparison function. This is typically used to indicate whether the
  405. // sorting needs to happen in ascending or descending manner. But it can also
  406. // be a pointer to a structure that contains this sorting information as well
  407. // as the column index for which the sorting has to happen.
  408. //
  409. // Components can call this function to ask DC to sort the items that are displayed
  410. // in DC palette.
  411. //
  412. [id(DISPID_IAcDcContentBrowser_SortPaletteItems), helpstring("method SortPaletteItems")]
  413. HRESULT SortPaletteItems(
  414. [in] VARIANT varpfnFunction // pointer to function(PFNLVCOMPARE)(VT_I4)
  415. , [in] VARIANT varSortData // sort data(VT_I4)
  416. );
  417. //
  418. // Restores previously selected item selection in the palette.
  419. //
  420. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  421. //
  422. // This can be used to ask the DesignCenter to restore the selection state of a
  423. // previously selected item. If a component clears/refreshes its contents in DC
  424. // palette, it can ask the DC to try to restore the previous selection since DC
  425. // maintains a cache of previous selection. This function should be called after
  426. // filling the palette with items because this would update the status bar of DC of
  427. // the selected item.
  428. //
  429. [id(DISPID_IAcDcContentBrowser_RestorePaletteSelection), helpstring("method RestorePaletteSelection")]
  430. HRESULT RestorePaletteSelection();
  431. //
  432. // Gets the handle to the status bar of DC frame; READ-ONLY.
  433. //
  434. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  435. //
  436. // pvarhStatusBar
  437. // HWND hDCStatusBar = (HWND)(pvarhStatusBar->lVal);
  438. //
  439. // A pointer to a VARIANT that contains the handle to DC status bar window.
  440. //
  441. // Components can call this function to obtain the Windows handle to the status bar
  442. // of DC. This handle should never be destroyed. The returned handle can be used
  443. // in updating the status bar during preview/description display to keep the user
  444. // informed of the task the component is performing. The handle is returned in
  445. // pvarhStatusBar.
  446. //
  447. [id(DISPID_IAcDcContentBrowser_GetDCStatusBar), helpstring("method GetDCStatusBar")]
  448. HRESULT GetDCStatusBar(
  449. // handle to DC status bar window(VT_I4); typecast it to HWND
  450. [out, retval] VARIANT *pvarhStatusBar
  451. );
  452. //
  453. // Gets the DC panes' info.
  454. //
  455. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  456. //
  457. // ePane
  458. // A flag from dcPane enum to describe the pane for which the information is
  459. // requested.
  460. // pvarWidth
  461. // int nWidth = pvarWidth->lVal;
  462. //
  463. // A pointer to a VARIANT that contains the width of the requested pane in
  464. // pixels.
  465. // pvarHeight
  466. // int nHeight = pvarHeight->lVal;
  467. //
  468. // A pointer to a VARIANT that contains the height of the requested pane in
  469. // pixels.
  470. //
  471. // This function can be used to get the width and height of DC panes. DC has three
  472. // panes: navigator pane, preview pane and description pane. Returns width and height
  473. // and height of requested pane in pvarWidth and pvarHeight.
  474. //
  475. // An example:
  476. // ...
  477. // dcPane ePane = dcPreview;
  478. // _variant_t varWidth, varHeight;
  479. // HRESULT hRes = m_spContentBrowser->GetPaneInfo(ePane, &varWidth, &varHeight);
  480. // ...
  481. //
  482. [id(DISPID_IAcDcContentBrowser_GetPaneInfo), helpstring("method GetPaneInfo")]
  483. HRESULT GetPaneInfo(
  484. [in] dcPane ePane // pane for which info is needed
  485. , [out] VARIANT *pvarWidth // width of the pane (VT_I4)
  486. , [out] VARIANT *pvarHeight // height of the pane (VT_I4)
  487. );
  488. //
  489. // Sets the DC palette view type.
  490. //
  491. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  492. //
  493. // eViewType
  494. // A flag from dcPalViewType enum that contains the view type of the palette to
  495. // be set.
  496. //
  497. // Components can call this function to change the view types of palette of DC.
  498. // The view types of the palette are list, details, small and large icon view.
  499. //
  500. [id(DISPID_IAcDcContentBrowser_SetPaletteViewType), helpstring("method SetPaletteViewType")]
  501. HRESULT SetPaletteViewType(
  502. [in] dcPalViewType eViewType // palette view type
  503. );
  504. //
  505. // Makes the DC navigate to the given path in given view.
  506. //
  507. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  508. //
  509. // eViewMode
  510. // A flag from dcContentMode enum that indicates the view mode the DC is
  511. // requested to navigate to.
  512. // bstrPath
  513. // A BSTR that contains the exact fully qualified path that is meaningful in
  514. // eViewMode. Fully qualified paths are different in different modes of DC: in
  515. // desktop, they are of the form, "<actual file/directory path on disk>"; in
  516. // open drawings, the are of the from, "Open Drawings\<name of dwg>\<name of
  517. // content type>;in custom view, they are of the form, "<application
  518. // name>\<application defined subnode>\...".
  519. //
  520. // For example, in desktop, the path can be "c:\winnt"; in open drawings, the
  521. // path can be "open drawings\foo.dwg\Blocks"; in custom view, the path can be
  522. // "aec\doors".
  523. //
  524. // Components can request DC to navigate to a valid given path in a given view
  525. // using this function. This function is currently supported only for custom view.
  526. //
  527. [id(DISPID_IAcDcContentBrowser_NavigateTo), helpstring("method NavigateTo")]
  528. HRESULT NavigateTo(
  529. [in] dcContentMode eViewMode
  530. , [in] BSTR bstrPath
  531. );
  532. }; // interface IAcDcContentBrowser
  533. [
  534. object,
  535. uuid(625cecb0-a722-11d1-9715-92a923000000),
  536. helpstring("IAcDcContentView interface"),
  537. pointer_default(unique)
  538. ]
  539. // IAcDcContentView interface
  540. interface IAcDcContentView : IUnknown
  541. {
  542. //
  543. // Called by DC to initialize the registered component.
  544. //
  545. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  546. //
  547. // varBrowser
  548. // IUnknown *pBrowser = varBrowser.punkVal;
  549. //
  550. // A pointer to IUnknown interface of the browser object implemented by DC.
  551. // varReserved
  552. // Reserved parameter.
  553. //
  554. // DesignCenter calls this function first to initialize the component. It
  555. // also gives the IUnknown pointer of the browser object that implements
  556. // IAcDcContentBrowser interface in varBrowser. This browser interface
  557. // pointer should be cached by the component and can be used to interact
  558. // with DesignCenter by calling methods in IAcDcContentBrowser interface.
  559. //
  560. //
  561. [id(DISPID_IAcDcContentView_Initialize), helpstring("Initializes the content")]
  562. HRESULT Initialize(
  563. [in] VARIANT varBrowser // Back pointer to IAcDcContentBrowser(VT_UNKNOWN)
  564. , [in] VARIANT varReserved // Reserved
  565. );
  566. //
  567. // Requested by DC to the component to ask it to set its image lists on DC.
  568. // The image lists provided by the component will be used by the DC palette
  569. // when it displays the contents of the component.
  570. //
  571. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  572. //
  573. // DesignCenter calls this function immediately after
  574. // IAcDcContentView::Initialize. The component should call
  575. // IAcDcContentBrowser::SetPaletteImageList with its small and large image
  576. // lists that were created in IAcDcContentView::Initialize.
  577. //
  578. // In addition to this, the components that participate in custom view mode
  579. // of DC should call IAcDcContentBrowser::SetNavigatorImageList to set the
  580. // image list to be used for navigator nodes in custom view.
  581. //
  582. [id(DISPID_IAcDcContentView_SetImageLists), helpstring("Sets the image lists")]
  583. HRESULT SetImageLists();
  584. //
  585. // DesignCenter calls this function whenever "Refresh" context menu in the
  586. // palette background of DC is chosen by the user.
  587. //
  588. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  589. //
  590. // If applicable, the component should clear the palette, refill the palette
  591. // with changed/new items, and then restore the selection of previously
  592. // selected item by calling appropriate methods on the browser object. The
  593. // node for which the component is displaying the content should have been
  594. // cached in IAcDcContentView::NavigatorNodeClick method and the content of
  595. // that node should be refilled in response to this function.
  596. //
  597. [id(DISPID_IAcDcContentView_Refresh), helpstring("Refreshes the content")]
  598. HRESULT Refresh();
  599. //
  600. // Called by DC when a navigator node is expanding.
  601. //
  602. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  603. //
  604. // varhNode
  605. // HTREEITEM hExpandingNode = (HTREEITEM)(varhNode.lVal);
  606. //
  607. // A VARIANT that contains the handle to the navigator node which needs
  608. // expanding.
  609. // bstrNodeText
  610. // A BSTR that contains the fully qualified path of the expanding node.
  611. //
  612. // Currently, this applies only to components which are participating in
  613. // custom view of DC.
  614. // The component is expected to create children of the node that is expanding.
  615. //
  616. [id(DISPID_IAcDcContentView_NavigatorNodeExpanding), helpstring("Event fired when a navigator node is clicked")]
  617. HRESULT NavigatorNodeExpanding(
  618. [in] VARIANT varhNode // expanding node id(VT_I4)
  619. , [in, string] BSTR bstrNodeText // full text of the node
  620. );
  621. //
  622. // Called by DC when a navigator node is collapsing.
  623. //
  624. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  625. //
  626. // varhNode
  627. // HTREEITEM hCollapsingNode = (HTREEITEM)(varhNode.lVal);
  628. //
  629. // A VARIANT that contains the handle to the navigator node which needs
  630. // collapsing.
  631. // bstrNodeText
  632. // A BSTR that contains the fully qualified path of the collapsing node.
  633. //
  634. // Currently, this applies only to components which are participating in
  635. // custom view of DC.
  636. //
  637. [id(DISPID_IAcDcContentView_NavigatorNodeCollapsing), helpstring("Event fired when a navigator node is collapsed")]
  638. HRESULT NavigatorNodeCollapsing(
  639. [in] VARIANT varhNode // collapsing node id(VT_I4)
  640. , [in, string] BSTR bstrNodeText // full text of the node
  641. );
  642. //
  643. // Called by DC when the content of a node needs to be filled in the palette.
  644. //
  645. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  646. //
  647. // varhNode
  648. // HTREEITEM hClickedNode = (HTREEITEM)(varhNode.lVal);
  649. //
  650. // A VARIANT that contains the handle to the navigator node that is clicked by
  651. // the user.
  652. // bstrNodeText
  653. // A BSTR that contains the fully qualified path of the node.
  654. //
  655. // DC calls this function on the component whenever:
  656. //
  657. // 1. the user single/double clicks(with left mouse button) or chooses
  658. // "Explore" context
  659. // menu item on a file which the component has registered as a container(in
  660. // desktop and open drawings mode).
  661. // 2. the user single/double clicks(with left mouse button) or chooses
  662. // "Explore" context
  663. // menu item on a place holder which the component has registered as a place
  664. // holder of a file(in desktop and open drawings mode).
  665. // 3. the user single/double clicks(with left mouse button) or chooses "Explore"
  666. // context menu item by right clicking on a shortcut file(.lnk extension) that
  667. // points to a file which the component has registered as a container(in desktop
  668. // view).
  669. // 4. the user single/double clicks(with left mouse button) in a node that is
  670. // registered and handled by the component(in custom view).
  671. //
  672. // A component typically does the following:
  673. // 1. Optionally enables the multi-item selection of palette items in DC by calling
  674. // IAcDcContentBrowser::SetPaletteMultiSelect.
  675. // 2. Cache the fully qualified path of the node.
  676. // 3. Iterates through a collection of items that it wants to display in DC
  677. // palette.
  678. // 4. Creates some data to associate with each item that it can use to sort
  679. // the items when asked by DC.
  680. // 5. Calls IAcDcContentBrowser::AddPaletteItem for each item.
  681. // 6. Calls IAcDcContentBrowser::SortPaletteItems to sort all the items it
  682. // added.
  683. //
  684. // Components which participate in both desktop and open drawings mode of DC should
  685. // always make sure that, at the time of adding the items, the DC mode is indeed in
  686. // the mode that they are expecting DC to be in by calling
  687. // IAcDcContentBrowser::GetCurrentViewMode since the user may have changed the
  688. // modes between Autocad event calls(for example, reactor notification calls).
  689. //
  690. [id(DISPID_IAcDcContentView_NavigatorNodeClick), helpstring("Event fired when a navigator node is clicked")]
  691. HRESULT NavigatorNodeClick(
  692. [in] VARIANT varhNode // node id(VT_I4)
  693. , [in, string] BSTR bstrNodeText // full text of the node
  694. );
  695. //
  696. // Called by DC when the mouse is released in the navigator.
  697. //
  698. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  699. //
  700. // varhNode
  701. // HTREEITEM hClickedNode = (HTREEITEM)(varhNode.lVal);
  702. //
  703. // A VARIANT that contains the handle to the navigator node on which the mouse
  704. // has been released.
  705. // bstrNodeText
  706. // A BSTR that contains the fully qualified path of the clicked node.
  707. // varX
  708. // int nMouseX = varX.lVal;
  709. //
  710. // A VARIANT that contains the x coordinate(in screen coordinates, in pixels)
  711. // of the mouse when it was released.
  712. // varY
  713. // int nMouseY = varY.lVal;
  714. //
  715. // A VARIANT that contains the y coordinate(in screen coordinates, in pixels)
  716. // of the mouse when it was released.
  717. //
  718. // Components can respond to this event by popping up a context menu that is
  719. // meaningful for the given node at the mouse coordinates supplied. Currently,
  720. // this event is only sent to components participating in custom view of DC.
  721. //
  722. [id(DISPID_IAcDcContentView_NavigatorMouseUp), helpstring("Event fired when the mouse is released in navigator")]
  723. HRESULT NavigatorMouseUp(
  724. [in] VARIANT varhNode // node id(VT_I4)
  725. , [in, string] BSTR bstrNodeText // full text of the node
  726. , [in] VARIANT varX // x position of mouse(VT_I4)
  727. , [in] VARIANT varY // y position of mouse(VT_I4)
  728. );
  729. //
  730. // Called by DC when a palette item is clicked(single click) by the user.
  731. //
  732. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  733. //
  734. // bstrItemText
  735. // A BSTR that contains fully qualified path of the item that is clicked.
  736. //
  737. // If applicable, components should respond to this by displaying the description
  738. // of the clicked item by calling IAcDcContentBrowser::SetItemDescription. The
  739. // component should first check if the description pane of DC is exposed by calling
  740. // IAcDcContentBrowser::GetPaneInfo before calling
  741. // IAcDcContentBrowser::SetItemDescription. Also, the preview pane should be
  742. // rendered with the visual thumbnail sketch of the clicked item. However, this is
  743. // done via RenderPreviewWindow call from DC. DC calls RenderPreviewWindow on the
  744. // component whenever the preview pane is up and needs rendering and there is a
  745. // selected item in the palette.
  746. //
  747. [id(DISPID_IAcDcContentView_PaletteItemClick), helpstring("Event fired when palette items are selected")]
  748. HRESULT PaletteItemClick(
  749. [in, string] BSTR bstrItemText // full text of the item
  750. );
  751. //
  752. // Called by DC when a palette item is double clicked. A typical component
  753. // may initiate an "Insert" type of action in AutoCAD's current active
  754. // document.
  755. //
  756. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  757. //
  758. // bstrItemText
  759. // A BSTR that contains fully qualified path of the item that is clicked.
  760. //
  761. // Components should do an "insert" action in AutoCAD for the item that is double
  762. // clicked.
  763. //
  764. [id(DISPID_IAcDcContentView_PaletteItemDblClick), helpstring("Event fired when a palette item is double clicked")]
  765. HRESULT PaletteItemDblClick(
  766. [in, string] BSTR bstrItemText // full text of item
  767. );
  768. //
  769. // Called by DC when the user has clicked the right mouse button on item(s) in the
  770. // palette.
  771. //
  772. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  773. //
  774. // varButton
  775. // int nButton = varButton.lVal;
  776. //
  777. // A VARIANT that contains a value that indicates which button was pressed.
  778. // The component should only respond if nButton == 2(right mouse button).
  779. // varItemTexts
  780. // SAFEARRAY *psaItemTexts = varItemTexts.parray;
  781. //
  782. // A VARIANT that contains a pointer to a SAFEARRAY of BSTRs that represent the
  783. // names of the items being selected in the palette of DC when the mouse up
  784. // happened.
  785. // varX
  786. // int nMouseX = varX.lVal;
  787. //
  788. // A VARIANT that contains the x coordinate(in screen coordinates, in pixels)
  789. // of the mouse when it was released.
  790. //
  791. // varY
  792. // int nMouseY = varY.lVal;
  793. //
  794. // A VARIANT that contains the y coordinate(in screen coordinates, in pixels)
  795. // of the mouse when it was released.
  796. //
  797. // If applicable, the component should display a context menu in response to this
  798. // event. It is recommended that a window owned by the component be made the owner
  799. // of the context menu for displaying the help texts for each menu item by calling
  800. // SetWindowText on DC status bar which can be obtained by calling
  801. // IAcDcContentBrowser::GetDcstatusbar.
  802. //
  803. [id(DISPID_IAcDcContentView_PaletteColumnClick), helpstring("Event fired when a column is clicked in the palette")]
  804. HRESULT PaletteColumnClick(
  805. [in] VARIANT varIndex // index of column(VT_I4)
  806. );
  807. //
  808. // Called by DC when the user has clicked the right mouse button on item(s) in the
  809. // palette.
  810. //
  811. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  812. //
  813. // varButton
  814. // int nButton = varButton.lVal;
  815. //
  816. // A VARIANT that contains a value that indicates which button was pressed.
  817. // The component should only respond if nButton == 2(right mouse button).
  818. // varItemTexts
  819. // SAFEARRAY *psaItemTexts = varItemTexts.parray;
  820. //
  821. // A VARIANT that contains a pointer to a SAFEARRAY of BSTRs that represent the
  822. // names of the items being selected in the palette of DC when the mouse up
  823. // happened.
  824. // varX
  825. // int nMouseX = varX.lVal;
  826. //
  827. // A VARIANT that contains the x coordinate(in screen coordinates, in pixels)
  828. // of the mouse when it was released.
  829. //
  830. // varY
  831. // int nMouseY = varY.lVal;
  832. //
  833. // A VARIANT that contains the y coordinate(in screen coordinates, in pixels)
  834. // of the mouse when it was released.
  835. //
  836. // If applicable, the component should display a context menu in response to this
  837. // event. It is recommended that a window owned by the component be made the owner
  838. // of the context menu for displaying the help texts for each menu item by calling
  839. // SetWindowText on DC status bar which can be obtained by calling
  840. // IAcDcContentBrowser::GetDcstatusbar.
  841. //
  842. [id(DISPID_IAcDcContentView_PaletteMouseUp), helpstring("Event fired when the mouse is released in palette")]
  843. HRESULT PaletteMouseUp(
  844. [in] VARIANT varButton // button that is pressed(VT_I4)
  845. , [in] VARIANT varItemTexts // item texts (VT_ARRAY)
  846. , [in] VARIANT varX // x position of mouse(VT_I4)
  847. , [in] VARIANT varY // y position of mouse(VT_I4)
  848. );
  849. //
  850. // Called by DC when the mouse is pressed down in the palette.
  851. //
  852. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  853. //
  854. // varButton
  855. // int nButton = varButton.lVal;
  856. //
  857. // A VARIANT that contains a value that indicates which button was pressed.
  858. // bstrItemText
  859. // A BSTR that contains the fully qualified path of the item.
  860. // varX
  861. // int nMouseX = varX.lVal;
  862. //
  863. // A VARIANT that contains the x coordinate(in screen coordinates, in pixels)
  864. // of the mouse when it was pressed.
  865. // varY
  866. // int nMouseY = varY.lVal;
  867. //
  868. // A VARIANT that contains the y coordinate(in screen coordinates, in pixels)
  869. // of the mouse when it was pressed.
  870. //
  871. // Components can take whatever action that is meaningful in response to this
  872. // event.
  873. //
  874. [id(DISPID_IAcDcContentView_PaletteMouseDown), helpstring("Event fired when the mouse is pressed in palette")]
  875. HRESULT PaletteMouseDown(
  876. [in] VARIANT varButton // button that is pressed(VT_I4)
  877. , [in, string] BSTR bstrItemText // full text of the item
  878. , [in] VARIANT varX // x position of mouse(VT_I4)
  879. , [in] VARIANT varY // y position of mouse(VT_I4)
  880. );
  881. //
  882. // Called by DC when the preview window size is changing or is redrawn and an item
  883. // is selected in the palette of DC.
  884. //
  885. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  886. //
  887. // bstrItemText
  888. // A BSTR that contains the fully qualified path of the selected item in the
  889. // palette of DC.
  890. // varhPreviewWindow
  891. // HWND hDCPreviewWnd = (HWND)(varhPreviewWindow.lVal);
  892. //
  893. // A VARIANT that contains the Windows handle to the preview window of DC.
  894. //
  895. // If applicable, components should render the visual representation of the
  896. // selected item in the preview pane of DC. The handle to the preview window
  897. // itself is provided as a parameter. This handle can be used to determine the
  898. // extent of the rendering and for rendering itself on a device context created for
  899. // this window.
  900. //
  901. [id(DISPID_IAcDcContentView_RenderPreviewWindow), helpstring("Event fired when the preview window is redrawn")]
  902. HRESULT RenderPreviewWindow(
  903. [in, string] BSTR bstrItemText // full text of the item
  904. , [in] VARIANT varhPreviewWindow // HWND of preview window(VT_I4)
  905. );
  906. //
  907. // Called by DC when a right mouse click happens in preview window.
  908. //
  909. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  910. //
  911. // varButton
  912. // int nButton = varButton.lVal;
  913. //
  914. // A VARIANT that contains a value that indicates which button was pressed.
  915. // The component should only respond if nButton == 2(right mouse button).
  916. // varX
  917. // int nMouseX = varX.lVal;
  918. //
  919. // A VARIANT that contains the x coordinate(in screen coordinates, in pixels)
  920. // varY
  921. // int nMouseY = varY.lVal;
  922. //
  923. // A VARIANT that contains the y coordinate(in screen coordinates, in pixels)
  924. //
  925. // If applicable, the component should display a context menu in response to this
  926. // event. The component is responsible for handling the menu selections.
  927. //
  928. [id(DISPID_IAcDcContentView_PreviewMouseUp), helpstring("Event fired when the mouse is relased in preview")]
  929. HRESULT PreviewMouseUp(
  930. [in] VARIANT varButton // button that is pressed(VT_I4)
  931. , [in] VARIANT varX // x position of mouse(VT_I4)
  932. , [in] VARIANT varY // y position of mouse(VT_I4)
  933. );
  934. //
  935. // Called by DC when the user begins to drag item(s) from DC palette.
  936. //
  937. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  938. //
  939. // varbstrItemTexts
  940. // SAFEARRAY *psaItemTexts = varItemTexts.parray;
  941. //
  942. // A VARIANT that contains a pointer to a SAFEARRAY of BSTRs that represent the
  943. // names of the items being selected in the palette of DC when the mouse up
  944. // happened.
  945. // varX
  946. // int nMouseX = varX.lVal;
  947. //
  948. // A VARIANT that contains the x coordinate(in screen coordinates, in pixels)
  949. // varY
  950. // int nMouseY = varY.lVal;
  951. //
  952. // A VARIANT that contains the y coordinate(in screen coordinates, in pixels)
  953. //
  954. // A component should call DoDragDrop to start the drag and drop and should
  955. // handle the OLE drag and drop until the process of dragging is over.
  956. //
  957. [id(DISPID_IAcDcContentView_PaletteBeginDrag), helpstring("Event fired when items are dragged in palette")]
  958. HRESULT PaletteBeginDrag(
  959. [in] VARIANT varbstrItemTexts // array of item texts(VT_ARRAY)
  960. , [in] VARIANT varX // x mouse position(VT_I4)
  961. , [in] VARIANT varY // y mouse position(VT_I4)
  962. );
  963. //
  964. // Called by DC to request the component for releasing its interface pointer
  965. // addrefed by the component in IAcDcContentBrowser::Initialize.
  966. //
  967. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  968. //
  969. // Component is expected to release the IAcDcContentBrowser pointer in this method.
  970. //
  971. [id(DISPID_IAcDcContentView_ReleaseBrowser), helpstring("Request to release IAcDcContentBrowser")]
  972. HRESULT ReleaseBrowser();
  973. //
  974. // Called by DC when user right clicks on a container file in the palette.
  975. //
  976. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  977. //
  978. // varhMenu
  979. // HMENU hDCContextMenu = (HMENU)(varhMenu.lVal);
  980. //
  981. // A VARIANT that contains the Windows handle to a context menu DC is going to
  982. // display for the selected container file. This is read-only. Components
  983. // should not destroy this handle.
  984. // varIndex
  985. // int nIndex = varIndex.lVal;
  986. //
  987. // A VARIANT that contains the zero-based index at which to insert the first
  988. // menu item.
  989. // varCmdFirst
  990. // int nCmdFirst = varCmdFirst.lVal;
  991. //
  992. // A VARIANT that contains the minimum value for a menu item identifier.
  993. // varCmdLast
  994. // int nCmdLast = varCmdLast.lVal;
  995. //
  996. // A VARIANT that contains the maximum value for a menu item identifier.
  997. // varItemTexts
  998. // SAFEARRAY *psaItemTexts = varItemTexts.parray;
  999. //
  1000. // A VARIANT that contains a pointer to a SAFEARRAY of BSTRs that represent the
  1001. // names of the items being selected in the palette of DC when the mouse up
  1002. // happened.
  1003. //
  1004. // This event is applicable only to files which are registered as containers by the
  1005. // component. It is not applicable to right click event on item(s) which are
  1006. // displayed by a component in the DC palette. A component is expected to add its
  1007. // own menu items(if it chooses to) which are meaningful to the container file to
  1008. // the given context menu. When the user selects a menu item that the component
  1009. // has put in the context menu, InvokeCommand method is called.
  1010. //
  1011. [id(DISPID_IAcDcContentView_QueryContextMenu), helpstring("Queries for a context menu")]
  1012. HRESULT QueryContextMenu(
  1013. [in] VARIANT varhMenu // handle of DC menu
  1014. , [in] VARIANT varIndex // index of first menu item
  1015. , [in] VARIANT varCmdFirst // min. value of menu item id
  1016. , [in] VARIANT varCmdLast // max. value of menu item id
  1017. , [in] VARIANT varItemTexts // item texts
  1018. );
  1019. //
  1020. // Called by DC when a context menu item put in by the component in response to
  1021. // QueryContextMenu is selected by user.
  1022. //
  1023. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1024. //
  1025. // varMenuItemID
  1026. // int nMenuID = varMenuItemID.lVal;
  1027. //
  1028. // A VARIANT that contains the menu identifier of the item the user selected.
  1029. //
  1030. // Components should respond to this event if they responded to QueryContextMenu
  1031. // method by providing a menu item of their own.
  1032. //
  1033. [id(DISPID_IAcDcContentView_InvokeCommand), helpstring("Handler for context menu item")]
  1034. HRESULT InvokeCommand(
  1035. [in] VARIANT varMenuItemID // menu ID
  1036. );
  1037. //
  1038. // Called by DC to know if the given item can be expanded.
  1039. //
  1040. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1041. //
  1042. // bstrItemText
  1043. // A BSTR that contains the fully qualified path of the item.
  1044. // pvarIsExpandable
  1045. // bool bIsExpandable = (VARIANT_BOOL)(pvarIsExpandable->boolVal);
  1046. //
  1047. // A VARIANT that contains a pointer to a boolean to indicate if the item is
  1048. // expandable.
  1049. //
  1050. // DC calls this to see if an item is expandable in custom view mode. This is
  1051. // applicable only for components who participate in custom view mode of DC.
  1052. //
  1053. [id(DISPID_IAcDcContentView_IsExpandable), helpstring("Ask if an item can be expanded")]
  1054. HRESULT IsExpandable(
  1055. [in, string] BSTR bstrItemText, // full text of item
  1056. [out, retval] VARIANT *pvarIsExpandable // 0 or 1 (VT_I4)
  1057. );
  1058. //
  1059. // Called by DC for a 32x32 image for a container file. This could be a
  1060. // preview or thumbnail icon of a file that the component chooses to store
  1061. // or generate.
  1062. //
  1063. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1064. //
  1065. // bstrFileName
  1066. // A BSTR that contains the fully qualified path of the file.
  1067. // pvarhLargeImage
  1068. // HBITMAP hLargeImage = (HBITMAP)(pvarhLargeImage->lVal);
  1069. //
  1070. // A VARIANT that contains a handle to a bitmap(32x32) for the given container
  1071. // file.
  1072. //
  1073. // If the component has a 32x32 thumbnail preview image of the given file, it
  1074. // should return S_OK with pvarhLargeImage->lVal set to HBITMAP of the given file.
  1075. // If the component doesn't have a bitmap for the given file, then it should return
  1076. // S_FALSE. If the component doesn't have image for any file, it should return
  1077. // E_NOTIMPL.
  1078. //
  1079. [id(DISPID_IAcDcContentView_GetLargeIcon), helpstring("Request to give large icon")]
  1080. HRESULT GetLargeImage(
  1081. [in] BSTR bstrFileName // full file name
  1082. , [in, out] VARIANT *pvarhLargeImage // HBITMAP of file (VT_I4)
  1083. );
  1084. //
  1085. // Called by DC to get small image list of a container content.
  1086. //
  1087. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1088. //
  1089. // bstrFileName
  1090. // A BSTR that contains the fully qualified path of the file.
  1091. // pvarhImageList
  1092. // HIMAGELIST hSmallImageList = (HIMAGELIST)(pvarhImageList->lVal);
  1093. //
  1094. // A VARIANT that contains the handle to small image list for the container
  1095. // file bstrFileName.
  1096. //
  1097. // Components should return the handle to the small image list for the container
  1098. // file. This function is currently not used by DC.
  1099. //
  1100. [id(DISPID_IAcDcContentView_GetSmallImageListForContent), helpstring("Request to get the small image list for a given container")]
  1101. HRESULT GetSmallImageListForContent(
  1102. [in] BSTR bstrFileName // full file name
  1103. , [out, retval] VARIANT *pvarhImageList // small HIMAGELIST (VT_I4)
  1104. );
  1105. //
  1106. // Called by DC to get small image list of a container content.
  1107. //
  1108. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1109. //
  1110. // bstrFileName
  1111. // A BSTR that contains the fully qualified path of the file.
  1112. // pvarhImageList
  1113. // HIMAGELIST hSmallImageList = (HIMAGELIST)(pvarhImageList->lVal);
  1114. //
  1115. // A VARIANT that contains the handle to large image list for the container
  1116. // file bstrFileName.
  1117. //
  1118. // Components should return the handle to the large image list for the container
  1119. // file. This function is currently not used by DC.
  1120. //
  1121. [id(DISPID_IAcDcContentView_GetLargeImageListForContent), helpstring("Request to get the large image list for a given container")]
  1122. HRESULT GetLargeImageListForContent(
  1123. [in] BSTR bstrFileName // full file name
  1124. , [out, retval] VARIANT *pvarhImageList // large HIMAGELIST (VT_I4)
  1125. );
  1126. //
  1127. // Called by DC to obtain language-independent command string or the help
  1128. // text for a context menu item; this is not used at this time by DC.
  1129. //
  1130. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1131. //
  1132. // varMenuID
  1133. // int nMenuID = varMenuID.lVal;
  1134. //
  1135. // A VARIANT that contains the menu identifier.
  1136. // dcMenuInfoFlag
  1137. // A flag taken from dcMenuInfoFlag to indicate the information to retrieve.
  1138. // Not used currently.
  1139. // pvarReserved
  1140. // Reserved.
  1141. // pbstrName
  1142. // A BSTR that would contain the null-terminated string.
  1143. //
  1144. [id(DISPID_IAcDcContentView_GetCommandString), helpstring("Request to get the command string or the help text for a context menu item")]
  1145. HRESULT GetCommandString(
  1146. [in] VARIANT varMenuID // menu id
  1147. , [in] dcMenuInfoFlag // which information is required
  1148. , [out] VARIANT *pvarReserved // reserved, handlers must ignore this
  1149. , [out] BSTR *pbstrName // menu information
  1150. );
  1151. //
  1152. // Deletes the component-defined data associated with each item by the
  1153. // component in either the navigator or palette of DesignCenter.
  1154. //
  1155. // * Returns NOERROR on success or an OLE-defined error on failure.
  1156. //
  1157. // dcSrc
  1158. // A flag taken from dcItemDataSource enum that indicates the source of
  1159. // the item data - either the navigator or the palette.
  1160. // varItemDataArray
  1161. // VARIANT varArray = varItemDataArray.parray;
  1162. //
  1163. // A VARIANT that contains a SAFEARRAY of DWORDs which point to a
  1164. // VARIANT that contains component-defined data.
  1165. //
  1166. // DesignCenter calls this function when it is deleting the items provided
  1167. // by the component in either the palette or the navigator. It supplies the
  1168. // data associated with all the items in a SAFEARRAY of DWORDs. These
  1169. // DWORDs actually point to the memory for a VARIANT that contains the
  1170. // actual data that the component supplied when it called AddPaletteItem.
  1171. // This memory for the VARIANT has to be freed by the component for each
  1172. // item in the SAFEARRAY. It is recommended that this memory be allocated
  1173. // by using COM memory allocator interface IMalloc or the OLE-implemented
  1174. // memory task manager.
  1175. //
  1176. [id(DISPID_IAcDcContentView_DeleteItemData), helpstring("Request to delete data associated with each item in navigator or palette")]
  1177. HRESULT DeleteItemData(
  1178. [in] dcItemDataSource dcSrc // navigator or palette
  1179. , [in] VARIANT varItemDataArray // SAFEARRAY of DWORDs (V_I4)
  1180. );
  1181. }; // interface IAcDcContentView
  1182. // structure for passing informations on found items, from the IcontentFinder implementation
  1183. // to the IAcDcContentFinderSite implementation
  1184. typedef struct {
  1185. LPCOLESTR lpObjectName; // name of the object
  1186. LPCOLESTR lpObjectType; // type of the object (ie: "AutoCAD Drawing")
  1187. LPCOLESTR lpCustomValue; // value of the found property, if the property to search is not the default
  1188. LPCOLESTR lpLocation; // object location (usually a folder name for file based object)
  1189. FILETIME ftLastWriteTime; // timestamp of the object
  1190. DWORD nFileSizeHigh; // object size (high order dword)
  1191. DWORD nFileSizeLow; // object size (low order dword)
  1192. short nBitmapIndex; // index of the bitmap which should be used with this object
  1193. short nObjectType; // type of the returned object. ceFinderObjectTypes enum value
  1194. short nObjectTypeEx; // extra information about the object type. custom defined. reserved for future use
  1195. } FINDOBJECTINFO;
  1196. // IUnknown interface for IAcDcContentFinderSite
  1197. //
  1198. [
  1199. object,
  1200. uuid(F6F24140-EC52-11d1-B9C7-0060B0B5E151),
  1201. helpstring("IAcDcContentFinderSite Interface"),
  1202. pointer_default(ref)
  1203. ]
  1204. interface IAcDcContentFinderSite : IUnknown
  1205. {
  1206. //
  1207. // Called by a component during its search process to communicate to the finder site
  1208. // informations about each objet it finds.
  1209. //
  1210. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1211. //
  1212. // lpObjectInfo
  1213. // Pointer to a FINDOBJECTINFO structure wich contains all the informations about
  1214. // an object.
  1215. // pbContinue
  1216. // Pointer to a boolean value set by the finder site. This value is
  1217. // true if the search should continue and false if the component should
  1218. // stop the search.
  1219. //
  1220. //
  1221. [helpstring("Callback for object information")]
  1222. HRESULT SetObjectInfo (
  1223. [in] FINDOBJECTINFO* lpObjectInfo, // informations about the object
  1224. [out, retval] boolean* pbContinue
  1225. );
  1226. //
  1227. // Called by a component to communicate a message to the finder site while a search
  1228. // is in progress
  1229. //
  1230. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1231. //
  1232. // lpMessage
  1233. // Message string
  1234. // pbContinue
  1235. // Pointer to a boolean value set by the finder site. This value is
  1236. // true if the search should continue and false if the component should
  1237. // stop the search.
  1238. //
  1239. // Called by an IAcDcContentFinder implementation to display a message in
  1240. // the finder dialog status bar . Most likely the component will communicate
  1241. // the current folder it is searching in
  1242. //
  1243. [helpstring("Callback for messages")]
  1244. HRESULT SetMessage (
  1245. [in, string] LPCOLESTR lpMessage, // message
  1246. [out, retval] boolean* pbContinue
  1247. );
  1248. //
  1249. // Called by a component in response to a EnumeratePropertyValues() request.
  1250. //
  1251. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1252. //
  1253. // lpPropertyValue
  1254. // Value that the component communicates to the finder site for the requested
  1255. // property
  1256. // pbContinue
  1257. // Pointer to a boolean value set by the finder site. This value is
  1258. // true if the search should continue and false if the component should
  1259. // stop the search.
  1260. //
  1261. // The finder site will call EnumeratePropertyValues() in the component if a
  1262. // property has been specified in the advanced tab. This apply to the
  1263. // current object that the component returns to the finder site using
  1264. // SetObjectInfo(). When EnumeratePropertyValues() is called the component
  1265. // is supposed to enter a loop and return each value of the requested
  1266. // property using SetPropertyValue()
  1267. //
  1268. [helpstring("Callback for property values")]
  1269. HRESULT SetPropertyValue (
  1270. [in, string] LPCOLESTR lpPropertyValue,
  1271. [out, retval] boolean* pbContinue
  1272. );
  1273. //
  1274. // Called by a component to communicates the 16x16 bitmap that it associates
  1275. // with a given type. The bitmap will be displayed in the search result
  1276. // list of the finder dialog.
  1277. //
  1278. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1279. //
  1280. // lpTypeName
  1281. // Name of the object type
  1282. // lpPictureDisp
  1283. // Pointer to the picture created by the component
  1284. // pnBitmapIndex
  1285. // Pointer to an index which is attributed by the finder site for the
  1286. // specified image. The component should cache this index and
  1287. // communicates it to the finder site in FINDOBJECTINFO.nBitmapIndex
  1288. // when calling SetObjectInfo()
  1289. //
  1290. [helpstring("Set the searched type bitmap")]
  1291. HRESULT SetTypeBitmap (
  1292. [in, string] LPCOLESTR lpTypeName,
  1293. [in] IPictureDisp* lpPictureDisp,
  1294. [out] short *pnBitmapIndex
  1295. );
  1296. //
  1297. // Called by a component to ask if the search should continue
  1298. //
  1299. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1300. //
  1301. // pbContinue
  1302. // Pointer to a boolean value set by the finder site. This value is
  1303. // true if the search should continue and false if the component should
  1304. // stop the search.
  1305. //
  1306. // This method should be called often because it allows the finder dialog to
  1307. // process its Windows messages. Thus calling it often make the finder
  1308. // dialog more responsive to the user input.
  1309. //
  1310. [helpstring("Ask for continuing. Also allow yield")]
  1311. HRESULT QueryContinueFind (
  1312. [out, retval] boolean* pbContinue
  1313. );
  1314. }; // IAcDcContentFinderSite
  1315. [
  1316. object,
  1317. #if !defined(_WIN64) && !defined (_AC64)
  1318. uuid(B7EE59AE-E9F7-11D1-B9C2-0060B0B5E151),
  1319. #else
  1320. uuid(3B98CCC9-AC84-437D-80FE-1F8199024F18),
  1321. #endif
  1322. helpstring("IAcDcContentFinder Interface"),
  1323. pointer_default(unique)
  1324. ]
  1325. // IUnknown interface for IAcDcContentFinder
  1326. //
  1327. interface IAcDcContentFinder : IUnknown
  1328. {
  1329. //
  1330. // Called by DC to initialize a finder component.
  1331. //
  1332. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1333. //
  1334. // pClient
  1335. // Back pointer to the finder site. This pointer can be cached by the
  1336. // component and used to call methods of the IAcDcContentFinderSite
  1337. // interface.
  1338. //
  1339. // This method is called by the finder client when it instantiate a finder
  1340. // component for the first time. It's only called once, even if the
  1341. // component supports more than one object types.
  1342. //
  1343. [helpstring("One time initialization for the finder")]
  1344. HRESULT Initialize (
  1345. [in] IAcDcContentFinderSite* pClient
  1346. );
  1347. //
  1348. // Called by DC to start a search.
  1349. //
  1350. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1351. //
  1352. // pClient
  1353. // Back pointer to the finder site. This pointer can be cached by the
  1354. // component and used to call methods of the IAcDcContentFinderSite
  1355. // interface.
  1356. // lpTypeName
  1357. // Name of the object type to search for.
  1358. // lpDirName
  1359. // Folder where the search must start. This value is supplied for
  1360. // component information: the finder site set the current directory to
  1361. // the folder specified, so the component does not have to take care of
  1362. // it
  1363. // lpFilter
  1364. // Filter specified by the user. In most cases this value is not used
  1365. // by the component. A component knows what type of file(s) search in
  1366. // for the given type, so the filter is ignored.
  1367. // bRecurse
  1368. // Tells if the search should include the subfolders
  1369. // lpPropertyRequested
  1370. // Name of the property specified in the 'In the Field(s)' combobox of
  1371. // the main tab
  1372. // bAdvPropertySearch
  1373. // Reserved. Internal use only
  1374. //
  1375. // The component is supposed to enter an enumeration loop. The component
  1376. // from this loop will: - call SetObjectInfo() for each object found of the
  1377. // given type - call regularly QueryContinueFind() in order to let the user
  1378. // stop the search. The call to QueryContinueFind() must be frequent enough
  1379. // to have a quick response to the user request to stop the search.
  1380. //
  1381. // Note: the finder site pointer is also received in the Initialize()
  1382. // method. If cached at this time, it can be ignored in this function
  1383. //
  1384. [helpstring("Start the enumeration of the objects of a given type")]
  1385. HRESULT EnumerateObjects (
  1386. [in] IAcDcContentFinderSite* pClient,
  1387. [in, string] LPCOLESTR lpTypeName,
  1388. [in, string] LPCOLESTR lpDirName,
  1389. [in, string] LPCOLESTR lpFilter,
  1390. [in] boolean bRecurse,
  1391. [in, string] LPCOLESTR lpPropertyRequested,
  1392. [in] boolean bAdvPropertySearch
  1393. );
  1394. //
  1395. // Called by DC to enumerate the values of an advanced property.
  1396. //
  1397. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1398. //
  1399. // lpPropertyName
  1400. // name of the advanced property
  1401. //
  1402. // This method is called if an aditionnal search criteria has been specified
  1403. // in the advanced tab. In this case, it is called immediately for each
  1404. // object in response to a call to SetObjectInfo() by the component.
  1405. //
  1406. [helpstring("Advanced property value enumeration")]
  1407. HRESULT EnumeratePropertyValues (
  1408. [in, string] LPCOLESTR lpPropertyName // property name
  1409. );
  1410. //
  1411. // Called by DC to ask if it supports multi selection in the result list for
  1412. // a given type.
  1413. //
  1414. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1415. //
  1416. // lpTypeName
  1417. // Name of the type
  1418. // pbEnable
  1419. // pointer to a boolean value set by the component to indicate if multiselection
  1420. // is supported
  1421. //
  1422. // If the component replies that the multiselection is enabled, the user
  1423. // will be able to drag and drop or invoke commands involoving multiple
  1424. // objects from multiple files in a single operation
  1425. //
  1426. [helpstring("Ask the component for multiselection")]
  1427. HRESULT IsMultiselectionEnabled (
  1428. [in, string] LPCOLESTR lpTypeName,
  1429. [out, retval] boolean* pbEnable
  1430. );
  1431. //
  1432. // Called by DC to process a selected contextual menu command
  1433. //
  1434. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1435. //
  1436. // nCmdId
  1437. // Command identifier. The command value is one of dcFinderCommands
  1438. // (see dcconst.idl)
  1439. // pNames
  1440. // Table of object names involved in the command. Can contain more than
  1441. // one name if the component indicated that multiselection is enabled
  1442. // in the Finder for the given type
  1443. // nObjectType
  1444. // Object type. Reserved for internal use. Object type is implicit. It
  1445. // is the last type the user has requested a search on.
  1446. //
  1447. [helpstring("Pass a command to be executed by the component")]
  1448. HRESULT InvokeCommand (
  1449. [in] int nCmdId,
  1450. [in] SAFEARRAY(BSTR) *pNames,
  1451. [in] int nObjectType
  1452. );
  1453. //
  1454. // Called by DC to indicates that the component should stop any search in
  1455. // progress immediately. If the component keeps database(s) open during the
  1456. // search, these databases should be closed by this function
  1457. //
  1458. [helpstring("Interrupt a search. Searching should stop immediatly")]
  1459. HRESULT Interrupt ();
  1460. //
  1461. // Called by DC to allow a component to add/remove/modify options in the
  1462. // contextual menu. This method is called just before the contextual menu
  1463. // is displayed
  1464. //
  1465. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1466. //
  1467. // hMenu
  1468. // HMENU hWinMenuHandle = (HMENU)hMenu
  1469. // handle of the contextual menu
  1470. //
  1471. // The options that the menu contains can be handled usinfg the command ID.
  1472. // Command ID in the menu have the idl values (see dcFinderCommands in
  1473. // dconst.idl) + an offset value of 100 This command is implicitely invoked
  1474. // on the last object type for which a search has been made.
  1475. //
  1476. [helpstring("Give to the component an opportunity to modify the popup menu before it is displayed")]
  1477. HRESULT InitPopupMenu (
  1478. [in] INT_PTR hMenu
  1479. );
  1480. //
  1481. // Called by DC to get the location of an object, as it appears in the
  1482. // DesignCenter tree and palette. This is used to perfom the 'Load into
  1483. // Palette' command.
  1484. //
  1485. // * Returns NOERROR if successful, or an OLE-defined error value otherwise
  1486. //
  1487. // lpObjectName
  1488. // the name of the object as the component supplied it in
  1489. // FINDOBJECTINFO.lpObjectName
  1490. // lpFolderName
  1491. // the name of the object as the component supplied it in
  1492. // FINDOBJECTINFO.lpLocation
  1493. // lpType
  1494. // the name of the object as the component supplied it in
  1495. // FINDOBJECTINFO.lpObjectType
  1496. // lpTreeLocation
  1497. // pointer to an LPOLESTR. This OLE string is allocated by the
  1498. // component, and will be freed by DC. The string must contains the
  1499. // location of the given object, as it appears in the DC tree.
  1500. // lpPaletteItemName
  1501. // pointer to an LPOLESTR. This OLE string is allocated by the
  1502. // component, and will be freed by DC. The string must contains the
  1503. // name of the object, as it appears in the DC palette.
  1504. //
  1505. // In most cases, especially from components displayed in the desktop view,
  1506. // the name returned in lpPaletteItemName will be the name received in
  1507. // lpObjectName. The location returned in lpTreeLocation will be the folder
  1508. // received in lpFolderName if the object is a file, and the folder name +
  1509. // the placeholder name if the object appears in a virtual folder
  1510. //
  1511. HRESULT QueryObjectLocation (
  1512. [in] LPCOLESTR lpObjectName,
  1513. [in] LPCOLESTR lpFolderName,
  1514. [in] LPCOLESTR lpType,
  1515. [in, out] LPOLESTR *lpTreeLocation,
  1516. [in, out] LPOLESTR *lpPaletteItemName
  1517. );
  1518. }; // IAcDcContentFinder