Ejemplo n.º 1
0
/*
 * Initialize the Layout for the form1.
 */
void CYPagesForm1::PreLayoutDynInitL()
{    
    CAknPopupFieldText* popupFieldText = static_cast <CAknPopupFieldText*> (ControlOrNull(EYPagesPopup));
	if (popupFieldText)
	{
		popupFieldText->SetCurrentValueIndex (0);
	}	
}
Ejemplo n.º 2
0
// ----------------------------------------------------------------------------
// CNewDestDialog::SaveFormDataL()
// Save form data.
// ----------------------------------------------------------------------------
//
TBool CNewDestDialog::SaveFormDataL()
{
   if( ControlOrNull( EWayFinderCtrlNewDestCountryEdwin ) ){
      GetEdwinText( iCountry, EWayFinderCtrlNewDestCountryEdwin );
   }
   if( ControlOrNull( EWayFinderCtrlNewDestHouseNumEdwin ) ){
      GetEdwinText( iHouseNum, EWayFinderCtrlNewDestHouseNumEdwin );
   }
   if( ControlOrNull( EWayFinderCtrlNewDestCityEdwin ) ){
      GetEdwinText( iCity, EWayFinderCtrlNewDestCityEdwin );
   }
   if( ControlOrNull( EWayFinderCtrlNewDestStringEdwin ) ){
      GetEdwinText( iSearchString, EWayFinderCtrlNewDestStringEdwin );
   }
   iView->SetSearchStrings( iCountry, iCity, iHouseNum, iSearchString );
   return ETrue;
}
Ejemplo n.º 3
0
// ----------------------------------------------------------------------------
// CNewDestDialog::PrepareLC( TInt aResourceId )
// 
// ----------------------------------------------------------------------------
//
void CNewDestDialog::PrepareLC( TInt aResourceId )
{
   CAknForm::PrepareLC( aResourceId );
   SetLineNonFocusing( EWayFinderCtrlNewDestCountryEdwin );
   CEikEdwin* control = static_cast<CEikEdwin*>( ControlOrNull( EWayFinderCtrlNewDestStringEdwin ) );
   if( control ){
      control->AddEdwinObserverL( this );
   }
}
Ejemplo n.º 4
0
/*
 * Initialize the Layout for the form.
 */
