FepSetupDialog.cpp
资源名称:Symbian.zip [点击查看]
上传用户:tjsjht
上传日期:2021-01-13
资源大小:25k
文件大小:3k
源码类别:
输入法编程
开发平台:
Visual C++
- /*
- * ============================================================================
- * Name : CFepSetupDialog from FepSetupDialog.h
- * Part of : FepSetup
- * Created : 02/22/2003 by Chiam Poh Guan
- * Implementation notes:
- * Initial content was generated by Series 60 AppWizard.
- * Version :
- * Copyright: Forum Nokia
- * ============================================================================
- */
- // INCLUDE FILES
- #include "FepSetupDialog.h"
- #include <eiklabel.h> // for example label control
- #include <avkon.hrh>
- #include <aknappui.h>
- #include <f32file.h> // for TParseBase
- #include <FepSetup.rsg>
- #include "fepsetup.hrh"
- #include <AknListQueryDialog.h>
- //_LIT(KAknExQueryDefaultDataText, "Hello");
- _LIT(KMySelect, "Selected %d");
- // ================= MEMBER FUNCTIONS =======================
- // Destructor
- CFepSetupDialog::~CFepSetupDialog()
- {
- delete iFepSetting;
- delete iFileNamesOfAvailableFeps;
- delete iNamesOfAvailableFeps;
- }
- // ---------------------------------------------------------
- // CFepSetupDialog::OkToExitL(TInt aButtonId)
- // called by framework when the OK button is pressed
- // ---------------------------------------------------------
- //
- TBool CFepSetupDialog::OkToExitL(TInt aButtonId)
- {
- // Translate the button presses into commands for the appui & current
- // view to handle
- if ( aButtonId == EAknSoftkeyOptions )
- {
- iAvkonAppUi->ProcessCommandL( EAknSoftkeyOptions );
- }
- else if ( aButtonId == EAknSoftkeyBack )
- {
- iAvkonAppUi->ProcessCommandL( EEikCmdExit );
- }
- return EFalse;
- }
- // ---------------------------------------------------------
- // CFepSetupDialog::PreLayoutDynInitL();
- // called by framework before dialog is shown
- // ---------------------------------------------------------
- //
- void CFepSetupDialog::PreLayoutDynInitL()
- {
- iFepSetting=CFepGenericGlobalSettings::NewL(*iEikonEnv,
- TFepOnOrOffKeyData(EKeyEnter, EModifierFunc|EModifierShift, EModifierFunc),
- TFepOnOrOffKeyData(EKeyEnter, EModifierFunc|EModifierShift, EModifierShift),
- EFalse);
- iFileNamesOfAvailableFeps = iEikonEnv->FileNamesOfAvailableFepsL();
- const TInt numberOfAvailableFeps = iFileNamesOfAvailableFeps->MdcaCount();
- iNamesOfAvailableFeps = new(ELeave) CDesCArrayFlat(numberOfAvailableFeps+1);
- for(TInt i=0; i<numberOfAvailableFeps; i++)
- {
- iNamesOfAvailableFeps->AppendL(TParsePtrC(iFileNamesOfAvailableFeps->MdcaPoint(i)).Name());
- }
- HBufC* noneFepText = iCoeEnv->AllocReadResourceLC(R_FEPSETUP_TBUF_NONE);
- iNamesOfAvailableFeps->AppendL(*noneFepText);
- CleanupStack::PopAndDestroy(); // noneFepText
- }
- void CFepSetupDialog::DisplayListOfFepsL()
- {
- TInt index(0);
- CAknListQueryDialog* dlg = new(ELeave) CAknListQueryDialog(&index);
- dlg->PrepareLC(R_FEPSETUP_LIST_QUERY);
- dlg->SetItemTextArray(iNamesOfAvailableFeps);
- dlg->SetOwnershipType(ELbmDoesNotOwnItemArray);
- TInt answer( dlg->RunLD() );
- if (answer)
- {
- TBuf<50> text;
- text.Format(KMySelect, index+1);
- iEikonEnv->InfoMsg(text);
- }
- else
- {
- // iEikonEnv->InfoMsg("Error");
- }
- }
- // End of File