Hot Door CORE 0.8.2
Adobe® Illustrator® Plug-in Library
Loading...
Searching...
No Matches
hdicoreIllustrator.h
Go to the documentation of this file.
1
7#ifndef __HDI_CORE_ILLUSTRATOR__
8#define __HDI_CORE_ILLUSTRATOR__
9
10#if defined(HDI_CORE_AIP_MODE)
11
12#include <map>
13#include <vector>
14
15#include "hdicoreColor.h"
16#include "hdicoreTypes.h"
17
21#define HDI_CORE_ILLUSTRATOR hdi::core::Illustrator::instance()
22
23namespace hdi
24{
25 namespace core
26 {
27 namespace ai
28 {
29 class Preferences;
30 }
31
32 class CurrentDocument;
33 class Document;
34 class FileFormat;
35 class Font;
36 class LiveEffect;
37 class MenuGroup;
38 class ThirdPartyPlugin;
39 class Typeface;
40
41 struct SuiteInfo;
42
47 {
48 public:
49 typedef std::vector< std::shared_ptr<Font> > FontVector;
50 typedef std::map<std::string, SuiteInfo> SuiteInfoMap;
51 typedef std::map< std::string, ThirdPartyPlugin* > ThirdPartyPluginMap;
52
57 {
58 PanelOrControlBarType = 10,
59 ModalOrFloatingDialogType = 20
60 };
61
66 {
67 UnknownBuiltinToolbox = 0,
68 BasicBuiltinToolbox = 1 << 0,
69 AdvancedBuiltinToolbox = 1 << 1
70 };
71
77 {
78 UnknownFolderType = 0,
79 ApplicationFolderType = 10,
80 PluginsFolderType = 20,
81 PrimaryScratchFolderType = 30,
82 SecondaryScratchFolderType = 40,
83 PreferencesFolderType = 50,
84 UserSupportFolderType = 60,
85 UserSupportAIFolderType = 70,
86 UserSupportAIPluginsFolderType = 80,
87 ApplicationSupportCommonFolderType = 90,
88 ApplicationSupportCommonColorFolderType = 100,
89 ApplicationSupportCommonTypeSupportFolderType = 110,
90 ApplicationSupportCommonFontsFolderType = 120,
91 ApplicationSupportCommonFontsRequiredFolderType = 130,
92 ApplicationSupportCommonFontsRequiredCMapsFolderType = 140,
93 RequiredFontsFolderType = 150,
94 FontsFolderType = 160,
95 MyDocumentsFolderType = 170,
96 ApplicationSupportCommonWorkflowFolderType = 180,
97 PrinterDescriptionsFolderType = 190,
98 RequiredPluginsFolderType = 200,
99 SettingsFolderType = 210,
100 ColorTableSettingsFolderType = 220,
101 OptimizeSettingsFolderType = 230,
102 HelpFolderType = 240,
103 RootFolderType = 250,
104 PresetsFolderType = 260,
105 PresetActionsFolderType = 270,
106 PresetBrushesFolderType = 280,
107 PresetGradientsFolderType = 290,
108 PresetKeyboardShortcutsFolderType = 300,
109 PresetPatternsFolderType = 310,
110 PresetScriptsFolderType = 320,
111 PresetStylesFolderType = 330,
112 PresetSwatchesFolderType = 340,
113 DictionariesFolderType = 350,
114 LegalFolderType = 360,
115 SampleFilesFolderType = 370,
116 UtilitiesFolderType = 380,
117 PackageFolderType = 390,
118 ApplicationSupportCommonFontsRequiredBaseFolderType = 400,
119 HelpersFolderType = 410,
120 PreviewInFolderType = 420,
121 RidersFileFolderType = 430,
122 HyphenationDictFolderType = 440,
123 ApplicationSupportCommonPDFLFolderType = 450,
124 ApplicationSupportCommonPDFL5FolderType = 460,
125 ApplicationSupportCommonPDFL5CMapsFolderType = 470,
126 ApplicationSupportCommonPDFL5FontsFolderType = 480,
127 ApplicationSupportCommonPrintSupportFolderType = 490,
128 ApplicationSupportCommonColorProfilesFolderType = 500,
129 ApplicationSupportCommonColorSettingsFolderType = 510,
130 ContentsFolderType = 520,
131 HelpImagesFolderType = 530,
132 FontsCMapsFolderType = 540,
133 PresetSymbolsFolderType = 550,
134 TsumeFolderType = 560,
135 SpellingDictFolderType = 570,
136 PresetTemplatesFolderType = 580,
137 FontsCFFolderType = 590,
138 ApplicationSupportCommonKinsokuSetFolderType = 600,
139 ApplicationSupportCommonMojikumeSetFolderType = 610,
140 PresetBlankDocumentsFolderType = 620,
141 UserSupportCommonFontsFolderType = 630,
142 FontsCFTempFolderType = 640,
143 LogsFolderType = 650,
144 SampleArtFolderType = 660,
145 SampleSVGFolderType = 670,
146 SampleGraphDesignsFolderType = 680,
147 SampleDataDrivenGraphicsFolderType = 690,
148 WorkspacesFolderType = 700,
149 PresetColorBooksFolderType = 710,
150 PresetLegacyColorBooksFolderType = 720,
151 PresetSwatchExchangeFolderType = 730,
152 ApplicationSupportCommonLinguisticsFolderType = 740,
153 ApplicationSupportCommonLinguisticsProvidersFolderType = 750,
154 DemonstratorFolderType = 760,
155 ResourcesFolderType = 770,
156 CoolExtrasFolderType = 780,
157 OutputSettingsFolderType = 790,
158 StartupScriptsFolderType = 800,
159 DesktopFolderType = 810,
160 IllustratorFormatsFolderType = 820,
161 AdditionalAIPluginsFolderType = 830,
162 UserWritableStartupFileFolderType = 840,
163 UserWritablePresetBrushesFolderType = 850,
164 UserWritablePresetStylesFolderType = 860,
165 UserWritablePresetSwatchesFolderType = 870,
166 UserWritablePresetSwatchExchangeFolderType = 880,
167 UserWritablePresetSymbolsFolderType = 890,
168 PresetFlashPanelsFolderType = 900,
169 UserWritablePresetSettingsFolderType = 910,
170 UserWritablePresetOptimizeSettingsFolderType = 920,
171 UserWritablePresetOutputSettingsFolderType = 930,
172 UserWritablePresetColorTableSettingsFolderType = 940,
173 RequiredStartupProfilesFolderType = 950,
174 PresetWorkspacesFolderType = 960,
175 PresetWelcomeScreenFolderType = 970,
176 RequiredFolderType = 980,
177 RequiredResourcesFolderType = 990,
178 RequiredLocalizedResourcesFolderType = 1000,
179 WSMgrCfgFolderType = 1010,
180 ModifiedWorkspacesFolderType = 1020,
181 ToolsFolderType = 1030,
182 PreferencesRootFolderType = 1040,
183 RequiredLinguisticsFolderType = 1050,
184 TemporaryFolder = 1060
185 };
186
195
202
210 PlatformAppPtr platformApp() const;
211
212 #if defined(WIN_ENV)
220 PlatformAppWindowPtr platformAppWindow() const;
221 #endif
222
236 void* alloc(const int32_t size_) const;
237
253 void* realloc(void* const block_, const int32_t newSize_) const;
254
262 void free(void* const block_) const;
263
271 std::string userName() const;
272
280 std::string userOrganization() const;
281
289 std::string serialNumber() const;
290
298 int32_t majorVersion() const;
299
307 int32_t minorVersion() const;
308
316 int32_t revisionVersion() const;
317
328 int16_t bitness() const;
329
339 std::string versionString(const bool useRevision_ = false) const;
340
348 std::string versionDescription() const;
349
357 SuiteInfoMap allSuites() const;
358
369 ThirdPartyPluginMap allPlugins() const;
370
379 std::unique_ptr<ThirdPartyPlugin> pluginWithName(const std::string& name_) const;
380
389
398
406 uint32_t documentCount() const;
407
416 std::unique_ptr<Document> documentAtIndex(const uint32_t index_) const;
417
429 std::unique_ptr<Document> openDocument(
430 const std::string& path_,
431 const DocumentColorModel colorModel_,
432 const bool showDialog_,
433 const bool forceCopy_ = false
434 ) const;
435
444 bool openURL(const std::string& url_) const;
445
456
463
471 uint32_t fontCount() const;
472
481 std::unique_ptr<Font> fontAtIndex(const uint32_t index_) const;
482
491 std::unique_ptr<Font> fontWithName(const std::string& faceName_) const;
492
500 FontVector allFonts() const;
501
509 uint32_t typefaceCount() const;
510
519 std::unique_ptr<Typeface> typefaceAtIndex(const uint32_t index_) const;
520
528 Locale locale() const;
529
537 std::string localeString() const;
538
546 uint32_t fileFormatCount() const;
547
556 std::unique_ptr<FileFormat> fileFormatAtIndex(const uint32_t index_) const;
557
568
576 uint32_t liveEffectCount() const;
577
586 std::unique_ptr<LiveEffect> liveEffectAtIndex(const uint32_t index_) const;
587
595 uint32_t menuGroupCount() const;
596
611 std::unique_ptr<MenuGroup> menuGroupAtIndex(const uint32_t index_) const;
612
619
626
633
640
648 bool hasContext() const;
649
658 std::string folderPath(const FolderType folder_) const;
659
669 bool checkFolderForFile(const FolderType folder_, const std::string& fileName_) const;
670
679 bool existsInPluginsFolder(const std::string& fileName_) const;
680
689 bool existsInToolsFolder(const std::string& fileName_) const;
690
702 bool fileSavePrompt(const std::string& title_, const std::string& fileName_, std::string& path__) const;
703
713 bool fileOpenPrompt(const std::string& title_, std::string& path__) const;
714
724 bool folderPrompt(const std::string& title_, std::string& path__) const;
725
734
742 bool uiThemeDark() const;
743
754 Color uiThemeColor(const ThemeWindowType dialog_, const ThemeComponentType component_) const;
755
769 bool uiShouldScale() const;
770
786 double uiScalingFactor() const;
787
788
789 private:
793 static Illustrator* __instance;
794
798 void* __data;
799
805 Illustrator();
806
812 Illustrator(const Illustrator&);
813
819 Illustrator& operator=(const Illustrator&);
820 };
821 }
822}
823
824#endif
825// HDI_CORE_AIP_MODE
826
827#endif
828// __HDI_CORE_ILLUSTRATOR__
Describes an RGB color, with opacity, typically for UI purposes.
Definition: hdicoreColor.h:32
Current (focused) document class to allow for metadata access, updating, dictionary access,...
Definition: hdicoreCurrentDocument.h:47
Describes a file format that Illustrator can either read or write.
Definition: hdicoreFileFormat.h:24
Allows access to a wide variety of Illustrator app-related runtime attributes, documents,...
Definition: hdicoreIllustrator.h:47
std::string versionString(const bool useRevision_=false) const
Gets the Illustrator version as a string (e.g. "16.0" for Illustrator 16)
bool uiThemeDark() const
Gets whether the current Illustrator UI theme color is considered dark.
CurrentDocument *const currentDocument()
Acquires an instance of the CurrentDocument class for the current document.
std::unique_ptr< Font > fontWithName(const std::string &faceName_) const
Gets a Font object via its name (case-insensitive)
void * realloc(void *const block_, const int32_t newSize_) const
Reallocates a block of memory in Illustrator's memory heap (that was previously allocated using the I...
bool folderPrompt(const std::string &title_, std::string &path__) const
Displays to the user a prompt to choose a folder on disk.
ThirdPartyPluginMap allPlugins() const
Gets a map of all available plugins, keyed on their name.
uint32_t fileFormatCount() const
Gets the count of available file formats.
bool openURL(const std::string &url_) const
Causes the OS's default browser to open a given URL.
FontVector allFonts() const
Gets a vector containing Font objects for all available fonts.
bool checkFolderForFile(const FolderType folder_, const std::string &fileName_) const
Checks whether a given file exists within one of Illustrator's support folders.
double uiScalingFactor() const
Gets the factor by which the Illustrator UI is scaled.
BuiltinToolbox visibleBuiltinToolboxes() const
Gets which built-in toolbox(es) is/are currently showing.
void pushContext()
Pushes a new Illustrator app context onto the stack.
FolderType
Describes a particular folder in an Illustrator installation, whose path can be acquired via the Illu...
Definition: hdicoreIllustrator.h:77
bool registerFileFormat(FileFormat &ff_)
Registers a new file format with Illustrator, which will be displayed in Illustrator's file dialog.
std::string folderPath(const FolderType folder_) const
Gets the folder path for a given illustrator folder.
int16_t bitness() const
Gets the bitness of Illustrator at runtime.
std::unique_ptr< LiveEffect > liveEffectAtIndex(const uint32_t index_) const
Gets a live effect object via its index.
std::unique_ptr< FileFormat > fileFormatAtIndex(const uint32_t index_) const
Gets a file format object via its index.
int32_t revisionVersion() const
Gets the Illustrator revision/bugfix version number (e.g. "2" from "16.0.2")
void cacheFonts()
Caches all the available fonts in an internal map until clearFontCache() is called.
uint32_t fontCount() const
Gets the count of available fonts.
bool fileSavePrompt(const std::string &title_, const std::string &fileName_, std::string &path__) const
Displays to the user a prompt to choose a location and file name for some data to be written to disk.
void suspendExistingContext()
Suspends the existing Illustrator app context, storing it for later resuming.
std::unique_ptr< Typeface > typefaceAtIndex(const uint32_t index_) const
Gets a Typeface object via its index.
uint32_t documentCount() const
Gets the open document count.
SuiteInfoMap allSuites() const
Gets a map of all available suites, keyed on their name.
std::unique_ptr< Document > openDocument(const std::string &path_, const DocumentColorModel colorModel_, const bool showDialog_, const bool forceCopy_=false) const
Opens a document and returns it.
ThemeWindowType
Used when querying for current UI colors.
Definition: hdicoreIllustrator.h:57
ai::Preferences *const preferences() const
Convenience method to return the ai::Preferences instance.
bool hasContext() const
Checks whether an Illustrator app context currently exists.
std::string localeString() const
Gets a string describing the current locale of Illustrator.
PlatformAppPtr platformApp() const
Gets a pointer to the platform object representing the current Illustrator instance.
Locale locale() const
Gets the current locale of Illustrator.
bool existsInToolsFolder(const std::string &fileName_) const
Verifies that a file is located in the Illustrator tools folder.
bool uiShouldScale() const
Gets whether the Illustrator UI should be scaled at all (reads the Illustrator pref for this purpose,...
BuiltinToolbox
Used to describe a given builtin Illustrator toolbox.
Definition: hdicoreIllustrator.h:66
void clearFontCache()
Clears fonts previously cached by the cacheFonts() method.
int32_t majorVersion() const
Gets the Illustrator major version number (e.g. "16" from "16.0.2")
void * alloc(const int32_t size_) const
Allocates a block of memory in Illustrator's memory heap (rather than the caller's memory heap); requ...
std::string serialNumber() const
Gets the serial number of the registered Illustrator user.
void popContext()
Pops a previously pushed Illustrator app context from the stack.
Color uiThemeColor(const ThemeWindowType dialog_, const ThemeComponentType component_) const
Gets the current color for a given widget component.
bool existsInPluginsFolder(const std::string &fileName_) const
Verifies that a file is located in one of the Illustrator plugins folders.
std::string versionDescription() const
Gets the Illustrator version description, a.k.a. the marketed version name.
uint32_t liveEffectCount() const
Gets the count of available live effects.
int32_t minorVersion() const
Gets the Illustrator minor version number (e.g. "0" from "16.0.2")
uint32_t menuGroupCount() const
Gets the count of menu groups in Illustrator (at all levels)
bool fileOpenPrompt(const std::string &title_, std::string &path__) const
Displays to the user a prompt to choose a file to be read from disk.
~Illustrator()
Destructs an Illustrator object.
std::string userName() const
Gets the name of the registered Illustrator user.
void free(void *const block_) const
Frees a block of memory previously allocated with the Illustrator::alloc() method.
std::unique_ptr< ThirdPartyPlugin > pluginWithName(const std::string &name_) const
Gets a specific plugin by its name (must be an exact match)
std::unique_ptr< Font > fontAtIndex(const uint32_t index_) const
Gets a Font object via its index.
std::unique_ptr< MenuGroup > menuGroupAtIndex(const uint32_t index_) const
Gets a menu group object via its index.
std::string userOrganization() const
Gets the organization/company name of the registered Illustrator user.
static Illustrator * instance()
Acquires an instance of the Illustrator class.
uint32_t typefaceCount() const
Gets the count of available typefaces.
std::unique_ptr< Document > documentAtIndex(const uint32_t index_) const
Gets an open document by its index.
void resumeSuspendedContext()
Resumes a previously suspended Illustrator app context.
Allows access to and manipulation of Illustrator app preferences; can be used to store plugin prefere...
Definition: hdicoreaiPreferences.h:29
Header file for describing plugin UI colors.
Header file for a wide variety of necessary typedefs, enums, and forwards declarations.
Locale
Indicates the locale under which the app is running. Many languages are only listed for one country,...
Definition: hdicoreTypes.h:851
DocumentColorModel
Indicates the color model of new document.
Definition: hdicoreTypes.h:366
ThemeComponentType
Used when querying the app for current UI colors.
Definition: hdicoreTypes.h:834