Nokia N97 SDK
Example Applications Guide

CAknExPopFieldTextValueDialog Class Reference

#include <aknexpopfieldtextvaluedialog.h>

Inheritance diagram for CAknExPopFieldTextValueDialog:

CAknExPopFieldBaseDialog List of all members.

Detailed Description

CAknExPopFieldTextValueDialog

Definition at line 40 of file aknexpopfieldtextvaluedialog.h.


Public Member Functions

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

Static Public Member Functions

static CAknExPopFieldTextValueDialog *  NewLC ()

Protected Member Functions

TBool  OkToExitL (TInt aButtonId)

Private Member Functions

  CAknExPopFieldTextValueDialog ()
void  DiscardTextArray ()
void  ConfigurePopfieldValueL ()
TBool  SaveFormDataL ()
void  DoNotSaveFormDataL ()

Private Attributes

CDesCArray *  iTextArray
CAknQueryValueTextArray *  iValueTextArray
CAknQueryValueText *  iTextValues [KAknExPopFieldMaxTextValueField]
TInt  iIndexValue [KAknExPopFieldMaxTextValueField]


Constructor & Destructor Documentation

CAknExPopFieldTextValueDialog::~CAknExPopFieldTextValueDialog (   )  [virtual]
 

CAknExPopFieldTextValueDialog Virtual Destructor.

Definition at line 69 of file aknexpopfieldtextvaluedialog.cpp.

References DiscardTextArray().

00070     {
00071     DiscardTextArray();
00072     }

CAknExPopFieldTextValueDialog::CAknExPopFieldTextValueDialog (   )  [private]
 

CAknExPopFieldTextValueDialog C++ default constructor.

Definition at line 36 of file aknexpopfieldtextvaluedialog.cpp.

References iTextValues.

00036                                                             : 
00037                                iTextArray( NULL ),
00038                                iValueTextArray( NULL )
00039     {
00040 
00041     TInt index( KAknExPopFieldIndexInitialize );
00042     for ( index = KAknExPopFieldIndexInitialize;
00043           index < KAknExPopFieldMaxTextValueField; index++ )
00044         {
00045         iTextValues[ index ] = NULL;
00046         }
00047     }


Member Function Documentation

CAknExPopFieldTextValueDialog * CAknExPopFieldTextValueDialog::NewLC (   )  [static]
 

NewLC Two-phase constructor.

Definition at line 55 of file aknexpopfieldtextvaluedialog.cpp.

Referenced by CAknExPopFieldContainer::DisplayTextPopFieldL().

00056     {
00057     CAknExPopFieldTextValueDialog* self =
00058         new ( ELeave ) CAknExPopFieldTextValueDialog;
00059     CleanupStack::PushL( self );
00060     self->ConstructL();
00061     return self;
00062     }

void CAknExPopFieldTextValueDialog::DiscardTextArray (   )  [private]
 

DiscardTextArray Discard text array in popup field object.

Definition at line 80 of file aknexpopfieldtextvaluedialog.cpp.

References iTextArray, iTextValues, and iValueTextArray.

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

00081     {
00082     TInt index( KAknExPopFieldIndexInitialize );
00083     for ( index = KAknExPopFieldIndexInitialize;
00084           index < KAknExPopFieldMaxTextValueField; index++ )
00085         {
00086         if ( iTextValues[ index ] )
00087             {
00088             delete iTextValues[ index ];
00089             iTextValues[ index ] = NULL;
00090             }
00091         }
00092 
00093     if ( iValueTextArray )
00094         {
00095         delete iValueTextArray;
00096         iValueTextArray = NULL;
00097         }
00098 
00099     if ( iTextArray )
00100         {
00101         delete iTextArray;
00102         iTextArray = NULL;
00103         }
00104     }

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

From CAknExPopFieldBaseDialog, OkToExitL.

Parameters:
aButtonId 
Returns:
TBool ok to exit?

Reimplemented from CAknExPopFieldBaseDialog.

Definition at line 111 of file aknexpopfieldtextvaluedialog.cpp.

