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

#include <IScrapItem.h>

Inheritance diagram for IScrapItem:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISCRAPITEM }
 

Public Member Functions

virtual ICommandGetDeleteCmd (bool16 includeRegisteredItems=kTrue)=0
 
virtual ICommandGetCopyCmd (ICommand *cmd, IDataBase *destinationDB, UID destParent, PMPoint *offset=nil, bool16 includeRegisteredItems=kTrue)=0
 
virtual ICommandGetPasteCmd (ICommand *cmd, IDataBase *destinationDB, UID destParent, PMPoint *offset=nil, bool16 includeRegisteredItems=kTrue)=0
 
virtual ICommandGetPreDeleteCleanupCommands (ICommand *cmd)=0
 
virtual ICommandGetPostDeleteCleanupCommands (ICommand *cmd)=0
 
virtual bool16 RegisterScrapItem (UID nOtherItem)=0
 
virtual bool16 UnregisterScrapItem (UID nOtherItem)=0
 
virtual bool16 IsRegistered (UID nOtherItem) const =0
 
virtual bool16 HasRegisteredItems () const =0
 
virtual const UIDListGetRegisteredItemsList () 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

This interface is used to get copy/paste/delete command for the items that could be on clipboard.

Member Enumeration Documentation

anonymous enum

Define the default IID for IScrapItem.

Member Function Documentation

virtual ICommand* IScrapItem::GetCopyCmd (ICommandcmd,
IDataBasedestinationDB,
UID destParent,
PMPointoffset = nil,
bool16 includeRegisteredItems = kTrue 
)
pure virtual

Get a command that can copy the object into the specified area of the destination target(document).

Parameters
cmdrefers to the root command, usually it could pass as nil and will be initialized as current copy command.
destinationDBrefers to the database of target.
destParentrefers to the parent which the item will be copied to such as layer.
offsetrefers to the specified area the item will be on. The default value is nil.
includeRegisteredItemsrefers to if we need to include registered items when do copy operation. The default value is kTrue.
Returns
ICommand the copy command.
virtual ICommand* IScrapItem::GetDeleteCmd (bool16 includeRegisteredItems = kTrue)
pure virtual

Get a command that can delete the object.

Parameters
includeRegisteredItemsindicating if we need to get delete command for those registered items too. The default value is kTrue.
Returns
ICommand the delete command.
virtual ICommand* IScrapItem::GetPasteCmd (ICommandcmd,
IDataBasedestinationDB,
UID destParent,
PMPointoffset = nil,
bool16 includeRegisteredItems = kTrue 
)
pure virtual

Get a command that can paste the object into the specified area such as active layer, text sub-selection of the destination target(document).

Parameters
cmdrefers to the root command, usually it could pass as nil and will be initialized as current copy command.
destinationDBrefers to the database of target.
destParentrefers to the parent which the item will be copied to such as layer.
offsetrefers to the specified area the item will be on. The default value is nil.
includeRegisteredItemsrefers to if we need to include registered items when do copy operation. The default value is kTrue.
Returns
ICommand the paste command.
virtual ICommand* IScrapItem::GetPostDeleteCleanupCommands (ICommandcmd)
pure virtual

Get a command that is created by iterating over the services registered for post delete and append those commands to the delete command.

Parameters
cmdwhich seems not been used in current code(dragontail).
Returns
ICommand the predelete command. It could be a CompoundSequenceCmd.
virtual ICommand* IScrapItem::GetPreDeleteCleanupCommands (ICommandcmd)
pure virtual

Get a command that is created by iterating over the services registered for pre delete and prepend those commands to the delete command.

Parameters
cmdwhich seems not been used in current code(dragontail).
Returns
ICommand the predelete command. It could be a CompoundSequenceCmd.
virtual const UIDList* IScrapItem::GetRegisteredItemsList () const
pure virtual

Get the item list that has registered.

Returns
const UIDList* items that are registered.
virtual bool16 IScrapItem::HasRegisteredItems () const
pure virtual

Check whether any items have been registered or not.

Returns
bool16 kTrue if there are items registered, otherwise kFalse.
virtual bool16 IScrapItem::IsRegistered (UID nOtherItem) const
pure virtual

Check whether the other scrap item has been registered or not.

Parameters
nOtherItemspecifies the other item.
Returns
bool16 kTrue if the other item has been registered, otherwise kFalse.
virtual bool16 IScrapItem::RegisterScrapItem (UID nOtherItem)
pure virtual

Register other scrap items to a scrap item. If you do so the Get***Cmd will return a CompoundSequenceCmd that contain the Get***Cmd of all registered scrap items. The order of the command collection is: first the registered items then this item.

Parameters
nOtherItemspecifies the other item to be registered.
Returns
bool16 kTrue if the other item has been successfully registered, otherwise kFalse.
virtual bool16 IScrapItem::UnregisterScrapItem (UID nOtherItem)
pure virtual

Unregister other scrap items from a scrap item.

Parameters
nOtherItemspecifies the other item to be unregistered.
Returns
bool16 kTrue if the other item has been unregistered, otherwise kFalse.