void CYPagesForm::PreLayoutDynInitL()
{
	TInt currCityIndex = 0;					// TInt for storing index of City.
   
	CAknPopupFieldText* popupFieldText = static_cast <CAknPopupFieldText*> (ControlOrNull(EYPagesPopup));
	if (popupFieldText) {
		popupFieldText->SetCurrentValueIndex (currCityIndex);
	}
}
Ejemplo n.º 5
0
void CNewDestDialog::HandleEdwinEventL( CEikEdwin* aEdwin,TEdwinEvent aEventType )
{
   CEikEdwin* control = static_cast<CEikEdwin*>( ControlOrNull( EWayFinderCtrlNewDestStringEdwin ) );
   if( control == aEdwin ){
      if( aEventType != EEventFormatChanged && aEventType != EEventNavigation ){
         iView->SetCategorySelected( EFalse );
      }
   }
}
// ----------------------------------------------------------------------------
// CAknExPopFieldMultiPageDialog::ConfigurePageTimeL()
// Configuration values (time) into Popup Fields.
// ----------------------------------------------------------------------------
//
void CAknExPopFieldMultiPageDialog::ConfigurePageTimeL()
    {
    // Calculate number of pop-up field.
    TInt index( KAknExPopFieldMultiPageIndexInitialize );
    TInt count( KAknExPopFieldMultiPageCountInitialize );
    TInt controlId( KAknExPopFieldMultiPageControlIdInitialize );
    CAknPopupField* popup[ KAknExPopFieldMaxMultiPageValueField ];
    for ( index = KAknExPopFieldMultiPageIndexInitialize;
          index < KAknExPopFieldMaxMultiPageValueField; index++ )
        {
        popup[ index ] = NULL;
        controlId = EAknExPopFieldDlgCtrlIdTime01 + index;
        CCoeControl* control = ControlOrNull( controlId );
        if ( control )
            {
            popup[ count ] = static_cast<CAknPopupField*> ( control );
            count++;
            }
        }

    // create an array of time
    TBuf<KAknExPopFieldArrayTextBufLength> text( NULL );
    iCoeEnv->ReadResource( text, R_AKNEXPOPFIELD_TIME_INITIAL_TEXT );
    iTimeArray = new ( ELeave ) CArrayFixFlat<TTime>(
        KAknExPopFieldMultiPageInitialArrayElementCount );
    TTime value( text );
    TInt step( KAknExPopFieldStepInitialize );
    for ( step = KAknExPopFieldStepInitialize;
          step < KAknExPopFieldTimeArrayStepNumber; step++ )
        {
        iTimeArray->AppendL( value );
        value += KAknExPopFieldTimeArrayStepHour;
        }

    // wrap the time array
    iValueTimeArray = CAknQueryValueTimeArray::NewL(
        R_AKNEXPOPFIELD_TIME_FORMAT_STRING_TEXT );
    iValueTimeArray->SetArray( *iTimeArray );

    // set the same array into all the values, and set initial index values
    for ( index = KAknExPopFieldMultiPageIndexInitialize; 
                    index < count; index++ )
        {
        iTimeValues[ index ] = CAknQueryValueTime::NewL();
        iTimeValues[ index ]->SetArrayL( iValueTimeArray );
        iTimeValues[ index ]->SetCurrentValueIndex( NULL );
        iTimeValues[ index ]->SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT );
        }

    // set values into popup fields
    for ( index = KAknExPopFieldMultiPageIndexInitialize; 
                    index < count; index++ )
        {
        popup[ index ]->SetQueryValueL( iTimeValues[ index ] );
        }
    }
// ----------------------------------------------------------------------------
// CAknExPopFieldMultiPageDialog::ConfigurePageDurationL()
// Configuration values (duration) into Popup Fields.
// ----------------------------------------------------------------------------
//
void CAknExPopFieldMultiPageDialog::ConfigurePageDurationL()
    {
    // Calculate number of pop-up field.
    TInt index( KAknExPopFieldMultiPageIndexInitialize );
    TInt count( KAknExPopFieldMultiPageCountInitialize );
    TInt controlId( KAknExPopFieldMultiPageControlIdInitialize );
    CAknPopupField* popup[ KAknExPopFieldMaxMultiPageValueField ];
    for ( index = KAknExPopFieldMultiPageIndexInitialize;
          index < KAknExPopFieldMaxMultiPageValueField; index++ )
        {
        popup[index] = NULL;
        controlId = EAknExPopFieldDlgCtrlIdDura01 + index;
        CCoeControl* control = ControlOrNull( controlId );
        if ( control )
            {
            popup[ count ] = static_cast<CAknPopupField*> ( control );
            count++;
            }
        }

    // create an array of duration
    iDurationArray = new ( ELeave ) CArrayFixFlat<TTimeIntervalSeconds>(
        KAknExPopFieldMultiPageInitialArrayElementCount );
    TInt value( KAknExPopFieldValueInitialize ); 
    for ( value = KAknExPopFieldDuraArrayMinimumValue;
          value < KAknExPopFieldDuraArrayMaximumValue;
          value += KAknExPopFieldDuraArrayStepValue )
        {
        TTimeIntervalSeconds interval( value );
        iDurationArray->AppendL( interval );
        }

    // wrap the duration array
    iValueDurationArray = CAknQueryValueDurationArray::NewL(
        R_AKNEXPOPFIELD_DURA_FORMAT_STRING_TEXT );
    iValueDurationArray->SetArray( *iDurationArray );

    // set the same array into all the values, and set initial index values
    for ( index = KAknExPopFieldMultiPageIndexInitialize; 
                    index < count; index++ )
        {
        iDurationValues[ index ] = CAknQueryValueDuration::NewL();
        iDurationValues[ index ]->SetArrayL( iValueDurationArray );
        iDurationValues[ index ]->SetCurrentValueIndex( NULL );
        iDurationValues[ index ]->
                    SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT );
        }

    // set values into popup fields
    for ( index = KAknExPopFieldMultiPageIndexInitialize; 
                    index < count; index++ )
        {
        popup[ index ]->SetQueryValueL( iDurationValues[ index ] );
        }
    }