References CAknExPopFieldBaseDialog::OkToExitL().

00112     {
00113     switch ( aButtonId )
00114         {
00115         case EAknSoftkeyBack:
00116             {
00117             CAknPopupFieldText* popupFieldText[KAknExPopupFieldTextMaxValues];
00118             TBuf<256> textbuf;
00119             for ( TInt i = 0; i < KAknExPopupFieldTextMaxValues; i++ )
00120                 {
00121                 // Get the proper control
00122                 popupFieldText[i] = ( CAknPopupFieldText* ) 
00123                         ControlOrNull( EAknExPopFieldDlgCtrlIdText01+i );
00124 
00125                 if ( popupFieldText[ i ] )
00126                     {
00127                     // Perform the calls on the API 
00128                     // provided by CAknPopupFieldText
00129                     HBufC* text = popupFieldText[ i ]->CurrentValueTextLC();
00130                     TInt value = popupFieldText[ i ]->CurrentValueIndex();
00131                     popupFieldText[ i ]->SetCurrentValueIndex( i );
00132                     popupFieldText[ i ]->SetAutoAppend( ETrue );
00133                     popupFieldText[ i ]->SetAllowsUserDefinedEntry( ETrue );
00134                     const MDesCArray* array = popupFieldText[ i ]->MdcArray();
00135                     TInt mdcaCount = array->MdcaCount();
00136 
00137                     // Print results to Debug 
00138                     _LIT( KPopupFieldText,"PopupFieldText Control Vals -> Number %d, Value %d, Text : " );
00139                     textbuf.Format( KPopupFieldText,i,value );
00140                     textbuf.Append( *text );
00141                     RDebug::Print( textbuf );
00142 
00143                     _LIT( KMdcaCountText,"... MdcaCount = %d." );
00144                     textbuf.Format( KMdcaCountText, mdcaCount );
00145                     RDebug::Print( textbuf );
00146 
00147                     // Clean up text
00148                     CleanupStack::PopAndDestroy(); // text
00149                     }
00150                 }
00151             break;
00152             }
00153         default:
00154             break;
00155         }
00156     return CAknExPopFieldBaseDialog::OkToExitL( aButtonId );
00157     }

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

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

Implements CAknExPopFieldBaseDialog.

Definition at line 164 of file aknexpopfieldtextvaluedialog.cpp.

References DiscardTextArray(), iTextArray, iTextValues, and iValueTextArray.

00165     {
00166     // Discard textarray.
00167     DiscardTextArray();
00168 
00169     // Calculate number of pop-up field.
00170     TInt index( KAknExPopFieldIndexInitialize );
00171     TInt count( KAknExPopFieldCountInitialize );
00172     TInt controlId( KAknExPopFieldControlIdInitialize );
00173     CAknPopupField* popup[ KAknExPopFieldMaxTextValueField ];
00174     for ( index = KAknExPopFieldIndexInitialize;
00175           index < KAknExPopFieldMaxTextValueField; index++ )
00176         {
00177         popup[ index ] = NULL;
00178         controlId = EAknExPopFieldDlgCtrlIdPop01 + index;
00179         CCoeControl* control = ControlOrNull( controlId );
00180         if ( control )
00181             {
00182             popup[ count ] = static_cast<CAknPopupField*> ( control );
00183             count++;
00184             }
00185         }
00186 
00187     // Create textarray.
00188     iTextArray = iCoeEnv->ReadDesCArrayResourceL(
00189         R_AKNEXPOPFIELD_FIVE_TEXT_ARRAY );
00190     iValueTextArray = CAknQueryValueTextArray::NewL();
00191     iValueTextArray->SetArray( *iTextArray );
00192 
00193     // Set the same textarray into all the values, and initial value index.
00194     for ( index = KAknExPopFieldIndexInitialize; index < count; index++ )
00195         {
00196         iTextValues[ index ] = CAknQueryValueText::NewL();
00197         iTextValues[ index ]->SetArrayL( iValueTextArray );
00198         iTextValues[ index ]->SetCurrentValueIndex( 0 );
00199         iTextValues[ index ]->SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT );
00200         // Set values into popup fields.
00201         popup[ index ]->SetQueryValueL( iTextValues[ index ] ); // Moved up 
00202                                                                 // from below.
00203         }
00204     }

