acpublishuireactors.h 12 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159160161162163164165166167168169170171172173174175176177178179180181182183184185186187188189190191192193194195196197198199200201202203204205206207208209210211212213214215216217218219220221222223224225226227228229230231232233234235236237238239240241242243244245246247248249250251252253254255256257258259260261262263264265266267268269270271272273274275276277278279280281282283284285286287288289290291292293294295296297298299300301302303304305306307308309310311312313314315316317318319320321322323324325326327328329330331332333334335336337338339340341342343344345346347348349350351352353354
  1. //////////////////////////////////////////////////////////////////////////////
  2. //
  3. // Copyright 2015 Autodesk, Inc. All rights reserved.
  4. //
  5. // Use of this software is subject to the terms of the Autodesk license
  6. // agreement provided at the time of installation or download, or which
  7. // otherwise accompanies this software in either electronic or hard copy form.
  8. //
  9. //////////////////////////////////////////////////////////////////////////////
  10. //
  11. // AcPublishUIReactors.h - Reactors File
  12. //
  13. #ifndef _ACPUBLISHUIREACTORS_H
  14. #define _ACPUBLISHUIREACTORS_H
  15. #include "AdAChar.h"
  16. #include "AcPublishReactors.h"
  17. #include "rxobject.h"
  18. #include "acarray.h"
  19. #include "AcPlDSDData.h"
  20. #include "AcPublishReactors.h"
  21. /// <summary>
  22. /// This class is the context information supplied by the
  23. /// OnInitPublishOptionsDialog notifier of AcPublishUIReactor. You do not need
  24. /// to construct this class. This is handed to the
  25. /// OnInitPublishOptionsDialog method.
  26. /// </summary>
  27. class AcPublishUIReactorInfo
  28. {
  29. public:
  30. /// <summary>
  31. /// default constructor
  32. /// </summary>
  33. ///
  34. /// <remarks>
  35. /// creates an empty AcPublishBeforeJobInfo. Clients do not
  36. /// construct this object, it is created by the Publishing app
  37. /// and handed to their reactors
  38. /// </remarks>
  39. AcPublishUIReactorInfo() {};
  40. /// <summary>
  41. /// destructor
  42. /// </summary>
  43. ///
  44. virtual ~AcPublishUIReactorInfo() {};
  45. /// <summary>
  46. /// read only accesss to the DSD object
  47. /// </summary>
  48. ///
  49. /// <returns>
  50. /// a const pointer to the DSD object for this publish job
  51. /// </returns>
  52. virtual const AcPlDSDData * GetDSDData() = 0;
  53. /// <summary>
  54. /// read/write access to the client's private DSD data
  55. /// </summary>
  56. ///
  57. /// <param name="sectionName">
  58. /// the name the client assigned to its private DSD data section
  59. /// as a null terminated mbcs string.
  60. /// </param>
  61. ///
  62. /// <returns>
  63. /// returns empty AcNameValuePairVec, if section not found,
  64. /// otherwise this returns a const AcNameValuePairVec object with
  65. /// name value pairs for the section requested.
  66. /// </returns>
  67. virtual const AcNameValuePairVec
  68. GetPrivateData(const ACHAR * sectionName) = 0;
  69. /// <summary>
  70. /// replaces a section of the same name
  71. /// will fail if it attempts to replace a "recognized" section of
  72. /// standard DSD data
  73. /// returns true on success, false on error
  74. /// </summary>
  75. ///
  76. /// <param name="sectionName">
  77. /// the name the client assigned to its private DSD data section
  78. /// as a null terminated mbcs string.
  79. /// </param>
  80. ///
  81. ///
  82. /// <param name="nameValuePairVec">
  83. /// Vector of name and value pairs that clients want to update in their
  84. /// section in the dsd file
  85. /// </param>
  86. ///
  87. /// <returns>
  88. /// returns true if section data is updated in the dsd data object
  89. /// successfully, otherwise returns false.
  90. /// </returns>
  91. virtual bool WritePrivateSection(const ACHAR * sectionName,
  92. const AcNameValuePairVec nameValuePairVec) = 0;
  93. // bool for bg/fg (this isn't in public dsd data)
  94. virtual bool JobWillPublishInBackground() = 0;
  95. };
  96. ////////////////////////////////////////////////////////////////////
  97. /// class AcPublishUIReactor
  98. ////////////////////////////////////////////////////////////////////
  99. /// <summary>
  100. /// Gives you notification for AcPublish Options UI events
  101. /// </summary>
  102. class AcPublishUIReactor : public AcRxObject
  103. {
  104. public:
  105. /// <summary>
  106. /// Event Fired just when the Publish Options dialog is about
  107. /// to be displayed. Gives users of this reactor to add their
  108. /// own controls to the property inspector that is passed to
  109. /// them via the IUnknown. This allows clients to add UI for
  110. /// the configuration of their metadata publication options. The
  111. /// results of this UI can be communicated in the Unrecognized Data section
  112. /// of the DSD object.
  113. /// </summary>
  114. ///
  115. /// <param name="pUnk">
  116. /// This "out" parameter provides access to the COM API for
  117. /// CDWFDataPropertyManager in the Publish Options dialog. This derives
  118. /// from IPropertyManager and IPropertyManager2. You can QueryInterface
  119. /// on it to get the PropertytManager which is documented in dynprops.h
  120. /// </param>
  121. ///
  122. /// <param name="pInfo">
  123. /// a pointer to an AcPublishUIReactorInfo object is supplied to
  124. /// the client reactor, providing context information and methods
  125. /// to set or get their private section data
  126. /// </param>
  127. ///
  128. virtual void OnInitPublishOptionsDialog(IUnknown **pUnk,
  129. AcPublishUIReactorInfo *pInfo);
  130. /// <summary>
  131. /// Event Fired just when the Export to DWF/PDF Publish Options dialog
  132. /// is about to be displayed. Gives users of this reactor to add their
  133. /// own controls to the property inspector that is passed to
  134. /// them via the IUnknown. This allows clients to add UI for
  135. /// the configuration of their metadata publication options. The
  136. /// results of this UI can be communicated in the registry of KEY
  137. /// @ HKEY_CURRENT_USER\...\Dialogs\AcQuickPublishOpts
  138. /// </summary>
  139. ///
  140. /// <param name="pUnk">
  141. /// This "out" parameter provides access to the COM API for
  142. /// CDWFDataPropertyManager in the Publish Options dialog. This derives
  143. /// from IPropertyManager and IPropertyManager2. You can QueryInterface
  144. /// on it to get the PropertytManager which is documented in dynprops.h
  145. /// </param>
  146. ///
  147. /// <param name="pInfo">
  148. /// a pointer to an AcPublishUIReactorInfo object is supplied to
  149. /// the client reactor, providing context information and methods
  150. /// to set or get their private section data
  151. /// The parameter is reserved for the future, now it is not used.
  152. /// </param>
  153. ///
  154. virtual void OnInitExportOptionsDialog(IUnknown **pUnk,
  155. AcPublishUIReactorInfo *pInfo);
  156. ///////////////////////////////////////////////////////////////////////////////
  157. /// <summary>
  158. /// Envent Fired just when Read/Save options from/to Registry
  159. /// @ HKEY_CURRENT_USER\...\Dialogs\AcQuickPublishOpts
  160. /// </summary>
  161. /// <returns>
  162. /// </returns>
  163. /// <param name="lpszRegRoot">
  164. /// This parameter is the root path of KEY @ Software\...\Dialogs\AcQuickPublishOpts
  165. /// </param>
  166. /// <param name="bIsReadRegistry">
  167. /// true, read options data from registry
  168. /// false, save options data to registy
  169. /// </param>
  170. virtual void PersistenceRegistryForExportOptionsDialog(const ACHAR* lpszRegRoot,
  171. bool bIsReadRegistry = true);
  172. /// <summary>
  173. /// Event Fired just when the Auto Publish Settings dialog is about
  174. /// to be displayed. Gives users of this reactor to add their
  175. /// own controls to the property inspector that is passed to
  176. /// them via the IUnknown. This allows clients to add UI for
  177. /// the configuration of their metadata publication options. The
  178. /// results of this UI can be communicated in the registry of KEY
  179. /// @ HKEY_CURRENT_USER\...\Dialogs\AcAutoPublishOpts
  180. /// </summary>
  181. ///
  182. /// <param name="pUnk">
  183. /// This "out" parameter provides access to the COM API for
  184. /// CDWFDataPropertyManager in the Publish Options dialog. This derives
  185. /// from IPropertyManager and IPropertyManager2. You can QueryInterface
  186. /// on it to get the PropertytManager which is documented in dynprops.h
  187. /// </param>
  188. ///
  189. /// <param name="pInfo">
  190. /// a pointer to an AcPublishUIReactorInfo object is supplied to
  191. /// the client reactor, providing context information and methods
  192. /// to set or get their private section data
  193. /// The parameter is reserved for the future, now it is not used.
  194. /// </param>
  195. ///
  196. virtual void OnInitAutoPublishSettingsDialog(IUnknown **pUnk,
  197. AcPublishUIReactorInfo *pInfo);
  198. ////////////////////////////////////////////////////////////////////////////////
  199. /// <summary>
  200. /// Envent Fired just when Read/Save options from/to Registry
  201. /// @ HKEY_CURRENT_USER\...\Dialogs\AcAutoPublishOpts
  202. /// </summary>
  203. /// <returns>
  204. /// </returns>
  205. /// <param name="lpszRegRoot">
  206. /// This parameter is the root path of KEY @ Software\...\Dialogs\AcAutoPublishOpts
  207. /// </param>
  208. /// <param name="bIsReadRegistry">
  209. /// true, read options data from registry
  210. /// false, save options data to registy
  211. /// </param>
  212. virtual void PersistenceRegistryForAutoPublishDialog(const ACHAR* lpszRegRoot,
  213. bool bIsReadRegistry = true);
  214. /// <summary>
  215. /// Public d'tor
  216. /// </summary>
  217. virtual ~AcPublishUIReactor() {};
  218. protected:
  219. /// <summary>
  220. /// Protected constructor; you must derive to instantiate one
  221. /// of these.
  222. /// </summary>
  223. AcPublishUIReactor() {};
  224. };
  225. /*
  226. // Base class inlines for AcPublish UI events
  227. */
  228. inline void
  229. AcPublishUIReactor::OnInitPublishOptionsDialog(IUnknown **pUnk,
  230. AcPublishUIReactorInfo *pInfo)
  231. {
  232. }
  233. inline void
  234. AcPublishUIReactor::OnInitExportOptionsDialog(IUnknown **pUnk,
  235. AcPublishUIReactorInfo *pInfo)
  236. {
  237. }
  238. inline void
  239. AcPublishUIReactor::PersistenceRegistryForExportOptionsDialog(const ACHAR* lpszRegRoot,
  240. bool bIsReadRegistry)
  241. {
  242. }
  243. inline void
  244. AcPublishUIReactor::OnInitAutoPublishSettingsDialog(IUnknown **pUnk,
  245. AcPublishUIReactorInfo *pInfo)
  246. {
  247. }
  248. inline void
  249. AcPublishUIReactor::PersistenceRegistryForAutoPublishDialog(const ACHAR* lpszRegRoot,
  250. bool bIsReadRegistry)
  251. {
  252. }
  253. ////////////////////////////////////////////////////////////////////
  254. /// class AcPublishUIReactor2
  255. ////////////////////////////////////////////////////////////////////
  256. /// <summary>
  257. /// AcPublishUIReactor2 is used to extend the implementation of AcPublishUIReactor
  258. /// while maintaining binary compatibility.
  259. /// AcPublishUIReactor expose PersistenceRegistryForPubishOptionsDialog method to
  260. /// read/save options for AcPublishDlg
  261. /// </summary>
  262. class AcPublishUIReactor2 : public AcPublishUIReactor
  263. {
  264. public:
  265. ////////////////////////////////////////////////////////////////////////////////
  266. /// <summary>
  267. /// Envent Fired just when Read/Save options from/to Registry
  268. /// @ HKEY_CURRENT_USER\...\Dialogs\AcPublishDlg
  269. /// </summary>
  270. /// <returns>
  271. /// </returns>
  272. /// <param name="lpszRegRoot">
  273. /// This parameter is the root path of KEY @ Software\...\Dialogs\AcPublishDlg
  274. /// </param>
  275. /// <param name="bIsReadRegistry">
  276. /// true, read options data from registry
  277. /// false, save options data to registy
  278. virtual void PersistenceRegistryForPubishOptionsDialog(const ACHAR* lpszRegRoot,
  279. bool bIsReadRegistry = true) {}
  280. /// <summary>
  281. /// Public d'tor
  282. /// </summary>
  283. virtual ~AcPublishUIReactor2() {}
  284. protected:
  285. /// <summary>
  286. /// Protected constructor; you must derive to instantiate one
  287. /// of these.
  288. /// </summary>
  289. AcPublishUIReactor2() {}
  290. };
  291. // Global functions to add and remove reactors that clients call for
  292. // AcPublish UI reactor notifications
  293. /// <summary>
  294. /// global function clients should call to add a reactor
  295. /// </summary>
  296. ///
  297. /// <param name="pReactor">
  298. /// a pointer to the reactor the client has derived and instantiated
  299. /// </param>
  300. ///
  301. void AcGlobAddPublishUIReactor(AcPublishUIReactor *pReactor);
  302. /// <summary>
  303. /// global function clients should call to remove a reactor
  304. /// </summary>
  305. ///
  306. /// <param name="pReactor">
  307. /// a pointer to the reactor the client has derived and instantiated and
  308. /// previously added
  309. /// </param>
  310. ///
  311. void AcGlobRemovePublishUIReactor(AcPublishUIReactor *pReactor);
  312. typedef void (__cdecl * ACGLOBADDPUBLISHUIREACTOR)(AcPublishUIReactor * pReactor);
  313. typedef void (__cdecl * ACGLOBREMOVEPUBLISHUIREACTOR)(AcPublishUIReactor * pReactor);
  314. #endif//_ACPUBLISHUIREACTORS_H