Ejemplo n.º 8
0
 /*
  * Save Form data, function to be executed when save option is selected. 
  * Creates the second form which allows for selecting the category.
  */
 TBool CYPagesForm1::SaveFormDataL()
{  
    CAknPopupFieldText* popupFieldText = static_cast <CAknPopupFieldText*> (ControlOrNull(EYPagesPopup));
 	if (popupFieldText) {		
		TInt categoryIndex = popupFieldText->CurrentValueIndex();
		TBuf <30> KMyTextFile;
		KMyTextFile.Format(_L("D:\\YPages\\%d%d.txt"), iColor, categoryIndex);
		
		RFs fileServer;
 	    User :: LeaveIfError (fileServer.Connect());
 	    RFile file;
 	    User::LeaveIfError(file.Open(fileServer, KMyTextFile, EFileRead|EFileStreamText));
 	    CleanupClosePushL(file);
 	    
 	    TFileText fileText;
 	    fileText.Set(file);
 	    
 	    TBuf<100> buffer;
 	    buffer = _L("");

 	    RBuf rBuf;
 	    rBuf.Create(buffer);
 	    rBuf.CleanupClosePushL();
 	    
 	  
 	    TInt err = KErrNone;
 	    while(err != KErrEof) {
 			err = fileText.Read(buffer);
 	    
 			if ((err != KErrNone) && (err != KErrEof)) {
 				User :: Leave(err);
 			}
 			if (KErrNone == err) {
 				rBuf.ReAllocL(rBuf.Length() + buffer.Length()+2);
 				rBuf.Append(buffer);
 				rBuf.Append(_L("\n"));
 			}
 	    }
 	    CAknMessageQueryDialog* dlg = CAknMessageQueryDialog::NewL(rBuf);
 	    dlg->PrepareLC(R_ABOUT_HEADING_PANE);
   	    dlg->SetHeaderTextL(_L(""));  
   	    dlg->RunLD();
 	    		     
 	    CleanupStack::PopAndDestroy(&rBuf);
 	    CleanupStack::PopAndDestroy(&file);
 	    
 	    fileServer.Close();

 	
 	}

        

 	return ETrue;
 }
Ejemplo n.º 9
0
void CNewDestDialog::RemoveInputFocus()
{
   CCoeControl* control = ControlOrNull( EWayFinderCtrlNewDestCityEdwin );
   if( control ) {
      control->SetFocus( EFalse );
   }
   control = ControlOrNull( EWayFinderCtrlNewDestHouseNumEdwin);
   if( control ) {
      control->SetFocus( EFalse );
   }
   control = ControlOrNull( EWayFinderCtrlNewDestStringEdwin );
   if( control ) {
      control->SetFocus( EFalse );
   }
   control = ControlOrNull( EWayFinderCtrlNewDestCountryEdwin );
   if( control ) {
      control->SetFocus( EFalse );
   }
   iHasFocus = EFalse;
}
// ----------------------------------------------------------------------------
// CAknExPopFieldMultiPageDialog::SaveFormDataL()
// Save form data.
// ----------------------------------------------------------------------------
//
TBool CAknExPopFieldMultiPageDialog::SaveFormDataL()
    {
    for ( TInt i = KAknExPopFieldMultiPageIndexInitialize;
              i < KAknExPopFieldMaxMultiPageValueField; i++ ) 
        {
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdText01+i ) )
            {
            iIndexValueText[ i ] = iTextValues[ i ]->CurrentValueIndex();
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdNum01+i ) )
            {
            iIndexValueNumber[ i ] = iNumberValues[ i ]->CurrentValueIndex();
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdPhon01+ i ) )
            {
            iIndexValuePhone[ i ] = iPhoneValues[ i ]->CurrentValueIndex();
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdTime01+i ) )
            {
            iIndexValueTime[ i ] = iTimeValues[ i ]->CurrentValueIndex();
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdDate01+i ) )
            {
            iIndexValueDate[ i ] = iDateValues[ i ]->CurrentValueIndex();
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdDura01+i ) )
            {
            iIndexValueDuration[ i ] = 
                    iDurationValues[ i ]->CurrentValueIndex();
            }
        }

    return ETrue;
    }
