Nokia N97 SDK
Example Applications Guide

CAknExPopFieldAttribSetDialog Class Reference

#include <aknexpopfieldattribsetdialog.h>

Inheritance diagram for CAknExPopFieldAttribSetDialog:

CAknExPopFieldBaseDialog List of all members.

Detailed Description

CAknExPopFieldAttribSetDialog

Definition at line 42 of file aknexpopfieldattribsetdialog.h.


Public Member Functions

virtual  ~CAknExPopFieldAttribSetDialog ()
void  DynInitMenuPaneL (TInt aResourceId, CEikMenuPane *aMenuPane)
void  ProcessCommandL (TInt aCommandId)

Static Public Member Functions

static CAknExPopFieldAttribSetDialog *  NewLC ()

Protected Member Functions

TBool  OkToExitL (TInt aButtonId)

Private Member Functions

  CAknExPopFieldAttribSetDialog ()
void  DiscardTextArray ()
void  SetIsSaveMenu (TBool aVal)
TBool  IsSaveMenu ()
void  ConfigurePopfieldValueL ()
TBool  SaveFormDataL ()
void  DoNotSaveFormDataL ()

Private Attributes

CDesCArray *  iTextEmptyArray [KAknExPopFieldAttribSetControlCount]
CAknQueryValueTextArray *  iValueTextArrayWithNoElements [KAknExPopFieldAttribSetControlCount]
CAknQueryValueText *  iTextValues [KAknExPopFieldAttribSetControlCount]
TBool  iIsSaveMenuFlag
TInt  iIndexValue [KAknExPopFieldAttribSetControlCount]


Constructor & Destructor Documentation

CAknExPopFieldAttribSetDialog::~CAknExPopFieldAttribSetDialog (   )  [virtual]
 

CAknExPopFieldAttribSetDialog Virtual Destructor.

Definition at line 66 of file aknexpopfieldattribsetdialog.cpp.

References DiscardTextArray().

00067     {
00068     DiscardTextArray();
00069     }

CAknExPopFieldAttribSetDialog::CAknExPopFieldAttribSetDialog (   )  [private]
 

CAknExPopFieldAttribSetDialog C++ default constructor.

Definition at line 36 of file aknexpopfieldattribsetdialog.cpp.

References iTextEmptyArray, iTextValues, and iValueTextArrayWithNoElements.

00037     {
00038     for ( TInt index( KAknExPopFieldAttribSetIndexInitialize );
00039           index < KAknExPopFieldAttribSetControlCount; ++index )
00040         {
00041         iTextValues[ index ] = NULL;
00042         iTextEmptyArray[ index ] = NULL;
00043         iValueTextArrayWithNoElements[ index ] =  NULL;
00044         }
00045     }


Member Function Documentation

CAknExPopFieldAttribSetDialog * CAknExPopFieldAttribSetDialog::NewLC (   )  [static]
 

ConstructL. 2nd phase constructor.

Definition at line 52 of file aknexpopfieldattribsetdialog.cpp.

Referenced by CAknExPopFieldContainer::DisplaySetAttribsPopFieldL().

00053     {
00054     CAknExPopFieldAttribSetDialog* self =
00055         new ( ELeave ) CAknExPopFieldAttribSetDialog;
00056     CleanupStack::PushL( self );
00057     self->ConstructL();
00058     return self;
00059     }

void CAknExPopFieldAttribSetDialog::DiscardTextArray (   )  [private]
 

DiscardTextArray Discard text array in popup field object.

Definition at line 77 of file aknexpopfieldattribsetdialog.cpp.

References iTextEmptyArray, iTextValues, and iValueTextArrayWithNoElements.

Referenced by ConfigurePopfieldValueL(), and ~CAknExPopFieldAttribSetDialog().

