InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
HTTPAssetLinkResourceHandler Class Reference

#include <HTTPAssetLinkResourceHandler.h>

Inheritance diagram for HTTPAssetLinkResourceHandler:
CPMUnknown< ILinkResourceHandler >ILinkResourceHandlerIPMUnknownCusHttpLnkLinkResourceHandler

Public Types

typedef CPMUnknown
< ILinkResourceHandler
inherited
 
typedef object_type data_type
 

Public Member Functions

 HTTPAssetLinkResourceHandler (IPMUnknown *boss)
 
virtual bool Init (const UIDRef &ref, const URI &uri)
 
virtual bool IsResourceURIValid (const UIDRef &ref, const URI &uri) const
 
virtual bool AreResourceIdsEquivalent (const ILinkResource::ResourceId &id1, const ILinkResource::ResourceId &id2) const
 
virtual FileTypeInfo GetResourceDataType (const UIDRef &ref, const URI &uri) const
 
virtual WideString GetShortResourceName (const UIDRef &ref, const URI &uri, bool bUIName) const
 
virtual WideString GetLongResourceName (const UIDRef &ref, const URI &uri, bool bUIName) const
 
virtual PMString GetResourceStateInfo (const UIDRef &ref, const URI &uri, ILinkResource::ResourceState state, ILinkResource::ResourceStoreState storeState) const
 
virtual bool AreStampsEquivalent (const WideString &stamp1, const WideString &stamp2) const
 
virtual bool CanReadResource (const UIDRef &ref, const URI &uri) const
 
virtual bool CanWriteResource (const UIDRef &ref, const URI &uri) const
 
virtual bool CanReadWriteResource (const UIDRef &ref, const URI &uri) const
 
virtual bool CanCreateResourceStream (const UIDRef &ref, const URI &uri, ILinkResource::AccessMode mode) const
 
virtual IPMStreamCreateResourceReadStream (const UIDRef &ref, const URI &uri) const
 
virtual IPMStreamCreateResourceWriteStream (const UIDRef &ref, const URI &uri) const
 
virtual IPMStreamCreateResourceReadWriteStream (const UIDRef &ref, const URI &uri) const
 
virtual bool CanCacheResource (const UIDRef &ref, const URI &uri) const
 
virtual bool CanEmbedResource (const UIDRef &ref, const URI &uri) const
 
virtual bool CanUnembedResource (const UIDRef &ref, const URI &uri) const
 
virtual bool CanCopyToFile (const UIDRef &ref, const URI &uri) const
 
virtual ErrorCode CopyToFile (const UIDRef &ref, const URI &uri, IDFile &file) const
 
virtual bool CanEditResource (const UIDRef &ref, const URI &uri) const
 
virtual ErrorCode EditResource (const UIDRef &ref, const URI &uri, const AppInfo &appInfo, PMString *errorString) const
 
virtual bool CanRevealResource (const UIDRef &ref, const URI &uri) const
 
virtual ErrorCode RevealResource (const UIDRef &ref, const URI &uri) const
 
virtual bool CanRevealResourceInBridge (const UIDRef &ref, const URI &uri) const
 
virtual ErrorCode RevealResourceInBridge (const UIDRef &ref, const URI &uri) const
 
virtual bool CanRevealResourceInCloudLibraries (const UIDRef &ref, const URI &uri) const
 
virtual ErrorCode RevealResourceInCloudLibraries (const UIDRef &ref, const URI &uri) const
 
virtual bool GetXMPPacketInfo (const UIDRef &resourceRef, const URI &uri, std::string &packet) const
 
virtual bool CanGetXMPPacketInfo (const UIDRef &ref, const URI &uri) const
 
virtual bool CanReplaceFPOWithOriginalResource (const UIDRef &ref, const URI &uri) const
 
virtual bool CanDownloadOriginalResource (const UIDRef &ref, const URI &uri) const
 
virtual ErrorCode DownloadOriginalResource (const UIDRef &ref, const URI &uri) const
 
virtual ErrorCode AsyncDownloadOriginalResource (const UIDRef &ref, const URI &uri, ILinkResource::DownloadCompletionFunction completionFunction) const
 
virtual
ILinkResource::ResourceDownloadState 
GetResourceDownloadProgress (const UIDRef &ref, const URI &uri, PMReal &progress) const
 