// ----------------------------------------------------------------------------
// CAknExPopFieldMultiPageDialog::DoNotSaveFormDataL()
// Does not save form data.
// ----------------------------------------------------------------------------
//
void CAknExPopFieldMultiPageDialog::DoNotSaveFormDataL()
    {
    for ( TInt i = KAknExPopFieldMultiPageIndexInitialize;
              i < KAknExPopFieldMaxMultiPageValueField; i++ )
        {
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdText01+i ) )
            {
            iTextValues[ i ]->SetCurrentValueIndex( iIndexValueText[ i ] );
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdNum01+i ) )
            {
            iNumberValues[ i ]->SetCurrentValueIndex( iIndexValueNumber[ i ] );
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdPhon01+i ) )
            {
            iPhoneValues[ i ]->SetCurrentValueIndex( iIndexValuePhone[ i ] );
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdTime01+i ) )
            {
            iTimeValues[ i ]->SetCurrentValueIndex( iIndexValueTime[ i ] );
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdDate01+i ) )
            {
            iDateValues[ i ]->SetCurrentValueIndex( iIndexValueDate[ i ] );
            }
        if ( ControlOrNull( EAknExPopFieldDlgCtrlIdDura01+i ) )
            {
            iDurationValues[ i ]->
                        SetCurrentValueIndex( iIndexValueDuration[ i ] );
            }
        }
    }
// ----------------------------------------------------------------------------
// CAknExPopFieldOptionalListDialog::DoNotSaveFormDataL()
// Does not save form data.
// ----------------------------------------------------------------------------
//
void CAknExPopFieldOptionalListDialog::DoNotSaveFormDataL()
    {
    for( TInt i = KAknExPopFieldOLIndexInitialize;
             i < KAknExPopFieldMaxOLTextValueField; i++ )
        {
        if( ControlOrNull( EAknExPopFieldDlgCtrlIdPop00+i ) )
            {
            if ( i != KAknExPopFieldEmptyFieldIndex ) // array is no empty
                {
                iTextValues[ i ]->SetCurrentValueIndex( iIndexValue[ i ] );
                }
            }
        }
    }
TBool CEmTubeVideoUploadDialog::SaveFormDataL()
	{
	TBuf<KUploadVideoMaxFieldLength> data;

	CEikEdwin* editor;

	editor = static_cast <CEikEdwin*> (Control(EUploadVideoFieldTitle));
	editor->GetText( data );
	iQueueEntry->SetTitleL( data );

	editor = static_cast <CEikEdwin*> (Control(EUploadVideoFieldDescription));
	editor->GetText( data );
	iQueueEntry->SetDescriptionL( data );

	editor = static_cast <CEikEdwin*> (Control(EUploadVideoFieldTags));
	editor->GetText( data );
	iQueueEntry->SetTagsL( data );


	CAknPopupFieldText* popup = static_cast<CAknPopupFieldText*>(ControlOrNull(EUploadVideoFieldPublic));
	switch ( popup->CurrentValueIndex() )
		{
		case 0:
			iQueueEntry->SetPublic( ETrue );
		break;

		case 1:
			iQueueEntry->SetPublic( EFalse );
		break;
		}

	popup = static_cast<CAknPopupFieldText*>(ControlOrNull(EUploadVideoFieldCategory));
	iQueueEntry->SetCategory( KCategories[ popup->CurrentValueIndex() ] );

	return ETrue;
	}
