TAlfActionCommand Class Reference

class TAlfActionCommand : public TAlfCommand

TAlfActionCommand is a simple action that triggers an action notification.

They are reserved for notifying observers of user-initiated actions in the user interface. For example, a button control might send an action command when the user clicks on the button.

Usage:
 //Candidate, interested in action notification, should implement 
 // MAlfActionObserver interface
 class ActionCommandTest : public MAlfActionObserver
  {
   public:
 	 .....
 	 .....
 	 .....
   void HandleAction( const TAlfActionCommand& aActionCommand );
  };
   
 // From MAlfActionObserver
 void ActionCommandTest::HandleAction( const TAlfActionCommand& aActionCommand )
    {
    //Perform required action on notification
    }
 -------------------------------------------------------------------------------
  //Observer registrartion
  ActionCommandTest* testClass = new ActionCommandTest();
 
  //Create command
  TAlfActionCommand command( 1 );
 
  //Register test command as observer to environment
  iEnv->AddActionObserverL( testClass );
    
   //Send command
   iEnv->Send( command, 1 );
 
  //Cleanup
  iEnv->RemoveActionObserver( testClass );
  delete testClass;

MAlfActionObserver CAlfEnv::AddActionObserverL() CAlfEnv::RemoveActionObserver()

Inherits from

Public Member Functions
TAlfActionCommand(TInt)
IMPORT_C voidExecuteL(CAlfEnv &)
IMPORT_C TIntId()
IMPORT_C TIntSize()
Protected Member Functions
IMPORT_C voidCommandExtension(const TUid &, TAny **)
Inherited Functions
TAlfCommand::ObjectCommand()const
TAlfCommand::TAlfCommand(TAlfCommandType)
TAlfCommand::Type()const
TAlfCommand::~TAlfCommand()
Private Attributes
TInt iId
TInt iSpare1
TInt iSpare2

Constructor & Destructor Documentation

TAlfActionCommand(TInt)

IMPORT_CTAlfActionCommand(TIntaId)

Constructs a new action command.

Parameters

TInt aIdIdentifier of the action.

Member Functions Documentation

CommandExtension(const TUid &, TAny **)

IMPORT_C voidCommandExtension(const TUid &aExtensionUid,
TAny **aExtensionParams
)[protected, virtual]

Parameters

const TUid & aExtensionUid
TAny ** aExtensionParams

ExecuteL(CAlfEnv &)

IMPORT_C voidExecuteL(CAlfEnv &aEnv)const [virtual]

Executes the command.

Parameters

CAlfEnv & aEnvThe environment in which the command is being executed.

Id()

IMPORT_C TIntId()const

Determines the action identifier of the command.

Size()

IMPORT_C TIntSize()const [virtual]

Returns the size of the command.

Member Data Documentation

TInt iId

TInt iId[private]

Action identifier.

TInt iSpare1

TInt iSpare1[private]

TInt iSpare2

TInt iSpare2[private]