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

#include <IDocument.h>

Inheritance diagram for IDocument:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_IDOCUMENT }
 
enum  saveType { kNativeType =0, kCloudType }
 
enum  UndoSupport { kFullUndoSupport, kPartialUndoSupport }
 

Public Member Functions

virtual void Save ()=0
 
virtual void SaveAs (const IDFile &destFile)=0
 
virtual void SaveACopy (const IDFile &destFile)=0
 
virtual void Close ()=0
 
virtual bool16 IsSaved ()=0
 
virtual bool16 IsRecovered ()=0
 
virtual bool16 IsConverted ()=0
 
virtual void SetConverted ()=0
 
virtual bool16 IsReadOnly ()=0
 
virtual bool16 IsMissingPlugins ()=0
 
virtual void SetMissingPlugins ()=0
 
virtual bool16 IsModified ()=0
 
virtual void GetName (PMString &name) const =0
 
virtual void SetName (const PMString &name)=0
 
virtual UIDRef GetDocWorkSpace () const =0
 
virtual UndoSupport GetUndoSupport () const =0
 
virtual int32 GetUntitledCount () const =0
 
virtual void SetUntitledCount (int32 untitledCount)=0
 
virtual bool16 IsCloudDoc () const =0
 
virtual void NotifyDocBasedAsyncJobQueued (AsyncWorkPacketID packetId)=0
 
virtual void SetAsCloudDoc ()=0
 
virtual void SetAssetRefForThisDoc (const std::string &assetRef)=0
 
virtual std::string GetAssetRefForThisDoc () const =0
 
virtual bool IsDocumentConflicted () const =0
 
virtual void SetIsDocumentConflicted (const bool conflicted)=0
 
virtual void SaveAsCloudDoc (const IDFile &path, const std::string &docPathValue)=0
 
virtual void SaveCloudDoc ()=0
 
virtual bool IsDocumentSyncedOnce () const =0
 
virtual void SetIsDocumentSynced (const bool syncedonce)=0
 
virtual void SaveCloudDocAsNative (const IDFile &destFile)=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

IID_IDOCUMENT interface, Represents an InDesign publication. Provides the basic file operations.

Member Enumeration Documentation

Level of undo support for the open document.

Full undo support means that we have both undo support for error handling as well as the capacity to have changes go on the undo menu, and hence be undoable. Partial undo support means that we have just enough support to do error handling. Document changes will not go on the undo menu and hence are not undoable.

Member Function Documentation

virtual void IDocument::Close ()
pure virtual

This doesn't close the document. Do not use this method! (only set open flag to kFalse)

Note
Third Party Developers should use a command (such as kCloseDocCmdBoss) instead. IDocumentCommands contains command generator methods for convenience.
See Also
IDocumentCommands.h
virtual UIDRef IDocument::GetDocWorkSpace () const
pure virtual

Get document level work space

Returns
UIDRef of document work space
virtual void IDocument::GetName (PMStringname) const
pure virtual

Return the name associated with the document. The name is used for the default window title, and for the default "save-to" file the first time it is saved. Do not use the document's name to make assumptions about the name of the actual pub file in the file system.

Parameters
name[OUT] Document name to path out
virtual int32 IDocument::GetUntitledCount () const
pure virtual

Get number used for next untitled-? document

Returns
int32 number for next untitled document
virtual bool16 IDocument::IsCloudDoc () const
pure virtual

Check the type of document this is, cloud or native

Returns
bool16 kTrue if CloudDocument, kFalse for native
virtual bool16 IDocument::IsConverted ()
pure virtual

Return if a converted document (from previous version or other type)

Returns
kTrue if the document was converted.
virtual bool IDocument::IsDocumentConflicted () const
pure virtual

Clouds docs can be conflicted since they can be edited from multiple machines\ These are setter and getter for cloud doc status Internal use only. ******************* Tells whether particular document has a conflict or not

Returns
kTrue if the document has a conflict.
virtual bool IDocument::IsDocumentSyncedOnce () const
pure virtual
Internal use only. *******************

Checks whether the document is synced atleast once

Returns
kTrue if the document is synced.
virtual bool16 IDocument::IsMissingPlugins ()
pure virtual