// ----------------------------------------------------------------------------
// CAknExPopFieldOptionalListDialog::SaveFormDataL()
// Save form data.
// ----------------------------------------------------------------------------
//
TBool CAknExPopFieldOptionalListDialog::SaveFormDataL()
    {
    for ( TInt i = KAknExPopFieldOLIndexInitialize;
             i < KAknExPopFieldMaxOLTextValueField; i++ )
        {
        if( ControlOrNull( EAknExPopFieldDlgCtrlIdPop00+i ) )
            {
            if ( i != KAknExPopFieldEmptyFieldIndex ) // array is no empty
                {
                iIndexValue[ i ] = iTextValues[ i ]->CurrentValueIndex();
                }
            }
        }

    return ETrue;
    }
// ----------------------------------------------------------------------------
// CAknExPopFieldMultiPageDialog::ConfigurePageTextL()
// Configuration values (text) into Popup Fields.
// ----------------------------------------------------------------------------
//
void CAknExPopFieldMultiPageDialog::ConfigurePageTextL()
    {
    // Calculate number of pop-up field.
    TInt index( KAknExPopFieldMultiPageIndexInitialize );
    TInt count( KAknExPopFieldMultiPageCountInitialize );
    TInt controlId( KAknExPopFieldMultiPageControlIdInitialize );
    CAknPopupField* popup[ KAknExPopFieldMaxMultiPageValueField ];
    for ( index = KAknExPopFieldMultiPageIndexInitialize;
          index < KAknExPopFieldMaxMultiPageValueField; index++ )
        {
        popup[ index ] = NULL;
        controlId = EAknExPopFieldDlgCtrlIdText01 + index;
        CCoeControl* control = ControlOrNull( controlId );
        if ( control )
            {
            popup[ count ] = static_cast<CAknPopupField*> ( control );
            count++;
            }
        }

    // Create text array.
    iTextArray = iCoeEnv->ReadDesCArrayResourceL(
        R_AKNEXPOPFIELD_SIX_TEXT_ARRAY );
    iValueTextArray = CAknQueryValueTextArray::NewL();
    iValueTextArray->SetArray( *iTextArray );

    // Set the same array into all the values, and initial value index.
    for ( index = KAknExPopFieldMultiPageIndexInitialize; 
                    index < count; index++ )
        {
        iTextValues[ index ] = CAknQueryValueText::NewL();
        iTextValues[ index ]->SetArrayL( iValueTextArray );
        iTextValues[ index ]->SetCurrentValueIndex( NULL );
        iTextValues[ index ]->SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT );
        }

    // Set values into popup fields.
    for ( index = KAknExPopFieldMultiPageIndexInitialize; 
                    index < count; index++ )
        {
        popup[ index ]->SetQueryValueL( iTextValues[ index ] );
        }
    }
Ejemplo n.º 16
0
 /*
  * Save Form data, function to be executed when save option is selected. 
  * Creates the second form which allows for selecting the category.
  */
