Hot Door CORE  0.7.1
Adobe® Illustrator® Plug-in Library
hdicoreIllustrator.h
Go to the documentation of this file.
1 
7 #ifndef __HDI_CORE_ILLUSTRATOR__
8 #define __HDI_CORE_ILLUSTRATOR__
9 
10 #include <map>
11 #include <vector>
12 
13 #include "hdicoreColor.h"
14 #include "hdicoreTypes.h"
15 
19 #define HDI_CORE_ILLUSTRATOR hdi::core::Illustrator::instance()
20 
21 namespace hdi
22 {
23  namespace core
24  {
25  #if defined(MAC_ENV)
26  typedef NSApplication* PlatformAppPtr;
27  #elif defined(WIN_ENV)
28  typedef HINSTANCE PlatformAppPtr;
29  #endif
30 
31  namespace ai
32  {
33  class Preferences;
34  }
35 
36  class CurrentDocument;
37  class Document;
38  class FileFormat;
39  class Font;
40  class LiveEffect;
41  class MenuGroup;
42  class ThirdPartyPlugin;
43  class Typeface;
44 
49  {
50  public:
51  struct SuiteInfo;
52 
53  typedef std::vector< Font* > FontVector;
54  typedef std::map<std::string, SuiteInfo> SuiteInfoMap;
55  typedef std::map< std::string, ThirdPartyPlugin* > ThirdPartyPluginMap;
56 
61  {
62  PanelOrControlBarType = 10,
63  ModalOrFloatingDialogType = 20
64  };
65 
70  {
71  WindowBackgroundColor = 10,
72  LabelTextColor = 20,
73  LabelTextDisabledColor = 30,
74  FieldTextColor = 40,
75  FieldTextDisabledColor = 50,
76  FieldBackgroundColor = 60,
77  FocusRingColor = 70,
78  ShadowColor = 80,
79  HighlightColor = 90
80  };
81 
87  {
88  UnknownFolderType = 0,
89  ApplicationFolderType = 10,
90  PluginsFolderType = 20,
91  PrimaryScratchFolderType = 30,
92  SecondaryScratchFolderType = 40,
93  PreferencesFolderType = 50,
94  UserSupportFolderType = 60,
95  UserSupportAIFolderType = 70,
96  UserSupportAIPluginsFolderType = 80,
97  ApplicationSupportCommonFolderType = 90,
98  ApplicationSupportCommonColorFolderType = 100,
99  ApplicationSupportCommonTypeSupportFolderType = 110,
100  ApplicationSupportCommonFontsFolderType = 120,
101  ApplicationSupportCommonFontsRequiredFolderType = 130,
102  ApplicationSupportCommonFontsRequiredCMapsFolderType = 140,
103  RequiredFontsFolderType = 150,
104  FontsFolderType = 160,
105  MyDocumentsFolderType = 170,
106  ApplicationSupportCommonWorkflowFolderType = 180,
107  PrinterDescriptionsFolderType = 190,
108  RequiredPluginsFolderType = 200,
109  SettingsFolderType = 210,
110  ColorTableSettingsFolderType = 220,
111  OptimizeSettingsFolderType = 230,
112  HelpFolderType = 240,
113  RootFolderType = 250,
114  PresetsFolderType = 260,
115  PresetActionsFolderType = 270,
116  PresetBrushesFolderType = 280,
117  PresetGradientsFolderType = 290,
118  PresetKeyboardShortcutsFolderType = 300,
119  PresetPatternsFolderType = 310,
120  PresetScriptsFolderType = 320,
121  PresetStylesFolderType = 330,
122  PresetSwatchesFolderType = 340,
123  DictionariesFolderType = 350,
124  LegalFolderType = 360,
125  SampleFilesFolderType = 370,
126  UtilitiesFolderType = 380,
127  PackageFolderType = 390,
128  ApplicationSupportCommonFontsRequiredBaseFolderType = 400,
129  HelpersFolderType = 410,
130  PreviewInFolderType = 420,
131  RidersFileFolderType = 430,
132  HyphenationDictFolderType = 440,
133  ApplicationSupportCommonPDFLFolderType = 450,
134  ApplicationSupportCommonPDFL5FolderType = 460,
135  ApplicationSupportCommonPDFL5CMapsFolderType = 470,
136  ApplicationSupportCommonPDFL5FontsFolderType = 480,
137  ApplicationSupportCommonPrintSupportFolderType = 490,
138  ApplicationSupportCommonColorProfilesFolderType = 500,
139  ApplicationSupportCommonColorSettingsFolderType = 510,
140  ContentsFolderType = 520,
141  HelpImagesFolderType = 530,
142  FontsCMapsFolderType = 540,
143  PresetSymbolsFolderType = 550,
144  TsumeFolderType = 560,
145  SpellingDictFolderType = 570,
146  PresetTemplatesFolderType = 580,
147  FontsCFFolderType = 590,
148  ApplicationSupportCommonKinsokuSetFolderType = 600,
149  ApplicationSupportCommonMojikumeSetFolderType = 610,
150  PresetBlankDocumentsFolderType = 620,
151  UserSupportCommonFontsFolderType = 630,
152  FontsCFTempFolderType = 640,
153  LogsFolderType = 650,
154  SampleArtFolderType = 660,
155  SampleSVGFolderType = 670,
156  SampleGraphDesignsFolderType = 680,
157  SampleDataDrivenGraphicsFolderType = 690,
158  WorkspacesFolderType = 700,
159  PresetColorBooksFolderType = 710,
160  PresetLegacyColorBooksFolderType = 720,
161  PresetSwatchExchangeFolderType = 730,
162  ApplicationSupportCommonLinguisticsFolderType = 740,
163  ApplicationSupportCommonLinguisticsProvidersFolderType = 750,
164  DemonstratorFolderType = 760,
165  ResourcesFolderType = 770,
166  CoolExtrasFolderType = 780,
167  OutputSettingsFolderType = 790,
168  StartupScriptsFolderType = 800,
169  DesktopFolderType = 810,
170  IllustratorFormatsFolderType = 820,
171  AdditionalAIPluginsFolderType = 830,
172  UserWritableStartupFileFolderType = 840,
173  UserWritablePresetBrushesFolderType = 850,
174  UserWritablePresetStylesFolderType = 860,
175  UserWritablePresetSwatchesFolderType = 870,
176  UserWritablePresetSwatchExchangeFolderType = 880,
177  UserWritablePresetSymbolsFolderType = 890,
178  PresetFlashPanelsFolderType = 900,
179  UserWritablePresetSettingsFolderType = 910,
180  UserWritablePresetOptimizeSettingsFolderType = 920,
181  UserWritablePresetOutputSettingsFolderType = 930,
182  UserWritablePresetColorTableSettingsFolderType = 940,
183  RequiredStartupProfilesFolderType = 950,
184  PresetWorkspacesFolderType = 960,
185  PresetWelcomeScreenFolderType = 970,
186  RequiredFolderType = 980,
187  RequiredResourcesFolderType = 990,
188  RequiredLocalizedResourcesFolderType = 1000,
189  WSMgrCfgFolderType = 1010,
190  ModifiedWorkspacesFolderType = 1020,
191  ToolsFolderType = 1030,
192  PreferencesRootFolderType = 1040,
193  RequiredLinguisticsFolderType = 1050, // Illustrator 17 and above only
194  TemporaryFolder = 1060 // Illustrator 19 and above only
195  };
196 
200  struct SuiteInfo
201  {
205  const std::string name;
206 
210  const int32_t internalVersion;
211 
216  const int32_t externalVersion;
217 
223  SuiteInfo();
224 
232  SuiteInfo(const SuiteInfo& si_);
233 
243  SuiteInfo(const std::string& name_, const int32_t intVers_, const int32_t extVers_);
244 
250  virtual ~SuiteInfo();
251 
260  bool operator==(const SuiteInfo& rhs_) const;
261 
270  bool operator!=(const SuiteInfo& rhs_) const;
271  };
272 
273  typedef std::auto_ptr<SuiteInfo> SuiteInfoAP;
274 
282  static Illustrator* instance();
283 
289  ~Illustrator();
290 
298  PlatformAppPtr platformApp() const;
299 
313  void* alloc(const int32_t size_) const;
314 
330  void* realloc(void* const block_, const int32_t newSize_) const;
331 
339  void free(void* const block_) const;
340 
348  std::string userName() const;
349 
357  std::string userOrganization() const;
358 
366  std::string serialNumber() const;
367 
375  int32_t majorVersion() const;
376 
384  int32_t minorVersion() const;
385 
393  int32_t revisionVersion() const;
394 
405  int16_t bitness() const;
406 
416  std::string versionString(const bool useRevision_ = false) const;
417 
425  std::string versionDescription() const;
426 
434  SuiteInfoMap allSuites() const;
435 
446  ThirdPartyPluginMap allPlugins() const;
447 
456  std::auto_ptr<ThirdPartyPlugin> pluginWithName(const std::string& name_) const;
457 
465  ai::Preferences* const preferences() const;
466 
474  CurrentDocument* const currentDocument();
475 
483  uint32_t documentCount() const;
484 
493  std::auto_ptr<Document> documentAtIndex(const uint32_t index_) const;
494 
506  std::auto_ptr<Document> openDocument(
507  const std::string& path_,
508  const DocumentColorModel colorModel_,
509  const bool showDialog_,
510  const bool forceCopy_ = false
511  ) const;
512 
521  bool openURL(const std::string& url_) const;
522 
532  void cacheFonts();
533 
539  void clearFontCache();
540 
548  uint32_t fontCount() const;
549 
558  std::auto_ptr<Font> fontAtIndex(const uint32_t index_) const;
559 
568  std::auto_ptr<Font> fontWithName(const std::string& faceName_) const;
569 
579  FontVector allFonts() const;
580 
588  uint32_t typefaceCount() const;
589 
598  std::auto_ptr<Typeface> typefaceAtIndex(const uint32_t index_) const;
599 
607  Locale locale() const;
608 
616  std::string localeString() const;
617 
625  uint32_t fileFormatCount() const;
626 
635  std::auto_ptr<FileFormat> fileFormatAtIndex(const uint32_t index_) const;
636 
646  bool registerFileFormat(FileFormat& ff_);
647 
655  uint32_t liveEffectCount() const;
656 
665  std::auto_ptr<LiveEffect> liveEffectAtIndex(const uint32_t index_) const;
666 
674  uint32_t menuGroupCount() const;
675 
690  std::auto_ptr<MenuGroup> menuGroupAtIndex(const uint32_t index_) const;
691 
697  void suspendExistingContext();
698 
704  void resumeSuspendedContext();
705 
711  void pushContext();
712 
718  void popContext();
719 
720  #if HDI_CORE_COMPILE_AI21_PLUS
721 
728  bool hasContext() const;
729  #endif
730 
739  std::string folderPath(const FolderType folder_) const;
740 
750  bool checkFolderForFile(const FolderType folder_, const std::string& fileName_) const;
751 
760  bool existsInPluginsFolder(const std::string& fileName_) const;
761 
770  bool existsInToolsFolder(const std::string& fileName_) const;
771 
783  bool fileSavePrompt(const std::string& title_, const std::string& fileName_, std::string& path__) const;
784 
794  bool fileOpenPrompt(const std::string& title_, std::string& path__) const;
795 
805  bool folderPrompt(const std::string& title_, std::string& path__) const;
806 
814  bool uiThemeDark() const;
815 
826  Color uiThemeColor(const ThemeWindowType dialog_, const ThemeComponentType component_) const;
827 
842  bool uiShouldScale() const;
843 
844  #if defined(WIN_ENV)
845 
859  double uiScalesDownOrUpFor125() const;
860  #endif
861 
862 
863  private:
867  static Illustrator* __instance;
868 
872  void* __data;
873 
879  Illustrator();
880 
886  Illustrator(const Illustrator&);
887 
893  Illustrator& operator=(const Illustrator&);
894  };
895  }
896 }
897 
898 #endif
899 // __HDI_CORE_ILLUSTRATOR__
const std::string name
Stores the name of the suite.
Definition: hdicoreIllustrator.h:205
Stores basic information about an Illustrator suite.
Definition: hdicoreIllustrator.h:200
std::string versionString()
Gets the version of the hdi_core library as a string.
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:24
ThemeWindowType
Used when querying for current UI colors.
Definition: hdicoreIllustrator.h:60
const int32_t externalVersion
Stores the external (public) version number of the suite (what would be used to acquire the suite) ...
Definition: hdicoreIllustrator.h:216
Allows access to and manipulation of Illustrator app preferences; can be used to store plugin prefere...
Definition: hdicoreaiPreferences.h:26
Header file for describing Illustrator UI colors.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Describes a file format that Illustrator can either read or write.
Definition: hdicoreFileFormat.h:21
Current (focused) document class to allow for metadata access, updating, dictionary access...
Definition: hdicoreCurrentDocument.h:50
FolderType
Describes a particular folder in an Illustrator installation, whose path can be acquired via the Illu...
Definition: hdicoreIllustrator.h:86
Definition: hdicoreaiArray.h:12
Locale
Indicates the locale under which Illustrator is running. Many languages are only listed for one count...
Definition: hdicoreTypes.h:523
Allows access to a wide variety of Illustrator app-related runtime attributes, documents, fonts, etc.
Definition: hdicoreIllustrator.h:48
const int32_t internalVersion
Stores the internal version number of the suite.
Definition: hdicoreIllustrator.h:210
DocumentColorModel
Indicates the color model of new document.
Definition: hdicoreTypes.h:356
ThemeComponentType
Used when querying for current UI colors.
Definition: hdicoreIllustrator.h:69