AcPlPlotConfig.h 5.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104105106107108109110111112113114115116117118119120121122123124125126127128129130131132133134135136137138139140
  1. //
  2. //////////////////////////////////////////////////////////////////////////////
  3. //
  4. // Copyright 2015 Autodesk, Inc. All rights reserved.
  5. //
  6. // Use of this software is subject to the terms of the Autodesk license
  7. // agreement provided at the time of installation or download, or which
  8. // otherwise accompanies this software in either electronic or hard copy form.
  9. //
  10. //////////////////////////////////////////////////////////////////////////////
  11. // DESCRIPTION: Header for Document and Document Manager Classes.
  12. //
  13. #ifndef ACPLPLOTCONFIG_H
  14. #define ACPLPLOTCONFIG_H
  15. #include "AcPl.h"
  16. #include "AcArray.h"
  17. #include "gepnt2d.h"
  18. #include "geblok2d.h"
  19. #include "dblayout.h"
  20. class HT_Plot_Config;
  21. class HT_Media_Size;
  22. class HT_Media_Description;
  23. class AcPlPlotConfig : public AcPlObject
  24. {
  25. ACPL_DECLARE_MEMBERS(AcPlPlotConfig)
  26. public:
  27. enum PlotToFileCapability {
  28. kNoPlotToFile = 0,
  29. kPlotToFileAllowed = 1,
  30. kMustPlotToFile = 2
  31. };
  32. public:
  33. ACPL_PORT virtual ~AcPlPlotConfig();
  34. ACPL_PORT virtual Acad::ErrorStatus copyFrom(const AcRxObject* pSrc);
  35. // returns the description field information - driver name
  36. // location, comment, port name, server name and tag line
  37. ACPL_PORT virtual void getDescriptionFields(ACHAR*& pDriverName,
  38. ACHAR*& pLocationName,
  39. ACHAR*& pComment,
  40. ACHAR*& pPortName,
  41. ACHAR*& pServerName,
  42. ACHAR*& pTagLine) const;
  43. // returns the current device name from the current plot config
  44. ACPL_PORT virtual const ACHAR* deviceName() const;
  45. // returns the full path name if the current plot config is of a pc3 file
  46. // or the UNC name if it is a system printer
  47. ACPL_PORT virtual const ACHAR* fullPath() const;
  48. // returns the maximum DPI supported by the device
  49. ACPL_PORT virtual unsigned int maxDeviceDPI() const;
  50. // returns the deviceType for the current plot config device
  51. ACPL_PORT virtual unsigned long deviceType() const;
  52. // returns the canonical media name list for the current device
  53. ACPL_PORT virtual void getCanonicalMediaNameList(AcArray<ACHAR*> &mediaList) const;
  54. // given a canonical media name, returns its local media name
  55. ACPL_PORT virtual void getLocalMediaName(const ACHAR* pCanonicalMediaName,
  56. ACHAR* &pLocalMediaName) const;
  57. // returns the media bounds (page size and printable bounds) for the
  58. // canonical media name passed in
  59. ACPL_PORT virtual void getMediaBounds(const ACHAR* pCanonicalMediaName,
  60. AcGePoint2d &pageSize,
  61. AcGeBoundBlock2d &printableArea) const;
  62. // resets the current cached media name list
  63. ACPL_PORT virtual void refreshMediaNameList();
  64. // gets/sets the config's plot to file setting
  65. ACPL_PORT virtual bool isPlotToFile() const;
  66. ACPL_PORT virtual Acad::ErrorStatus setPlotToFile(bool bPlotToFile);
  67. // returns the device's default file extension (if any)
  68. // including the leading '.'
  69. ACPL_PORT virtual Acad::ErrorStatus getDefaultFileExtension(const ACHAR*& pDefaultExtension) const;
  70. // returns the device's plot-to-file capability
  71. ACPL_PORT virtual PlotToFileCapability plotToFileCapability() const;
  72. // saves the current configuration to the specified pc3 file
  73. // Note: This doesn't load the saved pc3 as current config.
  74. // Use the method getPlotConfig() and pass in saved pc3 file to
  75. // get to the plot config
  76. ACPL_PORT virtual bool saveToPC3(const ACHAR* pPC3Name);
  77. // returns the current HT_Plot_Config object (for internal use only)
  78. ACPL_PORT virtual HT_Plot_Config* plotConfig() const;
  79. // internal use only
  80. ACPL_PORT virtual unsigned long isCustomPossible(double width, double height,
  81. bool bIsDimensional, bool bIsSheet, int dpi, const
  82. ACHAR * pPC3Dir) const;
  83. // internal use only
  84. ACPL_PORT virtual bool matchMediaSize(double page_x, double page_y,
  85. double printable_w, double printable_h,
  86. AcDbLayout::PlotPaperUnits units,
  87. bool bIsSheet, int dpi,
  88. const ACHAR * pTargetCanonicalName,
  89. ACHAR *& pNearestSizeName,
  90. ACHAR *& pLocalizedName,
  91. double & scaleFactor);
  92. // internal use only
  93. ACPL_PORT virtual Acad::ErrorStatus makeCustomMediaFromSizeDesc(
  94. HT_Media_Size * pSize, HT_Media_Description * pDesc,
  95. bool bSameDriver, bool bSavePC3,
  96. const ACHAR * pSourceEntry, const ACHAR * pSourceName,
  97. ACHAR *& pCanonicalSizeName, ACHAR *& pLocalizedSizeName,
  98. ACHAR *& pPMPPath, ACHAR *& pPC3Path, int dpi, double & scaleFactor);
  99. protected:
  100. friend class AcPlPlotConfigManagerImp;
  101. friend class AcPlPlotInfoImp;
  102. friend class AcPlPlotInfoValidatorImp;
  103. AcPlPlotConfig(HT_Plot_Config* pConfig, const ACHAR* pDevName,
  104. const ACHAR* pFullPath, unsigned long nDevType);
  105. AcPlPlotConfig(const AcPlPlotConfig* pOther);
  106. private:
  107. AcPlPlotConfig();
  108. };
  109. #endif // ACPLPLOTCONFIG_H