TBool CYPagesForm::SaveFormDataL()
{
    _LIT(KMessage,"Error!!");
	CAknPopupFieldText* popupFieldText = static_cast <CAknPopupFieldText*> (ControlOrNull(EYPagesPopup));
	
	if (popupFieldText) {
		if(popupFieldText->CurrentValueIndex()< KNumCities && popupFieldText->CurrentValueIndex()>=0 ) {
			TInt cityIndex;
			cityIndex = popupFieldText->CurrentValueIndex();
			
			CYPagesForm1* form = CYPagesForm1::NewL(iText,cityIndex);
			form->ExecuteLD(R_YPAGES_DIALOG_A);
		} else {
			iEikonEnv->AlertWin(KMessage);
		  }
	}
	
	return ETrue;
}
Ejemplo n.º 17
0
// -----------------------------------------------------------------------------
// CLandmarksEditDialog::HandleControlEventL
// 
// (other items were commented in a header).
// -----------------------------------------------------------------------------
//
void CLandmarksEditDialog::HandleControlEventL(
    CCoeControl* aControl, 
    TCoeEvent aEventType)
	{
    CAknForm::HandleControlEventL(aControl, aEventType);

    if (aEventType == EEventStateChanged)
        {
        if (aControl == ControlOrNull(ELandmarkLatitudeField))
            {
            iIsRealValueEdited[ELatitudeEditor] = ETrue;
            }
        else if (aControl == ControlOrNull(ELandmarkLongitudeField))
            {
            iIsRealValueEdited[ELongitudeEditor] = ETrue;
            }
        else if (aControl == ControlOrNull(ELandmarkAltitudeField))
            {
            iIsRealValueEdited[EAltitudeEditor] = ETrue;
            }
        else if (aControl == ControlOrNull(ELandmarkHorAccField))
            {
            iIsRealValueEdited[EHorizontalAccEditor] = ETrue;
            }
        else if (aControl == ControlOrNull(ELandmarkVerAccField))
            {
            iIsRealValueEdited[EVerticalAccEditor] = ETrue;
            }
        else if (aControl == ControlOrNull(ELandmarkRadiusField))
            {
            iIsRealValueEdited[ERadiusEditor] = ETrue;
            }
        else if (aControl == ControlOrNull(ELandmarkNameField))
            {
            UpdateTitleBarL(ETrue); // get it from name field
            }
        }
	}
Ejemplo n.º 18
0
TBool CVoIPForm::SaveFormDataL()
    {
    CVoIPAppUi* iAppUi = static_cast<CVoIPAppUi*> (iEikonEnv->EikAppUi());
    CVoIPDocument* iDocument =
            static_cast<CVoIPDocument*> (iAppUi->Document());

    TInt iModifyIndex = iDocument->ModifyIndex();
    RPointerArray<CContact> contacts = iAppUi->GetPhoneBook()->GetContactsL();

    if (iModifyIndex >= 0)
        {
        CContact* contact = contacts[iModifyIndex];

        if (contact)
            {
            iAppUi->GetPhoneBook()->DeleteContactItem(contact->GetEntryId());

            TContactItemId contactItemId =
                    iAppUi->GetPhoneBook()->CreateDefaultContactItem();

            contact->SetEntryId(contactItemId);

            CPbkContactItem* contactItem =
                    iAppUi->GetPhoneBook()->OpenContactItemLCX(contactItemId);

            TInt pageId = ActivePageId();

            RArray<CEikCaptionedControl*> aControls;

            ControlsOnPage(aControls, pageId);

            for (TInt i = 0; i < aControls.Count(); i++)
                {
                CEikCaptionedControl* control =
                        ((CEikCaptionedControl*) aControls[i]);

                TPbkContactItemField* field = contactItem->FindField(
                        control->iId);

                if (field == NULL)
                    {
                    CPbkFieldInfo* fieldInfo =
                            iAppUi->GetPhoneBook()->GetFieldsInfo().Find(
                                    control->iId);
                    contactItem->AddFieldL(*fieldInfo);
                    field = contactItem->FindField(control->iId);
                    }

                field->SetLabelL(control->GetFullCaptionText());

                CPbkFieldInfo& fieldInfo = field->FieldInfo();
                if (fieldInfo.CtrlType() == EPbkFieldCtrlTypeDateEditor)
                    {
                    CEikDateEditor* nEditor =
                            static_cast<CEikDateEditor*> (ControlOrNull(
                                    control->iId));
                    TTime time = nEditor->Date();
                    field->DateTimeStorage()->SetTime(time);
                    }
                else
                    {
                    CEikEdwin* nEditor =
                            static_cast<CEikEdwin*> (ControlOrNull(
                                    control->iId));
                    HBufC* text = nEditor->GetTextInHBufL();
                    field->TextStorage()->SetText(text);
                    }
                }

            aControls.Reset();

            iAppUi->GetPhoneBook()->CommitContactItem(contactItem);
            CleanupStack::PopAndDestroy(2); //OpenContactItemLCX
            }
        }
    return ETrue;
    }
