InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnipRunQuickApplyService Class Reference
Inheritance diagram for SnipRunQuickApplyService:
CPMUnknown< IQuickApplyService >IQuickApplyServiceIPMUnknown

Public Member Functions

 SnipRunQuickApplyService (IPMUnknown *boss)
 
virtual void BeginServiceSession ()
 
virtual void EndServiceSession ()
 
virtual TypesHandledList GetItemTypesHandled (const TypesHandledList &existingItemTypes)
 
virtual void LoadItems (IActiveContext *ac, K2Vector< QuickApplyFindListNode > *masterList, IdleTimer *timeCheck, uint32 itemTypeToLoad)
 
virtual bool16 LoadItemsIsComplete (uint32 id)
 
virtual bool16 ApplyItem (IActiveContext *ac, const QuickApplyFindListNode &itemToApply, IEvent *e, bool16 edit)
 
virtual void ResetProvider ()
 
- Public Member Functions inherited from CPMUnknown< IQuickApplyService >
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
 

Additional Inherited Members

- Public Types inherited from IQuickApplyService
enum  { kDefaultIID = IID_IQUICKAPPLYSERVICE }
 
- Protected Member Functions inherited from CPMUnknown< IQuickApplyService >
 CPMUnknown (IPMUnknown *boss)
 
- Protected Attributes inherited from CPMUnknown< IQuickApplyService >
HelperInterface fHelperInterface
 

Detailed Description

Implements the quick apply service for SnippetRunner.

Constructor & Destructor Documentation

SnipRunQuickApplyService::SnipRunQuickApplyService (IPMUnknownboss)

Constructor.

Parameters
bossinterface ptr from boss object on which this interface is aggregated.

Member Function Documentation

bool16 SnipRunQuickApplyService::ApplyItem (IActiveContextac,
const QuickApplyFindListNodeitemToApply,
IEvente,
bool16 edit 
)
virtual

Indicates to the service provider that the user has selected the itemToApply for execution.

Parameters
acIN the active context.
itemToApplyIN the item that represents the user selected snipper.
eIN the actual event that invokes the item (thisis useful for example when the behaviour might change with a modifier key).
editIN Holding down cmd/shift or cmd/alt indicates an edit of the item represented by the quick apply element is required.
Returns
kTrue if the service handles the application of the quick apply item.

Implements IQuickApplyService.

virtual void SnipRunQuickApplyService::BeginServiceSession ()
inlinevirtual

Called when the quick apply dialog opens to initialise the quick apply service.

Implements IQuickApplyService.

virtual void SnipRunQuickApplyService::EndServiceSession ()
inlinevirtual

Called befor ethe quick apply dialog closes to allow the service to perform clean-up activity.

Implements IQuickApplyService.

TypesHandledList SnipRunQuickApplyService::GetItemTypesHandled (const TypesHandledList & existingItemTypes)
virtual

Provide the type of items supported by this quick apply service

Parameters
existingItemTypesIN the set of previously registered quick apply item types. Interrogate these to ensure the choice of prefix key for this quick apply service provider is unique. Bad things happen if two quick apply services attempt to register with the same prefix key.
Returns
the type of item that this quick apply service supports.

Implements IQuickApplyService.

void SnipRunQuickApplyService::LoadItems (IActiveContextac,
K2Vector< QuickApplyFindListNode > * masterList,
IdleTimertimeCheck,
uint32 itemTypeToLoad 
)
virtual

The quick apply service can add items to the master list, the complete set of items that are displayed in the quick apply dialog. This implementation adds elements that represent runnable code snippets.

Parameters
acIN the current active context, used to determine the set of items that can be legally added.
masterListIN/OUT the list of items to be displayed in the quick apply dialog.
timeCheckOUT an idle time, if non-nil, an implementation that is heavy-weight should save state and return when the idle timer reaches 0. This allows more responsive UI, and the lazy loading of the quick apply dialog.
itemTypeToLoadIN the type of item to be loaded. Some services can support multiple item types. This indicates the actual type to be loaded.

Implements IQuickApplyService.

bool16 SnipRunQuickApplyService::LoadItemsIsComplete (uint32 id)
virtual

Indicates that the service has completed loading the items it supports. A service can indicate that it has not completed loading items (for example, where the loading of items would take too long and cause the dialog to stutter). It will then be called back at the next idle loop to continue loading.

Parameters
idIN the type of item being tested. Some services can support miltiple item types. This indicates the actual type to be tested.
Returns
kTrue if the service provider has completed loading the items, kFalse otherwise.

Implements IQuickApplyService.

virtual void SnipRunQuickApplyService::ResetProvider ()
inlinevirtual

Reset the provider back to the initial (unloaded) state.

Implements IQuickApplyService.