InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IDResourceShell.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Vadim Tkachev
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // Copyright 1997-2010 Adobe Systems Incorporated. All rights reserved.
16 //
17 // NOTICE: Adobe permits you to use, modify, and distribute this file in accordance
18 // with the terms of the Adobe license agreement accompanying it. If you have received
19 // this file from a source other than Adobe, then your use, modification, or
20 // distribution of it requires the prior written permission of Adobe.
21 //
22 //========================================================================================
23 
24 #ifndef __IDResourceShell_h__
25 #define __IDResourceShell_h__
26 
27 #include "LocaleSetting.h"
28 #include <boost/function.hpp>
29 #include "RsrcSpec.h"
30 
31 class PlugInData;
32 
33 
36 namespace IDBaseResourceShell {
37 
44  bool GetPathToPluginResourcesDirectory(const PluginID & pluginID, IDFile & resourcesDir, const PlugInData* pluginData = nil);
45 
46 } //namespace IDBaseResourceShell
47 
48 class IDResourcePrivateWrapper; //forward declaration of private wrapper, this is a private implementation
49 
52 struct IDResource
53 {
54  typedef base_type data_type; //simple shallow copies are sufficient
55 
59  IDResource(IDResourcePrivateWrapper* resource);
60 
63  virtual ~IDResource() {}
64 
68  void* Get() const;
69 
73  size_t Length() const;
74 
78  bool16 IsValid() const;
79 
80 private:
85  boost::shared_ptr<IDResourcePrivateWrapper> fImpl;
86 };
87 
88 namespace IDResourceShell
89 {
96  RsrcID GetLocalizedResourceID(const PluginID pluginId, const RsrcID resourceId);
97 
102  IDResource Get(const RsrcSpec & spec);
103 
108  IDResource GetLocalized(const RsrcSpec & spec);
109 
117  typedef boost::function<bool (IDResource r, void* userData, RsrcSpec spec)> ResourceEnumerationCallback;
118 
126  void EnumerateResourcesByType(const PluginID & pluginId, const RsrcType & resType, ResourceEnumerationCallback enumerate_callback, void* userData = nil);
127 
137  void EnumerateLocalizedResourcesByType(const PluginID & pluginId, const RsrcType & resType, ResourceEnumerationCallback enumerate_callback,
138  void* userData = nil, const PMLocaleId & localeId = LocaleSetting::GetLocale());
139 
140 } //namespace IDResourceShell
141 
142 
143 #endif // __IDResourceShell_h__