Ejemplo n.º 19
0
void CVoIPForm::LoadFormValuesFromDataL()
    {
    TInt pageId = ActivePageId();

    // Delete all controls not saved.

    RArray<CEikCaptionedControl*> aControls;

    ControlsOnPage(aControls, pageId);

    for (TInt i = 0; i < aControls.Count(); i++)
        {
        CEikCaptionedControl* control =
                ((CEikCaptionedControl*) aControls[i]);
        DeleteLine(control->iId, EFalse);
        }

    aControls.Reset();

    // Create controls based on PhoneBook contact item.

    CVoIPAppUi* iAppUi = static_cast<CVoIPAppUi*> (iEikonEnv->EikAppUi());
    CVoIPDocument* iDocument =
            static_cast<CVoIPDocument*> (iAppUi->Document());

    TInt iModifyIndex = iDocument->ModifyIndex();
    RPointerArray<CContact> contacts = iAppUi->GetPhoneBook()->GetContactsL();

    if (iModifyIndex >= 0)
        {
        CContact* contact = contacts[iModifyIndex];

        if (contact)
            {
            CPbkContactItem* contactItem =
                    iAppUi->GetPhoneBook()->ReadContactItemLC(
                            contact->GetEntryId());

            CPbkFieldArray& fieldArray = contactItem->CardFields();

            for (TInt i = 0; i < fieldArray.Count(); i++)
                {
                TPbkContactItemField field = fieldArray[i];
                if (field.IsEmpty() == EFalse)
                    {
                    CPbkFieldInfo& fieldInfo = field.FieldInfo();
                    TInt id = fieldInfo.FieldId();
                    TAny* unused = 0;

                    if (fieldInfo.CtrlType() == EPbkFieldCtrlTypeTextEditor)
                        {
                        TInt type = EEikCtEdwin;

                        CEikEdwin * nEditor =
                                static_cast<CEikEdwin*> (ControlOrNull(id));
                        if (!nEditor)
                            {
                            CEikEdwin* edwin =
                                    (CEikEdwin*) CreateLineByTypeL(
                                            field.Label(), pageId, id, type,
                                            unused);

                            edwin->ConstructL(EEikEdwinNoHorizScrolling
                                    | EEikEdwinResizable, 10, 100, 1);

                            edwin->SetTextL(&(field.Text()));
                            }
                        }
                    else if (fieldInfo.CtrlType()
                            == EPbkFieldCtrlTypeNumberEditor)
                        {
                        TInt type = EAknCtIntegerEdwin;

                        CAknNumericEdwin
                                * nEditor =
                                        static_cast<CAknNumericEdwin*> (ControlOrNull(
                                                id));
                        if (!nEditor)
                            {
                            CAknNumericEdwin* edwin =
                                    (CAknNumericEdwin*) CreateLineByTypeL(
                                            field.Label(), pageId, id, type,
                                            unused);

                            edwin->ConstructL(EEikEdwinNoHorizScrolling
                                    | EEikEdwinResizable, 10, 100, 1);

                            edwin->SetTextL(&(field.Text()));
                            }
                        }
                    else if (fieldInfo.CtrlType()
                            == EPbkFieldCtrlTypeDateEditor)
                        {
                        TInt type = EEikCtDateEditor;

                        CEikDateEditor * nEditor =
                                static_cast<CEikDateEditor*> (ControlOrNull(
                                        id));
                        if (!nEditor)
                            {
                            CEikDateEditor* editor =
                                    (CEikDateEditor*) CreateLineByTypeL(
                                            field.Label(), pageId, id, type,
                                            unused);

                            editor->ConstructL(TTime(mindateTime), TTime(
                                    maxdateTime),
                                    field.DateTimeStorage()->Time(), ETrue);
                            }
                        Line(id)->ActivateL();
                        }
                    }
                }
            SetChangesPending(ETrue);
            UpdatePageL(ETrue);
            CleanupStack::PopAndDestroy(); //contactItem
            }
        }
    }
