DbSectionManager.h 3.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556575859606162636465666768697071727374757677787980818283848586878889909192
  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. // Name: DbSectionManager.h
  12. //
  13. // Description: Header for AcDbSectionManager and
  14. // AcDbSectionManagerIterator classes.
  15. //
  16. //////////////////////////////////////////////////////////////////////////////
  17. #pragma once
  18. #include "AdAChar.h"
  19. #include "DbSection.h"
  20. class AcDbSection;
  21. class AcDbSectionManagerIterator;
  22. class AcDbImpSectionManager;
  23. //*************************************************************************
  24. // AcDbSectionManager
  25. //*************************************************************************
  26. class AcDbSectionManager : public AcDbObject
  27. {
  28. public:
  29. ACDB_DECLARE_MEMBERS(AcDbSectionManager);
  30. ACDB_PORT Acad::ErrorStatus getSection (const ACHAR* pszName,
  31. AcDbObjectId& id) const;
  32. ACDB_PORT Acad::ErrorStatus getSection (const ACHAR* pszName,
  33. AcDbSection*& pSecPlane,
  34. AcDb::OpenMode mode) const;
  35. ACDB_PORT Acad::ErrorStatus getLiveSection(AcDbObjectId& id) const;
  36. ACDB_PORT Acad::ErrorStatus getLiveSection(AcDbSection*& pSecPlane,
  37. AcDb::OpenMode mode) const;
  38. ACDB_PORT int numSections (void) const;
  39. ACDB_PORT Acad::ErrorStatus newIterator (AcDbSectionManagerIterator*& pIterator) const;
  40. ACDB_PORT Acad::ErrorStatus getUniqueSectionName(const ACHAR* pszBaseName,
  41. ACHAR*& pszUniqueName) const;
  42. // Base class overrides
  43. ACDB_PORT virtual Acad::ErrorStatus dwgInFields (AcDbDwgFiler* pFiler);
  44. ACDB_PORT virtual Acad::ErrorStatus dwgOutFields(AcDbDwgFiler* pFiler) const;
  45. ACDB_PORT virtual Acad::ErrorStatus dxfInFields (AcDbDxfFiler* pFiler);
  46. ACDB_PORT virtual Acad::ErrorStatus dxfOutFields(AcDbDxfFiler* pFiler) const;
  47. public:
  48. // TODO: These should be protected
  49. ACDB_PORT AcDbSectionManager(void);
  50. ACDB_PORT ~AcDbSectionManager(void);
  51. protected:
  52. ACDB_PORT virtual Acad::ErrorStatus subGetClassID (CLSID* pClsid) const;
  53. };
  54. //*************************************************************************
  55. // AcDbSectionManagerIterator
  56. //*************************************************************************
  57. class AcDbSectionManagerIterator
  58. {
  59. public:
  60. ACDB_PORT virtual ~AcDbSectionManagerIterator(void);
  61. ACDB_PORT void start (void);
  62. ACDB_PORT void step (void);
  63. ACDB_PORT bool done (void) const;
  64. ACDB_PORT AcDbObjectId getSection (void) const;
  65. ACDB_PORT Acad::ErrorStatus getSection (AcDbSection*& pSecPlane,
  66. AcDb::OpenMode openMode) const;
  67. protected:
  68. ACDB_PORT AcDbSectionManagerIterator(AcDbSectionManager* pMgr);
  69. protected:
  70. void * mpImpObj;
  71. friend class AcDbImpSectionManager;
  72. };