chxavaccesspointsettingsitem.cpp
上传用户:dangjiwu
上传日期:2013-07-19
资源大小:42019k
文件大小:2k
源码类别:
Symbian
开发平台:
Visual C++
- /************************************************************************
- * chxavaccesspointsettingsitem.cpp
- * --------------------------------
- *
- * Synopsis:
- * Implementation of access point settings item.
- *
- * Target:
- * Symbian OS
- *
- *
- * (c) 1995-2003 RealNetworks, Inc. Patents pending. All rights reserved.
- *
- ************************************************************************/
- // Includes from this project...
- #include "chxavmisc.h"
- #include "chxavcleanstring.h"
- #include "chxavaccesspointdb.h"
- #include "chxavaccesspointsettingsitem.h"
- ///////////////////////////////////
- // ctor
- CHXAvAccessPointSettingsItem::CHXAvAccessPointSettingsItem(TInt aIdentifier, TUint32& apId)
- : CAknSettingItem(aIdentifier), m_apId(apId)
- {
- }
- ///////////////////////////////////
- // dtor
- CHXAvAccessPointSettingsItem::~CHXAvAccessPointSettingsItem()
- {
- }
- ////////////////////////////////////////////
- // ensure text description accuately indicates what the
- // access point id is set to
- //
- void CHXAvAccessPointSettingsItem::UpdateApTextL()
- {
- CHXAvAccessPointDB* pDb = new (ELeave) CHXAvAccessPointDB;
- AUTO_PUSH_POP_DEL(pDb);
- pDb->ConstructL();
- m_spApText = pDb->AllocAccessPointNameL(m_apId);
- if( 0 == m_spApText->Length() )
- {
- TPtr ptr = m_spApText->Des();
- ptr.Copy(CHXAvCleanString(R_AVP_NO_ACCESS_POINT)());
- SetCompulsoryIndTextL (_L("*"));
- }
- }
- ////////////////////////////////////////////
- //
- const TDesC& CHXAvAccessPointSettingsItem::SettingTextL()
- {
- if(!m_spApText)
- {
- UpdateApTextL();
- }
- return *m_spApText;
- }
- ////////////////////////////////////////////
- // show the settings page associated with this settings item
- //
- void CHXAvAccessPointSettingsItem::EditItemL( TBool /* aCalledFromMenu */)
- {
- TInt wapId = CHXAvMisc::RunAccessPointSettingPageL(m_apId);
- if( wapId != 0 )
- {
- CHXAvAccessPointDB* pDb = new (ELeave) CHXAvAccessPointDB;
- AUTO_PUSH_POP_DEL(pDb);
- pDb->ConstructL();
- TInt apId = 0;
- apId = pDb->GetAPIdFromWapIdL(wapId);
- // user selected something...
- m_apId = apId;
- // update name
- UpdateApTextL();
- UpdateListBoxTextL();
- }
- }