00078     {
00079     for ( TInt index( KAknExPopFieldAttribSetIndexInitialize );
00080           index < KAknExPopFieldAttribSetControlCount; ++index )
00081         {
00082         if ( iTextValues[index] )
00083             {
00084             delete iTextValues[ index ];
00085             iTextValues[ index ] = NULL;
00086             }
00087         if ( iValueTextArrayWithNoElements[ index ] )
00088             {
00089             delete iValueTextArrayWithNoElements[ index ];
00090             iValueTextArrayWithNoElements[ index ] = NULL;
00091             }
00092         if ( iTextEmptyArray[ index ] )
00093             {
00094             delete iTextEmptyArray[ index ];
00095             iTextEmptyArray[ index ] = NULL;
00096             }
00097         } // for
00098     }

void CAknExPopFieldAttribSetDialog::SetIsSaveMenu (  TBool  aVal  )  [private]
 

SetIsSaveMenu Set flag to indicate if we are in the save menu.

Parameters:
aVal 

Definition at line 105 of file aknexpopfieldattribsetdialog.cpp.

References iIsSaveMenuFlag.

Referenced by OkToExitL(), and ProcessCommandL().

00106     {
00107     iIsSaveMenuFlag = aVal;
00108     }

TBool CAknExPopFieldAttribSetDialog::IsSaveMenu (   )  [private]
 

IsSaveMenu Check if we are in the save menu.

Returns:
TBool is menu saved or not?

Definition at line 115 of file aknexpopfieldattribsetdialog.cpp.

References iIsSaveMenuFlag.

Referenced by DynInitMenuPaneL(), and OkToExitL().

00116     {
00117     return iIsSaveMenuFlag;
00118     }

void CAknExPopFieldAttribSetDialog::DynInitMenuPaneL (  TInt  aResourceId,
CEikMenuPane *  aMenuPane
)  [virtual]
 

From CAknExPopfieldBaseDialog, DynInitMenuPaneL. Dims "Label", "Add" and "Delete" menu items.

Parameters:
aResourceId 
aMenuPane  Pointer to menu-pane object.

Reimplemented from CAknExPopFieldBaseDialog.

Definition at line 125 of file aknexpopfieldattribsetdialog.cpp.

References CAknExPopFieldBaseDialog::DynInitMenuPaneL(), and IsSaveMenu().

00127     {
00128 
00129     CAknExPopFieldBaseDialog::DynInitMenuPaneL( aResourceId, aMenuPane );
00130     if ( aResourceId == R_AVKON_FORM_MENUPANE && IsSaveMenu() )
00131         {
00132         aMenuPane->AddMenuItemsL( R_AKNEXPOPFIELD_EXTRA_MENU, 
00133                                   EAknFormCmdSave, ETrue );
00134         }
00135     }

void CAknExPopFieldAttribSetDialog::ProcessCommandL (  TInt  aCommandId  )  [virtual]
 

From CAknDialog, ProcessCommandL.

Parameters:
aCommandId 

Reimplemented from CAknExPopFieldBaseDialog.

Definition at line 142 of file aknexpopfieldattribsetdialog.cpp.

References SetIsSaveMenu().

00143     {
00144     switch ( aCommandId )
00145         {
00146         case EAknExPopFieldCmdEditEntry:
00147             {
00148             TInt ctrlId = IdOfFocusControl();
00149             // Don't call ActiveSelectionList on an empty list, 
00150             // or panic incurred!
00151             if( ctrlId == EAknExPopFieldDlgCtrlIdAttribSet02 ) 
00152                 {
00153                 CAknPopupField* popup; 
00154                 popup = static_cast<CAknPopupField*> (ControlOrNull( ctrlId ) );
00155                 if ( popup )
00156                     {
00157                     popup->ActivateSelectionListL();
00158                     }
00159                 }
00160             break;
00161             }
00162         case EAknFormCmdEdit:
00163             {
00164             SetIsSaveMenu( ETrue );
00165             break;
00166             }
00167         case EAknFormCmdSave:
00168             {
00169             SetIsSaveMenu( EFalse );
00170             break;
00171             }
00172         }
00173     CAknExPopFieldBaseDialog::ProcessCommandL( aCommandId );
00174     }

TBool CAknExPopFieldAttribSetDialog::OkToExitL (  TInt  aButtonId  )  [protected, virtual]
 

From CAknDialog, OkToExitL.

