InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
Facade::IHTMLPageItemFacade Class Referenceabstract

#include <IHTMLPageItemFacade.h>

Inheritance diagram for Facade::IHTMLPageItemFacade:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IHTMLPAGEITEMFACADE }
 

Public Member Functions

virtual bool32 IsHTMLContent (const WideString &text) const =0
 
virtual WideString GetHTMLContent (const IPMUnknown *pageItem) const =0
 
virtual ErrorCode CreateHTMLPageItem (IDataBase *db, const WideString &html, bool32 bAddParentFrame, UIDRef &newPageItemOrParentFrame) const =0
 
virtual ErrorCode SetHTMLContent (const UIDRef &pageItem, const WideString &html) const =0
 
virtual ErrorCode UpdatePoster (const UIDRef &pageItem, bool32 bAutoResizeParentFrame) const =0
 
virtual ErrorCode SetRelativeURIToHTMLFile (const UIDRef &pageItem, const WideString *relativePosixPath)=0
 
virtual void GetRelativeURIToHTMLFile (const UIDRef &pageItem, WideString &relativePosixPath) const =0
 
virtual ErrorCode SetResizable (const UIDRef &pageItem, bool32 isResizable)=0
 
virtual bool32 GetResizable (const UIDRef &pageItem) const =0
 
- Public Member Functions inherited from IPMUnknown
virtual IPMUnknownQueryInterface (PMIID interfaceID) const =0
 
virtual void AddRef () const =0
 
virtual void Release () const =0
 

Detailed Description

A high level API for dealing with images. Please use the IHTMLPageItemFacade directly via the UtilsBoss if possible, see Utils.h: i.e. Utils<IHTMLPageItemFacade>()->GetHTMLContent( ... ) ;

Author
David Stephens

Member Function Documentation

virtual ErrorCode Facade::IHTMLPageItemFacade::CreateHTMLPageItem (IDataBasedb,
const WideStringhtml,
bool32 bAddParentFrame,
UIDRefnewPageItemOrParentFrame 
) const
pure virtual

Given some embedded HTML content, create an embedded HTML page item. Note that the poster image is generated asynchronously so the page item that is returned likely will not contain a poster and will not be the correct size.

Parameters
dbIN The database
htmlIN The HTML content.
bAddParentFrameIN If true, add a parent container. If false, create only the html page item.
newPageItemOrParentFrameOUT The UIDRef of the new html page item or its parent frame if bAddParentFrame is true.
Returns
ErrorCode
virtual WideString Facade::IHTMLPageItemFacade::GetHTMLContent (const IPMUnknownpageItem) const
pure virtual

Get the HTML content associated with an embedded HTML page item.

Parameters
GetHTMLContentIN a pointer to any of the page item's interfaces.
Returns
the HTML content as a WideString.
virtual void Facade::IHTMLPageItemFacade::GetRelativeURIToHTMLFile (const UIDRefpageItem,
WideStringrelativePosixPath 
) const
pure virtual

Placed HTML comes into InDesign as a packaged file where the actual HTML file is embedded somewhere within the package. On HTML export, we need to build a relative path to the HTML file to use as the 'src' of an 'iframe'. This field helps us to do that.

Parameters
pageItem[IN] The UIDRef of the page item
relativePosixPath[OUT] a Posix subpath within the placed package to the actual HTML file, relative to the uncompressed package folder.
virtual bool32 Facade::IHTMLPageItemFacade::GetResizable (const UIDRefpageItem) const
pure virtual

Get whether or not this HTML is resizable. That is, does it know how to adapt when its container's size changes in the HTML runtime, or is it a fixed size and needs to be scaled in order to adapt?

Parameters
pageItem[IN] The UIDRef of the page item
Returns
true if resizable, false if it needs to be scaled
virtual bool32 Facade::IHTMLPageItemFacade::IsHTMLContent (const WideStringtext) const
pure virtual

Is the given string HTML content?

Parameters
textIN a pointer to a string of text which may be HTML
Returns
true if the text is HTML
virtual ErrorCode Facade::IHTMLPageItemFacade::SetHTMLContent (const UIDRefpageItem,
const WideStringhtml 
) const
pure virtual

Set new HTML content

Parameters
pageItem[IN] The UIDRef of the page item
html[IN] new HTML content
Returns
ErrorCode
virtual ErrorCode Facade::IHTMLPageItemFacade::SetRelativeURIToHTMLFile (const UIDRefpageItem,
const WideStringrelativePosixPath 
)
pure virtual

Placed HTML comes into InDesign as a packaged file where the actual HTML file is embedded somewhere within the package. On HTML export, we need to build a relative POSIX path to the HTML file to use as the 'src' of an 'iframe'. This field helps us to do that.

Parameters
pageItem[IN] The UIDRef of the page item
relativePosixPath[IN] subpath within the placed package to the actual HTML file, relative to the uncompressed package folder.
Returns
an ErrorCode (kSuccess if successful).
virtual ErrorCode Facade::IHTMLPageItemFacade::SetResizable (const UIDRefpageItem,
bool32 isResizable 
)
pure virtual

Set whether or not this HTML is resizable. That is, does it know how to adapt when its container's size changes in the HTML runtime, or is it a fixed size and needs to be scaled in order to adapt?

Parameters
pageItem[IN] The UIDRef of the page item
resizable[IN] true if resizable, false if it needs to be scaled
Returns
ErrorCode
virtual ErrorCode Facade::IHTMLPageItemFacade::UpdatePoster (const UIDRefpageItem,
bool32 bAutoResizeParentFrame 
) const
pure virtual

Force the poster to be regenerated from the current HTML

Parameters
pageItemIN The UIDRef of the HTML page item to update.
bAutoResizeParentFrameIN If true, then the parent container will be resized to fit the HTML page item after the poster generation is complete.
Returns
ErrorCode