// ----------------------------------------------------------------------------
// CAknExPopFieldOptionalListDialog::ConfigurePopfieldValueL()
// Configuration values (text) into Popup Fields.
// ----------------------------------------------------------------------------
//
void CAknExPopFieldOptionalListDialog::ConfigurePopfieldValueL()
    {
    // Discard textarray.
    DiscardTextArray();

    // Calculate number of pop-up field.
    TInt index( KAknExPopFieldOLIndexInitialize );
    TInt count( KAknExPopFieldOLCountInitialize );
    TInt controlId( KAknExPopFieldOLControlIdInitialize );
    CAknPopupField* popup[ KAknExPopFieldMaxOLTextValueField ];
    for ( index = KAknExPopFieldOLIndexInitialize;
          index < KAknExPopFieldMaxOLTextValueField; index++ )
        {
        popup[ index ] = NULL;
        controlId = EAknExPopFieldDlgCtrlIdPop00 + index;
        CCoeControl* control = ControlOrNull( controlId );
        if ( control )
            {
            popup[ count ] = static_cast<CAknPopupField*> ( control );
            count++;
            }
        }

    // Create textarray.
    iTextArray[ EAknExPopFieldTextArrayIndex0 ] =
        new ( ELeave ) CDesCArrayFlat( KAknExPopFieldInitialArrayElementCount );
    iTextArray[ EAknExPopFieldTextArrayIndex1 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_ONE_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex2 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_TWO_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex3 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_THREE_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex4 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_FOUR_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex5 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_FIVE_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex6 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_SIX_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex7 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_SEVEN_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex8 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_EIGHT_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex9 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_NINE_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex10 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_TEN_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex11 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_ELEVEN_TEXT_ARRAY );
    iTextArray[ EAknExPopFieldTextArrayIndex12 ] =
        iCoeEnv->ReadDesCArrayResourceL( R_AKNEXPOPFIELD_TWELVE_TEXT_ARRAY );

    for ( index = KAknExPopFieldOLIndexInitialize; index < count; index++ )
        {
        iValueTextArray[ index ] = CAknQueryValueTextArray::NewL();
        iValueTextArray[ index ]->SetArray( *iTextArray[ index ] );
        }

    // Set the same textarray into all the values, and initial value index.
    for ( index = KAknExPopFieldOLIndexInitialize; index < count; index++ )
        {
        iTextValues[ index ] = CAknQueryValueText::NewL();
        iTextValues[ index ]->SetArrayL( iValueTextArray[ index ] );
        if ( index != KAknExPopFieldEmptyFieldIndex ) // array is no empty
            {
            iTextValues[ index ]->SetCurrentValueIndex( NULL );
            iTextValues[ index ]->
                        SetQueryCaption( R_AKNEXPOPFIELD_QUERY_PROMPT );
            }
        }

    // Set values into popup fields.
    for ( index = KAknExPopFieldOLIndexInitialize; index < count; index++ )
        {
        popup[ index ]->SetQueryValueL( iTextValues[ index ] );
        }
    }
Ejemplo n.º 21
0
void CNewDestDialog::SetCity( TDesC &aCity )
{
   if( ControlOrNull( EWayFinderCtrlNewDestCityEdwin ) ){
      SetEdwinTextL( EWayFinderCtrlNewDestCityEdwin, &aCity );
   }
}
Ejemplo n.º 22
0
void CNewDestDialog::SetString( TDesC &aSearchString )
{
   if( ControlOrNull( EWayFinderCtrlNewDestStringEdwin ) ){
      SetEdwinTextL( EWayFinderCtrlNewDestStringEdwin, &aSearchString );
   }
}