acprofile.h 4.1 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960616263646566676869707172737475767778798081828384858687888990919293949596979899100101102103104
  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. #ifndef _ACPROFILE_H__
  12. #define _ACPROFILE_H__
  13. #include "acarray.h"
  14. #include "AdAChar.h"
  15. #pragma pack (push, 8)
  16. class AcApProfileStorage;
  17. class AcApProfileManagerReactor
  18. {
  19. public:
  20. virtual void currentProfileWillChange(const ACHAR *newProfile);
  21. virtual void currentProfileChanged(const ACHAR *newProfile);
  22. virtual void currentProfileWillBeReset(const ACHAR *currentProfile);
  23. virtual void currentProfileReset(const ACHAR *currentProfile);
  24. virtual void currentProfileWillBeSaved(const ACHAR *currentProfile);
  25. virtual void currentProfileSaved(const ACHAR *currentProfile);
  26. virtual void profileWillReset(const ACHAR *profileName);
  27. virtual void profileReset(const ACHAR *profileName);
  28. virtual void profileWillBeSaved(const ACHAR *profileName);
  29. virtual void profileSaved(const ACHAR *profileName);
  30. virtual ~AcApProfileManagerReactor() {}
  31. };
  32. typedef AcArray<ACHAR *> AcApProfileNameArray;
  33. class AcApProfileManager
  34. {
  35. public:
  36. virtual ~AcApProfileManager() { }
  37. virtual void ProfileRegistryKey(ACHAR *& strRegProfileKey,
  38. const ACHAR * strProfileName)=0;
  39. virtual Acad::ErrorStatus ProfileStorage(AcApProfileStorage*& pStore,
  40. const ACHAR * strProfileName,
  41. BOOL bCreateIfNotExists = TRUE)=0;
  42. virtual Acad::ErrorStatus FixedProfileStorage(AcApProfileStorage*& pStore,
  43. BOOL bCreateIfNotExists = TRUE)=0;
  44. virtual int ProfileListNames(AcApProfileNameArray& nameList)=0;
  45. virtual Acad::ErrorStatus ProfileExport(const ACHAR * strProfileName,
  46. const ACHAR * exportFileName)=0;
  47. virtual Acad::ErrorStatus ProfileImport(const ACHAR * strProfileName,
  48. const ACHAR * importFileName,
  49. const ACHAR * profileDescription,
  50. Adesk::Boolean bImportPathInfo)=0;
  51. virtual Acad::ErrorStatus ProfileDelete(const ACHAR * strProfileName)=0;
  52. virtual Acad::ErrorStatus ProfileReset(const ACHAR * strProfileName)=0;
  53. virtual Acad::ErrorStatus ProfileSetCurrent(const ACHAR * strProfileName)=0;
  54. virtual Acad::ErrorStatus ProfileCopy(const ACHAR * newProfileName,
  55. const ACHAR * oldProfileName,
  56. const ACHAR * newProfileDesc)=0;
  57. virtual Acad::ErrorStatus ProfileRename(const ACHAR * newProfileName,
  58. const ACHAR * oldProfileName,
  59. const ACHAR * newProfileDesc)=0;
  60. virtual void addReactor(AcApProfileManagerReactor* ) = 0;
  61. virtual void removeReactor(AcApProfileManagerReactor* ) = 0;
  62. };
  63. AcApProfileManager* acProfileManagerPtr();
  64. #define acProfileManager acProfileManagerPtr()
  65. class AcApProfileStorage
  66. {
  67. public:
  68. virtual ~AcApProfileStorage() {}
  69. virtual Acad::ErrorStatus CreateNode(const ACHAR * pszNodePath,
  70. IUnknown*& pUnknown) = 0;
  71. virtual Acad::ErrorStatus GetNode(const ACHAR * pszNodePath,
  72. IUnknown*& pUnknown) = 0;
  73. virtual Acad::ErrorStatus ReplaceNode(const ACHAR * pszNodePath,
  74. IUnknown* pUnknown) = 0;
  75. virtual Acad::ErrorStatus DeleteNode(const ACHAR * pszNodePath) = 0;
  76. virtual Acad::ErrorStatus GetStorageFile(AcString& pszFile) = 0;
  77. virtual Acad::ErrorStatus Save(void) = 0;
  78. };
  79. #pragma pack (pop)
  80. #endif // _ACPROFILE_H__