CAknGlobalListMsgQuery Class Reference

Link against: aknnotify.lib eiksrv.lib

Capability Information

Required Capabilities

None


#include <
AknGlobalListMsgQuery.h>

Detailed Description

Uses notification framework to show a global list query with message field.

Usage: Create an active object, start it and pass its TRequestStatus as a parameter to ShowListMsgQueryL(). After the user selects one item from the query and accepts it, the request status will hold the number of the selected item. If the user cancels the query with softkey, the request status will hold -1. If method CancelListMsgQuery() is called, the request status will hold -3 (KErrCancel).

Example 1. Show the global list message query:

     #include <akngloballistmsgquery.h>
     ...
     _LIT(KQueryHeaderText, "Global list msg query");
     _LIT(KQueryMsgText, "Query message.");
     _LIT(KListMsgQueryItem1, "Item 1");
     _LIT(KListMsgQueryItem2, "Item 2");

     CDesCArray* textArray = new (ELeave) CDesCArrayFlat(2);
     CleanupStack::PushL(textArray);
     textArray->AppendL(KListMsgQueryItem1);
     textArray->AppendL(KListMsgQueryItem2);
         
     if (iListObserver)
         {
         iListObserver->Cancel();
         delete iListObserver;
         iListObserver = 0;
         }

     if (iGlobalListMsgQuery)
         {
         delete iGlobalListMsgQuery;
         iGlobalListMsgQuery = 0;
         }

     iListObserver = CMyActiveObject::NewL();
     iGlobalListMsgQuery = CAknGlobalListMsgQuery::NewL();

     iGlobalListMsgQuery->ShowListMsgQueryL(
         textArray, 
         iListObserver->iStatus, 
         KQueryHeaderText,
         KQueryMsgText);

     iListObserver->Start();

     CleanupStack::PopAndDestroy(textArray);

Example 2. Get and handle the result in active object. The result is simply displayed on screen using info message:

     void CMyActiveObject::RunL() 
         {
         _LIT(KReceivedMsg, "Received:");
         TBuf<100> msg = KReceivedMsg();
         msg.AppendNum(iStatus.Int());
         CEikonEnv::Static()->InfoMsg(msg);
         }
Dll AknNotify.lib
Since:
S60 3.2

Public Member Functions

IMPORT_C ~CAknGlobalListMsgQuery ()
 Destructor.
IMPORT_C void ShowListMsgQueryL (const MDesCArray *aItems, TRequestStatus &aStatus, const TDesC &aHeaderText, const TDesC &aMsgText, const TInt aIndex=0, TInt aSoftkeys=0, TInt aAcceptKeyId=0, TInt aCancelKeyId=0, const TDesC &aHeaderImageFile=KNullDesC, TInt aImageId=0, TInt aImageMaskId=-1, CAknQueryDialog::TTone aTone=CAknQueryDialog::ENoTone)
 Shows the global list message query.
IMPORT_C void MoveSelectionUp ()
 Moves selection up.
IMPORT_C void MoveSelectionDown ()
 Moves selection down.
IMPORT_C void SelectItem ()
 Selects currently selected item in the list.
IMPORT_C void CancelListMsgQuery ()
 Cancels the query.
IMPORT_C void SetSecondaryDisplayData (CAknSDData *aData)
 Sets additional information to be sent to secondary display.
IMPORT_C void SetImageSkinId (const TAknsItemID &aId)
 Sets skin id for image.

Static Public Member Functions

static IMPORT_C CAknGlobalListMsgQueryNewL ()
 Two-phased constructor.
static IMPORT_C CAknGlobalListMsgQueryNewLC ()
 Two-phased constructor.

Constructor & Destructor Documentation

IMPORT_C CAknGlobalListMsgQuery::~CAknGlobalListMsgQuery  ) 
 

Destructor.


Member Function Documentation

IMPORT_C void CAknGlobalListMsgQuery::CancelListMsgQuery  ) 
 

Cancels the query.

IMPORT_C void CAknGlobalListMsgQuery::MoveSelectionDown  ) 
 

Moves selection down.

IMPORT_C void CAknGlobalListMsgQuery::MoveSelectionUp  ) 
 

Moves selection up.

static IMPORT_C CAknGlobalListMsgQuery* CAknGlobalListMsgQuery::NewL  )  [static]
 

Two-phased constructor.

Returns:
A pointer to the new instance.
static IMPORT_C CAknGlobalListMsgQuery* CAknGlobalListMsgQuery::NewLC  )  [static]
 

Two-phased constructor.

Leaves the instance to cleanup stack.

Returns:
A pointer to the new instance.
IMPORT_C void CAknGlobalListMsgQuery::SelectItem  ) 
 

Selects currently selected item in the list.

IMPORT_C void CAknGlobalListMsgQuery::SetImageSkinId const TAknsItemID aId  ) 
 

Sets skin id for image.

Must be called before ShowListMsgQueryL() is called.

Parameters:
aId Image skin id.
IMPORT_C void CAknGlobalListMsgQuery::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 CAknGlobalListMsgQuery::ShowListMsgQueryL const MDesCArray *  aItems,
TRequestStatus &  aStatus,
const TDesC &  aHeaderText,
const TDesC &  aMsgText,
const TInt  aIndex = 0,
TInt  aSoftkeys = 0,
TInt  aAcceptKeyId = 0,
TInt  aCancelKeyId = 0,
const TDesC &  aHeaderImageFile = KNullDesC,
TInt  aImageId = 0,
TInt  aImageMaskId = -1,
CAknQueryDialog::TTone  aTone = CAknQueryDialog::ENoTone
 

Shows the global list message query.

Parameters:
aItems Array of strings for list items. The items will be copied, so it is safe to delete the array as soon as ShowListMsgQueryL() has been called.
aStatus TRequestStatus which will be completed when user dismisses the query. Will contain KErrInUse if another global list query is already being shown. Will contain KErrArgument if aSoftkeys does not point to a valid resource. Will contain KErrArgument if aItems array is empty. Will contain KErrArgument if aIndex is out of bounds. Will contain KErrArgument if aAcceptKeyId is EAknSoftkeyCancel. Will contain KErrArgument if aCancelKeyId is EAknSoftkeyOk.
aHeaderText Query header text.
aMsgText Query message text. Maximum is three lines.
aIndex Index of the item that will be highlighted by default.
aSoftkeys Softkey resource id from Avkon.rss. If used, give also aAcceptKeyId and aCancelKeyId.
aAcceptKeyId Identifier of the softkey that is used to accept the query.
aCancelKeyId Identifier of the softkey that is used to cancel the query.
aHeaderImageFile A full path to image to be used in the header field.
aImageId Image id.
aImageId Image mask id.
aTone Tone id.

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

Copyright © Nokia Corporation 2001-2007
Back to top