InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
IHTTPLinkCachedAssetEntry.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 __IHTTPLinkCachedAssetEntry__
28 #define __IHTTPLinkCachedAssetEntry__
29 
30 #include "IPMUnknown.h"
31 #include "LinksID.h"
32 
33 #include "ILinkResource.h"
34 
35 #include "IHTTPLinkResourceServerAPIWrapper.h"
36 /*
37  AdobePatentID="P7137-US"
38  AdobePatentID="P7225-US"
39  AdobePatentID="P7609-US"
40 */
41 
54 {
55 public:
60  virtual bool16 Exists() = 0;
61 
66  virtual bool16 CanRead() = 0;
67 
72  virtual bool16 CanCreateReadStream() = 0;
73 
78  virtual IPMStream* CreateReadStream() = 0;
79 
84  virtual bool16 CanCopyToFile() = 0;
85 
91  virtual ErrorCode CopyToFile(IDFile& outFile) = 0;
92 
97  virtual FileTypeInfo GetFileTypeInfo() = 0;
98 
99  /*
100  Fills the packet with XMPInfo of the cached file.
101  @param packet [OUT] the output packet with XMPInfo of the cached file.
102  @return true if the operation is successful else false
103  */
104  virtual bool GetXMPPacketInfo(std::string& packet) const = 0;
105 
106  /*
107  Checks if we can get the file in cache or not
108  @return true if we can get the file in cache or false
109  */
110  virtual bool CanGetFile() const = 0;
111 
112  /*
113  Fills the passed file with the cached file.
114  @param file [OUT] the output file to be filled with the cached file.
115  @return true if the output file to be filled with the cached file else false
116  */
117  virtual bool GetFile(IDFile& file) const = 0;
118 
123  virtual bool16 IsValid() { return fIsValid; }
124 
130  virtual bool16 IsStale(const IHTTPLinkResourceServerAPIWrapper::AssetMetadataPtr assetCurrentAttributes) = 0;
131 
136  virtual void SetValid(bool16 valid) { fIsValid = valid; }
137 
138  IHTTPLinkCachedAssetEntry() : fIsValid(kTrue) {}
139 
140  virtual ~IHTTPLinkCachedAssetEntry() {}
141 
142  virtual void ReadWrite(IPMStream *s) = 0;
143 
144 private:
145  bool16 fIsValid;
146 };
147 
148 #endif // __IHTTPLinkCachedAssetEntry__