InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
ILinkResourceHandler.h
1 //========================================================================================
2 //
3 // $File$
4 //
5 // Owner: Michael Easter
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 // Description:
24 // This class defines an interface that implements behavior for an ILinkResource that
25 // is specific to the type of the resource as identified by the scheme of the link
26 // resource's URI.
27 //
28 //========================================================================================
29 
30 #ifndef __ILinkResourceHandler__
31 #define __ILinkResourceHandler__
32 
33 // ----- Includes -----
34 #include "IPMUnknown.h"
35 #include "LinksID.h"
36 #include "AppInfo.h"
37 
38 #include "ILinkResource.h"
39 
40 
65 {
66 public:
67  enum { kDefaultIID = IID_ILINKRESOURCEHANDLER };
68 
78  virtual bool Init(const UIDRef& ref, const URI& uri) = 0;
79 
86  virtual bool IsResourceURIValid(const UIDRef& ref, const URI& uri) const = 0;
87 
94  virtual bool AreResourceIdsEquivalent(const ILinkResource::ResourceId& id1, const ILinkResource::ResourceId& id2) const = 0;
95 
102  virtual FileTypeInfo GetResourceDataType(const UIDRef& ref, const URI& uri) const = 0;
103 
118  virtual WideString GetShortResourceName(const UIDRef& ref, const URI& uri, bool bUIName) const = 0;
119 
133  virtual WideString GetLongResourceName(const UIDRef& ref, const URI& uri, bool bUIName) const = 0;
134 
145  virtual PMString GetResourceStateInfo(const UIDRef& ref, const URI& uri, ILinkResource::ResourceState state, ILinkResource::ResourceStoreState storeState) const = 0;
146 
153  virtual bool AreStampsEquivalent(const WideString& stamp1, const WideString& stamp2) const = 0;
154 
161  virtual bool CanReadResource(const UIDRef& ref, const URI& uri) const = 0;
162 
169  virtual bool CanWriteResource(const UIDRef& ref, const URI& uri) const = 0;
170 
177  virtual bool CanReadWriteResource(const UIDRef& ref, const URI& uri) const = 0;
178 
186  virtual bool CanCreateResourceStream(const UIDRef& ref, const URI& uri, ILinkResource::AccessMode access) const = 0;
187 
196  virtual IPMStream* CreateResourceReadStream(const UIDRef& ref, const URI& uri) const = 0;
197 
206  virtual IPMStream* CreateResourceWriteStream(const UIDRef& ref, const URI& uri) const = 0;
207 
216  virtual IPMStream* CreateResourceReadWriteStream(const UIDRef& ref, const URI& uri) const = 0;
217 
224  virtual bool CanCacheResource(const UIDRef& ref, const URI& uri) const = 0;
225 
232  virtual bool CanEmbedResource(const UIDRef& ref, const URI& uri) const = 0;
233 
240  virtual bool CanUnembedResource(const UIDRef& ref, const URI& uri) const = 0;
241 
248  virtual bool CanCopyToFile(const UIDRef& ref, const URI& uri) const = 0;
249 
257  virtual ErrorCode CopyToFile(const UIDRef& ref, const URI& uri, IDFile& file) const = 0;
258 
265  virtual bool CanEditResource(const UIDRef& ref, const URI& uri) const = 0;
266 
276  virtual ErrorCode EditResource(const UIDRef& ref, const URI& uri, const AppInfo& appInfo, PMString* errorString) const = 0;
277 
284  virtual bool CanRevealResource(const UIDRef& ref, const URI& uri) const = 0;
285 
292  virtual ErrorCode RevealResource(const UIDRef& ref, const URI& uri) const = 0;
293 
300  virtual bool CanRevealResourceInBridge(const UIDRef& ref, const URI& uri) const = 0;
301 
308  virtual ErrorCode RevealResourceInBridge(const UIDRef& ref, const URI& uri) const = 0;
309 
316  virtual bool CanRevealResourceInCloudLibraries(const UIDRef& ref, const URI& uri) const = 0;
317 
324  virtual ErrorCode RevealResourceInCloudLibraries(const UIDRef& ref, const URI& uri) const = 0;
325 
332  virtual bool CanGetXMPPacketInfo(const UIDRef& ref, const URI& uri) const = 0;
333 
341  virtual bool GetXMPPacketInfo(const UIDRef& resourceRef, const URI& uri, std::string& packet) const = 0;
342 
350  virtual bool CanDownloadOriginalResource(const UIDRef& ref, const URI& uri) const = 0;
351 
359  virtual ErrorCode DownloadOriginalResource(const UIDRef& ref, const URI& uri) const = 0;
360 
369  virtual ErrorCode AsyncDownloadOriginalResource(const UIDRef& ref, const URI& uri, ILinkResource::DownloadCompletionFunction completionFunction) const = 0;
370 
378  virtual bool CanReplaceFPOWithOriginalResource(const UIDRef& ref, const URI& uri) const = 0;
379 
387  virtual ILinkResource::ResourceDownloadState GetResourceDownloadProgress(const UIDRef& ref, const URI& uri, PMReal& progress) const = 0;
388 
395  virtual bool CanProvideFile(const UIDRef& ref, const URI& uri) const = 0;
396 
404  virtual ErrorCode GetFile(const UIDRef& ref, const URI& uri, IDFile& idFile) const = 0;
405 
406  /*
407  Determines if a resource can get the underlying instance name or not.
408  @return true if the resource can provide the underlying instance name.
409  */
410  virtual bool canGetInstanceName() const = 0;
411 
412  /*
413  Get the underlying instance name from the link resource.
414  @param instanceURI [OUT] authority component of the instance.
415  return kSucess if it the instance name is available, else an error code.
416  */
417  virtual ErrorCode GetInstanceName(PMString &instanceURI) const = 0;
418 
419 };
420 
421 #endif // __ILinkResourceHandler__