|
|
|||
Location:
QikCommand.h
Link against: qikcore.lib
class CQikCommand : public CBase;
Visual representation of an action in the user interface.
CQikCommand is a visual representation of an action in an application. Application users initiate an action by selecting the corresponding command in the user interface.
The Command Processing Framework decides where to place each command. A command can be placed on a softkey, in a button bar or in a menu depending on the phone's interaction style and the other commands that are displayed at the same time.
Developers cannot hard code commands to be placed in a specific place. Instead, attributes are set that control where in the user interface the command will be located.
Use SetTextL() to set text that represents the command in the user interface.
Use SetType() to specify the type of function the command executes. Some common types are "Item", "Done", "Yes" and "No". Setting a type is mandatory.
Use SetPriority() to set the priority. A priority is expressed as an integer, negative, positive or zero. The lower the value, the higher the priority will be. For example, a command with priority = -5 will be given a better position than one with priority = 10. Setting a priority is not mandatory. The default value is 0.
The type and priority of a command can be changed at anytime.
More information about the Command Processing Framework, CPF is available in the UIQ Developer Library.
CBase - Base class for all classes to be instantiated on the heapCQikCommand - Visual representation of an action in the user interfaceDefined in CQikCommand:
AddObserverL(), AppDefined(), BaseConstructL(), CQikCommand(), CategoryHandle(), Checked(), CloneL(), Compare(), ConstructCloneL(), ConstructFromResourceL(), ConstructL(), Consumed(), CpfFlags(), Dimmed(), ENotifyAfterExecution, ENotifyBeforeExecution, ExecuteL(), GroupId(), HandleAttemptDimmedSelectionL(), Handler(), Icon(), Id(), IncludeInUiConfiguration(), Invisible(), NamedGroupId(), NamedGroupLinkId(), NewL(), NewLC(), Priority(), RemoveObserver(), SetAppDefined(), SetAvailable(), SetCategoryHandle(), SetCheckBox(), SetChecked(), SetConsumed(), SetCpfFlags(), SetDebugOnly(), SetDimmed(), SetGroupId(), SetHandler(), SetIcon(), SetIcon(), SetIcon(), SetIcon(), SetIcon(), SetIcon(), SetIcon(), SetInlinePane(), SetInvisible(), SetNamedGroupId(), SetNamedGroupLinkId(), SetPriority(), SetRadioEnd(), SetRadioMiddle(), SetRadioStart(), SetShortTextL(), SetShortTextL(), SetSortAlphabetic(), SetStateFlags(), SetTextL(), SetTextL(), SetType(), SetUsed(), ShortText(), StateFlags(), TNotificationSchedule, Text(), Type(), Used(), ~CQikCommand()
Inherited from CBase:
Delete(),
Extension_(),
operator new()
static IMPORT_C CQikCommand *NewL(TInt aCommandId=0x0812);
Factory method that creates and return a new CQikCommand instance.
|
|
static IMPORT_C CQikCommand *NewLC(TInt aCommandId=0x0812);
Factory method that creates and return a new CQikCommand instance. The returned instance is left on the CleanupStack.
|
|
virtual IMPORT_C void ConstructL();
Second phase construction. This function completes the construction of a newly allocated CQikCommand instance.
Constructs the private class that encapsultes the instance variables of CQikCommand by calling BaseConstructL() . Must be called from ConstructL() of any subclass to CQikCommand .
virtual IMPORT_C CQikCommand *CloneL() const;
Used by the framework to copy commands, when adding a command to more than one UI configuration. The existing CQikCommand instance is copied to a new instance.
This method does the following:
creates an Command instance
calls CQikCommand::ConstructCloneL() , which:
calls CQikCommand::BaseConstructL() for basic initiation and
copies the member data to the new Command instance.
A subclass of CQikCommand must perform the same steps. An example of a custom command implementation of this method follows:
EXPORT_C CMyCustomCommand* CMyCustomCommand::CloneL() const
{
CMyCustomCommand* cmd = new (ELeave) CMyCustomCommand(iCommandId);
CleanupStack::PushL(cmd);
cmd->ConstructCloneL(*this);
cmd->MyCustomSpecificConstructCloneL(*this); // copies specific custom command members.
CleanupStack::Pop(cmd);
return cmd;
}
|
IMPORT_C void ConstructFromResourceL(TResourceReader &aResourceReader, CEikonEnv &aEikonEnv);
Factory method used by the CPF framework to initialize CQikCommand:s defined in resource files.
|
|
QIK_COMMANDQIK_COMMAND_LISTIMPORT_C TInt Id() const;
Get method for the ID of the command. This is the unique identifier for this command set with one of the methods NewL() or NewLC() .
|
IMPORT_C TBool Checked() const;
Get method for the state saying if the command is checked or not.
|
IMPORT_C TPtrC Text() const;
Get method for the command text representation.
A command can have a text and an optional short text. When the text attribute is the only one set, it will be used both in menus and on softkeys (unless there is an icon availabe in which case text will not be used on softkeys).
|
IMPORT_C TPtrC ShortText() const;
Get method for the short command text representation. Short text will be the preferred choice on softkeys and buttons, while the text will be preferred in menus.
|
IMPORT_C const CQikContent *Icon() const;
Get method for the command icon representation. The icon is used for buttons and menues.
If a command has an icon but no short text, only the icon will be used on softkeys. Icon and shorttext can coexist on a softkey while a penstyle button will only show the icon when an icon is available.
|
IMPORT_C TQikCommandType Type() const;
Get method for the command type. The type specifies which type of function the command executes.
|
IMPORT_C TInt GroupId() const;
Get method for the ID of the anonymous group to which this command belongs to.
For more details about anonymous groups look in the UIQ Developer Library. Search for this topic by using the key words "anonymous group".
|
IMPORT_C TInt NamedGroupId() const;
Get method for the ID of the named group to which this command belongs to.
For more details about named groups look in the UIQ Developer Library. Search for this topic by using the key words "named group".
|
IMPORT_C TInt NamedGroupLinkId() const;
Get method for the ID of the named group to which this command links to.
This is the ID of the cascaded menu which is launched when selecting this command.
For more details about named groups look in the UIQ Developer Library. Search for this topic by using the key words "named group".
|
IMPORT_C TInt Priority() const;
Get method for the priority of the command. Priority is used to sort commands within groups.
|
IMPORT_C TInt CategoryHandle() const;
Get method returning the category handle of the command.
|
IMPORT_C TAny *AppDefined() const;
Get method returning a pointer to the general application data associated with this command. The type of the data is defined by the Application.
|
IMPORT_C MQikCommandHandler *Handler() const;
Get method returning the command handler for the command. The command handler receives the HandleCommandL() calls.
|
SetHandler()MQikCommandListOwner::MapCommandHandler(CQikCommand&)IMPORT_C TBool Dimmed() const;
Get method for the state saying if the command is in dimmed state or not.
|
IMPORT_C TBool Invisible() const;
Get method for the state saying if the command is invisible or not.
|
IMPORT_C void SetTextL(const TDesC &aText);
Allocates a new copy of aText on the heap and assign it to this command. A command can have a text and an optional short text. Text are used in menus and also on buttons if no shorttext is defined.
If the new value differs from current value and this command is currently being used in the UI. An asynchronous refresh of command operators is be posted if such is not already pending. If the command is sorted alphabetically rather than on priority, an asynchronous re-sort of the list this command belongs to is posted if such is not already pending. Leaves if not enough memory could be allocated. In that case the old text remains.
|
TextL()IMPORT_C void SetTextL(TInt aResourceId);
Allocates the text identified by aResourceId and assign it to this command. A command can have a text and an optional short text. Text are used in menus and also on buttons if no shorttext is defined.
If the new text differs from current text, an asynchronous refresh of commandoperators will be posted if such isn't already pending. If the command is sorted alphabetically rather than on priority, an asynchronous re-sort of the list this command belongs to will be posted if such isn't already pending. Leaves if not enough memory could be allocated. In that case the old text remains.
|
TextL()IMPORT_C void SetShortTextL(const TDesC &aShortText);
Allocates a new copy of aText on the heap and assign it to this command. Short text is the preferred choice on softkeys and buttons, while the text is preferred in menus.
If the new text differs from current text, an asynchronous refresh of commandoperators will be posted if such isn't already pending. Leaves if not enough memory could be allocated. In that case the old text remains.
|
ShortTextL()IMPORT_C void SetShortTextL(TInt aResourceId);
Allocates the text identified by aResourceId and assign it to this command. Short text is the preferred choice on softkeys and buttons, while the text is preferred in menus.
If the new shorttext differs from current shorttext, an asynchronous refresh of commandoperators will be posted if such isn't already pending. Leaves if not enough memory could be allocated. In that case the old text remains.
|
ShortTextL()IMPORT_C void SetType(TQikCommandType aType);
Update the type of this command.
If the new value differs from current value and this command is currently being used in the UI. An asynchronous re-sort of the list this command belongs to will be posted if such isn't already pending. An asynchronous refresh of command operators will also be posted if such isn't already pending.
|
|
IMPORT_C void SetGroupId(TInt aGroupId);
Change which group this command belongs to.
For more details about anonymous groups look in the UIQ Developer Library. Search for this topic by using the key words "anonymous group".
If the new value differs from current value and this command is currently being used in the UI. An asynchronous re-sort of the list this command belongs to will be posted if such isn't already pending. An asynchronous refresh of commandoperators will also be posted if such isn't already pending.
|
IMPORT_C void SetNamedGroupId(TInt aPaneId);
Change which named group this command belongs to.
For more details about named groups look in the UIQ Developer Library. Search for this topic by using the key words "named group".
If the new value differs from current value and this command is currently being used in the UI. An asynchronous re-sort of the list this command belongs to will be posted if such isn't already pending. An asynchronous refresh of commandoperators will also be posted if such isn't already pending.
|
IMPORT_C void SetNamedGroupLinkId(TInt aPaneLinkId);
Change which named group this command points to.
This is the ID of the cascaded menu which is launched when selecting this command. For more details about named groups look in the UIQ Developer Library. Search for this topic by using the key words "named group".
An asynchronous refresh of commandoperators will be posted if such isn't already pending.
|
IMPORT_C void SetPriority(TInt aPriority);
Change the priority of this command. Priority is used to sort commands within groups.
If the new value differs from current value and this command is currently being used in the UI. An asynchronous re-sort of the list this command belongs to will be posted if such isn't already pending. An asynchronous refresh of commandoperators will also be posted if such isn't already pending.
|
IMPORT_C void SetIcon(const CQikContent *aIcon, TQikPassingOwnership aOwnership);
Sets the icon representation of the command.
|
IMPORT_C void SetIcon(CQikContent *aIcon, TQikPassingOwnership aOwnership);
Sets the icon representation of the command.
|
IMPORT_C void SetIcon(const CGulIcon *aIcon, TQikPassingOwnership aOwnership);
Sets the icon representation of the command.
|
IMPORT_C TInt SetIcon(const TDesC &aUri, const TCapabilitySet &aCapabilities, TUint aFlags);
|
|
IMPORT_C TInt SetIcon(const TDesC &aMbmFilename, TInt aMainId, TInt aMaskId);
Sets the icon representation of the command. Loads the icon from an MBM file.
|
|
IMPORT_C TInt SetIcon(const TDesC &aMbmFilename, TInt aMainId, TInt aMaskId, const TCapabilitySet &aCapabilities, TUint aFlags);
Sets the icon representation of the command. Loads the icon from an MBM file.
|
|
IMPORT_C void SetHandler(MQikCommandHandler *aHandler);
Sets the receiver to aHandler . If aHandler is NULL , the applications AppUi will act as default command handler and receive the HandleCommandL calls.
|
IMPORT_C void SetCategoryHandle(TInt aHandle);
Sets the category handle member. Used by applications to easy find out which category-handle is coupled to this command.
|
IMPORT_C void SetAppDefined(TAny *aAny);
Set method used to set the pointer to the general application data associated with this command. The type of the data is defined by the Application and may be used for arbitrary purposes.
|
IMPORT_C void AddObserverL(MQikCommandObserver *aObserver, TNotificationSchedule aSchedule);
Register with this method if you want to get notified when a command is executed.
|
IMPORT_C void RemoveObserver(MQikCommandObserver *aObserver);
Removes all occurences of aObserver from the set of observers.
|
IMPORT_C void ExecuteL();
This method is called by Command operators (invokers) to trig execution of a command.
IMPORT_C void SetAvailable(TBool aValue);
This method sets the availability of the command. If a command is unavailable it will become invisible when the interaction style of the device is Softkey style, and dimmed when the interaction style is Pen Style.
|
IMPORT_C void SetDimmed(TBool aValue);
Updates the dimmed state of this command if aValue differs from the current value. An asynchronous redraw is posted to the command operators affected by this command.
|
IMPORT_C void SetInvisible(TBool aValue);
Updates the visible state of this command if aValue differs from the current value. An asynchronous refresh is posted to the command operators.
|
IMPORT_C void SetChecked(TBool aChecked);
Updates the checked state of this command if aValue differs from the current value. If the command is a radiobutton, other radiobuttons in the same group is unchecked automatically. An asynchronous redraw is posted to the command operators affected by this command.
|
IMPORT_C void SetSortAlphabetic(TBool aValue);
Use this method to control if this command shall be sorted on its iText member rather than on iPriority . An asynchronous sort and refresh is posted to the command operators if the value is changed.
|
IMPORT_C void SetDebugOnly(TBool aValue);
Use this method to set the availability of the command in debug builds. An asynchronous refresh is posted to the command operators if the value is changed.
|
IMPORT_C void SetInlinePane(TBool aValue);
This method is typically only used by the framework. Inline panes is used when the maximum number of cascading menu panes is reached. Maximum number of cascading menu panes can differ on different devices. An asynchronous refresh is posted to the command operators if the value is changed.
|
IMPORT_C void SetRadioStart(TBool aValue);
Use this method to set that this command is the first member in a radio button group. An asynchronous refresh is posted to the command operators if the value is changed.
|
IMPORT_C void SetRadioMiddle(TBool aValue);
Use this method to set that this command is a member in a radio button group, but not the first or last member. An asynchronous refresh is posted to the command operators if the value is changed.
|
IMPORT_C void SetRadioEnd(TBool aValue);
Use this method to set that this command is the last member in a radio button group. An asynchronous refresh is posted to the command operators if the value is changed.
|
IMPORT_C void SetCheckBox(TBool aValue);
Use this method to set that this command shall be representable with a checkbox or latching button. An asynchronous refresh is posted to the command operators if the value is changed.
|
IMPORT_C TUint StateFlags() const;
Get method for the state flags of the command. State flags control the state of a specific command (dimmed, invisible, checked), and if it shall be displayed as a radiobutton or checkbok in a menu pane. See QikCommand.hrh.
|
IMPORT_C void SetStateFlags(TUint aFlags);
State flags control the state of this single command (dimmed, invisible, checked), and if it shall be displayed as a radiobutton or checkbok in a menupane. See QikCommand.hrh.
An asynchronous refresh of command operators will be posted if a change takes place and a refresh isn't already pending. In addition, if the EQikCmdFlagSortAlphabetic bit is changed, an asynchronous re-sort of the list this command belongs to will be posted if such isn't already pending.
|
IMPORT_C TUint CpfFlags() const;
Get method for the CPF flags of the command. Flags that affect how the Command Processing Framework, CPF, collaborate. See QikCommand.hrh.
|
IMPORT_C void SetCpfFlags(TUint aFlags);
Flags that affect how the CPF framework collaborate. See QikCommand.hrh.
An asynchronous refresh of command operators will be posted if a change takes place and a refresh isn't already pending.
|
IMPORT_C TBool IncludeInUiConfiguration(const TQikUiConfig &aUiConfig) const;
Checks if the command should be included in this aUiConfig .
The following CPF flags are checked:
EQikCpfFlagTouchscreenOnly
EQikCpfFlagNoTouchscreenOnly
EQikCpfFlagInteractionMenubarOnly
EQikCpfFlagInteractionSoftkeysOnly
EQikCpfFlagPortraitOnly
EQikCpfFlagLandscapeOnly
|
|
IMPORT_C TBool Used() const;
Returns if the command has been used or not. For use by the Command Operators (e.g. softkeys, menues and other controls implementing MQikCommandOperator).
|
IMPORT_C TBool Consumed() const;
Returns if the command has been consumed or not. For use by the Command Operators (e.g. softkeys, menues and other controls implementing MQikCommandOperator).
|
IMPORT_C void SetUsed(TBool aUsed);
Sets the command's used state. For use by the Command Operators (e.g. softkeys, menues and other controls implementing MQikCommandOperator).
|
IMPORT_C void SetConsumed(TBool aConsumed);
Sets the command's consumed state. For use by the Command Operators (e.g. softkeys, menues and other controls implementing MQikCommandOperator).
|
static IMPORT_C TInt Compare(const CQikCommand &aCmd1, const CQikCommand &aCmd2);
Compare two commands. First compare the Type of the commands, if equal compare the NamedGroupId, if that is equal too compare the GroupId, lastly compare the Priority (or Text if EQikCommandSortAlphabetic is set on both commands). The type sort order for the commands is given by the CQikCommandManagers resource file configured by the device manufacturer.
|
|
protected: IMPORT_C void BaseConstructL();
Initialises the command with standard values. Any sub class of CQikCommand must make sure that this method is called during the construction phase. Usually by calling the CQikCommand::ConstructL() .
protected: IMPORT_C void ConstructCloneL(const CQikCommand &aCommand);
Set the value of all members of this instance to the same values as in aCommand . This method constructs a clone or a copy of the provided command.
|
TNotificationSchedule
You can be notifed when a command is about to execute or just after it has executed.
|