InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IImageCacheMgr.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Dave Stephens
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 // Purpose of Interface:
24 // The IImageCacheMgr is a centralized list of image caches which lives off of
25 // kDocWorkspaceBoss. It can be accessed by anyone at any time allowing image
26 // caches to be purged separately from the IShape instance which generated it.
27 // Moreover, it will allow clients to purge a cache based on when it was last
28 // used, its size and amount of time required to regenerate it.
29 //
30 //========================================================================================
31 
32 #ifndef __IImageCacheMgr__
33 #define __IImageCacheMgr__
34 
35 #include "IPMUnknown.h"
36 #include "IImageStreamManager.h"
37 #include "ImageID.h"
38 
39 class IImageCache;
40 
51 class IImageCacheMgr : public IPMUnknown
52 {
53 public:
54  enum { kDefaultIID = IID_IIMAGECACHEMGR };
55 
59  enum {
60  kWildCard = 0, // matches anything
61  kRasterImage = 1,
62  kAlphaMask = 2,
63  kLinkThumbnail = 4,
64  kUncalibratedRasterImage = 5,
65 
66  // Transparency effect masks (yes, in theory, there really could be this many on a page item)
67  kXP_DSH_PI = 10,
68  kXP_DSH_ST = 11,
69  kXP_DSH_FI = 12,
70  kXP_DSH_CT = 13,
71  kXP_ISH_PI = 14,
72  kXP_ISH_ST = 15,
73  kXP_ISH_FI = 16,
74  kXP_ISH_CT = 17,
75  kXP_OGL_PI = 18,
76  kXP_OGL_ST = 19,
77  kXP_OGL_FI = 20,
78  kXP_OGL_CT = 21,
79  kXP_IGL_PI = 22,
80  kXP_IGL_ST = 23,
81  kXP_IGL_FI = 24,
82  kXP_IGL_CT = 25,
83  kXP_BE1_PI = 26,
84  kXP_BE1_ST = 27,
85  kXP_BE1_FI = 28,
86  kXP_BE1_CT = 29,
87  kXP_BE2_PI = 30,
88  kXP_BE2_ST = 31,
89  kXP_BE2_FI = 32,
90  kXP_BE2_CT = 33,
91  kXP_BE3_PI = 34,
92  kXP_BE3_ST = 35,
93  kXP_BE3_FI = 36,
94  kXP_BE3_CT = 37,
95  kXP_BE4_PI = 38,
96  kXP_BE4_ST = 39,
97  kXP_BE4_FI = 40,
98  kXP_BE4_CT = 41,
99  kXP_SAT_PI = 42,
100  kXP_SAT_ST = 43,
101  kXP_SAT_FI = 44,
102  kXP_SAT_CT = 45,
103  kXP_FTH_PI = 46,
104  kXP_FTH_ST = 47,
105  kXP_FTH_FI = 48,
106  kXP_FTH_CT = 49,
107  kXP_DRF_PI = 50,
108  kXP_DRF_ST = 51,
109  kXP_DRF_FI = 52,
110  kXP_DRF_CT = 53,
111  kXP_GRF_PI = 54,
112  kXP_GRF_ST = 55,
113  kXP_GRF_FI = 56,
114  kXP_GRF_CT = 57
115  };
116 
133  virtual ErrorCode Add(const UIDRef& imageRef, IImageCache* cache, bool8 purgeFirst = kFalse, uint32 selector = kRasterImage) = 0;
134 
138  virtual uint32 Purge(const UIDRef& imageRef, IImageCache* cache) = 0;
139 
143  virtual uint32 Purge(const UIDRef& imageRef, const PMReal& resolution, uint32 selector = kWildCard) = 0;
144 
149  virtual uint32 Purge(const UIDRef& imageRef, uint32 selector = kWildCard) = 0;
150 
155  virtual uint32 Purge(const IDataBase *db, uint32 selector = kWildCard) = 0;
156 
160  virtual uint32 GetSize(void) const = 0;
161 
176  virtual bool16 GetClosestMatchResolution(const UIDRef& imageRef, PMReal& resolution, uint32 selector = kRasterImage,
177  uint32* selectorFound = nil) const = 0;
178 
193  virtual IImageCache* QueryClosestResolution(const UIDRef& imageRef, const PMReal& resolution, uint32 selector = kRasterImage,
194  uint32* selectorFound = nil) = 0;
195 
208  virtual IImageCache* QueryPreviousResolution(const UIDRef& imageRef, const IImageCache& currentCache, uint32 selector = kRasterImage,
209  uint32* selectorFound = nil) = 0;
210 
223  virtual IImageCache* QueryNextResolution(const UIDRef& imageRef, const IImageCache& currentCache, uint32 selector = kRasterImage,
224  uint32* selectorFound = nil) = 0;
225 
253  virtual IImageCache* Resample(const UIDRef& imageRef, uint32 srcSelector, uint32 dstSelector, const PMReal &resToResampleFrom,
254  const PMReal &resToResampleTo, IImageStreamManager::ResamplingType &sampleType,
255  bool32 bForceNonVirtual = kFalse) = 0;
256 
261  virtual void SetMaxSize(uint32 kiloBytes) = 0;
262 
267  virtual void PurgeMemory(int32 level, bool16 inGrowZone) = 0; // levels from MemUtils.h
268 };
269 
270 #endif