virtual bool CanProvideFile (const UIDRef &ref, const URI &uri) const
 
virtual ErrorCode GetFile (const UIDRef &ref, const URI &uri, IDFile &idFile) const
 
virtual bool IsHTTPSSupportedURI (const URI &uri) const
 
virtual bool canGetInstanceName () const
 
virtual ErrorCode GetInstanceName (PMString &uri) const
 
- Public Member Functions inherited from CPMUnknown< ILinkResourceHandler >
IPMUnknownQueryInterface (PMIID interfaceID) const
 
void AddRef () const
 
void Release () const
 
void PreDirty (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
void PreDirtyNoMessage (ImplementationID prop=kInvalidImpl, bool16 allowModification=kTrue)
 
 CPMUnknown (const CPMUnknown &)=delete
 
CPMUnknownoperator= (const CPMUnknown &)=delete
 

Protected Attributes

bool fbInited
 
InterfacePtr
< IHTTPLinkResourceServerCache
fCache
 
InterfacePtr
< IHTTPLinkResourceConnection
fConnection
 
WideString fShortNameCache
 
WideString fShortUINameCache
 
WideString fLongNameCache
 
WideString fLongUINameCache
 
- Protected Attributes inherited from CPMUnknown< ILinkResourceHandler >
HelperInterface fHelperInterface
 

Additional Inherited Members

- Protected Member Functions inherited from CPMUnknown< ILinkResourceHandler >
 CPMUnknown (IPMUnknown *boss)
 

Detailed Description

Experimental header - will be modified/documented in future.

Member Function Documentation

virtual bool HTTPAssetLinkResourceHandler::AreResourceIdsEquivalent (const ILinkResource::ResourceIdid1,
const ILinkResource::ResourceIdid2 
) const
virtual

Called to determine if the given resource references are equivalent.

Parameters
id1[IN] Resource identifier to compare with id2.
id2[IN] Resource identifier to compare with id1.
Returns
True if the given resource identifiers are equivalent, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::AreStampsEquivalent (const WideStringstamp1,
const WideStringstamp2 
) const
virtual

Called to determine if the given resource stamps are equivalent.

Parameters
stamp1[IN] Stamp to compare with stamp2.
stamp2[IN] Stamp to compare with stamp1.
Returns
True if the given stamps are equivalent, else false.

Implements ILinkResourceHandler.

virtual ErrorCode HTTPAssetLinkResourceHandler::AsyncDownloadOriginalResource (const UIDRefref,
const URIuri,
ILinkResource::DownloadCompletionFunction completionFunction 
) const
virtual

Called to download original asynchronously for an FPO resource.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to be downloaded.
completionFunction[IN] completion function to be called at the end of download.
Returns
kSuccess if the resource can be downloaded.
See Also
ILinkResourceRenditionData::ResourceRenditionType

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanCacheResource (const UIDRefref,
const URIuri 
) const
inlinevirtual

Called to determine if a resource can be cached.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be cached, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanCopyToFile (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if a resource can be copied to a file.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be copied to a file, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanCreateResourceStream (const UIDRefref,
const URIuri,
ILinkResource::AccessMode access 
) const
virtual

Called to determine if a resource can currently be opened with the given access mode.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
access[IN] Type of access desired.
Returns
True if the resource can be opened with the given access mode, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanDownloadOriginalResource (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if the original for an FPO resource can be downloaded.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the link resource.
Returns
true if the resource can be downloaded, else false.
See Also
ILinkResourceRenditionData::ResourceRenditionType

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanEditResource (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if a resource can be edited.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be edited, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanEmbedResource (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if a resource can be embedded.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be embedded, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanGetXMPPacketInfo (const UIDRefref,
const URIuri 
) const
virtual

Determines if we can get the XMP Info for the resource.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the link resource.
Returns
true if we can get the XMP info else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanProvideFile (const UIDRefref,
const URIuri 
) const
virtual

Determines if a resource can provide the underlying file or not.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the link resource.
Returns
true if the resource can provide the file.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanReadResource (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if a resource can be read.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be read, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanReadWriteResource (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if a resource can be read and written simultaneously.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be read and written simultaneously, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanReplaceFPOWithOriginalResource (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if the FPO resource can be replaced with original.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the link resource.
Returns
true if the FPO resource can be replaced with the original.
See Also
ILinkResourceRenditionData::ResourceRenditionType

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanRevealResource (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if a resource can be revealed.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be revealed, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanRevealResourceInBridge (const UIDRefref,
const URIuri 
) const
inlinevirtual

Called to determine if a resource can be revealed in Adobe Bridge

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be revealed, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanRevealResourceInCloudLibraries (const UIDRefref,
const URIuri 
) const
inlinevirtual

Called to determine if a resource can be revealed in CC Libraries panel

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be revealed, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanUnembedResource (const UIDRefref,
const URIuri 
) const
inlinevirtual

Called to determine if a resource can be unembedded.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be unembedded, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::CanWriteResource (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if a resource can be written.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to check.
Returns
True if the resource can be written, else false.

Implements ILinkResourceHandler.

virtual ErrorCode HTTPAssetLinkResourceHandler::CopyToFile (const UIDRefref,
const URIuri,
IDFilefile 
) const
virtual

Called to copy a resource to the given file.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to copy.
file[IN] File to copy the resource to.
Returns
kSuccess if the resource was successfuly copied, else an error code.

Implements ILinkResourceHandler.

virtual IPMStream* HTTPAssetLinkResourceHandler::CreateResourceReadStream (const UIDRefref,
const URIuri 
) const
virtual

Called to create a stream that can be used to read data from a resource. \ The caller assumes responsibility for deleting the stream.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to create a read stream for.
Returns
Pointer to a read stream. \ Nil if the resource is not readable.

Implements ILinkResourceHandler.

virtual IPMStream* HTTPAssetLinkResourceHandler::CreateResourceReadWriteStream (const UIDRefref,
const URIuri 
) const
virtual

Called to create a stream that can be used to read and write data from/to a resource. \ The caller assumes responsibility for deleting the stream.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to create a read/write stream for.
Returns
Pointer to a read/write stream. \ Nil if a read/write stream is not supported.

Implements ILinkResourceHandler.

virtual IPMStream* HTTPAssetLinkResourceHandler::CreateResourceWriteStream (const UIDRefref,
const URIuri 
) const
virtual

Called to create a stream that can be used to write data to a resource. \ The caller assumes responsibility for deleting the stream.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to create a write stream for.
Returns
Pointer to a write stream. \ Nil if the resource is not writable.

Implements ILinkResourceHandler.

virtual ErrorCode HTTPAssetLinkResourceHandler::DownloadOriginalResource (const UIDRefref,
const URIuri 
) const
virtual

Called to download original synchronously for an FPO resource.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to be downloaded.
Returns
kSuccess if the resource was downloaded.
See Also
ILinkResourceRenditionData::ResourceRenditionType

Implements ILinkResourceHandler.

virtual ErrorCode HTTPAssetLinkResourceHandler::EditResource (const UIDRefref,
const URIuri,
const AppInfoappInfo,
PMStringerrorString 
) const
virtual

Called to edit a resource.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to edit.
appInfo[IN] Indicates which app to edit the resource with. kNullAppInfo means use the default editor.
errorString[OUT] If editing fails, this fills out an error message when the string pointer is non-nil
Returns
kSuccess if the resource was successfully edited, else an error code.

Implements ILinkResourceHandler.

virtual ErrorCode HTTPAssetLinkResourceHandler::GetFile (const UIDRefref,
const URIuri,
IDFileidFile 
) const
virtual

Get the underlying file from the link resource.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the link resource.
idFile[OUT] IDFile of the underlying link resource.
Returns
kSuccess if the underlying file is available, else an error code.

Implements ILinkResourceHandler.

virtual WideString HTTPAssetLinkResourceHandler::GetLongResourceName (const UIDRefref,
const URIuri,
bool bUIName 
) const
virtual

Called to get a resource's long name. \ For example, the long name for a file resource is the file's full path.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to get a long name for.
bUIName[IN] Denotes to return the resource's long UI name if different from the resource's actual long name.\ In some cases, resources may want to have long UI name that differs from the resource's actual long name. For example, file resources on the Mac return a POSIX path as the resource's actual long name, and a HFS/POSIX path as the resource's long UI name.
Returns
Resource's long name.

Implements ILinkResourceHandler.

Reimplemented in CusHttpLnkLinkResourceHandler.

virtual FileTypeInfo HTTPAssetLinkResourceHandler::GetResourceDataType (const UIDRefref,
const URIuri 
) const
virtual

Called to get a resource's data/file type.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to get the data/file type for.
Returns
Resource's data/file type.

Implements ILinkResourceHandler.

virtual ILinkResource::ResourceDownloadState HTTPAssetLinkResourceHandler::GetResourceDownloadProgress (const UIDRefref,
const URIuri,
PMRealprogress 
) const
virtual

Return resource's download state and fill progress

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the link resource.
progress[OUT] the download progress, currently unused. resource's download state

Implements ILinkResourceHandler.

virtual PMString HTTPAssetLinkResourceHandler::GetResourceStateInfo (const UIDRefref,
const URIuri,
ILinkResource::ResourceState state,
ILinkResource::ResourceStoreState storeState 
) const
virtual

Called to get additional information about a resource's state. \ The additional information is added to state string the Links UI displays in the link information pane and the status tooltip.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to get a state informational string for.
state[IN] Resource's current availability state.
storeState[IN] Resource's current store state.
Returns
Additional resource state information.

Implements ILinkResourceHandler.

virtual WideString HTTPAssetLinkResourceHandler::GetShortResourceName (const UIDRefref,
const URIuri,
bool bUIName 
) const
virtual

Called to get a resource's short name. \ For example, the short name for a file resource is the file's name.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to get a short name for.
bUIName[IN] Denotes to return the resource's short UI name if different from the resource's actual short name.\ In some cases, resources may want to have short UI name that differs from the resource's actual short name. For example, file resources on the Mac return a POSIX file name as the resource's actual short name, and a HFS/POSIX file name as the resource's short UI name.
Returns
Resource's short name.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::GetXMPPacketInfo (const UIDRefresourceRef,
const URIuri,
std::string & packet 
) const
virtual

Get the XMP Info for the resource

Parameters
resourceRef[IN] UID reference of the link resource.
uri[IN] URI of the link resource.
packet[OUT] the resource's XMP info
Returns
true if the XMP info is filled in packet else false .

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::Init (const UIDRefref,
const URIuri 
)
virtual

Called by the LinkResource to allow the handler to initialize itself. This method can be used by the handler to optimize its resource handling. For example, the handler may want to parse the URI in this method so that calls to other methods can used the parsed information.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the link resource.
Returns
True if the handler initializes without errors, else false.

Implements ILinkResourceHandler.

virtual bool HTTPAssetLinkResourceHandler::IsResourceURIValid (const UIDRefref,
const URIuri 
) const
virtual

Called to determine if the provider supports the given URI.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI to check.
Returns
True if the URI is supported, else false.

Implements ILinkResourceHandler.

virtual ErrorCode HTTPAssetLinkResourceHandler::RevealResource (const UIDRefref,
const URIuri 
) const
virtual

Called to reveal a resource.

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to reveal.
Returns
kSuccess if the resource was successfully revealed, else an error code.

Implements ILinkResourceHandler.

virtual ErrorCode HTTPAssetLinkResourceHandler::RevealResourceInBridge (const UIDRefref,
const URIuri 
) const
inlinevirtual

Called to reveal a resource in Adobe Bridge

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to reveal.
Returns
kSuccess if the resource was successfully revealed, else an error code.

Implements ILinkResourceHandler.

virtual ErrorCode HTTPAssetLinkResourceHandler::RevealResourceInCloudLibraries (const UIDRefref,
const URIuri 
) const
inlinevirtual

Called to reveal a resource in CC Libraries panel

Parameters
ref[IN] UID reference of the link resource.
uri[IN] URI of the resource to reveal.
Returns
kSuccess if the resource was successfully revealed, else an error code.

Implements ILinkResourceHandler.

Member Data Documentation

bool HTTPAssetLinkResourceHandler::fbInited
protected

Denotes whether the handler was able to successfully initialize via a call to Init() by converting the link resource's URI to an IDFile.

WideString HTTPAssetLinkResourceHandler::fShortNameCache
mutableprotected

Caches used to store the resource's short and long names so that they don't have to regenerated every time. The caches should always be invalidated every time the handler is initialized.