/**
 * Edit the setting item identified by the given id and store
 * the changes into the store.
 * @param aIndex the index of the setting item in SettingItemArray()
 * @param aCalledFromMenu true: a menu item invoked editing, thus
 *	always show the edit page and interactively edit the item;
 *	false: change the item in place if possible, else show the edit page
 */
void CCalendarManagerSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
	{
	aIndex = SettingItemArray()->ItemIndexFromVisibleIndex(aIndex);	
	CAknSettingItem* item = ( *SettingItemArray() )[aIndex];
	switch ( item->Identifier() )
		{
	// [[[ begin generated region: do not modify [Editing Started Invoker]
	// ]]] end generated region [Editing Started Invoker]
	
		}
	
	CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
	
	TBool storeValue = ETrue;
	switch ( item->Identifier() )
		{
	// [[[ begin generated region: do not modify [Editing Stopped Invoker]
	// ]]] end generated region [Editing Stopped Invoker]
	
		}
		
	if ( storeValue )
		{
		item->StoreL();
		SaveSettingValuesL();
		}	
	}
Exemple #2
0
/**
 * Edit the setting item identified by the given id and store
 * the changes into the store.
 * @param aIndex the index of the setting item in SettingItemArray()
 * @param aCalledFromMenu true: a menu item invoked editing, thus
 *	always show the edit page and interactively edit the item;
 *	false: change the item in place if possible, else show the edit page
 */
void CSymbian_ua_guiSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
{
    CAknSettingItem* item = ( *SettingItemArray() )[aIndex];
    switch ( item->Identifier() )
    {
        // [[[ begin generated region: do not modify [Editing Started Invoker]
        // ]]] end generated region [Editing Started Invoker]

    }

    CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );

    TBool storeValue = ETrue;
    switch ( item->Identifier() )
    {
        // [[[ begin generated region: do not modify [Editing Stopped Invoker]
        // ]]] end generated region [Editing Stopped Invoker]

    }

    if ( storeValue )
    {
        item->StoreL();
        SaveSettingValuesL();
    }
}
	void ShowSettingPageL(TInt aCalledFromMenu)
    {
		TInt index = iListbox->CurrentItemIndex();
		if ( index >= 0 )
			{
				CAknSettingItem* item = iSettingItemArray->At(index);
				
				item->EditItemL(aCalledFromMenu);
				item->UpdateListBoxTextL();
				iListbox->DrawDeferred();
			}
		//iListBox-DrawNow();
    }
void CCommonDialogsExSettingsDialog::PreLayoutDynInitL()
    {
    iMemory = CAknMemorySelectionSettingPage::EPhoneMemory;
    iDriveNumber = EDriveC;

    CAknSettingStyleListBox* listBox = 
                            static_cast< CAknSettingStyleListBox* >
                            ( Control( ECommonDialogsExSettingsListboxId ) );
    User::LeaveIfNull( listBox );

    CAknSettingItem* settingItem;
    HBufC* itemTitle;

    // Create the memory selection item
    if ( iMultiDriveSupport )
        {    
        settingItem =
                new( ELeave ) CAknMemorySelectionSettingItemMultiDrive(
                                            iResourceId, iDriveNumber );
        }
    else
        {
        settingItem =
                new( ELeave ) CAknMemorySelectionSettingItem(
                                            iResourceId, iMemory );
        }
    CleanupStack::PushL( settingItem );

    // Set memory selection item's title
    itemTitle = iCoeEnv->AllocReadResourceLC( R_STRING_COMMONDIALOGSEX_SET_MEMORY );
    settingItem->ConstructL( EFalse, 0, *itemTitle, NULL, 0,
                                                    EAknCtPopupSettingList );
    CleanupStack::PopAndDestroy();  // itemTitle

    // Add memo store item to the settings array
    iSettingItemArray.AppendL( settingItem );
    CleanupStack::Pop();    // settingItem

    CTextListBoxModel* model = listBox->Model();
    model->SetItemTextArray( &iSettingItemArray );
    // Ownership retained by us
    model->SetOwnershipType( ELbmDoesNotOwnItemArray );

    iSettingItemArray.RecalculateVisibleIndicesL();
    listBox->CreateScrollBarFrameL( ETrue );
    listBox->ScrollBarFrame()->SetScrollBarVisibilityL(
                        CEikScrollBarFrame::EOff, CEikScrollBarFrame::EAuto );
    listBox->HandleItemAdditionL();
    listBox->SetListBoxObserver( this );
    listBox->UpdateScrollBarsL();
    }
