CAknGlobalMsgQuery Class Reference

API published in: S60 1st Ed

Link against: aknnotify.lib eiksrv.lib

Capability Information

Required Capabilities

None


#include <aknglobalmsgquery.h>

Detailed Description

CAknGlobalMsgQuery Uses notification framework to show a global message query.

Usage: Create an active object, start it and pass its TRequestStatus as a parameter to ShowMsgQueryL. After the user presses a softkey, the request status will hold the id of the pressed softkey. E.g. If the user selected Cancel, the request status will hold -1.

Example 1. Show the global message query: if ( iListObserver ) { iListObserver->Cancel(); delete iListObserver; } iMsgObserver = new(ELeave) CGlobalMsgObserver(iEikonEnv); iMsgObserver->Start(); iGlobalMsgQuery->ShowMsgQueryL( iMsgObserver->iStatus, iMsgText, R_AVKON_SOFTKEYS_OK_CANCEL, iMsgHeader, iHeaderImageFile, EImageId, EMaskId );

Example 2. Get and handle the result in active object. void CMyActiveObject::RunL() { TBuf<120> msg = _L("Received: "); msg.AppendNum( iStatus.Int() ); iEnv->InfoMsg(msg); Cancel(); }

Example 3. Update the query (softkeys) iGlobalMsgQuery->UpdateMsgQuery( R_AVKON_SOFTKEYS_BACK );

Example 4. Cancel the query iGlobalMsgQuery->CancelMsgQuery();

NOTE !!! All descriptors passed as parameters need to be class members, i.e. they cannot be local variables of a method. That is because they need to exist when server gets the message.


Public Member Functions

IMPORT_C  ~CAknGlobalMsgQuery ()
IMPORT_C void  ShowMsgQueryL (TRequestStatus &aStatus, const TDesC &aMsgText, TInt aSoftkeys, const TDesC &aHeaderText, const TDesC &aHeaderImageFile, TInt aImageId=0, TInt aImageMaskId=-1, CAknQueryDialog::TTone aTone=CAknQueryDialog::ENoTone)
  Shows global message query synchronously.
IMPORT_C void  UpdateMsgQuery (TInt aSoftkeys)
  Update the softkeys of the message query.
IMPORT_C void  CancelMsgQuery ()
  Cancel the message query.
IMPORT_C void  SetExitDelay (TInt aDelay)
  Set delay after which query will be removed from screen after message is completed.
IMPORT_C void  SetImageSkinId (TAknsItemID &aId)
  Set Skin id for query header image.
IMPORT_C void  SetSecondaryDisplayData (CAknSDData *aData)
  Sets additional information to be sent to secondary display.

Static Public Member Functions

static IMPORT_C CAknGlobalMsgQuery NewL ()
static IMPORT_C CAknGlobalMsgQuery NewLC ()

Constructor & Destructor Documentation

IMPORT_C CAknGlobalMsgQuery::~CAknGlobalMsgQuery  ) 
 

Member Function Documentation

IMPORT_C void CAknGlobalMsgQuery::CancelMsgQuery  ) 
 

Cancel the message query.

static IMPORT_C CAknGlobalMsgQuery* CAknGlobalMsgQuery::NewL  )  [static]
 
static IMPORT_C CAknGlobalMsgQuery* CAknGlobalMsgQuery::NewLC  )  [static]
 
IMPORT_C void CAknGlobalMsgQuery::SetExitDelay TInt  aDelay  ) 
 

Set delay after which query will be removed from screen after message is completed.

Can be used to get around problems with global query exit and CrossCheckForeground probs. Must be called before ShowMsgQueryL in order to be effective.

Parameters:
aDelay  Time in microsecond, after which query will be removed from display.
IMPORT_C void CAknGlobalMsgQuery::SetImageSkinId TAknsItemID aId  ) 
 

Set Skin id for query header image.

Must be called before ShowMsgQueryL in order to have effect. No need to use this method if image from avkon.mbm is used.

aId SkinId for image in query. If image not found from active skin, image definitions used in ShowMsgQueryL used instead.

IMPORT_C void CAknGlobalMsgQuery::SetSecondaryDisplayData CAknSDData *  aData  ) 
 

Sets additional information to be sent to secondary display.

Takes ownership of object. Must be called before sending data to notifier to have effect.

Parameters:
aData  Data to be sent to cover UI.
IMPORT_C void CAknGlobalMsgQuery::ShowMsgQueryL TRequestStatus &  aStatus,
const TDesC &  aMsgText,
TInt  aSoftkeys,
const TDesC &  aHeaderText,
const TDesC &  aHeaderImageFile,
TInt  aImageId = 0,
TInt  aImageMaskId = -1,
CAknQueryDialog::TTone  aTone = CAknQueryDialog::ENoTone
 

Shows global message query synchronously.

Parameters:
aMsgText  Message text.
aHeaderText  Header text.
aSoftkeys  Softkey resource.
aStatus  TRequestStatus which will be completed when user selects one item from the list query.
IMPORT_C void CAknGlobalMsgQuery::UpdateMsgQuery TInt  aSoftkeys  ) 
 

Update the softkeys of the message query.

Parameters:
aSoftkeys  New resource for softkeys.

The documentation for this class was generated from the following file:

Copyright © Nokia Corporation 2001-2008
Back to top