InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IHTTPLinkResourceServerCache.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Sanyam Jain
6 //
7 // $Author$
8 //
9 // $DateTime$
10 //
11 // $Revision$
12 //
13 // $Change$
14 //
15 // ADOBE CONFIDENTIAL
16 //
17 // Copyright 2016 Adobe
18 // All Rights Reserved.
19 //
20 // NOTICE: Adobe permits you to use, modify, and distribute this file in
21 // accordance with the terms of the Adobe license agreement accompanying
22 // it. If you have received this file from a source other than Adobe,
23 // then your use, modification, or distribution of it requires the prior
24 // written permission of Adobe.
25 //
26 //========================================================================================
27 #ifndef __IHTTPLinkResourceServerCache__
28 #define __IHTTPLinkResourceServerCache__
29 
30 #include "IPMUnknown.h"
31 #include "IHTTPLinkCachedAssetEntry.h"
32 #include "LinksID.h"
33 #include "HTTPLinkSubsystemTypes.h"
34 #include "URI.h"
35 #include "IHTTPLinkResourceServerAPIWrapper.h"
36 
37 /*
38  AdobePatentID="P7137-US"
39  AdobePatentID="P7225-US"
40  AdobePatentID="P7609-US"
41  */
42 
52 {
53 public:
54  enum { kDefaultIID = IID_IHTTPLINKRESOURCESERVERCACHE };
55 
62  typedef boost::function<void(
63  const URI& inUri,
65  const float inProgress)> AssetDownloadProgressCallback;
66 
73  typedef boost::function<void(
74  const URI& inUri,
76  std::shared_ptr<IHTTPLinkCachedAssetEntry> cachedAssetEntry)> AssetDownloadCompletionCallback;
77 
82  virtual bool16 Initialize() = 0;
83 
88  virtual bool16 Shutdown() = 0;
89 
99  virtual std::shared_ptr<IHTTPLinkCachedAssetEntry> GetCachedAssetEntry(const URI& inUri,
100  bool16 inDownloadIfMissing = kTrue,
101  HTTPLinkSubsystemTypes::AssetDownloadMode inDownloadMode = HTTPLinkSubsystemTypes::kAssetDownloadMode_Sync,
102  IHTTPLinkResourceServerCache::AssetDownloadProgressCallback downloadProgressCallback = NULL,
103  IHTTPLinkResourceServerCache::AssetDownloadCompletionCallback downloadCompletionCallback = NULL) = 0;
104 
110  virtual bool16 InvalidateCacheForURI(const URI& inUri) = 0;
111 
118  virtual bool16 IsCachedAssetEntryStale(const URI& inUri, const IHTTPLinkResourceServerAPIWrapper::AssetMetadataPtr assetCurrentAttributes) = 0;
119 
125  virtual bool16 PurgeCache(bool16 forcePurgeAll = kFalse) = 0;
126 
133 
141  virtual void ReadWriteSnapshotForBackgroundThread(IPMStream* s) = 0;
142 };
143 
144 #endif // __IHTTPLinkResourceServerCache__