CAknSettingItem* CDirectPrintPrinterSettingView::GetSettingItemL(const TDesC& aItemTitle)
	{
	CAknSettingItem* item = NULL;
	CAknSettingItemArray* array = iListBox->SettingItemArray();
	TInt count = array->Count();

	for (TInt i=0; i<count; i++)
		{
		item = (*array)[i];
		TPtrC name = item->SettingName();
		if (name.Compare(aItemTitle) == 0)
			{
			break;
			}
		item = NULL;
		}

	return item;
	}
/**
 * Edit the setting item identified by the given id and store
 * the changes into the store.
 * @param aIndex the index of the setting item in SettingItemArray()
 * @param aCalledFromMenu true: a menu item invoked editing, thus
 *	always show the edit page and interactively edit the item;
 *	false: change the item in place if possible, else show the edit page
 */
void CSetupGisWeatherSettingItemList::EditItemL ( TInt aIndex, TBool aCalledFromMenu )
	{
	CAknSettingItem* item = ( *SettingItemArray() )[aIndex];
	switch ( item->Identifier() )
		{
	
		}

	switch(aIndex)
	    {
	case 5:
		iSettings.SelectApp();
		LoadSettingsL();
		break;
	case 6:
	    iSettings.SelectAP();
	    LoadSettingsL();
	    break;
	case 7:
	    InputUrl();
	    LoadSettingsL();
	    break;
	default:
	    CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
	    break;
	    }
	//TResourceReader read;
	//asfawefiCoeEnv->CreateResourceReaderLC(read,R_SETTING_LIST_SETTING_TIME);
	TBool storeValue = ETrue;
	switch ( item->Identifier() )
	    {

	    }
		
	if ( storeValue )
		{
		item->StoreL();
		SaveSettingValuesL();
		}	
	}
void CTrkConnSettingsList::ControlStateChangedAfterL(TInt aIndex)
{
	CAknSettingItemArray* array = SettingItemArray();
	
	CTrkConnIndexPopupSettingItem* connTypePopUp = (CTrkConnIndexPopupSettingItem *)array->At(0);
	TInt index = connTypePopUp->CurrentIndex();
	
	CAknSettingItem* portEditor = array->At(1);
	CAknSettingItem* baudRatePopUp = array->At(2);

	switch(aIndex)
	{
		case 0:
		{
			switch (index)
			{
				// Now port and baud rate are hidden for 
				case 0: // USB (Dbg&Trc)
				case 1: // BT
				case 2: // XTI
				case 3: // DCC
				{
					portEditor->SetHidden(ETrue);
					baudRatePopUp->SetHidden(ETrue);
					HandleChangeInItemArrayOrVisibilityL();				
						break;			
				}
				default:
					break;
			}
			break;
		}
		default:
			break;
	}
}
	virtual class CAknSettingItem* CreateItemL(TInt aId, TInt aOrdinal)
	{
		CALLSTACKITEM_N(_CL("CAutoSettingsImpl"), _CL("CreateItemL") );
		if ( ! iResources )
			Bug( _L("Resources not read") ).Raise();
		
		CAknSettingItem* item = CreateSettingItemL( aId );
		ResourceReaders::CSettingItem* r = iResources->Find( aId );
		if ( ! r )
			{
				Bug( _L("Resource not found for identifier %d in ordinal %d") ).TechMsg( aId, aOrdinal ).Raise();
				return NULL;
			}

		item->SetEmptyItemTextL( r->EmptyItemText() );
		item->SetCompulsoryIndTextL( r->CompulsoryText() );
		item->ConstructL( EFalse, aOrdinal, r->Name(), NULL, r->iSettingPageResource, r->iType, r->iSettingEditorResource, r->iAssociatedResource );
		
		// clumsy and stupid, but 
		LoadSettingL( aId );
		SetItemDataL( aId );
		UpdateSettingItemL( aId );
		return iItems[aId];
	}