TBool CAknExPopFieldTextValueDialog::SaveFormDataL (   )  [private]
 

From CAknForm, SaveFormDataL Save the contents of the form.

Returns:
TBool save form data?

Definition at line 211 of file aknexpopfieldtextvaluedialog.cpp.

References iIndexValue, and iTextValues.

00212     {
00213     for ( TInt i = KAknExPopFieldIndexInitialize;
00214               i < KAknExPopFieldMaxTextValueField; i++ )
00215         {
00216         if ( ControlOrNull( EAknExPopFieldDlgCtrlIdPop01+i ) )
00217             {
00218             iIndexValue[ i ] = iTextValues[ i ]->CurrentValueIndex();
00219             }
00220         }
00221 
00222     return ETrue;
00223     }

void CAknExPopFieldTextValueDialog::DoNotSaveFormDataL (   )  [private]
 

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

Definition at line 230 of file aknexpopfieldtextvaluedialog.cpp.

References iIndexValue, and iTextValues.

00231     {
00232     for ( TInt i = KAknExPopFieldIndexInitialize;
00233               i < KAknExPopFieldMaxTextValueField; i++ )
00234         {
00235         if( ControlOrNull( EAknExPopFieldDlgCtrlIdPop01+i ) )
00236             {
00237             iTextValues[ i ]->SetCurrentValueIndex( iIndexValue[ i ] );
00238             }
00239         }
00240     }

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

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

Parameters:
aResourceId 
aMenuPane  Pointer to menu-pane object.

Reimplemented in CAknExPopFieldAttribSetDialog.

Definition at line 54 of file aknexpopfieldbasedialog.cpp.

Referenced by CAknExPopFieldAttribSetDialog::DynInitMenuPaneL().

00056     {
00057     CAknForm::DynInitMenuPaneL( aResourceId, aMenuPane );
00058     if ( aResourceId == R_AVKON_FORM_MENUPANE )
00059         {
00060         aMenuPane->SetItemDimmed( EAknFormCmdLabel, ETrue );
00061         aMenuPane->SetItemDimmed( EAknFormCmdAdd, ETrue );
00062         aMenuPane->SetItemDimmed( EAknFormCmdDelete, ETrue );
00063         }
00064     }

void CAknExPopFieldBaseDialog::ProcessCommandL (  TInt  aCommandId  )  [virtual, inherited]
 

From CAknDialog, ProcessCommandL.

Parameters:
aCommandId 

Reimplemented in CAknExPopFieldAttribSetDialog.

Definition at line 71 of file aknexpopfieldbasedialog.cpp.

00072     {
00073     CAknForm::ProcessCommandL( aCommandId );
00074     }


Member Data Documentation

CDesCArray* CAknExPopFieldTextValueDialog::iTextArray [private]
 

iTextArray Owned by CAknExPopFieldTextValueDialog object.

Definition at line 112 of file aknexpopfieldtextvaluedialog.h.

Referenced by ConfigurePopfieldValueL(), and DiscardTextArray().

CAknQueryValueTextArray* CAknExPopFieldTextValueDialog::iValueTextArray [private]
 

iValueTextArray Owned by CAknExPopFieldTextValueDialog object.

Definition at line 118 of file aknexpopfieldtextvaluedialog.h.

Referenced by ConfigurePopfieldValueL(), and DiscardTextArray().

CAknQueryValueText* CAknExPopFieldTextValueDialog::iTextValues[KAknExPopFieldMaxTextValueField] [private]
 

iTextValues Owned by CAknExPopFieldTextValueDialog object.

Definition at line 124 of file aknexpopfieldtextvaluedialog.h.

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


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

© Nokia 2009

Back to top