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

#include <IShortcutUtils.h>

Inheritance diagram for IShortcutUtils:
IPMUnknown

Public Types

enum  { kDefaultIID = IID_ISHORTCUTUTILS }
 

Public Member Functions

virtual PMString GetShortcutString (ActionID id, bool16 bAddContextStr=kFalse, const bool bGetOnlyOne=false)=0
 
virtual PMString GetShortcutString (const VirtualKey &key, int16 mods, const bool &shouldTranslate=true)=0
 
virtual void ParseShortcutString (const PMString &shortcutStr, VirtualKey *keyOut, int16 *modsOut, const bool &shouldTranslate=false)=0
 
virtual UID FindShortcutStyle (IWorkspace *ws, const VirtualKey &key, int16 mods, ClassID *whichStrand)=0
 
virtual int16 GetEventModifiersForKBSC (const IEvent *pEvent, VirtualKey &vkey)=0
 
virtual IShortcutContextQueryCurrentContext ()=0
 
virtual bool16 IsEnabledShortcut (const IEvent *e)=0
 
virtual bool16 GetNumLockStatus () const =0
 
virtual void SetNumLockStatus (bool16 bStatus)=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 provides utility functions for working with shortcuts, and lives on the Utils boss. see Utils.h and use like so: Utils<IShortcutUtils>()->GetShortcutString( ... ) ;

Member Function Documentation

virtual UID IShortcutUtils::FindShortcutStyle (IWorkspacews,
const VirtualKeykey,
int16 mods,
ClassIDwhichStrand 
)
pure virtual

Find the shortcut style.

Parameters
wsthe workspace.
keythe virtual key you want a shortcut style for.
modsa set of modifier keys(from KBSCModifierDefs.h)
whichStrandspecified ID
Returns
shortcut style
virtual int16 IShortcutUtils::GetEventModifiersForKBSC (const IEventpEvent,
VirtualKeyvkey 
)
pure virtual

Returns approriate modifiers for using this event as a KBSC. It may change the VirtualKey passed in(for numpad keys on windows)

Parameters
pEventis the event you want the key & modifiers for
vkeyis the virtual key, which you pass in and may be changed by this function
Returns
modifers for this event + vkey - see KBSCModifierDefs.h
virtual bool16 IShortcutUtils::GetNumLockStatus () const
pure virtual

Get the status of the numlock key on the keyboard

Returns
true if numlock key is on.
virtual PMString IShortcutUtils::GetShortcutString (ActionID id,
bool16 bAddContextStr = kFalse,
const bool bGetOnlyOne = false 
)
pure virtual

Returns a string including all the shortcuts assigned to this ActionID.

Parameters
idis the action you want the shortcuts for.
bAddContextStris a boolean indicating whether or not you want the string for the shortcut context in which this shortcut is valid appended to the string or not.
bGetOnlyOneis a boolean indicating whether or not you want to get only one shortcut string.
Returns
string describing all the shortcuts for this action.
virtual PMString IShortcutUtils::GetShortcutString (const VirtualKeykey,
int16 mods,
const bool & shouldTranslate = true 
)
pure virtual

Returns a string describing the key & modifiers passed in.

Parameters
keyis the virtual key you want a shortcut description for.
modsis a set of modifier keys(from KBSCModifierDefs.h)
shouldTranslatecontrols whether the individual modifier strings are translated.
Returns
string describing this shortcut key + modifiers
virtual bool16 IShortcutUtils::IsEnabledShortcut (const IEvente)
pure virtual

Is this event(virtual key + mods) an enabled shortcut in the currently active shortcut context.

Parameters
eis the event you want to know about
Returns
true if this event refers to an enabled shortcut, taking into account what the current shortcut context is.
virtual void IShortcutUtils::ParseShortcutString (const PMStringshortcutStr,
VirtualKeykeyOut,
int16 * modsOut,
const bool & shouldTranslate = false 
)
pure virtual

Parse a shortcut string into key & modifiers

Parameters
shortcutStris shortcut string you want to parse
keyOutis set to the key part of the shortcut from the string.
modsOutis set to the modifiers from this shortcut string(defined in KBSCModifierDefs.h)
shouldTranslateshould be set true if you want the parser to traslate the individual components as it parses. Useful for reading untranslate strings from the XML keyboard shortcut file format.
virtual IShortcutContext* IShortcutUtils::QueryCurrentContext ()
pure virtual

Returns the appropriate shortcut context for the current user state

Returns
current user shortcut context
virtual void IShortcutUtils::SetNumLockStatus (bool16 bStatus)
pure virtual

Set the status of the numlock key on the keyboard. Client code should not call this.

Parameters
bStatusis the new status.