CAknSettingItem* CBuddycloudEditPlaceList::CreateSettingItemL (TInt aIdentifier) {
	CAknSettingItem* aSettingItem = NULL;

    switch(aIdentifier) {
		case EEditPlaceItemName:
			aSettingItem = new (ELeave) CAknTextSettingItem(aIdentifier, iName);
			aSettingItem->SetSettingPageFlags(CAknTextSettingPage::EPredictiveTextEntryPermitted);
			break;
		case EEditPlaceItemStreet:
			aSettingItem = new (ELeave) CAknTextSettingItem(aIdentifier, iStreet);
			aSettingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed | CAknTextSettingPage::EPredictiveTextEntryPermitted);
			break;
		case EEditPlaceItemArea:
			aSettingItem = new (ELeave) CAknTextSettingItem(aIdentifier, iArea);
			aSettingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed | CAknTextSettingPage::EPredictiveTextEntryPermitted);
			break;
		case EEditPlaceItemCity:
			aSettingItem = new (ELeave) CAknTextSettingItem(aIdentifier, iCity);
			aSettingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed | CAknTextSettingPage::EPredictiveTextEntryPermitted);
			break;
		case EEditPlaceItemPostcode:
			aSettingItem = new (ELeave) CAknTextSettingItem(aIdentifier, iPostcode);
			aSettingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed | CAknTextSettingPage::EPredictiveTextEntryPermitted);
			break;
		case EEditPlaceItemRegion:
			aSettingItem = new (ELeave) CAknTextSettingItem(aIdentifier, iRegion);
			aSettingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed | CAknTextSettingPage::EPredictiveTextEntryPermitted);
			break;
		case EEditPlaceItemCountry:
			aSettingItem = new (ELeave) CAknTextSettingItem(aIdentifier, iCountry);
			aSettingItem->SetSettingPageFlags(CAknTextSettingPage::EPredictiveTextEntryPermitted);
			break;
		case EEditPlaceItemVisibility:
			aSettingItem = new (ELeave) CAknBinaryPopupSettingItem(aIdentifier, iShared);
			break;
		default:
			break;
    }

    return aSettingItem;
}
	CAknSettingItem* CreateSettingItemL( TInt identifier )
	{
		CALLSTACKITEM_N(_CL("CAutoSettingsImpl"), _CL("CreateSettingItemL"));
		CAknSettingItem * settingItem = NULL;
		
		const TSettingItem i = TClSettings::GetKClSettings(identifier);
		
		switch (i.iDatatype) {
		case ::EAP:
			{
				TInt *p=new (ELeave) TInt;
				*p=1;
				if (i.iDefaultExists) *p=i.iIntDefault;
				iData[identifier]=p;
				CAknSettingItem * item = (new (ELeave) CAknEnumeratedTextPopupSettingItem(identifier, *p ));
				settingItem =  item;
				iItems[identifier] = item;
				break;
			}
		case ::EString:
			{
				TBuf<256>* p=new (ELeave) TBuf<256>;
				iData[identifier]=p;
				if (i.iDefaultExists && i.iStringDefault) *p=TPtrC((TText*)i.iStringDefault);
				CAknSettingItem * item = NULL;
				
				// Hack to make password secret.
				// Should enable 
				if ( i.iSettingNo == SETTING_JABBER_PASS )
					{
						item =  new (ELeave) CAknPasswordSettingItem(identifier, 
																	 CAknPasswordSettingItem::EAlpha,
																	 *p);
						
					}
				else
					{
						item = new (ELeave) CAknTextSettingItem(identifier, *p);
						/* !Allowing empty setting! */
						TInt flags=item->SettingPageFlags();
						item->SetSettingPageFlags( flags | CAknTextSettingPage::EZeroLengthAllowed );
					}
				settingItem = item;
				iItems[identifier] = item;
				break;
			}
		case ::EBool:
			{
				TInt *p=new (ELeave) TInt;
				*p=1;
				if (i.iDefaultExists) *p=i.iIntDefault;
				iData[identifier]=p;
				CAknSettingItem * item =new (ELeave) CAknBinaryPopupSettingItem(identifier, *p );
				settingItem =  item;
				iItems[identifier] =  item; 
				break;
			}
		case ::EEnum:
		{
			TInt *p=new (ELeave) TInt;
			*p=1;
			if (i.iDefaultExists) *p=i.iIntDefault;
			iData[identifier]=p;
			CAknSettingItem * item =new (ELeave) CAknEnumeratedTextPopupSettingItem(identifier, *p );
			settingItem =  item;
			iItems[identifier] =  item; 
			break;
		}
		case ::EInt:
			{
				TInt *p=new (ELeave) TInt;
				*p=0;
				if (i.iDefaultExists) *p=i.iIntDefault;
				iData[identifier]=p;
				CAknSettingItem * item = new (ELeave) CAknIntegerEdwinSettingItem(identifier, *p );
				settingItem =  item;
				iItems[identifier] =  item;
				break;
			}
		default:
			break;
		}
		if (!settingItem) {
			User::Leave(-1027);
		}
		return settingItem;
	}