Parameters:
aButtonId 
Returns:
TBool is it ok to exit?

Reimplemented from CAknExPopFieldBaseDialog.

Definition at line 181 of file aknexpopfieldattribsetdialog.cpp.

References IsSaveMenu(), CAknExPopFieldBaseDialog::OkToExitL(), and SetIsSaveMenu().

00182     {
00183     if ( aButtonId == EAknSoftkeyBack && IsSaveMenu() )
00184         {
00185         SetIsSaveMenu( EFalse );
00186         } 
00187     return CAknExPopFieldBaseDialog::OkToExitL( aButtonId );
00188     }

void CAknExPopFieldAttribSetDialog::ConfigurePopfieldValueL (   )  [private, virtual]
 

From CAknExPopFieldBaseDialog, ConfigurePopfieldTextL Configuration values (text) into Popup Fields.

Implements CAknExPopFieldBaseDialog.

Definition at line 195 of file aknexpopfieldattribsetdialog.cpp.

References DiscardTextArray(), iTextEmptyArray, iTextValues, and iValueTextArrayWithNoElements.

00196     {
00197     // Discard textarray.
00198     DiscardTextArray();
00199     
00200     // Control container.
00201     CAknPopupField* popup[ KAknExPopFieldAttribSetControlCount ]; 
00202     
00203     for ( TInt index( KAknExPopFieldAttribSetIndexInitialize ) ; 
00204             index < KAknExPopFieldAttribSetControlCount; ++index )
00205         {
00206         // Get PopFieldAttribSet controls.
00207         
00208                 popup[ index ] = static_cast<CAknPopupField*> 
00209                         (ControlOrNull( EAknExPopFieldDlgCtrlIdAttribSet01 + index ) );
00210 
00211         __ASSERT_ALWAYS( popup[ index ]!=NULL, User::Leave( KErrNotFound ) );
00212         
00213         // Fill the arrays with empty array instances.
00214         iTextEmptyArray[index] = new ( ELeave ) CDesCArrayFlat(
00215         KAknExPopFieldGranularityForEmptyArray ); // Granularity of 16
00216         
00217         // Set iValueTextValueArray with the empty arrays.
00218         iValueTextArrayWithNoElements[ index ] = 
00219                             CAknQueryValueTextArray::NewL();
00220         iValueTextArrayWithNoElements[ index ]->
00221                             SetArray( *iTextEmptyArray[index] );
00222 
00223         // Set the same textarray into all the values, and initial value index, and
00224         // make calls onto the CAknPopfield APIs
00225         iTextValues[ index ] = CAknQueryValueText::NewL();
00226         iTextValues[ index ]->
00227                     SetArrayL( iValueTextArrayWithNoElements[ index ] );
00228         iTextValues[ index ]->SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT );
00229         
00230         // Set values into popup fields.
00231         popup[ index ]->SetQueryValueL( iTextValues[ index ] );
00232         popup[ index ]->SetFont( LatinPlain12() );
00233         popup[ index ]->SetMaxNumberOfLinesPermitted( 
00234                          KAknExPopFieldMaxNumberLines );
00235 
00236         if ( !index ) // Call APIs specific to the control.
00237             {
00238             popup[ index ]->
00239                 SetEmptyListNoteL( R_AKNEXPOPFIELD_EMPTY_LIST_NOTE );
00240             TBuf16<KAknExPopFieldReplacementTextBufLength> replacementString01;
00241             iEikonEnv->ReadResource( replacementString01, 
00242                         R_AKNEXPOPFIELD_EMPTY_TEXT_RAPLACEMENT );
00243             popup[ index ]->SetEmptyTextL( replacementString01 );
00244             }
00245         else
00246             {
00247             popup[ index ]->SetAllowsUserDefinedEntry( ETrue );
00248             
00249             // Set the Other text replacement in attribset02
00250             TBuf16<KAknExPopFieldReplacementTextBufLength> replacementString02;
00251             iEikonEnv->ReadResource( replacementString02, 
00252                         R_AKNEXPOPFIELD_OTHER_TEXT_RAPLACEMENT );
00253             popup[ index ]->SetOtherTextL( replacementString02 );
00254             
00255             // Set the Empty text replacement in attribset02
00256             TBuf16<KAknExPopFieldReplacementTextBufLength> replacementString03;
00257             iEikonEnv->ReadResource( replacementString03, 
00258                         R_AKNEXPOPFIELD_EMPTY_TEXT_RAPLACEMENT );
00259             popup[ index ]->SetEmptyTextL( replacementString03 );
00260             }
00261         } // for
00262     }

