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

#include <IQuickApplyService.h>

Inheritance diagram for IQuickApplyService:
IPMUnknownCPMUnknown< IQuickApplyService >SnipRunQuickApplyService

Public Types

enum  { kDefaultIID = IID_IQUICKAPPLYSERVICE }
 

Public Member Functions

virtual void BeginServiceSession ()=0
 
virtual void EndServiceSession ()=0
 
virtual TypesHandledList GetItemTypesHandled (const TypesHandledList &existingItemTypes)=0
 
virtual void LoadItems (IActiveContext *ac, K2Vector< QuickApplyFindListNode > *masterList, IdleTimer *timeCheck, uint32 itemTypeToLoad)=0
 
virtual bool16 LoadItemsIsComplete (uint32 idType)=0
 
virtual bool16 ApplyItem (IActiveContext *ac, const QuickApplyFindListNode &itemToApply, IEvent *e, bool16 edit)=0
 
virtual void ResetProvider ()=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

An interface used to provide items to the quick apply dialog. Parties who want to add new types of items to the quick apply dialog are expected to make an service provider with their item described via this interface.

Author
Kevin Van Wiel

Member Enumeration Documentation

anonymous enum

Standard enum to for use with GetDefaultIID() method.

Member Function Documentation

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

When the user selects an item from the quick apply dialog and does the apply action this routine will be called. If the item passed in is one that your implementation owns then it should do it's apply action for that item.

Parameters
acactive context to apply item into.
itemToApplyitem in the quick apply dialog that was selected when apply was selected.
e(may be nil) an event which can be used to determine any special types of apply that may happen. For example, if the option key is held down paragraph styles will apply differently than if no modifiers are active.
editopen up an edit dialog rather than apply where applicable (i.e. styles).
Returns
kTrue if the itemToApply was of a type that the routine handled.

Implemented in SnipRunQuickApplyService.

virtual void IQuickApplyService::BeginServiceSession ()
pure virtual

This is called just after the quick apply dialog opens to give the service provider a chance to initialize any activity it needs to.

Parameters
allocatorclass to allocate id types for the service provider.
Returns
none

Implemented in SnipRunQuickApplyService.

virtual void IQuickApplyService::EndServiceSession ()
pure virtual

This is called just before the quick apply dialog closes to give the service provider a chance to clean up any data storage it has allocated.

Returns
none

Implemented in SnipRunQuickApplyService.

virtual TypesHandledList IQuickApplyService::GetItemTypesHandled (const TypesHandledList & existingItemTypes)
pure virtual

When this routine is called the service provider should return a list of the types of items it is responsible for.

Parameters
existingItemTypesA list of types already known up to the point when this routine is called. You may not return a prefix key that is already existing. Use this to make sure new prefix keys are unique.
Returns
TypesHandledList which is a list of pairs. The elements are the UI name of the type(s) handled and it's cooresponding id which must be unique. It's recommended to achieve it's QuickApplyItemRecord.fItemID data type.

Implemented in SnipRunQuickApplyService.

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

The implementor of this routine should append a list of items to be displayed in quick apply dialog through the masterList parameter. Note Items may already be present in the master list don't delete existing items!

Parameters
acthe active context for the application (useful to determine what items should be loaded).
masterListthis is a return parameter this routine will append new items (if any) to the end of this list.
timeCheckif timecheck is not nil then an implementation of this method should save it's state a return when this timeCheck reaches 0.
itemTypeToLoadthe type of items to load.
Returns
none;

Implemented in SnipRunQuickApplyService.

virtual bool16 IQuickApplyService::LoadItemsIsComplete (uint32 idType)
pure virtual

Each provider is expected to know whether it has completed loading of it's items or not. This is to support the partial loading of sort items for those that may take extended times to load. The LoadItems() routine may be called multiple times (called via an idle task) and during each one those some (or all) items will be loaded in the quick apply dialog. This let's the dialog open instantly although the loading of all items may take some short amount of time to all load after that. The user can start typing immediatly and by the time he finishes (or sooner) typically all items will be loaded. Providing a smooth studder free experience. At BeginServiceSession() time you should clear whatever flag(s) are used to indicate whether the LoadItemsIsComplete() then set them as necessary after LoadItems() is called.

Returns
none

Implemented in SnipRunQuickApplyService.

virtual void IQuickApplyService::ResetProvider ()
pure virtual

The dialog can at certain infrequent times ask a service provider to reset. What this means is the that the service implimentor should prepare itself to have the LoadItems() routine called again like it does when the dialog opens. Typically this would be called in the case of a item type being activated/deactivated.

Returns
none

Implemented in SnipRunQuickApplyService.