Nokia N97 SDK
Example Applications Guide

CCommonDialogsExSettingsDialog Class Reference

#include <CommonDialogsExSettingsDialog.h>

Inheritance diagram for CCommonDialogsExSettingsDialog:

List of all members.

Detailed Description

This class defines a settings dialog for application.

Definition at line 28 of file CommonDialogsExSettingsDialog.h.


Public Member Functions

  ~CCommonDialogsExSettingsDialog ()
void  HandleListBoxEventL (CEikListBox *aListBox, TListBoxEvent aEventType)

Static Public Member Functions

static CCommonDialogsExSettingsDialog *  NewL (TInt aResId, TBool aMultiDriveSupport)

Protected Member Functions

TBool  OkToExitL (TInt aButtonId)
void  PreLayoutDynInitL ()
void  ProcessCommandL (TInt aCommandId)

Private Member Functions

  CCommonDialogsExSettingsDialog ()

Private Attributes

CAknSettingItemArray  iSettingItemArray
CAknMemorySelectionDialog::TMemory  iMemory
TInt  iResourceId
TBool  iMultiDriveSupport
TDriveNumber  iDriveNumber


Constructor & Destructor Documentation

CCommonDialogsExSettingsDialog::~CCommonDialogsExSettingsDialog (   ) 
 

Destructor.

Definition at line 24 of file CommonDialogsExSettingsDialog.cpp.

References iSettingItemArray.

00025     {
00026     iSettingItemArray.ResetAndDestroy();
00027     }

CCommonDialogsExSettingsDialog::CCommonDialogsExSettingsDialog (   )  [inline, private]
 

Default constructor. Inlined to save a few bytes. Parameters to array: granularity, isnumered, 1st ordinal

Definition at line 51 of file CommonDialogsExSettingsDialog.h.

00051 : iSettingItemArray( 1, EFalse, 1 ) {} 


Member Function Documentation

CCommonDialogsExSettingsDialog * CCommonDialogsExSettingsDialog::NewL (  TInt  aResId,
TBool  aMultiDriveSupport
)  [static]
 

Two-phased constructor.

Definition at line 29 of file CommonDialogsExSettingsDialog.cpp.

References iResourceId.

00030     {
00031     CCommonDialogsExSettingsDialog* self = new( ELeave ) CCommonDialogsExSettingsDialog;
00032     CleanupStack::PushL( self );
00033     self->iResourceId = aResId;
00034     self->iMultiDriveSupport = aMultiDriveSupport;
00035     CleanupStack::Pop();
00036     return self;
00037     }

TBool CCommonDialogsExSettingsDialog::OkToExitL (  TInt  aButtonId  )  [protected]
 

Tests if it is OK to exit the dialog.

Parameters:
aButtonId  The ID of the button that was activated.
Returns:
ETrue to validate and exit the dialog, EFalse to keep the dialog active.

Definition at line 39 of file CommonDialogsExSettingsDialog.cpp.

References ProcessCommandL().

00040     {
00041     if ( aButtonId == EAknSoftkeySelect )
00042         {
00043         ProcessCommandL( aButtonId );
00044         return EFalse;
00045         }
00046     return ETrue;
00047     }

void CCommonDialogsExSettingsDialog::PreLayoutDynInitL (   )  [protected]
 

Pre-layout dialog initialisation.

Definition at line 49 of file CommonDialogsExSettingsDialog.cpp.

References iDriveNumber, iMemory, iMultiDriveSupport, iResourceId, and iSettingItemArray.

00050     {
00051     iMemory = CAknMemorySelectionSettingPage::EPhoneMemory;
00052     iDriveNumber = EDriveC;
00053 
00054     CAknSettingStyleListBox* listBox = 
00055                             static_cast< CAknSettingStyleListBox* >
00056                             ( Control( ECommonDialogsExSettingsListboxId ) );
00057     User::LeaveIfNull( listBox );
00058 
00059     CAknSettingItem* settingItem;
00060     HBufC* itemTitle;
00061 
00062     // Create the memory selection item
00063     if ( iMultiDriveSupport )
00064         {    
00065         settingItem =
00066                 new( ELeave ) CAknMemorySelectionSettingItemMultiDrive(
00067                                             iResourceId, iDriveNumber );
00068         }
00069     else
00070         {
00071         settingItem =
00072                 new( ELeave ) CAknMemorySelectionSettingItem(
00073                                             iResourceId, iMemory );
00074         }
00075     CleanupStack::PushL( settingItem );
00076 
00077     // Set memory selection item's title
00078     itemTitle = iCoeEnv->AllocReadResourceLC( R_STRING_COMMONDIALOGSEX_SET_MEMORY );
00079     settingItem->ConstructL( EFalse, 0, *itemTitle, NULL, 0,
00080                                                     EAknCtPopupSettingList );
00081     CleanupStack::PopAndDestroy();  // itemTitle
00082 
00083     // Add memo store item to the settings array
00084     iSettingItemArray.AppendL( settingItem );
00085     CleanupStack::Pop();    // settingItem
00086 
00087     CTextListBoxModel* model = listBox->Model();
00088     model->SetItemTextArray( &iSettingItemArray );
00089     // Ownership retained by us
00090     model->SetOwnershipType( ELbmDoesNotOwnItemArray );
00091 
00092     iSettingItemArray.RecalculateVisibleIndicesL();
00093     listBox->CreateScrollBarFrameL( ETrue );
00094     listBox->ScrollBarFrame()->SetScrollBarVisibilityL(
00095                         CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
00096     listBox->HandleItemAdditionL();
00097     listBox->SetListBoxObserver( this );
00098     listBox->UpdateScrollBarsL();
00099     }

void CCommonDialogsExSettingsDialog::HandleListBoxEventL (  CEikListBox *  aListBox,
TListBoxEvent  aEventType
) 
 

Handles list box events. This is invoked by CEikListBox to notify the observer of list box events.

Parameters:
aListBox  The originating list box.
aEventType  A code for the event.

Definition at line 101 of file CommonDialogsExSettingsDialog.cpp.

References iSettingItemArray.

Referenced by ProcessCommandL().

00103     {
00104     TInt index( aListBox->CurrentItemIndex() );
00105     if ( index >=0 )    // index is -1 if there are no items in the list
00106         {
00107         iSettingItemArray.At( index )->EditItemL(
00108                          aEventType == EEventEditingStarted );
00109         aListBox->DrawItem( index );
00110         }
00111     }


Member Data Documentation

CAknSettingItemArray CCommonDialogsExSettingsDialog::iSettingItemArray [private]
 

Array of setting items contained in the listbox. Owned.

Definition at line 88 of file CommonDialogsExSettingsDialog.h.

Referenced by HandleListBoxEventL(), PreLayoutDynInitL(), and ~CCommonDialogsExSettingsDialog().

CAknMemorySelectionDialog::TMemory CCommonDialogsExSettingsDialog::iMemory [private]
 

Selected memo store

Definition at line 93 of file CommonDialogsExSettingsDialog.h.

Referenced by PreLayoutDynInitL().


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

© Nokia 2009

Back to top