TBool CAknExPopFieldAttribSetDialog::SaveFormDataL (   )  [private]
 

From CAknForm Save the contents of the form.

Returns:
TBool Save Form Data?

Definition at line 269 of file aknexpopfieldattribsetdialog.cpp.

References iIndexValue, and iTextValues.

00270     {
00271     for ( TInt i = KAknExPopFieldAttribSetIndexInitialize;
00272               i < KAknExPopFieldAttribSetControlCount; i++ )
00273         {
00274             if ( ControlOrNull( EAknExPopFieldDlgCtrlIdPop01+i ) )
00275                 { 
00276                      iIndexValue[ i ] = iTextValues[ i ]->CurrentValueIndex();
00277                 }
00278         }
00279 
00280     return ETrue;
00281     }

void CAknExPopFieldAttribSetDialog::DoNotSaveFormDataL (   )  [private]
 

From CAknForm DoNotSaveFormDataL Does not save the contents of the form.

Definition at line 288 of file aknexpopfieldattribsetdialog.cpp.

References iIndexValue, and iTextValues.

00289     {
00290     for ( TInt i = KAknExPopFieldAttribSetIndexInitialize;
00291               i < KAknExPopFieldAttribSetControlCount; i++ )
00292         {
00293         if ( ControlOrNull( EAknExPopFieldDlgCtrlIdPop01+i ) )
00294             {
00295             iTextValues[ i ]->SetCurrentValueIndex( iIndexValue[ i ] );
00296             }
00297         }
00298     }


Member Data Documentation

CDesCArray* CAknExPopFieldAttribSetDialog::iTextEmptyArray[KAknExPopFieldAttribSetControlCount] [private]
 

iTextEmptyArray Owned by CAknExPopFieldAttribSetDialog object.

Definition at line 144 of file aknexpopfieldattribsetdialog.h.

Referenced by CAknExPopFieldAttribSetDialog(), ConfigurePopfieldValueL(), and DiscardTextArray().

CAknQueryValueTextArray* CAknExPopFieldAttribSetDialog::iValueTextArrayWithNoElements[KAknExPopFieldAttribSetControlCount] [private]
 

iTextEmptyArray Owned by CAknExPopFieldAttribSetDialog object.

Definition at line 151 of file aknexpopfieldattribsetdialog.h.

Referenced by CAknExPopFieldAttribSetDialog(), ConfigurePopfieldValueL(), and DiscardTextArray().

CAknQueryValueText* CAknExPopFieldAttribSetDialog::iTextValues[KAknExPopFieldAttribSetControlCount] [private]
 

iTextValues Owned by CAknExPopFieldAttribSetDialog object.

Definition at line 157 of file aknexpopfieldattribsetdialog.h.

Referenced by CAknExPopFieldAttribSetDialog(), ConfigurePopfieldValueL(), DiscardTextArray(), DoNotSaveFormDataL(), and SaveFormDataL().

TBool CAknExPopFieldAttribSetDialog::iIsSaveMenuFlag [private]
 

Flag for SaveMenu?

Definition at line 161 of file aknexpopfieldattribsetdialog.h.

Referenced by IsSaveMenu(), and SetIsSaveMenu().

TInt CAknExPopFieldAttribSetDialog::iIndexValue[KAknExPopFieldAttribSetControlCount] [private]
 

Counter for indexvalue

Definition at line 164 of file aknexpopfieldattribsetdialog.h.

Referenced by DoNotSaveFormDataL(), and SaveFormDataL().


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

© Nokia 2009

Back to top