AcPlPlotConfigMgr.h 5.6 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140141142143144145146147148149150151152153154155156157158159
  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. // DESCRIPTION: Header for Document and Document Manager Classes.
  11. //
  12. #ifndef ACPLPLOTCONFIGMGR_H
  13. #define ACPLPLOTCONFIGMGR_H
  14. #include "AdAChar.h"
  15. #include "AcPl.h"
  16. #include "AcArray.h"
  17. #include "AcPlObject.h"
  18. class AcPlPlotConfig;
  19. class HT_Thin_Plot_Config_Manager;
  20. class HT_Error_Handler;
  21. enum DeviceType {
  22. kSystemPrinter = 0,
  23. kPC3File = 1,
  24. kOneOffConfig = 2, // for internal use only
  25. kUninitialized = -1
  26. };
  27. class AcPlPlotConfigInfo : public AcPlObject
  28. {
  29. public:
  30. ACPL_PORT AcPlPlotConfigInfo();
  31. ACPL_PORT AcPlPlotConfigInfo(const ACHAR * pDevName,
  32. const ACHAR * pFullPath,
  33. DeviceType devType);
  34. // copy constructor
  35. ACPL_PORT AcPlPlotConfigInfo(const AcPlPlotConfigInfo &copy);
  36. // assignment operator calls this method to copy the contents from src
  37. ACPL_PORT Acad::ErrorStatus copyFrom(const AcRxObject* pSrc);
  38. // assignment operator copies the device name, full path and device type
  39. // information
  40. ACPL_PORT const AcPlPlotConfigInfo& operator=(const AcPlPlotConfigInfo& src);
  41. // destructor
  42. ACPL_PORT virtual ~AcPlPlotConfigInfo();
  43. ACPL_DECLARE_MEMBERS(AcPlPlotConfigInfo);
  44. // returns the full path for the pc3 file. In case of system printers
  45. // just returns the UNC name
  46. ACPL_PORT const ACHAR * fullPath() const;
  47. // call to set the full path for the pc3 file or just the UNC name for
  48. // system printers
  49. ACPL_PORT void setFullPath(const ACHAR * pPath);
  50. // returns the pc3 filename+ext portion or UNC name for system printers
  51. ACPL_PORT const ACHAR * deviceName() const;
  52. // call to set the pc3 filename+ext portion or UNC name for system printers
  53. ACPL_PORT void setDeviceName(const ACHAR * pDevName);
  54. // returns the device type (kSystemPrinter, kPC3file)
  55. ACPL_PORT DeviceType deviceType() const;
  56. // call to set the device type (kSystemPrinter, kPC3file)
  57. ACPL_PORT void setDeviceType(DeviceType devType);
  58. ACPL_PORT const ACHAR * deviceId() const;
  59. ACPL_PORT void setDeviceId(const ACHAR * pDevId);
  60. };
  61. class ADESK_NO_VTABLE AcPlPlotConfigManager
  62. {
  63. public:
  64. // Refresh Codes
  65. enum RefreshCode {
  66. kAll,
  67. kRefreshDevicesList,
  68. kRefreshStyleList,
  69. kRefreshSystemDevicesList,
  70. kRefreshPC3DevicesList
  71. };
  72. // Different type of plot style tables
  73. enum StyTypes {
  74. kUndefined = 0,
  75. kRegular = 0x01,
  76. kTranslation = 0x02,
  77. kColorDep = 0x04,
  78. kAllTypes = 0x07
  79. };
  80. // List of standard pc3 files that are installed by default
  81. enum StdConfigs {
  82. kNoneDevice,
  83. kDefaultWindowsSysPrinter,
  84. kDWF6ePlot,
  85. kDWFePlotOptForPlotting,
  86. kDWFePlotOptForViewing,
  87. kPublishToWebDWF,
  88. kPublishToWebJPG,
  89. kPublishToWebPNG,
  90. kDWFxePlot,
  91. kPublishToWebDWFx,
  92. kPDFePlot,
  93. kPDFePlotGeneralDocs, // to specify Pdf pc3 config file for General Documentation.
  94. kPDFePlotHighQuality, // to specify Pdf pc3 config file for High Quality Print.
  95. kPDFePlotSmallerFile, // to specify Pdf pc3 config file for Smallest File Size.
  96. kPDFePlotWebMobile // to specify Pdf pc3 config file for Web and Mobile.
  97. };
  98. // Returns the list of system printer, pc3 file installed on the current
  99. // system. Also includes the None device as the first element of the array
  100. virtual bool getDevicesList(AcArray<AcPlPlotConfigInfo,
  101. AcArrayObjectCopyReallocator <AcPlPlotConfigInfo> > &deviceList);
  102. // Returns a list of plot style table based on the styType flag specified
  103. // currently installed on a system
  104. virtual bool getStyleList(AcArray<ACHAR *> &list,
  105. long styType = kAllTypes); //VC8: Removed extra qualifier
  106. // Resets the local cache of the devices or plot style tables based on
  107. // the refreshCode specified
  108. virtual void refreshList(RefreshCode refreshCode = kAll);
  109. // Returns the current active plot config object in the Plot Config Manager
  110. // wrapped as a AcPlPlotConfig object
  111. virtual Acad::ErrorStatus getCurrentConfig(AcPlPlotConfig*& pConfig);
  112. // Creates a plot config for the specified device, wraps it as a
  113. // AcPlPlotConfig object and returns it
  114. virtual Acad::ErrorStatus setCurrentConfig(AcPlPlotConfig*& pConfig,
  115. const ACHAR * pDeviceName);
  116. // Returns the localized name for the default pc3 files that are
  117. // installed with AutoCAD
  118. virtual const ACHAR * getStdConfigName(StdConfigs stdConfig);
  119. // Returns a pointer to the current global thin plot config manager
  120. virtual HT_Thin_Plot_Config_Manager* thinPltCfgMgr(); // (for internal use only)
  121. // Returns a pointer to the Plot Config Manager's error handler
  122. virtual HT_Error_Handler* errorHandler(); // (for internal use only)
  123. // Returns a pointer the parent error handler (ACAD_Err_Handler)
  124. virtual HT_Error_Handler* acadErrorHandler(); // (for internal use only)
  125. };
  126. ACPL_PORT AcPlPlotConfigManager* __stdcall acplPlotConfigManagerPtr();
  127. #define acplPlotConfigManager acplPlotConfigManagerPtr()
  128. #endif // ACPLPLOTCONFIGMGR_H