Return if the doc was opened in a missing plug-in state

Returns
kTrue if the document was opened in a missing plug-in state.
virtual bool16 IDocument::IsModified ()
pure virtual

Return if the document has been modified since the last save or open

Returns
kTrue if the document has been modified since the last save or open.
virtual bool16 IDocument::IsReadOnly ()
pure virtual

Return if a ready only dccument

Returns
kTrue if the document was opened read-only.
virtual bool16 IDocument::IsRecovered ()
pure virtual

Return if a recovered document

Returns
kTrue if the document was recovered.
virtual bool16 IDocument::IsSaved ()
pure virtual

Test if the document has ever been saved (not UNTITLEDxx.indd)

Returns
if the document has a permanent pub file associated with it
virtual void IDocument::NotifyDocBasedAsyncJobQueued (AsyncWorkPacketID packetId)
pure virtual
 Internal use only. *******************

Notify the document that an asynchronous job is queued that accesses this document

Parameters
packetIdpacket id for the enqueued job
virtual void IDocument::Save ()
pure virtual

Save the document to the user file. May want to make sure that IsSaved() below returns kTrue before you call this method

Note
Third Party Developers should use a command (such as kSaveDocCmdBoss) instead. IDocumentCommands contains command generator methods for convenience.
See Also
IDocumentCommands.h
virtual void IDocument::SaveACopy (const IDFiledestFile)
pure virtual

Save the document to the specified file. If there is already a file with the same name, it is first deleted. After the call: Leaves the document open and targeted to the current file. Further editing will not affect destFile.

Note
Third Party Developers should use a command (such as kSaveACopyCmdBoss) instead. IDocumentCommands contains command generator methods for convenience.
See Also
IDocumentCommands.h
Parameters
destFilefile to save a copy to.
virtual void IDocument::SaveAs (const IDFiledestFile)
pure virtual

Save the document to the specified file. If there is already a file with the same name, it is first deleted. After the call: Leaves the document open and targeted to the saved-to file.

Note
Third Party Developers should use a command (such as kSaveAsDocCmdBoss) instead. IDocumentCommands contains command generator methods for convenience.
See Also
IDocumentCommands.h
Parameters
destFilesaved to file
virtual void IDocument::SaveAsCloudDoc (const IDFilepath,
const std::string & docPathValue 
)
pure virtual
Internal use only. *******************

Save As for cloud documents.

Parameters
pathIN For IDS only - path of document where to save
docPathValueIN path of file on cloud.
virtual void IDocument::SaveCloudDoc ()
pure virtual
Internal use only. *******************

Incremental save for cloud document.

virtual void IDocument::SaveCloudDocAsNative (const IDFiledestFile)
pure virtual
Internal use only. *******************

Saves Cloud Document (.inddc) as a native document (.indd)

Parameters
destFileIN path to save the native file.
virtual void IDocument::SetAsCloudDoc ()
pure virtual
 Internal use only. *******************

This is used to make system aware that there is backing file for this doc

virtual void IDocument::SetAssetRefForThisDoc (const std::string & assetRef)
pure virtual

Clouds docs have unique UIRs from which we can uniquely identify them\ These are setter and getter for cloud assetRef associated with a doc

virtual void IDocument::SetConverted ()
pure virtual

Set converted flag

virtual void IDocument::SetIsDocumentConflicted (const bool conflicted)
pure virtual
Internal use only. *******************

Sets status as conflicted for document.

Parameters
conflictedIN bool value for the conflict status of the document
virtual void IDocument::SetIsDocumentSynced (const bool syncedonce)
pure virtual
Internal use only. *******************

Sets the status of the document synced

Parameters
syncedonceIN sets the whether document is synced once or not.
virtual void IDocument::SetMissingPlugins ()
pure virtual

Set missing plugins flag

virtual void IDocument::SetName (const PMStringname)
pure virtual

Set the document name. See GetName() above for more info.

Note
Third Party Developers should use a command (such as kSetDocNameCmdBoss) instead.
See Also
kSetDocNameCmdBoss
Parameters
namedocument's new name
virtual void IDocument::SetUntitledCount (int32 untitledCount)
pure virtual

Set number used for next untitled-? document

Parameters
int32number for next untitled document