# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1282114699 -10800 # Node ID 11a052f4b02ee8ac0e6a984991f202c18677fd0c # Parent 76883296a0d5394f35e4987b6624e890f3cba1d8 Revision: 201031 Kit: 201033 diff -r 76883296a0d5 -r 11a052f4b02e appsupport.pro --- a/appsupport.pro Tue Jul 06 14:26:20 2010 +0300 +++ b/appsupport.pro Wed Aug 18 09:58:19 2010 +0300 @@ -23,4 +23,6 @@ SUBDIRS += coreapplicationuis\devicepowermenuplugin SUBDIRS += systemsettings\accindicatorplugin SUBDIRS += systemsettings\accindicatorplugin\accindicatorsettings +SUBDIRS += coreapplicationuis\powersaveutilities +SUBDIRS += coreapplicationuis\Rfs\Plugins\cprfsplugin } diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/ATCmdPlugin/data/atcmdpluginresource.rss --- a/coreapplicationuis/ATCmdPlugin/data/atcmdpluginresource.rss Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/ATCmdPlugin/data/atcmdpluginresource.rss Wed Aug 18 09:58:19 2010 +0300 @@ -1,5 +1,5 @@ - // Copyright (c) 2008-2009 Nokia Corporation and/or its subsidiary(-ies). + // Copyright (c) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). // All rights reserved. // This component and the accompanying materials are made available // under the terms of "Eclipse Public License v1.0" @@ -15,7 +15,6 @@ #include #include -#include #include "atcmdplugin.rh" diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfsplugin.h --- a/coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfsplugin.h Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfsplugin.h Wed Aug 18 09:58:19 2010 +0300 @@ -18,16 +18,16 @@ #define CPRFSPLUGIN_H #include -#include +#include -class CpRfsPlugin : public QObject, public CpPluginPlatInterface +class CpRfsPlugin : public QObject, public CpPluginInterface { Q_OBJECT - Q_INTERFACES(CpPluginPlatInterface) + Q_INTERFACES(CpPluginInterface) public: CpRfsPlugin(); ~CpRfsPlugin(); - virtual CpSettingFormItemData *createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; }; #endif //CPRFSPLUGIN_H diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfssettingsdataformcustomitem.h --- a/coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfssettingsdataformcustomitem.h Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfssettingsdataformcustomitem.h Wed Aug 18 09:58:19 2010 +0300 @@ -20,6 +20,9 @@ #include + +class HbPushButton; + class CpRfsSettingsDataFormCustomItem : public HbDataFormViewItem { Q_OBJECT @@ -27,6 +30,14 @@ public: CpRfsSettingsDataFormCustomItem(QGraphicsItem *parent); ~CpRfsSettingsDataFormCustomItem(); + virtual bool canSetModelIndex(const QModelIndex &index) const; + virtual HbAbstractViewItem* createItem(); +protected: + //Override createCustomWidget API + virtual HbWidget* createCustomWidget(); +public: + HbPushButton *mButton; + }; #endif // CP_RFS_SETTINGS_DATAFORM_CUSTOMITEM_H diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfssettingsform.h --- a/coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfssettingsform.h Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/Plugins/cprfsplugin/inc/cprfssettingsform.h Wed Aug 18 09:58:19 2010 +0300 @@ -19,6 +19,7 @@ #define CP_RFS_SETTINGSFORM_H #include +#include class HbDataFormModelItem; @@ -44,6 +45,7 @@ //DataForm List Items HbDataFormModelItem *mNormalRfs; HbDataFormModelItem *mDeepRfs; + HbTranslator mTrans; }; #endif // CP_RFS_SETTINGSFORM_H diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfsplugin.cpp --- a/coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfsplugin.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfsplugin.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -19,6 +19,7 @@ #include "cprfsview.h" #include #include +#include CpRfsPlugin::CpRfsPlugin() { @@ -27,9 +28,11 @@ CpRfsPlugin::~CpRfsPlugin() { } -CpSettingFormItemData *CpRfsPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +QList CpRfsPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const { - return new CpSettingFormEntryItemDataImpl(itemDataHelper,tr("Restore Factory Settings")); + HbTranslator trans("control_panel"); + return QList() + << new CpSettingFormEntryItemDataImpl(itemDataHelper,hbTrId("txt_cp_dblist_reset"),hbTrId("txt_cp_dblist_reset_val_reset_your_device"),QString("qtg_large_reset")); } Q_EXPORT_PLUGIN2(cprfsplugin, CpRfsPlugin); diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfssettingsdataformcustomitem.cpp --- a/coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfssettingsdataformcustomitem.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfssettingsdataformcustomitem.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -18,6 +18,7 @@ #include #include #include +#include CpRfsSettingsDataFormCustomItem::CpRfsSettingsDataFormCustomItem(QGraphicsItem *parent) : HbDataFormViewItem(parent) @@ -27,3 +28,50 @@ CpRfsSettingsDataFormCustomItem::~CpRfsSettingsDataFormCustomItem() { } + +//overridden method which is required in case of customwidget +bool CpRfsSettingsDataFormCustomItem::canSetModelIndex(const QModelIndex &index) const + { + HbDataFormModelItem::DataItemType itemType = + static_cast( + index.data(HbDataFormModelItem::ItemTypeRole).toInt()); + //each custom item can be represented by customitembase+number and 10 is just in future if u have to add extra custom items + if(itemType >= HbDataFormModelItem::CustomItemBase && + itemType <= HbDataFormModelItem::CustomItemBase + 10 ) { + return true; + } + return false; + + } +//overridden method which is required in case of customwidget +HbAbstractViewItem* CpRfsSettingsDataFormCustomItem::createItem() + { + return new CpRfsSettingsDataFormCustomItem(*this); + } +//overridden method which is required in case of customwidget +HbWidget* CpRfsSettingsDataFormCustomItem::createCustomWidget() + { + HbDataFormModelItem::DataItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + HbTranslator trans("control_panel"); + switch(itemType) + { + case HbDataFormModelItem::CustomItemBase + 1: + { + //Create 1st button + mButton = new HbPushButton(); + mButton->setText(hbTrId("txt_cp_setlabel_settings_reset_val_reset_settings")); + return mButton; + } + case HbDataFormModelItem::CustomItemBase + 2: + { + //Create 2nd button + mButton = new HbPushButton(); + mButton->setText(hbTrId("txt_cp_setlabel_device_reset_val_reset_device")); + return mButton; + } + //Some other cases can also be added if there are more than 2 custom data item + default: + return 0; + } + } diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfssettingsform.cpp --- a/coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfssettingsform.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfssettingsform.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -25,18 +25,19 @@ #include CpRfsSettingsForm::CpRfsSettingsForm(QGraphicsItem *parent) : - HbDataForm(parent) + HbDataForm(parent),mTrans("control_panel") { - this->setHeading(tr("Restore Factory Settings")); + this->setHeading(hbTrId("txt_cp_subhead_reset")); //initialize the form model initRfsSettingModel(); - connect(this, SIGNAL(activated(QModelIndex)),this, SLOT(onItemActivated(QModelIndex))); + connect(this, SIGNAL(itemShown(QModelIndex)),this, SLOT(onItemActivated(QModelIndex))); } CpRfsSettingsForm::~CpRfsSettingsForm() { + } void CpRfsSettingsForm::initRfsSettingModel() @@ -44,16 +45,16 @@ HbDataFormModel *model = new HbDataFormModel(0); // Create the custom items because HbPushButton cannot be added to the HbDataFormModelItem - HbDataFormModelItem::DataItemType customItem = static_cast(HbDataFormModelItem::CustomItemBase + 1); - - mNormalRfs = model->appendDataFormItem(customItem, QString(), model->invisibleRootItem()); - mNormalRfs->setData(HbDataFormModelItem::KeyRole, tr("Restore")); - HbDataFormModelItem::DataItemType customItem1 = static_cast(HbDataFormModelItem::CustomItemBase + 1); - - mDeepRfs = model->appendDataFormItem(customItem1, QString(), model->invisibleRootItem()); - mDeepRfs->setData(HbDataFormModelItem::KeyRole,tr("Delete Data and Restore")); - + + mNormalRfs = model->appendDataFormItem(customItem1, QString(), model->invisibleRootItem()); + mNormalRfs->setLabel(hbTrId("txt_cp_setlabel_settings_reset")); + mNormalRfs->setDescription(hbTrId("txt_cp_info_original_settings_will_be_restored_no")); + HbDataFormModelItem::DataItemType customItem2 = static_cast(HbDataFormModelItem::CustomItemBase + 2); + + mDeepRfs = model->appendDataFormItem(customItem2, QString(), model->invisibleRootItem()); + mDeepRfs->setLabel(hbTrId("txt_cp_setlabel_device_reset")); + mDeepRfs->setDescription(hbTrId("txt_cp_info_all_data_will_be_deleted_and_factory_s")); this->setModel(model); } @@ -65,8 +66,8 @@ if (itemData->type() > HbDataFormModelItem::GroupPageItem) { //get the widget of setting item - HbWidget* widget = this->dataFormViewItem(index)->dataItemContentWidget(); - + HbAbstractViewItem* viewitem = static_cast(this)->itemByIndex(index); + HbWidget* widget =static_cast(viewitem)->dataItemContentWidget(); if (itemData == mNormalRfs) { activateNormalRfs(widget); diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfsview.cpp --- a/coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfsview.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/Plugins/cprfsplugin/src/cprfsview.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -28,9 +28,13 @@ //custom prototype CpRfsSettingsDataFormCustomItem* customPrototype = new CpRfsSettingsDataFormCustomItem(settingForm); - settingForm->setItemPrototype(customPrototype); - this->setSettingForm(settingForm); + QList protos = settingForm->itemPrototypes(); + protos.append(customPrototype); + settingForm->setItemPrototypes(protos); + //function from hbview + setWidget(settingForm); + } CpRfsView::~CpRfsView() { diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/eabi/rfsU.DEF --- a/coreapplicationuis/Rfs/eabi/rfsU.DEF Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/eabi/rfsU.DEF Wed Aug 18 09:58:19 2010 +0300 @@ -33,4 +33,6 @@ _ZTV12CRfsShutdown @ 32 NONAME ; ## _ZTV13CRfsCompleter @ 33 NONAME ; ## _ZTV9CRfsAppUi @ 34 NONAME ; ## + _ZTI12CRfsConTimer @ 35 NONAME + _ZTV12CRfsConTimer @ 36 NONAME diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/group/rfs.mmp --- a/coreapplicationuis/Rfs/group/rfs.mmp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/group/rfs.mmp Wed Aug 18 09:58:19 2010 +0300 @@ -49,6 +49,7 @@ SOURCE rfsShutdown.cpp SOURCE rfsCompleter.cpp SOURCE rfsConnectionObserver.cpp +SOURCE rfscontimer.cpp START RESOURCE ../src/rfs.rss TARGETPATH RESOURCE_FILES_DIR diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/inc/rfsConTimer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/Rfs/inc/rfsConTimer.h Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2006-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + + +#ifndef __RFSCONTIMER_H +#define __RFSCONTIMER_H + +#include +#include +#include + +#include "rfsConnectionObserver.h" + +class CRfsConnectionObserver; + +class CRfsConTimer : public CActive + { + private: + + CRfsConTimer(CRfsConnectionObserver * aRfsConnectionObserver); // Construction + + + +public: + + static CRfsConTimer* CRfsConTimer::NewL(CRfsConnectionObserver * aRfsConnectionObserver); + ~CRfsConTimer(); // Destruction + void IssueTimerRequest(); // issue request + +protected: + void DoCancel(); // Cancel request + void RunL(); // service completed request. + +public: + + RTimer iTimer; // Asynchronous service provider. + CRfsConnectionObserver* iRfsConnectionObserver; + +private: // friend classes + + friend class CRfsConnectionObserver; + }; + +#endif //__RFSCONTIMER_H diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/inc/rfsConnectionObserver.h --- a/coreapplicationuis/Rfs/inc/rfsConnectionObserver.h Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/inc/rfsConnectionObserver.h Wed Aug 18 09:58:19 2010 +0300 @@ -21,13 +21,22 @@ #include +// P&S KEYS FROM SIP & PDP CONNECTION +#include +#include +#include + +#include "rfscontimer.h" + +class CRfsConTimer; + enum TRfsConnectionCloseState { ESipConnectionClose, EPdpConnectionClose // this should be the last enum }; -NONSHARABLE_CLASS( CRfsConnectionObserver ): CActive,public MHbDeviceProgressDialogObserver +NONSHARABLE_CLASS( CRfsConnectionObserver ): public CActive,public MHbDeviceProgressDialogObserver { public: @@ -68,13 +77,22 @@ void ReOpenPDPConnection(); void ReportRfsFailureToSip(); void ReportRfsCompletionToSip(); + /** + * Subscribes PDP property + * + * @since S60 v3.1 + */ + void Subscribe(); + + -private: +protected: /** * From base class CActive */ - + void DoCancel(); + /** * From CActive * @@ -82,25 +100,13 @@ */ void RunL(); - /** - * From CActive - * - * @since S60 v3.1 - */ - void DoCancel(); - + private: /** * New methods */ - /** - * Subscribes PDP property - * - * @since S60 v3.1 - */ - void Subscribe(); /** * Dismisses closing connections dialog @@ -166,16 +172,19 @@ */ TBool iAllConnectionClosed; TBool iIsWaitForDialogExecuted; - TInt iIsPDPFeatureEnabled; TBool iIsSIPConnectionsPresent; TBool iIsDialogNeedToBeDisplayed; TBool iIsSipInformedForClosingAllConnection; TBool iIsPDPInformedforClosingAllConnection; TBool iIsClosingConnectionsApplicable; - - TRfsConnectionCloseState iState; //for synchronous dialog handling CActiveSchedulerWait *iWait; + + +public: + TRfsConnectionCloseState iState; + TInt iIsPDPFeatureEnabled; + CRfsConTimer* iRfsConTimer; }; #endif //RFSPDPOBSERVER_H diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/src/rfsConnectionObserver.cpp --- a/coreapplicationuis/Rfs/src/rfsConnectionObserver.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/src/rfsConnectionObserver.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -23,14 +23,10 @@ #include #include #include -#include #include #include -// P&S KEYS FROM SIP & PDP CONNECTION -#include -#include -#include + // USER INCLUDES #include "rfsConnectionObserver.h" @@ -141,6 +137,9 @@ Subscribe(); } + // Create the Timer Active Object + iRfsConTimer = CRfsConTimer :: NewL(this); + TRACES("CRfsConnectionObserver::ConstructL(): End"); } @@ -170,6 +169,11 @@ CRfsConnectionObserver::~CRfsConnectionObserver() { TRACES("CRfsConnectionObserver::~CRfsConnectionObserver()"); + + if(iRfsConTimer) + { + delete iRfsConTimer; + } Cancel(); delete iWait; TRACES("CRfsConnectionObserver::~CRfsConnectionObserver(): End"); @@ -191,16 +195,21 @@ // only perform the following operation if the 'iIsClosingConnectionsApplicable' is ETrue iAllConnectionClosed = EFalse; - // Send P&S notification to SIP that RFS has started TInt err(KErrNone); if (iIsSIPConnectionsPresent && iState == ESipConnectionClose) { + // Send P&S notification to SIP that RFS has started and start the timer + err = iSIPProperty.Set(KPSSipRfsUid, KSipRfsState, ESipRfsStarted ); + iRfsConTimer->IssueTimerRequest(); iIsSipInformedForClosingAllConnection = ETrue; } else if (iIsPDPFeatureEnabled && iState == EPdpConnectionClose) { + // Send P&S notification to PDP that RFS has started and start the timer + err = iPDPProperty.Set(KPDPContextManager2,KPDPContextManagerFactorySettingsReset,EPDPContextManagerFactorySettingsResetStart ); + iRfsConTimer->IssueTimerRequest(); iIsPDPInformedforClosingAllConnection = ETrue; } @@ -208,12 +217,6 @@ // Leave from here is there is any error setting the intial handshake information // This means that RFS has failed as there was some problem setting the P&S keys User::LeaveIfError(err); - if(err != KErrNone) - { - TRACES1("CRfsConnectionObserver::CloseAlwaysOnConnectionL(): Err = %d", err); - // This means that the RFS has failed - return EFalse; - } // we set the flag to indicate showl is called and the dialog needs to be // dismissed from within the RunL() @@ -255,9 +258,11 @@ { iPDPProperty.Set(KPDPContextManager2,KPDPContextManagerFactorySettingsReset,EPDPContextManagerFactorySettingsResetStop); } - - - + if(iRfsConTimer) + { + // Cancel the Active timer if the user cancel the Rfs operation + iRfsConTimer->Cancel(); + } } @@ -345,7 +350,9 @@ { // set the information that we have closed all the active connections // here itself because the PDP connection/feature doen't exist + // Cancel the outstanding timer request iAllConnectionClosed = ETrue; + iRfsConTimer->Cancel(); DismissWaitDialog(); } @@ -354,7 +361,14 @@ iPDPProperty.Set(KPDPContextManager2,KPDPContextManagerFactorySettingsReset,EPDPContextManagerFactorySettingsResetStart ); // change the state to the next from within this as we are done with closing the SIP connection - iState = EPdpConnectionClose; + // Cancel the Outstanding SIP and timer request + // Subscribe to PDP and start the timer + Cancel(); + iRfsConTimer->Cancel(); + iState = EPdpConnectionClose; + Subscribe(); + iRfsConTimer->IssueTimerRequest(); + // // Under following cases the 'iIsPDPInformedforClosingAllConnection' will be set // @@ -395,6 +409,7 @@ // Now we may proceed to dsmiss the dialog and also set the state to the True for // all active connections closed iAllConnectionClosed = ETrue; + iRfsConTimer->Cancel(); DismissWaitDialog(); } } @@ -429,17 +444,19 @@ { TRACES("CRfsConnectionObserver::DoCancel()"); - if(iIsPDPFeatureEnabled) + if(iIsSIPConnectionsPresent && iState == ESipConnectionClose) + { + iSIPProperty.Cancel(); + if(!iIsPDPFeatureEnabled) + { + DismissWaitDialog(); + } + } + if(iIsPDPFeatureEnabled && iState == EPdpConnectionClose) { iPDPProperty.Cancel(); + DismissWaitDialog(); } - if(iIsSIPConnectionsPresent) - { - iSIPProperty.Cancel(); - } - - DismissWaitDialog(); - TRACES("CRfsConnectionObserver::DoCancel(): End"); } diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/src/rfsHandler.cpp --- a/coreapplicationuis/Rfs/src/rfsHandler.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/Rfs/src/rfsHandler.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -191,8 +191,9 @@ CHbDeviceMessageBoxSymbian* note = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EInformation); CleanupStack::PushL(note); note->SetTextL(*prompt); - note->ShowL(); - CleanupStack::PopAndDestroy(note); + //could have used show() but it is aynchronous and execution proceeds before note is seen so have used synchronous API exec() + note->ExecL(); + CleanupStack::PopAndDestroy(note); CleanupStack::PopAndDestroy( prompt ); diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/Rfs/src/rfscontimer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/Rfs/src/rfscontimer.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,90 @@ +/* +* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* Implements CRFsScript class which controls the parsing of the Rfs scripts +* +*/ + +#include + +#include "rfscontimer.h" +#include "RfsTraces.h" + +const TInt KRfsConnectionTimeOut = 60000000; + +CRfsConTimer :: CRfsConTimer(CRfsConnectionObserver * aRfsConnectionObserver):CActive( EPriorityStandard ) + { + iRfsConnectionObserver = aRfsConnectionObserver; + iTimer.CreateLocal(); + CActiveScheduler::Add( this ); + } + +CRfsConTimer :: ~CRfsConTimer() + { + TRACES("CRfsConTimer :: ~CRfsConTimer()"); + + iRfsConnectionObserver = NULL; + Cancel(); + iTimer.Close(); + } + +CRfsConTimer* CRfsConTimer::NewL(CRfsConnectionObserver * aRfsConnectionObserver) + { + TRACES("CRfsConTimer :: NewL()"); + + CRfsConTimer* self = new (ELeave) CRfsConTimer(aRfsConnectionObserver ); + return self; + } + +void CRfsConTimer :: IssueTimerRequest() + { + TRACES("CRfsConTimer :: IssueTimerRequest()"); + + if(!IsActive()) + { + iTimer.After(iStatus, KRfsConnectionTimeOut); + SetActive(); + } + } +void CRfsConTimer :: RunL() + { + TRACES("CRfsConTimer :: RunL()"); + + if(iRfsConnectionObserver->iState == ESipConnectionClose && iRfsConnectionObserver->iIsPDPFeatureEnabled) + { + // If SIP doesn't respond with in the set time, RunL will be called, + // Rfs cancels the outstanding SIP request and If PDP connection exists, + // Rfs will inform the PDP and start the timer. + + iRfsConnectionObserver->Cancel(); + iRfsConnectionObserver->iState = EPdpConnectionClose; + iRfsConnectionObserver->Subscribe(); + iTimer.After(iStatus, KRfsConnectionTimeOut); + SetActive(); + } + else + { + iRfsConnectionObserver->Cancel(); + } + } + +void CRfsConTimer :: DoCancel() + { + TRACES("CRfsConTimer :: DoCancel()"); + + if(IsActive()) + { + iTimer.Cancel(); + } + } diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Group/SysAp.mmp --- a/coreapplicationuis/SysAp/Group/SysAp.mmp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Group/SysAp.mmp Wed Aug 18 09:58:19 2010 +0300 @@ -201,10 +201,18 @@ SOURCEPATH ../Src SOURCE sysapkeymanagement.cpp SysApTaskList.cpp -SOURCE SysApKeySndHandler.cpp SysApKeySndAnim.cpp SysApAnimKeySndControl.cpp +SOURCE SysApKeySndHandler.cpp SysApKeySndAnim.cpp SysApAnimKeySndControl.cpp SysApShutdownAnimation.cpp //For Shutdown LIBRARY SVGEngine.lib LIBRARY gdi.lib LIBRARY avkon.lib + +LIBRARY customapi.lib + +SOURCE SysApEtelNetworkStatusNspsObserver.cpp SysApEtelConnector.cpp SysApEtelNetworkBarObserver.cpp SysApEtelSmsStoreObserver.cpp sysapeteldatabearerobserver.cpp sysapetelnetworkbargetter.cpp sysapetelnetworkinfoobserver.cpp + +LIBRARY etelpckt.lib + + diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Inc/SysApAccessoryObserver.h --- a/coreapplicationuis/SysAp/Inc/SysApAccessoryObserver.h Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApAccessoryObserver.h Wed Aug 18 09:58:19 2010 +0300 @@ -25,6 +25,7 @@ #include #include #include +#include // FORWARD DECLARATIONS class CSysApAppUi; @@ -56,6 +57,7 @@ * @return Current accessory mode */ TAccMode GetAccessoryMode() const; + TInt GetAccessoryConnectionType() const; private: /** @@ -118,6 +120,8 @@ * notifications due change in audio output status. */ TAccMode iPreviousMode; + RAccessoryConnection iAccessoryConnection; + TInt iPhysicalConnectionType; }; diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Inc/SysApAppUi.h --- a/coreapplicationuis/SysAp/Inc/SysApAppUi.h Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApAppUi.h Wed Aug 18 09:58:19 2010 +0300 @@ -28,12 +28,16 @@ #include #include #include +#include + + #include "SysApTimer.h" #include "SysApLightsController.h" #include "coreapplicationuisprivatecrkeys.h" #include "sysapusbchargerdetector.h" #include "SysApAccessoryObserver.h" #include +#include //For Powermenu--CHbDevicePowerMenuSymbian #include "hbdevicepowermenusymbian.h" @@ -78,7 +82,11 @@ class CSysApCenRepLogsObserver; class MSysApUsbIndicator; class CKeyguardAccessApi; +class CHbIndicatorSymbian; +class CSysApShutdownAnimation; +class CSysApDefaultKeyHandler; +class CSysApEtelConnector; const TInt KBluetoothModulePowerModeOn ( 1 ); const TInt KDummyReason( -1 ); @@ -176,6 +184,16 @@ * @param None * @return void */ + +#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION + void +#else // RD_STARTUP_ANIMATION_CUSTOMIZATION + TBool +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + ShowAnimationL(); + + void PrepareForShutdownAnimation(); + public: void ConstructL(); @@ -204,6 +222,7 @@ * @return TKeyResponse */ TKeyResponse HandleKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType ); + void HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent); public: // void CallFromMain(); @@ -267,7 +286,7 @@ void SetUsbAttachStatus( const TBool aUsbAttached ); TSysApUsbChargerDetector& UsbChargerDetector(); - void HandleAccessoryConnectedL( TAccMode aAccessoryState ); + void HandleAccessoryConnectedL( TAccMode aAccessoryState, TInt aPhysicalConnectionType ); void HandleAccessoryDisconnectedL(); void DoLightsTimeoutChangedL( const TInt aTimeout ); @@ -309,6 +328,9 @@ void SetLightsOnSecurityQueryL(); TBool CheckLongPowerKeyPressed(); TBool ReleasePowerMenuCustomDialogMemory(); +// TBool ReleaseMemoryCardCustomDialogMemory(); + static TInt DoStopAnimTiming( TAny* aObject ); + CEikStatusPane* StatusPane(); #ifdef SYSAP_USE_STARTUP_UI_PHASE /** @@ -318,7 +340,20 @@ #endif // SYSAP_USE_STARTUP_UI_PHASE - + + + void HandleNspsRawKeyEventL(); + + void HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ); + + void HandleRawKeyEventLightsRequireL() const; + + void HandleSmsStorageNotificationL( TBool aSimStoreFull ); + + void UpdateSignalBarsL(); + + + private: /** * Frees SysAp's reserved memory, closes connections to servers etc. @@ -345,6 +380,7 @@ void HandleAccessoryProfileInStartupL( ); CSysApCenRepLogsObserver& CSysApAppUi::LogsObserverL(); + void ContinueShutdown(); private: @@ -362,6 +398,7 @@ TSysApUsbChargerDetector iSysApUsbChargerDetector; CSysApAccessoryObserver* iSysApAccessoryObserver; CSysApShutdownImage* iSysApShutdownImage; + CSysApShutdownAnimation* iSysApShutdownAnimation; CSysApKeySndHandler* iSysApKeySndHandler; CSysApCenRepController* iSysApCenRepController; CSysApCenRepLightSettingsObserver* iSysApCenRepLightSettingsObserver; @@ -383,8 +420,12 @@ CKeyguardAccessApi* iKeyguardController; CHbDevicePowerMenuSymbian* iPowerMenuDialog; CSysApKeyManagement* iSysApKeyManagement; + + CSysApEtelConnector* iSysApEtelConnector; -// CSysApDriveList* iSysApDriveList; + public: + CHbIndicatorSymbian* iHbIndicatorSymbian; + private: TBool iPowerKeyPopupMenuActive; @@ -420,6 +461,10 @@ TBool iIgnoreAccessorySpecificProfileChanges; TBool iCheckLongPowerKeyEvent; + TInt iCapturedAppskey; + TInt iCapturedAppskeyUpAndDowns; + TBool iShutdownContinued; + TBool iNsps; // friend class CSysApWsClient; }; diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Inc/SysApShutdownImage.h --- a/coreapplicationuis/SysAp/Inc/SysApShutdownImage.h Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Inc/SysApShutdownImage.h Wed Aug 18 09:58:19 2010 +0300 @@ -56,6 +56,8 @@ void ShowShutdownImageL(TInt aBitmapId); RWindow& ShutdownCoeControlWindow(); + + void SetRectForAnimation(); #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION /** diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/SysApAccessoryObserver.cpp --- a/coreapplicationuis/SysAp/Src/SysApAccessoryObserver.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApAccessoryObserver.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -20,6 +20,8 @@ #include "SysApAccessoryObserver.h" #include "SysAp.hrh" #include "SysApAppUi.h" +#include +#include #include // RDebug @@ -59,6 +61,7 @@ TRACES( RDebug::Print( _L("CSysApAccessoryObserver::~CSysApAccessoryObserver") ) ); Cancel(); iAccessoryMode.CloseSubSession(); + iAccessoryConnection.CloseSubSession(); iAccessoryServer.Close(); } @@ -92,9 +95,51 @@ TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): iAccMode.iAccessoryMode=%d" ), iAccMode.iAccessoryMode ) ); iPreviousMode = iAccMode.iAccessoryMode; } + TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): trying RAccessoryConnection::CreateSubSession" ) ) ); + err = iAccessoryConnection.CreateSubSession( iAccessoryServer ); + if ( err == KErrNone ) + { + TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): connection to RAccessoryConnection established" ) ) ); + TAccPolGenericIDArray iAccGenericIDArray; + err = iAccessoryConnection.GetAccessoryConnectionStatus( iAccGenericIDArray ); + if ( err == KErrNone ) + { + TInt iIndex = 0; + TAccPolGenericID iAccGenericID = iAccGenericIDArray.GetGenericIDL( iIndex ); + TUint iPhysicalConnection = iAccGenericID.PhysicalConnectionCaps(); + if (iPhysicalConnection & KPCWired) + { + iPhysicalConnectionType = KPCWired; + } + else if (iPhysicalConnection & KPCBluetooth) + { + iPhysicalConnectionType = KPCBluetooth; + } + else if (iPhysicalConnection & KPCInfraRed) + { + iPhysicalConnectionType = KPCInfraRed; + } + else if (iPhysicalConnection & KPCUSB) + { + iPhysicalConnectionType = KPCUSB; + } + else if (iPhysicalConnection & KPCHDMI) + { + iPhysicalConnectionType = KPCHDMI; + } iAccessoryMode.NotifyAccessoryModeChanged( iStatus, iAccMode ); SetActive(); + } + else + { + TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): Error in Getting AccessoryConnectionStatus Error: %d " ),err ) ); + } + } + else + { + TRACES( RDebug::Print( _L("CSysApAccessoryObserver::ConstructL(): RAccessoryConnection::CreateSubSession - Error: %d" ), err ) ); + } } else { @@ -115,6 +160,7 @@ { TRACES( RDebug::Print( _L("CSysApAccessoryObserver::DoCancel()" ) ) ); iAccessoryMode.CancelNotifyAccessoryModeChanged(); + iAccessoryConnection.CancelGetAccessoryConnectionStatus(); } // ---------------------------------------------------------------------------- @@ -133,7 +179,37 @@ } else if ( iAccMode.iAccessoryMode != iPreviousMode ) // for filtering audio output change notifications { - iSysApAppUi.HandleAccessoryConnectedL( iAccMode.iAccessoryMode ); + TInt err( KErrNone ); + TAccPolGenericIDArray iAccGenericIDArray; + err = iAccessoryConnection.GetAccessoryConnectionStatus( iAccGenericIDArray ); + if ( err == KErrNone ) + { + TInt iIndex = 0; + TAccPolGenericID iAccGenericID = iAccGenericIDArray.GetGenericIDL( iIndex ); + TUint iPhysicalConnection = iAccGenericID.PhysicalConnectionCaps(); + if ( iPhysicalConnection & KPCWired ) + { + iPhysicalConnectionType = KPCWired; + } + else if ( iPhysicalConnection & KPCBluetooth ) + { + iPhysicalConnectionType = KPCBluetooth; + } + else if ( iPhysicalConnection & KPCInfraRed ) + { + iPhysicalConnectionType = KPCInfraRed; + } + else if ( iPhysicalConnection & KPCUSB ) + { + iPhysicalConnectionType = KPCUSB; + } + else if ( iPhysicalConnection & KPCHDMI ) + { + iPhysicalConnectionType = KPCHDMI; + } + } + TRACES( RDebug::Print( _L("CSysApAccessoryObserver::RunL: iAccessoryMode: %d, iPhysicalConnectionType: %d" ), iAccMode.iAccessoryMode,iPhysicalConnectionType ) ); + iSysApAppUi.HandleAccessoryConnectedL( iAccMode.iAccessoryMode,iPhysicalConnectionType ); } iPreviousMode = iAccMode.iAccessoryMode; @@ -168,6 +244,14 @@ return iAccMode.iAccessoryMode; } + +// ---------------------------------------------------------------------------- +// CSysApAccessoryObserver::GetAccessoryConnectionType() const +// ---------------------------------------------------------------------------- +TInt CSysApAccessoryObserver::GetAccessoryConnectionType() const + { + return iPhysicalConnectionType; + } // End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/SysApAppUi.cpp --- a/coreapplicationuis/SysAp/Src/SysApAppUi.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApAppUi.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -32,7 +32,7 @@ #include //#include #include -//#include +#include #include //#include "SysApWsClient.h" @@ -53,24 +53,41 @@ #include "MSysApBtSapController.h" #include "MSysApBtController.h" #include "MSysApUsbIndicator.h" -//#include -//#include -//#include + #include "sysapkeymanagement.h" #include "SysApShutdownImage.h" #include "SysApKeySndHandler.h" +#include "SysApShutdownAnimation.h" +#include "SysApEtelConnector.h" + + + #include #include #include #include +#include // USB transfer modes +#include +#include "sysap.rsg" +#include class CHbSymbianVariant; const TInt KModifierMask( 0 ); _LIT_SECURITY_POLICY_PASS(KAlwaysPassPolicy); _LIT_SECURITY_POLICY_C1(KWriteDeviceDataPolicy, ECapabilityWriteDeviceData); const TInt KDelayBeforeNextScanningRound( 1000000 ); -/* + +/* ENABLE ANIMATION: Add id of background image. + Example: const TInt KBackgroundImageID = EMbmSysapQgn_graf_startup_bg; + If there is no image defined, clear screen is used.*/ +const TInt KBackgroundImageID = 0; + + +_LIT(KAccesoryPlugin,"com.nokia.accessory.indicatorplugin/1.0"); +_LIT(KAccMode, "AccMode"); +_LIT(KAccPhyConType, "AccType"); + _LIT(KPsmPlugin,"com.nokia.hb.powersavemodeplugin/1.0"); _LIT(KPsm,"PSM"); _LIT(KCharging,"Charging"); @@ -79,7 +96,7 @@ _LIT(KlowbatteryIcon,"qtg_small_bt_low_battery.svg"); _LIT(KbatteryFullIcon,"qtg_status_battery.svg"); -*/ + // ============================ MEMBER FUNCTIONS ============================== @@ -219,7 +236,6 @@ iActiveProfileBeforeOfflineMode = iSysApCenRepController->GetInt( KCRUidCoreApplicationUIsSysAp, KSysApProfileBeforeOfflineMode ); iSysApFeatureManager->FeatureVariationCheckDone(); - // iHbIndicatorSymbian = CHbIndicatorSymbian::NewL(); TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApLightsController::NewL()") ) ); iSysApLightsController = CSysApLightsController::NewL( *this, @@ -244,6 +260,9 @@ TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL : CSysApKeyManagement::NewL returns error=%d"), keyManagementErr ) ); } + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CSysApEtelConnector::NewL()") ) ); + iSysApEtelConnector = CSysApEtelConnector::NewL( *this ); + // Initialize animdll for handling side volume keys // (needed before normal mode in case emergency number is dialed from PIN query) iSysApKeySndHandler = CSysApKeySndHandler::NewL(iEikonEnv->WsSession()); @@ -258,10 +277,11 @@ RProperty::Define( KPSUidCoreApplicationUIs,KCoreAppUIsPowerMenuCustomDialogStatus, RProperty::EInt, KAlwaysPassPolicy, KWriteDeviceDataPolicy ); RProperty::Set( KPSUidCoreApplicationUIs, KCoreAppUIsPowerMenuCustomDialogStatus, ECoreAppUIsPowerMenuCustomDialogUninitialized ); - - - // TBool result = HbTextResolverSymbian::Init(KPsmlocalisationfile, KtsfilePath); - + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: trying CHbIndicatorSymbian::NewL()") ) ); + iHbIndicatorSymbian = CHbIndicatorSymbian::NewL(); + + TBool result = HbTextResolverSymbian::Init(KPsmlocalisationfile, KtsfilePath); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: END") ) ); } @@ -274,7 +294,7 @@ TRACES( RDebug::Print( _L("CSysApAppUi::FreeResources") ) ); delete iSysApBatteryInfoController; delete iSysApPsmController; - //delete iVariantAccState; + delete iVariantAccState; delete iSysApAudioRoutingObserver; @@ -311,7 +331,7 @@ delete iSysApUsbIndicatorController; delete iKeyguardController; - // delete iHbIndicatorSymbian; + delete iHbIndicatorSymbian; delete iSysApKeyManagement; iSysApKeyManagement = NULL; @@ -325,7 +345,7 @@ // --------------------------------------------------------------------------- void CSysApAppUi::PrepareToExit() { - TRACES("CSysApAppUi::PrepareToExit()"); + TRACES(RDebug::Print( _L("CSysApAppUi::PrepareToExit()"))); CEikAppUi::PrepareToExit(); } @@ -406,7 +426,11 @@ UpdateBatteryBarsL( state ); DoSwStateNormalConstructionL(); - HandleAccessoryProfileInStartupL(); + HandleAccessoryProfileInStartupL(); + + + + if ( !iSysApPsmController ) // created here if first state change has not occurred yet { @@ -415,10 +439,22 @@ if ( iSysApPsmController ) { - if ( iCharging ) // if charger is connected on boot PSM queries may need to be shown + if ( iCharging ) // if charger is connected on boot PSM queries may need to be shown { HandleChargingStatusL( StateOfProperty( KPSUidHWRMPowerState, KHWRMChargingStatus ) ); } + + if ( iSysApPsmController->FullPsmEnabled() ) + { + // activate psm indicator + iVariantAccState = CHbSymbianVariant::NewL(&KPsm, CHbSymbianVariant::EDes); + if (!iHbIndicatorSymbian->Activate(KPsmPlugin,iVariantAccState)) + { + int error = iHbIndicatorSymbian->Error(); + //use the errorcode... + } + } + } TInt batteryStatus = StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryStatus ); @@ -472,7 +508,7 @@ if ( aSwState == RStarterSession::ECharging ) { iSysApPsmController->ChargerConnected(); - iSysApPsmController->DoEnablePartialPsm( EFalse ); // disable power save now + iSysApPsmController->DoEnableFullPsm(EFalse); // disable power save now } } @@ -529,8 +565,35 @@ if( !iResourcesFreed ) { FreeResources(); - } + + iStarterSession.Close(); + + } + + delete iSysApShutdownImage; + +#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION + if (iSysApShutdownAnimation) + { + RemoveFromStack( iSysApShutdownAnimation ); +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + delete iSysApShutdownAnimation; +#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION + } +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + +// delete iProfileNote; + +#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION + if( iAnimTimer ) + { + iAnimTimer->Cancel(); + } + delete iAnimTimer; +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + delete iSysApStartupController; + TRACES( RDebug::Print( _L("~CSysApAppUi() completed") ) ); } TBool CSysApAppUi::ResourcesFreed() const @@ -882,10 +945,10 @@ if( !aReset ) { #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION -// TRAPD( err, ShowAnimationL() ); -// if ( err ) + TRAPD( err, ShowAnimationL() ); + if ( err ) { - // TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); + TRACES( RDebug::Print(_L("CSysApAppUi::DoShutdownL ShowAnimationL() leaved: %d" ), err ) ); CompleteShutdown(aReset, aResetReason); } } @@ -1201,6 +1264,9 @@ if ( accessoryState == EAccModeHandPortable ) { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL:Before Deactivating accessory Plugin"))); + iHbIndicatorSymbian->Deactivate(KAccesoryPlugin); + TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryDisconnectedL:After Deactivating accessory Plugin"))); iSysApLightsController->AccessoryConnectedL( EFalse ); iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApAccessoryConnected, 0 ); } @@ -1231,30 +1297,22 @@ // CSysApAppUi::HandleAccessoryConnectedL() // ---------------------------------------------------------------------------- -void CSysApAppUi::HandleAccessoryConnectedL( TAccMode aAccessoryState ) +void CSysApAppUi::HandleAccessoryConnectedL( TAccMode aAccessoryState, TInt aPhysicalConnectionType ) { - TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL( aAccessoryState: %d ) "), aAccessoryState ) ); - - if ( aAccessoryState == EAccModeWirelessHeadset || - aAccessoryState == EAccModeWiredHeadset || - aAccessoryState == EAccModeHeadphones ) - { - } - else if ( aAccessoryState == EAccModeLoopset ) - { - } - else if ( aAccessoryState == EAccModeTextDevice ) - { - } - else if ( aAccessoryState == EAccModeWirelessCarKit || aAccessoryState == EAccModeWiredCarKit ) - { - } - else if ( aAccessoryState == EAccModeTVOut ) - { - } - else if (aAccessoryState == EAccModeHDMI ) - { - } + TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL( aAccessoryState: %d )(aPhysicalConnectionType: %d "), aAccessoryState, aPhysicalConnectionType ) ); + + CHbSymbianVariantMap* iAccVariantMap = CHbSymbianVariantMap::NewL(); + CleanupStack::PushL(iAccVariantMap); + CHbSymbianVariant* variantAccState = CHbSymbianVariant::NewL(&aAccessoryState, CHbSymbianVariant::EInt); + iAccVariantMap->Add(KAccMode,variantAccState); + CHbSymbianVariant* variantAccType = CHbSymbianVariant::NewL(&aPhysicalConnectionType, CHbSymbianVariant::EInt); + iAccVariantMap->Add(KAccPhyConType,variantAccType); + + + CHbSymbianVariant* iAccVariant = CHbSymbianVariant::NewL(iAccVariantMap, CHbSymbianVariant::EVariantMap ); + CleanupStack::PushL(iAccVariant); + iHbIndicatorSymbian->Activate(KAccesoryPlugin, iAccVariant); + TInt swState( StateOfProperty( KPSUidStartup, KPSGlobalSystemState ) ); TRACES( RDebug::Print( _L("CSysApAppUi::HandleAccessoryConnectedL: swState: %d"), swState ) ); @@ -1290,6 +1348,7 @@ } SetIhfIndicatorL(); SetHacIndicatorL(); + CleanupStack::PopAndDestroy(2); } @@ -1620,13 +1679,22 @@ { case MSysApPsmControllerNotifyCallback::EPsmActivationComplete: UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); - ShowUiNoteL( EPowerSaveModeActivated ); + iVariantAccState = CHbSymbianVariant::NewL(&KPsm, CHbSymbianVariant::EDes); + if (!iHbIndicatorSymbian->Activate(KPsmPlugin,iVariantAccState)) + { + int error = iHbIndicatorSymbian->Error(); + //use the errorcode... + } break; case MSysApPsmControllerNotifyCallback::EPsmDeactivationComplete: UpdateBatteryBarsL( StateOfProperty( KPSUidHWRMPowerState, KHWRMBatteryLevel ) ); - ShowUiNoteL( EPowerSaveModeDeactivated ); - break; + if (!iHbIndicatorSymbian->Deactivate(KPsmPlugin)) + { + int error = iHbIndicatorSymbian->Error(); + //use the errorcode... + } + break; case MSysApPsmControllerNotifyCallback::EPsmActivationFailed: ShowUiNoteL( ECannotActivatePowerSaveMode ); @@ -1720,6 +1788,16 @@ // ---------------------------------------------------------------------------- +// CSysApAppUi::HandleRawKeyEventLightsRequireL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleRawKeyEventLightsRequireL() const + { + iSysApLightsController->HandleRawKeyEventLightsRequireL(); + } + + +// ---------------------------------------------------------------------------- // CSysApAppUi::AlertUiKeyLockOff( const TBool aKeyLockOff ) // ---------------------------------------------------------------------------- @@ -1832,6 +1910,26 @@ { TRACES( RDebug::Print( _L("CSysApAppUi::HandleBatteryStatusL aValue: %d"), aValue ) ); + TBool enableAutoPsm(EFalse); + CRepository* repository( NULL ); + TRAPD( err, repository = CRepository::NewL( KCRUidDeviceManagementSettings ) ); + + if ( err == KErrNone ) + { + TInt value( 0 ); + err = repository->Get( KSettingsPowerSavingQuery, value ); + + if ( err == KErrNone ) + { + enableAutoPsm = value ? EFalse: ETrue; + } + } + + _LIT(Klowbattery, "txt_power_management_dpopinfo_low_battery"); + // returns the string "low battery" + HBufC* lowBattery = HbTextResolverSymbian::LoadL(Klowbattery); + + if ( aValue == EBatteryStatusEmpty ) { //Display Recharge Battery note @@ -1845,23 +1943,30 @@ iSysApPsmController->BatteryLow( ETrue ); - if ( iSysApPsmController->ShowActivateQuery()) + if ( enableAutoPsm) { - // show activation query, replaces the first battery low query - ShowQueryL( ESysApBattLowPowerSavingQuery ); + iSysApPsmController->DoEnableFullPsm( ETrue ); + + _LIT(KPsmOn, "txt_power_management_dpopinfo_psm_activated_automa"); + // returns the string "power saving mode on" + HBufC* psmOn = HbTextResolverSymbian::LoadL(KPsmOn); + + _LIT(Kicon, "qgn_indi_battery_ps_activate"); + // returns the power save mode icon + HBufC* psmIcon = HbTextResolverSymbian::LoadL(Kicon); + + CHbDeviceNotificationDialogSymbian::NotificationL(*psmIcon,*psmOn,*lowBattery); } else // default low warning note must be shown { - // activate partial power save mode on first low warning - iSysApPsmController->DoEnablePartialPsm( ETrue ); // activated on first warning note //Display Battery Low note. - ShowUiNoteL( EBatteryLowNote ); + CHbDeviceNotificationDialogSymbian::NotificationL(KlowbatteryIcon,KNullDesC,*lowBattery); } } else { //Display Battery Low note. - ShowUiNoteL( EBatteryLowNote ); + CHbDeviceNotificationDialogSymbian::NotificationL(KlowbatteryIcon,KNullDesC,*lowBattery); } } @@ -1870,6 +1975,7 @@ iSysApBatteryInfoController->BatteryStatusUpdated( aValue ); } + delete repository; } // ---------------------------------------------------------------------------- @@ -1933,24 +2039,13 @@ break; case EBatteryFullUnplugChargerNote: { - /* TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); iSysApLightsController->BatteryEmptyL( ETrue ); _LIT(KunplugCharger,"txt_power_dpopinfo_unplug_charger_to_save_energy"); HBufC* unplugCharger = HbTextResolverSymbian::LoadL(KunplugCharger); _LIT(KbatteryFull,"txt_power_management_dpophead_100_full"); HBufC* batteryFull = HbTextResolverSymbian::LoadL(KbatteryFull); - CHbDeviceNotificationDialogSymbian::NotificationL(KbatteryFullIcon,*unplugCharger,*batteryFull); - */ - - iSysApLightsController->BatteryEmptyL( ETrue ); - _LIT(KPowerPressKey,"Charging complete. Unplug charger to save energy."); - HBufC* aString = HBufC16::NewLC(200); - TPtrC aStringPointer = aString->Des(); - aStringPointer.Set(KPowerPressKey); - TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); - ShowExampleUiNoteL( aStringPointer ); - CleanupStack::PopAndDestroy(); // aString + CHbDeviceNotificationDialogSymbian::NotificationL(KbatteryFullIcon,*unplugCharger,*batteryFull); } break; case EUnplugChargerNote: @@ -2011,20 +2106,25 @@ if ( iCharging && !iSysApPsmController->ChargerConnected() ) // first time after charger connection { iSysApPsmController->ConnectCharger( ETrue ); - if ( iSysApPsmController->ShowDeactivateQuery() ) - { - ShowQueryL( ESysApBattChargingPowerSavingQuery ); - // Query is on the display. Don't show the note. - showNote = EFalse; - } - else - { - iSysApPsmController->DoEnablePartialPsm( EFalse ); - } + iSysApPsmController->DoEnableFullPsm(EFalse); + iVariantAccState = CHbSymbianVariant::NewL(&KCharging, CHbSymbianVariant::EDes); + + if (!iHbIndicatorSymbian->Activate(KPsmPlugin,iVariantAccState)) + { + int error = iHbIndicatorSymbian->Error(); + //use the errorcode... + } + + } else if ( aValue == EChargingStatusNotConnected ) { iSysApPsmController->ConnectCharger( EFalse ); + if (!iHbIndicatorSymbian->Deactivate(KPsmPlugin)) + { + int error = iHbIndicatorSymbian->Error(); + //use the errorcode... + } } } if( showNote ) @@ -2180,20 +2280,11 @@ TRACES( RDebug::Print( _L("CSysApAppUi::ShowChargingNoteL KCTsyCallState=%d"), StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) ) ); if ( showNote ) // Power Mgmt UI spec defines that no Charging note is shown while the phone is ringing/alerting { - /* TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); _LIT(KChargingNote,"txt_power_management_dblist_charging"); HBufC* chargingNote = HbTextResolverSymbian::LoadL(KChargingNote); CHbDeviceNotificationDialogSymbian::NotificationL(KNullDesC,*chargingNote); - */ - - _LIT(KChargingNote,"Charging"); - HBufC* aString = HBufC16::NewLC(50); - TPtrC aStringPointer = aString->Des(); - aStringPointer.Set(KChargingNote); - TRACES( RDebug::Print( _L("CSysApWsClient::RunL(): Key EEventKeyUp 01") ) ); - ShowExampleUiNoteL( aStringPointer ); - CleanupStack::PopAndDestroy(); // aString + } } } @@ -2431,9 +2522,11 @@ TBool accessoryConnectedNow ( EFalse ); TAccMode accessoryState(EAccModeHandPortable); + TInt physicalConnectionType = 0; if ( iSysApAccessoryObserver ) { accessoryState = iSysApAccessoryObserver->GetAccessoryMode(); + physicalConnectionType = iSysApAccessoryObserver->GetAccessoryConnectionType(); } if ( accessoryState != EAccModeHandPortable ) @@ -2449,7 +2542,7 @@ } else if ( !accessoryConnectedInShutdown && accessoryConnectedNow ) { - HandleAccessoryConnectedL( accessoryState ); + HandleAccessoryConnectedL( accessoryState, physicalConnectionType ); } else if ( !accessoryConnectedNow ) { @@ -2728,10 +2821,339 @@ //PowerMenu already exist delete iPowerMenuDialog; iPowerMenuDialog = NULL; + TRACES( RDebug::Print(_L("CSysApAppUi::ReleasePowerMenuCustomDialogMemory True") ) ); return ETrue; } + TRACES( RDebug::Print(_L("CSysApAppUi::ReleasePowerMenuCustomDialogMemory false") ) ); return EFalse; } +// ---------------------------------------------------------------------------- +// CSysApAppUi::ShowAnimationL() +// ---------------------------------------------------------------------------- + +#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION +void +#else // RD_STARTUP_ANIMATION_CUSTOMIZATION +TBool +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION +CSysApAppUi::ShowAnimationL() + { + TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): START" ) ) ); + + TRACES( RDebug::Print( _L("CSysApAppUi::ShowAnimationL: Initialise shutdown animation") ) ); + +#ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION + + PrepareForShutdownAnimation(); + + iSysApShutdownAnimation = CSysApShutdownAnimation::NewL( *iSysApShutdownImage ); + iSysApShutdownAnimation->Play( TCallBack( DoStopAnimTiming, this ) ); + + TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): End" ) ) ); + +#else // RD_STARTUP_ANIMATION_CUSTOMIZATION + iSysApShutdownAnimation = CSysApShutdownAnimation::NewL( this ); + AddToStackL( iSysApShutdownAnimation ); + iAnimationShowingTime = iSysApShutdownAnimation->ShowingTime(); + TRACES( RDebug::Print( _L("CSysApAppUi::ShowAnimationL: Shutdown animation initialised. Animation time = %d") ,iAnimationShowingTime) ); + + TBool ret_val( EFalse ); + + if ( iAnimationShowingTime ) + { + if ( iSysApFeatureManager->CoverDisplaySupported() ) + { + // Construct mediator observer + iSysApMediatorObserver = CSysApMediatorObserver::NewL( this ); + + // Sync animation + TInt err = iSysApMediatorObserver->SyncShutdownAnimation(); + + if ( err != KErrNone ) + { + // Pretend coverUI synced instantly if error in issuing command. + ShutdownAnimationSyncOK(); + } + } + else + { + // Pretend coverUI synced instantly when it is not supported. + ShutdownAnimationSyncOK(); + } + + ret_val = ETrue; + } + + TRACES( RDebug::Print(_L("CSysApAppUi::ShowAnimationL(): returns: %d" ),ret_val ) ); + return ret_val; +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + } + + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::PrepareForShutdownAnimation() +// ---------------------------------------------------------------------------- +void CSysApAppUi::PrepareForShutdownAnimation() + { + TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() begin") ) ); + +#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION + TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() showtime = %d"), iAnimationShowingTime ) ); + if ( iAnimationShowingTime ) + { +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + + if (iPowerMenuDialog!=NULL) + { + //PowerMenu already exist + delete iPowerMenuDialog; + iPowerMenuDialog = NULL; + } + + RWindowGroup groupWin = iCoeEnv->RootWin(); + iCapturedAppskey = groupWin.CaptureKey( EKeyApplication, KModifierMask, KModifierMask ); + iCapturedAppskeyUpAndDowns = groupWin.CaptureKeyUpAndDowns( EStdKeyApplication0, KModifierMask, KModifierMask ); + iEikonEnv->RootWin().SetOrdinalPosition(0, ECoeWinPriorityAlwaysAtFront ); + + TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() Draw background image" ) ) ); + + ShowShutdownImage( KBackgroundImageID ); + +#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION + TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() Show Shutdown animation" ) ) ); + TInt err(0); + TRAP( err, iSysApShutdownAnimation->StartL( iLastPowerKeyWasShort ) ); + if ( err ) + { + TRACES( RDebug::Print( _L("SysAp: Shutdown animation fails. Error code: %d" ), err ) ); + // Start animation timing immediatily if animation starting fails. + // Otherwise animation will call StartAnimTiming when it is ready. + StartAnimTiming(); + } + } +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + + TRACES( RDebug::Print( _L("CSysApAppUi::PrepareForShutdownAnimation() end") ) ); + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::DoStopAnimTiming( TAny* aObject ) +// ---------------------------------------------------------------------------- + +TInt CSysApAppUi::DoStopAnimTiming( TAny* aObject ) + { + TInt err(KErrNone); + CSysApAppUi* appUi = STATIC_CAST( CSysApAppUi*, aObject ); + + // This method could theoretically be called by two timers (iAnimTimer and one in CSysApShutdownAnimation), + // so a check is needed to prevent multiple executions. + if ( !(appUi->iShutdownContinued) ) + { + appUi->iShutdownContinued = ETrue; + + TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() Animation timer completed or animation skipped" ) ) ); + +#ifndef RD_STARTUP_ANIMATION_CUSTOMIZATION + if ( appUi->iAnimTimer ) + { + appUi->iAnimTimer->Cancel(); + } +#endif // RD_STARTUP_ANIMATION_CUSTOMIZATION + + TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() Call ContinueShutdown(...)" ) ) ); + appUi->ContinueShutdown(); + TRACES( RDebug::Print( _L("CSysApAppUi::DoStopAnimTiming() end") ) ); + } + + return err; + } + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::ContinueShutdown() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::ContinueShutdown() + { + TRACES( RDebug::Print(_L("CSysApAppUi::ContinueShutdown() started" ) ) ); + CompleteShutdown(); + TRACES( RDebug::Print(_L("CSysApAppUi::ContinueShutdown() completed" ) ) ); + } + +CEikStatusPane* CSysApAppUi::StatusPane() +{ +return iEikonEnv->AppUiFactory()->StatusPane(); +} + + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::ShowEjectWaitNoteL +// ---------------------------------------------------------------------------- + +//void CSysApAppUi::ShowEjectWaitNoteL( TInt /* aDriveToEject */ ) + /*{ + if ( iSysApWaitNote ) + { + return; + } + HBufC* text = iSysApDriveList->GetFormattedDriveNameLC( + aDriveToEject, + 0, // Not used + R_QTN_EJECTING_MEMORY_NAME_WAIT ); + iSysApWaitNote = CSysApWaitNote::NewL( + iSysApFeatureManager->CoverDisplaySupported() ); + iSysApWaitNote->ShowNoteL( EClosingApplicationsNote, text ); + CleanupStack::PopAndDestroy( text ); + }*/ + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleApplicationSpecificEventL(TInt aType,const TWsEvent& aEvent) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: aType:%d"), aType ) ); + + CEikAppUi::HandleApplicationSpecificEventL(aType, aEvent); + + if ( ResourcesFreed() ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleApplicationSpecificEventL: discarded, shutting down") ) ); + return; + } + + switch( aType ) + { + case EEikKeyLockEnabled: + iKeyLockEnabled = ETrue; + iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 1 ); +// SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOn ); + iSysApLightsController->KeylockStateChangedL( ETrue ); + break; + case EEikKeyLockDisabled: + iKeyLockEnabled = EFalse; + iSysApCenRepController->SetInt( KCRUidCoreApplicationUIsSysAp, KSysApKeyguardActive, 0 ); +// SetIndicatorStateL( EAknIndicatorKeyguard, EAknIndicatorStateOff ); + if (! iDeviceLockEnabled ) + { + iSysApLightsController->KeylockStateChangedL( EFalse ); + if ( iSysApFeatureManager->MmcHotSwapSupported() ) + { + if ( StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateRinging && StateOfProperty( KPSUidCtsyCallInformation, KCTsyCallState ) != EPSCTsyCallStateAlerting ) + { + //RunUnlockNotifierL(); + } + } + } + break; + case EEikKeyLockPowerKeyPressed: //sent when power key is captured by keylockserver +// HandleShortPowerKeyPressedL(); + break; + + case EEikKeyLockLightsOnRequest: + iSysApLightsController->SetLightsOnUnlockNoteL(); + break; + + case EEikEcsQueryLights: // emergency note is shown + iSysApLightsController->SetLightsOnEcsQueryL(); + break; + + case EEikSecurityQueryLights: // for device lock security query + iSysApLightsController->SetLightsOnSecurityQueryL(); + break; + + default: + break; + } + } + + + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleNspsRawKeyEventL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleNspsRawKeyEventL() + { +#ifdef __SYSAP_MODULE_TEST + ModuleTestShowUiNoteL( _L("Network wakeup from NSPS") ); +#endif + + if ( iSysApEtelConnector ) + { + iSysApEtelConnector->CommandNetCsWakeupOnNsps(); + } + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::UpdateSignalBarsL() +// ---------------------------------------------------------------------------- + +void CSysApAppUi::UpdateSignalBarsL() + { +// UpdateSignalBarsL(iSysApEtelConnector->GetSignalBars()); + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleSmsStorageNotificationL( TBool aSimStoreFull ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleSmsStorageNotificationL: aSimStoreFull: %d "), aSimStoreFull ) ); + + if ( aSimStoreFull ) + { +/* HBufC* noteStringBuf; + noteStringBuf = StringLoader::LoadLC( R_QTN_MEMLO_MEMORY_LOW_SIM_MES, iEikonEnv ); + TPtr textBuffer = noteStringBuf->Des(); + iSysApMsgSimMemLowQuery->StartL( textBuffer ); + CleanupStack::PopAndDestroy(); +*/ } + +// SetEnvelopeIndicatorL(); + } + +// ---------------------------------------------------------------------------- +// CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) +// ---------------------------------------------------------------------------- + +void CSysApAppUi::HandleNetworkNspsNotification( RMmCustomAPI::TNspsStatus aNspsStatus ) + { + TRACES( RDebug::Print( _L("CSysApAppUi::HandleNetworkNspsNotification aNspsStatus:%d, iNsps:%d )" ), aNspsStatus, iNsps ) ); + if( iSysApNspsHandler ) + { + if( aNspsStatus == RMmCustomAPI::ENspsOn ) + { + if( !iNsps ) + { +#ifdef __SYSAP_MODULE_TEST + TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS on") ) ); +#endif + iSysApNspsHandler->SetNspsOn(); + iNsps = ETrue; + } + } + else if( aNspsStatus == RMmCustomAPI::ENspsOff ) + { + if( iNsps ) + { +#ifdef __SYSAP_MODULE_TEST + TRAPD( err, ModuleTestShowUiNoteL( _L("Setting NSPS off") ) ); +#endif + iSysApNspsHandler->SetNspsOff(); + iNsps = EFalse; + } + } + } + } + + + //end of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/SysApEtelSmsStoreObserver.cpp --- a/coreapplicationuis/SysAp/Src/SysApEtelSmsStoreObserver.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApEtelSmsStoreObserver.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -211,10 +211,10 @@ if ( info.iTotalEntries > 0 && info.iUsedEntries >= info.iTotalEntries ) { // Blink the Envelope indicator - iObserver.iSysApAppUi.SetIndicatorStateL( +/* iObserver.iSysApAppUi.SetIndicatorStateL( EAknIndicatorEnvelope, EAknIndicatorStateAnimate ); iObserver.iStoreFull = ETrue; - } +*/ } } TRACES( RDebug::Print( diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/SysApPubSubObserver.cpp --- a/coreapplicationuis/SysAp/Src/SysApPubSubObserver.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApPubSubObserver.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -52,6 +52,7 @@ const TUint KCoreAppUIsMmcRemovedWithoutEjectCmdMask = 0xFFFF; const TUint KCoreAppUIsMmcRemovedWithoutEjectValShift = 16; +_LIT(KGpsIndicatorPlugin, "PositioningIndicator"); const TUid KPSUidSecurityUIs = { 0x100059b5 }; const TUint32 KSecurityUIsLights = 0x00000308; @@ -396,12 +397,12 @@ // iSysApAppUi.HandleMessageTonePlayingQuitability( aValue ); break; case KCoreAppUIsNspsRawKeyEvent: - // iSysApAppUi.HandleNspsRawKeyEventL(); + iSysApAppUi.HandleNspsRawKeyEventL(); break; case KCoreAppUIsLightsRawKeyEvent: if ( aValue == ECoreAppUIsKeyEvent ) { - // iSysApAppUi.HandleRawKeyEventLightsRequireL(); + iSysApAppUi.HandleRawKeyEventLightsRequireL(); } break; case KCoreAppUIsMmcRemovedWithoutEject: @@ -908,10 +909,12 @@ case KPosIntGpsHwStatus: if ( aValue == EPosIntGpsHwOff ) { + iSysApAppUi.iHbIndicatorSymbian->Deactivate(KGpsIndicatorPlugin); // iSysApAppUi.SetIndicatorStateL( EAknIndicatorGPS, EAknIndicatorStateOff ); } else if ( aValue == EPosIntGpsHwOn ) { + iSysApAppUi.iHbIndicatorSymbian->Activate(KGpsIndicatorPlugin); // iSysApAppUi.SetIndicatorStateL( EAknIndicatorGPS, EAknIndicatorStateOn ); } else if ( aValue == EPosIntGpsHwIntermediate ) diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/SysApShutdownAnimation.cpp --- a/coreapplicationuis/SysAp/Src/SysApShutdownAnimation.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApShutdownAnimation.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -21,13 +21,21 @@ #ifdef RD_STARTUP_ANIMATION_CUSTOMIZATION -#include +//#include +#include #include #include #include "SysApShutdownAnimation.h" #include "SysApShutdownImage.h" #include "SysAp.hrh" +#include +#include +#include +#include +#include + +#define iSysApUiHandle ((CSysApAppUi*)CEikonEnv::Static()->EikAppUi()) // ======== MEMBER FUNCTIONS ======== @@ -99,8 +107,11 @@ iCtrl = NULL; } - iAvkonAppUi->StatusPane()->MakeVisible( EFalse ); - iView.SetRect( iAvkonAppUi->ApplicationRect() ); +// iAvkonAppUi->StatusPane()->MakeVisible( EFalse ); +// iView.SetRect( iAvkonAppUi->ApplicationRect() ); +// iAvkonAppUi->StatusPane()->MakeVisible( EFalse ); +// iSysApUiHandle->StatusPane()->MakeVisible( EFalse ); + iView.SetRectForAnimation(); iState = ELoading; TRAPD( errorCode, iCtrl = CSAnimStartupCtrl::NewL( iView.Rect(), iView ) ); diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/SysApShutdownImage.cpp --- a/coreapplicationuis/SysAp/Src/SysApShutdownImage.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/SysApShutdownImage.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -74,6 +74,7 @@ void CSysApShutdownImage::ShowShutdownImageL(TInt aBitmapId) { TRACES( RDebug::Print(_L("CSysApShutdownImage::ShowShutdownImageL:start" ) ) ); + TInt err ( 0 ); TRect rect(iCoeEnv->ScreenDevice()->SizeInPixels()); SetRect(rect); @@ -352,4 +353,10 @@ return EKeyWasNotConsumed; } +void CSysApShutdownImage::SetRectForAnimation() + { + TRect rect(iCoeEnv->ScreenDevice()->SizeInPixels()); + SetRect(rect); + } + // End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/hbdevicepowermenusymbian.cpp --- a/coreapplicationuis/SysAp/Src/hbdevicepowermenusymbian.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/hbdevicepowermenusymbian.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -18,6 +18,7 @@ #include #include #include +#include #include "hbdevicepowermenusymbian.h" @@ -247,8 +248,9 @@ TBool* OfflineValue = OfflineVariant->Value(); if(OfflineValue) { - iOfflineEnable = *OfflineValue; - User::LeaveIfError( iPowerMenuManager->iCenrepOffline->Set( KSettingsAirplaneMode, iOfflineEnable ) ); + iOfflineEnable = *OfflineValue; + // negate the value before storing in cen rep as the n/w conn allowed key is complement of offline mode + User::LeaveIfError( iPowerMenuManager->iCenrepOffline->Set(KCoreAppUIsNetworkConnectionAllowed, !iOfflineEnable ) ); } TRACES( RDebug::Print( _L("CHbDevicePowerMenuPrivate::DataReceived: OfflineVariant::End") ) ); } @@ -405,25 +407,32 @@ { TRACES( RDebug::Print( _L("CHbDevicePowerMenuSymbian::ConstructL: START") ) ); iProfileEngine = ::CreateProfileEngineExtended2L(); - iCenrepOffline = CRepository::NewL( KCRUidCommunicationSettings ); + iCenrepOffline = CRepository::NewL( KCRUidCoreApplicationUIs ); iCenrepProfile = CRepository::NewL( KCRUidProfileEngine ); iPowerMenuPrivate = CHbDevicePowerMenuPrivate::NewL(this); //To Sync with Contro panel - TBool airplaneMode(0); - User::LeaveIfError( iCenrepOffline->Get( KSettingsAirplaneMode, airplaneMode ) ); - SetOfflineMode(airplaneMode); + TBool networkConnectionAllowed(EFalse); + TInt error = iCenrepOffline->Get( KCoreAppUIsNetworkConnectionAllowed, networkConnectionAllowed ); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: KCoreAppUIsNetworkConnectionAllowed = %d"), error ) ); + + // The value of KCoreAppUIsNetworkConnectionAllowed is Inverted status of Offline mode + // Hence negate the value and use as Offline mode + SetOfflineMode(!networkConnectionAllowed); TInt masterVolume(0); - User::LeaveIfError( iCenrepProfile->Get( KProEngMasterVolume, masterVolume ) ); - SetVolume(masterVolume); + error = iCenrepProfile->Get( KProEngMasterVolume, masterVolume ); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: KProEngMasterVolume = %d"), error ) ); + SetVolume(masterVolume); TBool masterVibrate(0); - User::LeaveIfError( iCenrepProfile->Get( KProEngMasterVibra, masterVibrate ) ); + error = iCenrepProfile->Get( KProEngMasterVibra, masterVibrate ); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: KProEngMasterVibra = %d"), error ) ); SetVibrationEnabled(masterVibrate); TBool silenceMode(EFalse); - User::LeaveIfError( iCenrepProfile->Get( KProEngSilenceMode, silenceMode ) ); + error = iCenrepProfile->Get( KProEngSilenceMode, silenceMode ); + TRACES( RDebug::Print( _L("CSysApAppUi::ConstructL: KProEngSilenceMode = %d"), error ) ); SetSilenceMode(silenceMode); //Cypheroff is True when No encryption/Decryption is happening diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/sysapeteldatabearerobserver.cpp --- a/coreapplicationuis/SysAp/Src/sysapeteldatabearerobserver.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/sysapeteldatabearerobserver.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -110,11 +110,11 @@ if ( newHsdpaState != iHsdpaActive ) { iHsdpaActive = newHsdpaState; - TRAPD( err, iSysApAppUi.SetSignalIndicatorL() ); +// TRAPD( err, iSysApAppUi.SetSignalIndicatorL() ); - if ( err != KErrNone ) +// if ( err != KErrNone ) { - TRACES( RDebug::Print( _L("CSysApEtelDataBearerObserver::RunL: err=%d"), err ) ); +// TRACES( RDebug::Print( _L("CSysApEtelDataBearerObserver::RunL: err=%d"), err ) ); } } } diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/Src/sysapetelnetworkinfoobserver.cpp --- a/coreapplicationuis/SysAp/Src/sysapetelnetworkinfoobserver.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/SysAp/Src/sysapetelnetworkinfoobserver.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -111,13 +111,13 @@ if ( hsdpaAvailable != iHsdpaAvailable ) { iHsdpaAvailable = hsdpaAvailable; - TRAPD( err, iSysApAppUi.SetSignalIndicatorL() ); +/* TRAPD( err, iSysApAppUi.SetSignalIndicatorL() ); if ( err != KErrNone ) { TRACES( RDebug::Print( _L("CSysApEtelNetworkInfoObserver::RunL: err=%d"), err ) ); } - } +*/ } } OrderNotification(); diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/SysAp/conf/coreapplicationuis_101F876C.crml Binary file coreapplicationuis/SysAp/conf/coreapplicationuis_101F876C.crml has changed diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/accfwuinotifier/data/accfwnoteuinotifier.rss --- a/coreapplicationuis/accfwuinotifier/data/accfwnoteuinotifier.rss Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/accfwuinotifier/data/accfwnoteuinotifier.rss Wed Aug 18 09:58:19 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -25,140 +25,11 @@ #include #include -#include - - // RESOURCE DEFINITIONS RESOURCE RSS_SIGNATURE { } RESOURCE TBUF r_text_unsupp_accessory_connected { buf = text_unsupp_accessory_connected; } -RESOURCE TBUF r_text_default_enhanc { buf = qtn_acc_default_enhanc; } -RESOURCE TBUF r_text_headphones_mic { buf = qtn_acc_headphones_mic; } - -//------------------------------------------------------------------------------ -// SELECTION_DATA structure. -//------------------------------------------------------------------------------ - -STRUCT SELECTION_DATA - { - LONG index; //selection index - LTEXT nameliteral; //name literal - } - -//------------------------------------------------------------------------------ -// SELECTION_LITERALS_ARRAY structure. -//------------------------------------------------------------------------------ - -STRUCT SELECTION_LITERALS_ARRAY - { - STRUCT literals[]; - } - -//------------------------------------------------------------------------------ -// r_selection_dialog_list_query. -//------------------------------------------------------------------------------ - -RESOURCE DIALOG r_selection_dialog_list_query -{ - flags = EGeneralQueryFlags; - buttons = R_AVKON_SOFTKEYS_OK_CANCEL; - items = - { - DLG_LINE - { - type = EAknCtListQueryControl; - id = EListQueryControl; - - control = AVKON_LIST_QUERY_CONTROL - { - listtype = EAknCtSinglePopupMenuListBox; - listbox = LISTBOX - { - flags = EAknListBoxMenuList; - - }; - heading = qtn_acc_select_acc; - }; - - } - }; -} - -//------------------------------------------------------------------------------ -// r_accfwuinotifier_information_note -//------------------------------------------------------------------------------ - -RESOURCE DIALOG r_accfwuinotifier_information_note - { - flags = EEikDialogFlagNoDrag | - EEikDialogFlagNoTitleBar | - EEikDialogFlagCbaButtons; - - buttons = R_AVKON_SOFTKEYS_EMPTY; - items = - { - DLG_LINE - { - type = EAknCtNote; - id = EGeneralNote; - control = AVKON_NOTE - { - layout = EGeneralLayout; - singular_label = " "; - animation = R_QGN_NOTE_INFO_ANIM; - }; - } - }; - - } - -//------------------------------------------------------------------------------ -// r_selection_dialog_literals. -//------------------------------------------------------------------------------ - -RESOURCE SELECTION_LITERALS_ARRAY r_selection_dialog_literals -{ - literals = - { - SELECTION_DATA - { - index = 0x1; - nameliteral = qtn_tty_acc_selection_dialog; - }, - SELECTION_DATA - { - index = 0x2; - nameliteral = qtn_loopset_acc_selection_dialog; - }, - SELECTION_DATA - { - index = 0x4; - nameliteral = qtn_headset_acc_selection_dialog; - }, - SELECTION_DATA - { - index = 0x8; - nameliteral = qtn_headphones_acc_selection_dialog; - }, - SELECTION_DATA - { - index = 0x10; - nameliteral = qtn_lineout_acc_selection_dialog; - }, - SELECTION_DATA - { - index = 0x20; - nameliteral = qtn_tvout_acc_selection_dialog; - }, - SELECTION_DATA - { - index = 0x40; - nameliteral = qtn_musicstand_acc_selection_dialog; - } - }; -} - // End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/accfwuinotifier/group/accfwuinotifier.mmp --- a/coreapplicationuis/accfwuinotifier/group/accfwuinotifier.mmp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/accfwuinotifier/group/accfwuinotifier.mmp Wed Aug 18 09:58:19 2010 +0300 @@ -38,7 +38,7 @@ SOURCE AccFwUiNotifierProxy.cpp SOURCE AccFwUiNoteNotifier.cpp -//SOURCE AccFwUiDialogNotifier.cpp + USERINCLUDE ../inc diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/accfwuinotifier/group/bld.inf --- a/coreapplicationuis/accfwuinotifier/group/bld.inf Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/accfwuinotifier/group/bld.inf Wed Aug 18 09:58:19 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2004 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2004-2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -22,7 +22,6 @@ DEFAULT PRJ_EXPORTS -../loc/accfwnotifier.loc MW_LAYER_LOC_EXPORT_PATH(accfwnotifier.loc) ../rom/accfwuinotifier.iby CORE_MW_LAYER_IBY_EXPORT_PATH(accfwuinotifier.iby) ../rom/accfwuinotifierresources.iby LANGUAGE_MW_LAYER_IBY_EXPORT_PATH(accfwuinotifierresources.iby) diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/accfwuinotifier/inc/AccFwUiDialogNotifier.h --- a/coreapplicationuis/accfwuinotifier/inc/AccFwUiDialogNotifier.h Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,145 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of accessory selection dialog. -* -*/ - -#ifndef __CACCFWUIDIALOGNOTIFIER_H -#define __CACCFWUIDIALOGNOTIFIER_H - -// INCLUDES -#include -#include -#include -#include -#include - -// CONSTANTS -const TUid KAccFwUiDialogNotifierUid={0x10205062}; -// MACROS - -// DATA TYPES - -// FUNCTION PROTOTYPES - -// FORWARD DECLARATIONS - -class CCoeEnv; -class CAknListQueryDialog; - -// CLASS DECLARATION -/** -* Implementation of accessory selection dialog. -* @lib - -* @since S60 3.1 -*/ -class CAccFwUiDialogNotifier : public CActive, public MEikSrvNotifierBase2 - { - public: // Constructors and destructor - - /** - * Two-phased constructor. - * @return The created object. - */ - static CAccFwUiDialogNotifier* NewL(); - - ~CAccFwUiDialogNotifier(); - - public: // From MEikSrvNotifierBase2 - - void Release(); - - TNotifierInfo RegisterL(); - - TNotifierInfo Info() const; - - TPtrC8 StartL(const TDesC8& aBuffer); - - void StartL(const TDesC8& aBuffer, TInt aReplySlot, const RMessagePtr2& aMessage); - - void Cancel(); - - TPtrC8 UpdateL(const TDesC8& aBuffer); - - //from CActive - - void RunL(); - TInt RunError(TInt aError); - - protected: - //from CActive - void DoCancel(); - - - private: // Functions - - /** - * C++ default constructor. - */ - CAccFwUiDialogNotifier(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL(); - - private: // Data - - //Notifier info - TNotifierInfo iInfo; - - //resource file offset - TInt iResourceFileOffset; - - //item list... - CDesCArray *iItemList; - - //selection dialog - CAknListQueryDialog * iDialog; - - //selections list - RArray iSelections; - - //for coverui - CArrayFixFlat* iCoverUIITems; - - //message to complete - RMessagePtr2 iMessage; - - //rmessage reply slot - TInt iReplySlot; - - //is notifier cancelled - TBool iIsCancelled; - - CCoeEnv* iCoeEnv; // not owned - - RAknKeylock2 iServer; - - // Check if keys should be locked - TBool iLockKeys; - - // Check if keys were locked - TBool iWasLocked; - - // Error in connection to keylock server - TInt iErr; - - }; - -#endif // __CACCFWUIDIALOGNOTIFIER_H - -// End of File - - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/accfwuinotifier/inc/AccFwUiNoteNotifier.h --- a/coreapplicationuis/accfwuinotifier/inc/AccFwUiNoteNotifier.h Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/accfwuinotifier/inc/AccFwUiNoteNotifier.h Wed Aug 18 09:58:19 2010 +0300 @@ -100,8 +100,6 @@ // Indication whether notifier cancelled TBool iIsCancelled; - // Indication whether to show not supported note in cover display - TBool iPublishNote; // Text to show in note HBufC* iNoteText; diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/accfwuinotifier/loc/accfwnotifier.loc --- a/coreapplicationuis/accfwuinotifier/loc/accfwnotifier.loc Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +0,0 @@ -/* -* Copyright (c) 2005-2008 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localization strings for AccFWNotifier -* -*/ - - -// LOCALISATION STRINGS - -//d:Text of a default accessory in use note -//d:Shown when accessory connected and default accessory is used -//l:popup_note_window -//w: -//r: 3.1 -#define qtn_acc_default_enhanc "Default enhancement:" - -//d:Text of a accessory use phone microphone information note -//d:Shown when headphones are connected -//l:popup_note_window -//w: -//r: 3.1 -#define qtn_acc_headphones_mic "Use phone microphone." - -//d:Text of a accessory selection dialog header -//d:Accessory selection dialog -//l:heading_pane_t1 -//w: -//r: 3.1 -#define qtn_acc_select_acc "Select accessory:" - - -//d:Text for TTY selection -//d:Accessory selection dialog -//l:list_single_pane_t1_cp2 -//w: -//r: 3.1 -#define qtn_tty_acc_selection_dialog "TTY" - -//d:Text for loopset selection -//d:Accessory selection dialog -//l:list_single_pane_t1_cp2 -//w: -//r: 3.1 -#define qtn_loopset_acc_selection_dialog "Loopset" - -//d:Text for headset selection -//d:Accessory selection dialog -//l:list_single_pane_t1_cp2 -//w: -//r: 3.1 -#define qtn_headset_acc_selection_dialog "Headset" - -//d:Text for headphones selection -//d:Accessory selection dialog -//l:list_single_pane_t1_cp2 -//w: -//r: 3.1 -#define qtn_headphones_acc_selection_dialog "Headphones" - -//d:Text for lineout selection -//d:Accessory selection dialog -//l:list_single_pane_t1_cp2 -//w: -//r: 3.1 -#define qtn_lineout_acc_selection_dialog "Lineout" - -//d:Text for tv-out selection -//d:Accessory selection dialog -//l:list_single_pane_t1_cp2 -//w: -//r: 3.1 -#define qtn_tvout_acc_selection_dialog "TV-out" - -//d:Text for Music Stand selection -//d:Accessory selection dialog -//l: heading_pane_t1 -//w: -//r: 3.1 -#define qtn_musicstand_acc_selection_dialog "Music Stand" - -// End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/accfwuinotifier/src/AccFwUiDialogNotifier.cpp --- a/coreapplicationuis/accfwuinotifier/src/AccFwUiDialogNotifier.cpp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,458 +0,0 @@ -/* -* Copyright (c) 2002-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation of Accessory selection dialog. -* -*/ - - -// INCLUDE FILES -#include "AccFwUiDialogNotifier.h" -#include "acc_debug.h" - -#include -#include -#include -#include -#include -#include -#include - -// EXTERNAL DATA STRUCTURES - -// EXTERNAL FUNCTION PROTOTYPES - -// CONSTANTS - -const TUid KScreenOutputChannel = { 0x10282E0A }; -_LIT(KAccFwUiNotifierResource, "accfwnoteuinotifier.rsc"); - - -// MACROS - -// LOCAL CONSTANTS AND MACROS - -// MODULE DATA STRUCTURES - -// LOCAL FUNCTION PROTOTYPES - -// FORWARD DECLARATIONS - -// ============================= LOCAL FUNCTIONS =============================== - -// ============================ MEMBER FUNCTIONS =============================== - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::CAccFwUiDialogNotifier() -// C++ default constructor can NOT contain any code, that -// might leave. -// ----------------------------------------------------------------------------- -// -CAccFwUiDialogNotifier::CAccFwUiDialogNotifier() - : CActive( EPriorityStandard) - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::CAccFwUiDialogNotifier() - enter" ); - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::CAccFwUiDialogNotifier() - return void" ); - } - -// Destructor -CAccFwUiDialogNotifier::~CAccFwUiDialogNotifier() - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::~CAccFwUiDialogNotifier() - enter" ); - - delete iDialog; - delete iCoverUIITems; - iSelections.Close(); - CActive::Cancel(); - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccPolAccessoryPolicy::~CAccFwUiDialogNotifier() - return void" ); - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::ConstructL() -// Symbian 2nd phase constructor can leave. -// ----------------------------------------------------------------------------- -// -void CAccFwUiDialogNotifier::ConstructL() - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::ConstructL() - enter" ); - - iErr = KErrNone; - - //get pointer to CEikonEnv - iCoeEnv = CEikonEnv::Static(); - - if ( !iCoeEnv ) - { - User::Leave( KErrGeneral ); - } - - iLockKeys = ETrue; - - //Open resource file - TFileName fileName; - fileName.Zero(); - - TFileName drivePath; - Dll::FileName( drivePath ); - - fileName.Append( TParsePtrC( drivePath ).Drive() ); - fileName.Append( KDC_RESOURCE_FILES_DIR ); - fileName.Append( KAccFwUiNotifierResource ); - - BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName ); - - //handle to resource file - iResourceFileOffset = iCoeEnv->AddResourceFileL( fileName ); - - //add to scheduler - CActiveScheduler::Add( this ); - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::ConstructL() - return void" ); - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::NewL() -// Two-phased constructor. -// ----------------------------------------------------------------------------- -// -CAccFwUiDialogNotifier* CAccFwUiDialogNotifier::NewL() - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::NewL() - enter" ); - - CAccFwUiDialogNotifier* self = new( ELeave ) CAccFwUiDialogNotifier; - - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::CAccFwUiDialogNotifier::NewL() - return" ); - return self; - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::Release() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -void CAccFwUiDialogNotifier::Release() - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::Release() - enter" ); - - if( iResourceFileOffset ) - { - iCoeEnv->DeleteResourceFile( iResourceFileOffset ); - } - - delete this; - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::Release() - return void" ); - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::RegisterL() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -CAccFwUiDialogNotifier::TNotifierInfo CAccFwUiDialogNotifier::RegisterL() - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RegisterL() - enter" ); - - iInfo.iUid=KAccFwUiDialogNotifierUid; - iInfo.iChannel=KScreenOutputChannel; - iInfo.iPriority=ENotifierPriorityHigh; - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::CAccFwUiDialogNotifier::RegisterL() - return" ); - return iInfo; - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::Info() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -CAccFwUiDialogNotifier::TNotifierInfo CAccFwUiDialogNotifier::Info() const - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::Info() - enter" ); - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::Info() - return void" ); - return iInfo; - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::StartL() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TPtrC8 CAccFwUiDialogNotifier::StartL( const TDesC8& /*aBuffer*/ ) - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::StartL() - enter" ); - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::StartL() - return void" ); - return KNullDesC8(); - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::StartL() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -void CAccFwUiDialogNotifier::StartL( - const TDesC8& aBuffer, - TInt aReplySlot, - const RMessagePtr2& aMessage ) - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::StartL() - enter" ); - - // Connect to AknKeylock2 server; - iErr = iServer.Connect(); - - //get selection bit mask - TUint32 selectionBitmask( 0 ); - TPckg selectioPckg( selectionBitmask ); - selectioPckg.Copy( aBuffer ); - - //prepare selection array - iSelections.Close(); - - - // construct listbox item array - iItemList = new ( ELeave ) CDesCArrayFlat( 10 ); - - //if cover UI exist - if( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) ) - { - delete iCoverUIITems; - iCoverUIITems = 0; - iCoverUIITems = new ( ELeave ) CArrayFixFlat( 10 ); - } - TResourceReader reader; - HBufC8* literals = iCoeEnv->AllocReadResourceAsDes8LC( R_SELECTION_DIALOG_LITERALS ); - reader.SetBuffer( literals ); - - TInt count( reader.ReadInt16() ); - TInt coverUIItemCounter( 0 ); - - //add items to dialog - for ( TInt i(0); i < count; i++ ) - { - //read from resource - TUint32 index( reader.ReadUint32() ); - HBufC * buf( reader.ReadHBufCL() ); - CleanupStack::PushL( buf ); - - if ( index & selectionBitmask ) - { - iItemList->AppendL( *buf ); - iSelections.Append( index ); - - //append cover UI items - if ( iCoverUIITems ) - { - iCoverUIITems->AppendL( coverUIItemCounter++ ); - } - } - - CleanupStack::PopAndDestroy( buf ); - - if ( ( index << 1 ) > selectionBitmask ) - { - //stop for-loop, selectionbitmask can't match anymore - break; - } - } - CleanupStack::PopAndDestroy( literals ); - iMessage = aMessage; - iReplySlot = aReplySlot; - iIsCancelled = EFalse; - - //prepare active object - SetActive(); - TRequestStatus* status = &iStatus; - User::RequestComplete( status, KErrNone );//RunL() function will get called - - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::StartL() - return void" ); - } - - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::RunL() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- - -void CAccFwUiDialogNotifier::RunL() - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - enter" ); - - if ( iIsCancelled ) - { - return; - } - - if( iErr == KErrNone ) - { - iWasLocked = iServer.IsKeyLockEnabled(); - // Change the bit on and off. SysAp will detect that - // the lights should be switched on for the specified time. - iServer.DisableKeyLock(); - } - - TInt replyValue; - - //create and prepare dialog - iDialog = new ( ELeave ) CAknListQueryDialog ( &replyValue ); - iDialog->PrepareLC( R_SELECTION_DIALOG_LIST_QUERY ); - - //add items to popup list - iDialog->SetItemTextArray( iItemList ); - - if( FeatureManager::FeatureSupported( KFeatureIdCoverDisplay ) ) - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - Publish cover UI "); - iDialog->PublishDialogL( ECmdShowAccessorySelectionDialog, - KCatAccFw, - iCoverUIITems ); - //iDialog take ownership - iCoverUIITems = 0; - } - - //show dialog... - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - Show dialog -> RunLD()" ); - TBool result = iDialog->RunLD(); - iDialog = 0; - - //create package - TInt returnValue( 0 ); - TPckg valuePck( returnValue ); - - if ( !iIsCancelled ) - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - Check dialog result" ); - - if ( result ) - { - //write selected item to reply slot - if ( returnValue >= 0 && iSelections.Count() ) - { - returnValue = iSelections[ replyValue ]; - API_TRACE_1( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - Set selection: %d", returnValue ); - } - // Don't lock keys if something was selected - iLockKeys = EFalse; - } - else - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - Cancel pressed" ); - returnValue = 0; - iLockKeys = ETrue; - } - - //complete client requests - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - Write response value to message" ); - iMessage.Write( iReplySlot, valuePck, 0 ); - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - Complete message" ); - iMessage.Complete( KErrNone ); - } - else - { - // Message is being completed with KErrCancel in Cancel-method - } - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - Release resources" ); - delete iCoverUIITems; - iCoverUIITems = 0; - iSelections.Close(); - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunL() - return void" ); - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::RunError() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TInt CAccFwUiDialogNotifier::RunError(TInt aError) - { - API_TRACE_1( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunError() - %d", aError ); - if( !iMessage.IsNull() ) - { - iMessage.Complete( aError ); - } - aError = KErrNone; - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::RunError() - return" ); - return aError; - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::DoCancel() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -void CAccFwUiDialogNotifier::DoCancel() - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::DoCancel() - enter" ); - if( !iMessage.IsNull() ) - { - iMessage.Complete( KErrCancel ); - } - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::DoCancel() - return" ); - } - - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::Cancel() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -void CAccFwUiDialogNotifier::Cancel() - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::Cancel() - enter" ); - - iIsCancelled = ETrue; - - if( iLockKeys && iWasLocked && ( iErr == KErrNone ) ) - { - iServer.EnableKeyLock(); - } - - iLockKeys = ETrue; - - if ( iDialog ) - { - //cancel active object, delete dialog and release resources - if ( IsActive() ) - { - CActive::Cancel(); - } - delete iDialog; - iDialog = 0; - delete iCoverUIITems; - iCoverUIITems = 0; - iSelections.Close(); - - TInt returnValue( 0 ); - TPckg valuePck( returnValue ); - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::Cancel() - Write response value to message" ); - iMessage.Write( iReplySlot, valuePck, 0 ); - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::Cancel() - Complete message with Cancel" ); - iMessage.Complete( KErrCancel ); - } - - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::Cancel() - return void" ); - } - -// ----------------------------------------------------------------------------- -// CAccFwUiDialogNotifier::UpdateL() -// (other items were commented in a header). -// ----------------------------------------------------------------------------- -TPtrC8 CAccFwUiDialogNotifier::UpdateL( - const TDesC8& /*aBuffer*/ ) - { - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::UpdateL() - enter" ); - API_TRACE_( "[AccFW: ACCFWUINOTIFIER] CAccFwUiDialogNotifier::UpdateL() - return void" ); - return KNullDesC8(); - } - -// End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/accfwuinotifier/src/AccFwUiNotifierProxy.cpp --- a/coreapplicationuis/accfwuinotifier/src/AccFwUiNotifierProxy.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/accfwuinotifier/src/AccFwUiNotifierProxy.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -19,9 +19,7 @@ // INCLUDE FILES #include #include - #include "AccFwUiNoteNotifier.h" -#include "AccFwUiDialogNotifier.h" #include "acc_debug.h" // EXTERNAL DATA STRUCTURES diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/advancedtspcontroller/data/keyevent.rul --- a/coreapplicationuis/advancedtspcontroller/data/keyevent.rul Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/advancedtspcontroller/data/keyevent.rul Wed Aug 18 09:58:19 2010 +0300 @@ -105,7 +105,6 @@ - + + + + + + + /> diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/group/bld.inf --- a/coreapplicationuis/group/bld.inf Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/group/bld.inf Wed Aug 18 09:58:19 2010 +0300 @@ -32,7 +32,6 @@ #include "../accfwuinotifier/group/bld.inf" #include "../kefmapper/group/bld.inf" #include "../advancedtspcontroller/group/bld.inf" -#include "../powersaveutilities/group/bld.inf" #include "../gsserverenginestub/group/bld.inf" #include "../GSServerEngine/group/bld.inf" #include "../sensordatacompensatorplugin/group/bld.inf" diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/BWINS/batterypopupcontrolu.DEF --- a/coreapplicationuis/powersaveutilities/BWINS/batterypopupcontrolu.DEF Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,6 +0,0 @@ -EXPORTS - ?NewL@CBatteryPopupControl@@SAPAV1@ABVTDesC16@@0@Z @ 1 NONAME ; class CBatteryPopupControl * CBatteryPopupControl::NewL(class TDesC16 const &, class TDesC16 const &) - ?SetCommandObserver@CBatteryPopupControl@@QAEXAAVMEikCommandObserver@@@Z @ 2 NONAME ; void CBatteryPopupControl::SetCommandObserver(class MEikCommandObserver &) - ?ShowPopUpL@CBatteryPopupControl@@QAEXXZ @ 3 NONAME ; void CBatteryPopupControl::ShowPopUpL(void) - ??1CBatteryPopupControl@@QAE@XZ @ 4 NONAME ; CBatteryPopupControl::~CBatteryPopupControl(void) - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/CenRep/keys_bsutil.xls Binary file coreapplicationuis/powersaveutilities/CenRep/keys_bsutil.xls has changed diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/EABI/batterypopupcontrolu.DEF --- a/coreapplicationuis/powersaveutilities/EABI/batterypopupcontrolu.DEF Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,7 +0,0 @@ -EXPORTS - _ZN20CBatteryPopupControl10ShowPopUpLEv @ 1 NONAME - _ZN20CBatteryPopupControl18SetCommandObserverER19MEikCommandObserver @ 2 NONAME - _ZN20CBatteryPopupControl4NewLERK7TDesC16S2_ @ 3 NONAME - _ZN20CBatteryPopupControlD1Ev @ 4 NONAME - _ZN20CBatteryPopupControlD2Ev @ 5 NONAME - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batindicatorpaneplugin/inc/batindicatorpanepluginimpl.h --- a/coreapplicationuis/powersaveutilities/batindicatorpaneplugin/inc/batindicatorpanepluginimpl.h Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,180 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: BatIndicatorPanePlugin plugin implementation -* -*/ - - -#ifndef BATINDICATORPANEPLUGINIMPL_H -#define BATINDICATORPANEPLUGINIMPL_H - -// INCLUDES -#include // CAknIndicatorPlugin -#include -#include // CPsmClient -#include // RConeResourceLoader -#include "batterypopupcontrol.h" - -class CPsmClient; -class CBSUtil; - -/** -* BatIndicatorPanePlugin Plug-in implementation -* -* @lib BatIndicatorPanePlugin -* @since S60 5.0 -*/ -class CBatIndicatorPanePluginImpl : public CAknIndicatorPlugin, - public MEikCommandObserver, - public MPsmClientObserver -{ - -private: - - // Preview popup command ids - enum TLinkCommandID - { - ELinkNone = 0, - ELinkFirst = 1 - }; - -public: // Constructors and destructor - - /** - * Two-phased constructor. - * @since S60 5.0 - * @param aCallback Callback for psm client. - */ - static CBatIndicatorPanePluginImpl* NewL( ); - - /** - * Destructor. - */ - ~CBatIndicatorPanePluginImpl(); - -// From MEikCommandObserver - - /** - * @see MEikCommandObserver - */ - void ProcessCommandL( TInt aCommandId ); - -private: - - /** - * C++ default constructor. - */ - CBatIndicatorPanePluginImpl(); - - /** - * By default Symbian 2nd phase constructor is private. - */ - void ConstructL( ); - - /** - * Shows preview popup. - * - * @since S60 5.0 - */ - void ShowPreviewPopupL( ); - - /** - * Enables or disables power save mode. - * If the wished state is already active, does nothing. - * - * @since S60 5.0 - */ - void SetPowerSaveModeEnabled( ); - - /** - * Gets local variation for plugin. - * - * @since S60 5.0 - */ - void GetFeatures( ); - - /** - * This method can check if feature is supported or not. - * @param TInt aFeatureId (defined in batindpanepluginprivatecrkeys.h) - * @return TInt: aFeatureId supported if != 0 - * - * @since S60 5.0 - */ - TInt Supported( TInt aFeatureId ); - -// From CAknIndicatorPlugin - - /** - * @see CAknIndicatorPlugin - */ - void HandleIndicatorTapL( const TInt aUid ); - -// from MPsmClientObserver - - /** - * @see MPsmClientObserver - */ - virtual void PowerSaveModeChanged( const TPsmsrvMode aMode ); - - /** - * @see MPsmClientObserver - */ - virtual void PowerSaveModeChangeError( const TInt aError ); - -private: // data - - /** - * Actual content - * Own. - */ - HBufC* iContentText; - - /** - * Link text - * Own. - */ - HBufC* iLinkText; - - /** - * PSM Server client. - * Own. - */ - CPsmClient* iPsmClient; - - /** - * Battery status utility. - * Own. - */ - CBSUtil* iBatteryStateUtil; - - /** - * Control for preview popup. - * Own. - */ - CBatteryPopupControl* iPopupControl; - - /** - * Resource loader. - */ - RConeResourceLoader iResourceLoader; - - /** - * Value of KBatIndPanePlugin. - */ - TInt iBatIndPanePluginFeatures; - }; - -#endif // BATINDICATORPANEPLUGINIMPL_H - -// End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batindicatorpaneplugin/inc/batindpanepluginprivatecrkeys.h --- a/coreapplicationuis/powersaveutilities/batindicatorpaneplugin/inc/batindpanepluginprivatecrkeys.h Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Battery Indicator Pane Plug-in central repository -* configuration keys. -* -*/ - - -#ifndef BATINDPANEPLUGINPRIVATECRKEYS_H -#define BATINDPANEPLUGINPRIVATECRKEYS_H - -// INCLUDES - -// ============================================================================= -// Battery Indicator Pane Plug-in Configuration API -// ============================================================================= -const TUid KCRUidBatIndPanePluginConf = { 0x2001011A }; - -/** -* Bitmask used in configuring Battery Indicator Pane Plug-in. -*/ -const TUint32 KBatIndPanePlugin = 0x00000001; - -// ============================================================================= -// Battery Indicator Pane Plug-in Local Variation constants -// ============================================================================= - -/** -* KBatIndPanePluginLinkOnly is an on/off setting for enabling -* a preview popup with battery level information in percents. If enabled, this popup -* is shown only with link for activate/deactivate power save mode. If disabled, this -* popup is shown with icon, battery level information and link. -* -*/ -const TUint32 KBatIndPanePluginLinkOnly = 0x01; // 2^0 - -#endif // BATINDPANEPLUGINPRIVATECRKEYS_H - -// End of File - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batindicatorpaneplugin/inc/trace.h --- a/coreapplicationuis/powersaveutilities/batindicatorpaneplugin/inc/trace.h Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,378 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Battery Indicator Pane Plug-in trace definitions. -* -*/ - - -#ifndef TRACE_H -#define TRACE_H - -#include "traceconfiguration.hrh" - -#ifdef TRACE_INTO_FILE -#include // RFileLogger -#else -#include // RDebug -#endif - -//----------------------------------------------------------------------------- -// Constants -//----------------------------------------------------------------------------- -// - -/** -* Prefix trace macro to complete tracing with component name. -* Returns TDesC which can be used directly with RDebug or RFileLogger. -*/ -#define _PREFIX_TRACE( aMsg ) TPtrC( (const TText*)L"[BatIndicatorPanePlugin]: " L##aMsg ) - -/** -* Prefix error trace -*/ -#define _PREFIX_ERROR( aMsg ) _PREFIX_TRACE( "[ERROR: %d]: " L##aMsg ) - -/** -* Prefix info trace. -*/ -#define _PREFIX_INFO( aMsg ) _PREFIX_TRACE( "[INFO]: " L##aMsg ) - -/** -* Prefix macro for strings -*/ -#define _PREFIX_CHAR( aMsg ) (const char*)"[BatIndicatorPanePlugin]: " ##aMsg - -/** -* Define needed directories if TRACE_INTO_FILE macro in use -*/ -#ifdef TRACE_INTO_FILE - - _LIT( KDir, "BatIndicatorPanePlugin" ); - _LIT( KFile, "BatIndicatorPanePlugin_log.txt" ); - _LIT( KFullPath, "c:\\logs\\BatIndicatorPanePlugin\\" ); - -#endif - -//----------------------------------------------------------------------------- -// Error trace macros -//----------------------------------------------------------------------------- -// -#ifdef ERROR_TRACE - - /** - * Error trace definitions. - */ - #ifdef TRACE_INTO_FILE - - #define ERROR( aErr, aMsg )\ - {\ - if( aErr < KErrNone )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr );\ - }\ - } - #define ERROR_1( aErr, aMsg, aP1 )\ - {\ - if( aErr < KErrNone )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1 );\ - }\ - } - #define ERROR_2( aErr, aMsg, aP1, aP2 )\ - {\ - if( aErr < KErrNone )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\ - }\ - } - #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\ - {\ - if( aErr < KErrNone )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\ - }\ - } - - #else//TRACE_INTO_FILE not defined - - #define ERROR( aErr, aMsg )\ - {\ - if( aErr < KErrNone )\ - {\ - RDebug::Print( _PREFIX_ERROR( aMsg ), aErr );\ - }\ - } - #define ERROR_1( aErr, aMsg, aP1 )\ - {\ - if( aErr < KErrNone )\ - {\ - RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1 );\ - }\ - } - #define ERROR_2( aErr, aMsg, aP1, aP2 )\ - {\ - if( aErr < KErrNone )\ - {\ - RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\ - }\ - } - #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\ - {\ - if( aErr < KErrNone )\ - {\ - RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\ - }\ - } - - #endif//TRACE_INTO_FILE - - #define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg ) - #define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 ) - #define ERROR_GEN_2( aMsg, aP1, aP2 ) ERROR_2( KErrGeneral, aMsg, aP1, aP2 ) - #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) ERROR_3( KErrGeneral, aMsg, aP1, aP3 ) - -#else//ERROR_TRACE not defined - - #define ERROR( aErr, aMsg ) - #define ERROR_1( aErr, aMsg, aP1 ) - #define ERROR_2( aErr, aMsg, aP1, aP2 ) - #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 ) - #define ERROR_GEN( aMsg ) - #define ERROR_GEN_1( aMsg, aP1 ) - #define ERROR_GEN_2( aMsg, aP1, aP2 ) - #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) - -#endif//ERROR_TRACE - -//----------------------------------------------------------------------------- -// Info trace macros -//----------------------------------------------------------------------------- -// -#ifdef INFO_TRACE - - /** - * Info log message definitions. - */ - #ifdef TRACE_INTO_FILE - - #define INFO( aMsg )\ - {\ - RFileLogger::Write( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ) );\ - } - #define INFO_1( aMsg, aP1 )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1 );\ - } - #define INFO_2( aMsg, aP1, aP2 )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2 );\ - } - #define INFO_3( aMsg, aP1, aP2, aP3 )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\ - } - - #else//TRACE_INTO_FILE not defined - - #define INFO( aMsg )\ - {\ - RDebug::Print( _PREFIX_INFO( aMsg ) );\ - } - #define INFO_1( aMsg, aP1 )\ - {\ - RDebug::Print( _PREFIX_INFO( aMsg ), aP1 );\ - } - #define INFO_2( aMsg, aP1, aP2 )\ - {\ - RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2 );\ - } - #define INFO_3( aMsg, aP1, aP2, aP3 )\ - {\ - RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\ - } - - #endif//TRACE_INTO_FILE - -#else//INFO_TRACE not defined - - #define INFO( aMsg ) - #define INFO_1( aMsg, aP1 ) - #define INFO_2( aMsg, aP1, aP2 ) - #define INFO_3( aMsg, aP1, aP2, aP3 ) - -#endif//INFO_TRACE - -//----------------------------------------------------------------------------- -// Trace current client thread name and process id -//----------------------------------------------------------------------------- -// -#ifdef CLIENT_TRACE - - #define CLIENT( aMessage )\ - {\ - RThread thread;\ - TInt err = aMessage.Client( thread );\ - if( err == KErrNone )\ - {\ - RProcess process;\ - err = thread.Process( process );\ - if( err == KErrNone )\ - {\ - TPtrC thredName( thread.Name() );\ - TUid processUid( process.SecureId() );\ - INFO_2( "Current client process UID: [%x], thread name: [%S]",\ - processUid,\ - &thredName );\ - }\ - process.Close();\ - }\ - thread.Close();\ - } - -#else - - #define CLIENT( aMessage ) - -#endif - -//----------------------------------------------------------------------------- -// Function trace macros -//----------------------------------------------------------------------------- -// -#ifdef FUNC_TRACE - - /** - * Function logging definitions. - */ - #ifdef TRACE_INTO_FILE - - #define FUNC( aMsg, aP1 )\ - {\ - TPtrC8 trace( _S8( aMsg ) );\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, trace, aP1 );\ - }\ - - #else//TRACE_INTO_FILE not defined - - #define FUNC( aMsg, aP1 )\ - {\ - RDebug::Printf( aMsg, aP1 );\ - }\ - - #endif//TRACE_INTO_FILE - - /** - * Function trace helper class. - * - * NOTE: - * LC -methods cannot be trapped. Therefore if LC -method leaves - * END trace is used instead of LEAVE trace. - * If you have an idea how to round this problem please tell. - */ - _LIT8( KFuncNameTerminator, "(" ); - _LIT8( KFuncLeavePatternL, "L" ); - class TFuncLog - { - public: - static void Cleanup( TAny* aPtr ) - { - TFuncLog* self = static_cast< TFuncLog* >( aPtr ); - self->iLeft = ETrue; - FUNC( _PREFIX_CHAR("%S-LEAVE"), &self->iFunc ); // Leave detected - } - inline TFuncLog( const char* aFunc ) : - iFunc( aFunc ? _S8( aFunc ) : _S8("") ), - iLeft( EFalse ), - iCleanupItem( Cleanup, this ), - iCanLeave( EFalse ) - { - TInt pos( iFunc.Find( KFuncNameTerminator ) ); - if( pos != KErrNotFound ) - { - iFunc.Set( iFunc.Left( pos ) ); - iCanLeave = !iFunc.Right( KFuncLeavePatternL().Length() ).Compare( KFuncLeavePatternL ); - if ( iCanLeave ) - { - CleanupStack::PushL( iCleanupItem ); // Ignore warnings - } - } - FUNC( _PREFIX_CHAR("%S-START"), &iFunc ); - } - - inline ~TFuncLog() - { - if ( !iLeft ) - { - if ( iCanLeave ) - { - CleanupStack::Pop( this ); // Pop the cleanup item - } - FUNC( _PREFIX_CHAR("%S-END"), &iFunc ); // Normally finished - } - } - - private: // Data - TPtrC8 iFunc; - TBool iLeft; - TCleanupItem iCleanupItem; - TBool iCanLeave; - }; - #define FUNC_LOG TFuncLog _fl( __PRETTY_FUNCTION__ ); - -#else//FUNC_TRACE not defined - - #define FUNC_LOG - -#endif//FUNC_TRACE - -//----------------------------------------------------------------------------- -// Timestamp trace macros -//----------------------------------------------------------------------------- -// -#ifdef TIMESTAMP_TRACE - - #ifdef TRACE_INTO_FILE - - #define TIMESTAMP( aCaption )\ - {\ - TTime t;\ - t.HomeTime();\ - TDateTime dt = t.DateTime();\ - _LIT( KCaption, aCaption );\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\ - _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\ - &KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\ - } - - #else//TRACE_INTO_FILE not defined - - #define TIMESTAMP( aCaption )\ - {\ - TTime t;\ - t.HomeTime();\ - TDateTime dt = t.DateTime();\ - _LIT( KCaption, aCaption );\ - RDebug::Print( _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\ - &KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\ - } - - #endif//TRACE_INTO_FILE - -#else//TIMESTAMP_TRACE not defined - - #define TIMESTAMP( aCaption ) - -#endif//TIMESTAMP_TRACE - -#endif diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batindicatorpaneplugin/inc/traceconfiguration.hrh --- a/coreapplicationuis/powersaveutilities/batindicatorpaneplugin/inc/traceconfiguration.hrh Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Trace configuration for Battery Indicator Pane Plug-in -* -*/ - - -#ifndef TRACECONFIGURATION_HRH -#define TRACECONFIGURATION_HRH - -//----------------------------------------------------------------------------- -// Trace definitions -//----------------------------------------------------------------------------- -// - -/** -* Error trace enabled -*/ -#ifdef _DEBUG - #define ERROR_TRACE -#else - #undef ERROR_TRACE -#endif - -/** -* Info trace enabled -*/ -#ifdef _DEBUG - #define INFO_TRACE -#else - #undef INFO_TRACE -#endif - -/** -* Function trace enabled -*/ -#ifdef _DEBUG - #define FUNC_TRACE -#else - #undef FUNC_TRACE -#endif - -/** -* Timestamp tracing on -*/ -#ifdef _DEBUG - #define TIMESTAMP_TRACE -#else - #undef TIMESTAMP_TRACE -#endif - -/** -* Tracing current client process and thread -*/ -#ifdef _DEBUG - #define CLIENT_TRACE -#else - #undef CLIENT_TRACE -#endif - -/** -* Tracing into file enabled, default RDebug -*/ -#undef TRACE_INTO_FILE - -#endif \ No newline at end of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batindicatorpaneplugin/src/batindicatorpanepluginimpl.cpp --- a/coreapplicationuis/powersaveutilities/batindicatorpaneplugin/src/batindicatorpanepluginimpl.cpp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,293 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: BatIndicatorPanePlugin plugin implementation -* -*/ - - -// INCLUDE FILES -#include // RPropert -#include // BatIndicatorPanePlugin resources -#include // Stringloader -#include -#include -#include -#include // KDC_ECOM_RESOURCE_DIR -#include -#include "batindicatorpanepluginimpl.h" -#include "batindpanepluginprivatecrkeys.h" -#include "bsutil.h" -#include "trace.h" - -// CONSTANTS -_LIT( KIndicatorResourceFile,"z:batindpaneplugin.rsc" ); - - -// ======== MEMBER FUNCTIONS ======== - -// --------------------------------------------------------------------------- -// Two-phased constructor. -// --------------------------------------------------------------------------- -// -CBatIndicatorPanePluginImpl* CBatIndicatorPanePluginImpl::NewL( ) - { - FUNC_LOG - - CBatIndicatorPanePluginImpl* self = new( ELeave ) CBatIndicatorPanePluginImpl( ); - CleanupStack::PushL( self ); - self->ConstructL(); - CleanupStack::Pop( self ); - return self; - } - -// --------------------------------------------------------------------------- -// Destructor -// --------------------------------------------------------------------------- -// -CBatIndicatorPanePluginImpl::~CBatIndicatorPanePluginImpl() - { - FUNC_LOG - - delete iContentText; - delete iPsmClient; - delete iBatteryStateUtil; - delete iPopupControl; - delete iLinkText; - iResourceLoader.Close(); - } - -// --------------------------------------------------------------------------- -// From MEikCommandObserver -// --------------------------------------------------------------------------- -// -void CBatIndicatorPanePluginImpl::ProcessCommandL( TInt aCommandId ) - { - FUNC_LOG - - if( aCommandId == ELinkFirst ) - { - SetPowerSaveModeEnabled(); - } - } - -// --------------------------------------------------------------------------- -// CBatIndicatorPanePluginImpl::CBatIndicatorPanePluginImpl -// C++ default constructor can NOT contain any code, that -// might leave. -// --------------------------------------------------------------------------- -// -CBatIndicatorPanePluginImpl::CBatIndicatorPanePluginImpl( ): - iResourceLoader( *CEikonEnv::Static() ), - iBatIndPanePluginFeatures( 0 ) - { - FUNC_LOG - } - -// --------------------------------------------------------------------------- -// CBatIndicatorPanePluginImpl::ConstructL -// Symbian 2nd phase constructor can leave. -// --------------------------------------------------------------------------- -// -void CBatIndicatorPanePluginImpl::ConstructL( ) - { - FUNC_LOG - // Create PSM client - iPsmClient = CPsmClient::NewL( *this ); - - GetFeatures(); - - // Create Battery State Utilities - if( !Supported( KBatIndPanePluginLinkOnly ) ) - { - iBatteryStateUtil = CBSUtil::NewL(); - } - - // Read resource strings - TParse* fp = new( ELeave ) TParse(); - CleanupStack::PushL( fp ); - fp->Set( KIndicatorResourceFile, &KDC_ECOM_RESOURCE_DIR , NULL ); - TFileName filename = fp->FullName(); - iResourceLoader.OpenL( filename ); - CleanupStack::PopAndDestroy( fp ); - } - -// --------------------------------------------------------------------------- -// Shows soft notification. -// --------------------------------------------------------------------------- -// -void CBatIndicatorPanePluginImpl::ShowPreviewPopupL( ) - { - FUNC_LOG - - delete iPopupControl; - iPopupControl = NULL; - - if( iContentText ) - { - iPopupControl = CBatteryPopupControl::NewL( *iContentText, - *iLinkText ); - } - else - { - iPopupControl = CBatteryPopupControl::NewL( KNullDesC, - *iLinkText ); - } - - iPopupControl->SetCommandObserver( *this ); - // Launch - iPopupControl->ShowPopUpL(); - - delete iContentText; - iContentText = NULL; - - delete iLinkText; - iLinkText = NULL; - } - -// --------------------------------------------------------------------------- -// Enables or disables power save mode. -// --------------------------------------------------------------------------- -// -void CBatIndicatorPanePluginImpl::SetPowerSaveModeEnabled( ) - { - FUNC_LOG - // Get PSM state - TInt mode; - TInt err = iPsmClient->PsmSettings().GetCurrentMode( mode ); - - if ( err == KErrNone ) - { - if( mode == EPsmsrvModeNormal || - mode == EPsmsrvPartialMode ) - { - iPsmClient->ChangePowerSaveMode( EPsmsrvModePowerSave ); - } - else - { - iPsmClient->ChangePowerSaveMode( EPsmsrvModeNormal ); - } - } - } - -// --------------------------------------------------------------------------- -// From CAknIndicatorPlugin -// --------------------------------------------------------------------------- -// -void CBatIndicatorPanePluginImpl::HandleIndicatorTapL( const TInt /*aUid*/ ) - { - FUNC_LOG - - delete iContentText; - iContentText = NULL; - - delete iLinkText; - iLinkText = NULL; - - TInt err = KErrNone; - - if ( iBatteryStateUtil ) - { - TInt batteryStatus; - err = RProperty::Get( KPSUidHWRMPowerState, KHWRMBatteryStatus, batteryStatus ); - - if( !err && batteryStatus == EBatteryStatusLow ) - { - iContentText = StringLoader::LoadL( R_QTN_BATTERY_LOW_PREVIEW_POPUP ); - } - else - { - TUint8 batteryCapacity = iBatteryStateUtil->GetBatteryCapacity(); - - iContentText = StringLoader::LoadL( R_QTN_BATTERY_STATUS_POPUP, - batteryCapacity ); - } - } - - // Get PSM state - TInt mode; - TBool psmActive = EFalse; - err = iPsmClient->PsmSettings().GetCurrentMode( mode ); - - if ( err == KErrNone ) - { - psmActive = ( mode == EPsmsrvModePowerSave ); - } - - if ( psmActive ) - { - iLinkText = StringLoader::LoadL( R_QTN_DEACTIVATE_POWER_SAVING ); - } - else - { - iLinkText = StringLoader::LoadL( R_QTN_ACTIVATE_POWER_SAVING ); - } - ShowPreviewPopupL(); - } - -// ---------------------------------------------------------------------------- -// CBatIndicatorPanePluginImpl::GetFeatures() -// ---------------------------------------------------------------------------- -// -void CBatIndicatorPanePluginImpl::GetFeatures( ) - { - FUNC_LOG - - CRepository* repository = NULL; - - TRAPD( err, repository = CRepository::NewL( KCRUidBatIndPanePluginConf ) ); - - if ( err == KErrNone ) - { - err = repository->Get( KBatIndPanePlugin, iBatIndPanePluginFeatures ); - - if ( err != KErrNone || iBatIndPanePluginFeatures < 0 ) // ERROR - { - INFO_1( "CBatIndicatorPanePluginImpl::GetFeatures - Reading features err %d", err ) - iBatIndPanePluginFeatures = 0; - } - } - else - { - INFO_1( "CBatIndicatorPanePluginImpl::GetFeatures: open KCRUidBatIndPanePluginConf failed, err=%d", err ) - } - delete repository; - } - -// ---------------------------------------------------------------------------- -// CBatIndicatorPanePluginImpl::Supported() -// ---------------------------------------------------------------------------- -// -TInt CBatIndicatorPanePluginImpl::Supported( TInt aFeatureId ) - { - FUNC_LOG - return aFeatureId & iBatIndPanePluginFeatures; - } -// --------------------------------------------------------------------------- -// From MPsmClientObserver -// --------------------------------------------------------------------------- -// -void CBatIndicatorPanePluginImpl::PowerSaveModeChanged( const TPsmsrvMode /*aMode*/ ) - { - FUNC_LOG - } - -// --------------------------------------------------------------------------- -// From MPsmClientObserver -// --------------------------------------------------------------------------- -// -void CBatIndicatorPanePluginImpl::PowerSaveModeChangeError( const TInt /*aError*/ ) - { - FUNC_LOG - } -// End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batindicatorpaneplugin/src/dllmain.cpp --- a/coreapplicationuis/powersaveutilities/batindicatorpaneplugin/src/dllmain.cpp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,51 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Implementation for DllMain. -* -*/ - - -#include "batindicatorpanepluginimpl.h" - -#include -#include - -// --------------------------------------------------------------------------- -// Define the interface UIDs -// Map the interface implementation UIDs to implementation factory functions -// --------------------------------------------------------------------------- -// -const TImplementationProxy ImplementationTable[] = - { -#ifdef KImplUIDBatteryIndicatorPlugin - IMPLEMENTATION_PROXY_ENTRY( KImplUIDBatteryIndicatorPlugin, - CBatIndicatorPanePluginImpl::NewL ) -#else - IMPLEMENTATION_PROXY_ENTRY( 0x2000E51D, - CBatIndicatorPanePluginImpl::NewL ) -#endif //KImplUIDBatteryIndicatorPlugin - }; - -// --------------------------------------------------------------------------- -// Exported proxy for instantiation method resolution. -// --------------------------------------------------------------------------- -// -EXPORT_C const TImplementationProxy* ImplementationGroupProxy - (TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(ImplementationTable[0]); - return ImplementationTable; - } - -// End of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batterypopupcontrol/inc/batterypopupcontrol.h --- a/coreapplicationuis/powersaveutilities/batterypopupcontrol/inc/batterypopupcontrol.h Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,296 +0,0 @@ -/* -* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Content for preview pop-up. -* -*/ - - -#ifndef CBATTERYPOPUPCONTROL_H -#define CBATTERYPOPUPCONTROL_H - -//#include -//#include -//#include // Controlling the preview pop-up component -#include -class MEikCommandObserver; -class CEikLabel; -class CGulIcon; - - -/** -* Class defining stylus activated pop-up content. -* -* This content is intended to be used in connection with preview pop-up -* component. Content shows an icon, text and -* an optional stylus tappable function link. If using link, the user gives link text and -* corresponding ID for link in construction. The user must also set -* itself as an observer for this content when using function links. This -* way the user gets callbacks (with ID) for its ProcessCommandL() function -* when the link is tapped. -* -* @lib BatteryPopupControl.lib -* @since S60 5.0 -*/ -NONSHARABLE_CLASS( CBatteryPopupControl ) :public MCoeControlObserver - // public CAknControl, - // public MAknPreviewPopUpObserver - { -public: - - /** Preview popup command ids */ - enum TLinkCommandID - { - ELinkNone = 0, - ELinkFirst = 1 - }; - - /** - * Two-phased constructor. Constructs the content - * with text and function link. - * - * @since S60 5.0 - * @param aContentText Text for the popup. Mandatory. - * @param aLinkText Link text. - * @return Pointer to the created content object. - */ - - IMPORT_C static CBatteryPopupControl* NewL( const TDesC& aContentText, - const TDesC& aLinkText ); - - /** - * Destructor. - */ - IMPORT_C ~CBatteryPopupControl(); - - /** - * Sets the command observer of the preview pop-up content. When - * link that is set to the content is pressed, the command - * observer's ProcessCommandL() method is called with the command ID - * of the pressed component. - * - * @since S60 5.0 - * @param aCommandObserver Command observer. - */ - IMPORT_C void SetCommandObserver( MEikCommandObserver& aCommandObserver ); - - /** - * Shows preview popup - * - * @since S60 5.0 - */ - IMPORT_C void ShowPopUpL(); - -private: -// from base class CCoeControl - - /** - * Handles a change to the control's resources of type aType which are - * shared across the environment. - * - * @param aType The type of resource that have changed. - */ - void HandleResourceChange( TInt aType ); - - /** - * Sets container window. - * - * @param aContainer Container. - */ - void SetContainerWindowL( const CCoeControl& aContainer ); - - /** - * Handles pointer events - * - * @param aPointerEvent information about the pointer event. - */ - void HandlePointerEventL( const TPointerEvent& aPointerEvent ); - - -// from base class MCoeControlObserver - - /** - * Handles an event from an observed control. - * - * @param aControl The control that sent the event. - * @param aEventType The event type. - */ - void HandleControlEventL( CCoeControl *aControl, - TCoeEvent aEventType ); - -// From MAknPreviewPopUpObserver - - /** - * @see MAknPreviewPopUpObserver - */ - // void HandlePreviewPopUpEventL( CAknPreviewPopUpController* aController, - // TPreviewPopUpEvent aEvent ); - - /** - * Default constructor. - */ - CBatteryPopupControl(); - - /** - * Symbian 2nd phase constructor. - * - * @since S60 5.0 - * @param aContentText Text for the popup. - * @param aLinkText Link text. - */ - void ConstructL( const TDesC& aContentText, - const TDesC& aLinkText ); - - /** - * Gets rect from layout data. - * - * @since S60 5.0 - * @param aParent Parent rect. - * @param aComponentLayout Layout data. - */ - // TRect RectFromLayout( const TRect& aParent, - // const TAknWindowComponentLayout& aComponentLayout ) const; - - /** - * Gets rect from layout data. - * - * @since S60 5.0 - * @param aComponentLayout Layout data. - */ - // TRect PopUpWindowRectFromLayout( const TAknWindowComponentLayout& - // aComponentLayout ) const; - - /** - * Creates CGulIcon. - * - * @since S60 5.0 - */ - void CreateIconL( ); - -// from base class CCoeControl - - /** - * Returns a control determined by control index. - * - * @param aIndex Index of a control to be returned. - * @return Pointer to control. - */ - CCoeControl* ComponentControl( TInt aIndex ) const; - - /** - * Returns the number of controls inside the control. - * - * @return The number of component controls. - */ - TInt CountComponentControls() const; - - /** - * Draws the control. - * - * @param aRect The control's area. - */ - void Draw( const TRect& aRect ) const; - - /** - * Returns the control's minimum required size. - * - * @return The minimum size required by the control. - */ - TSize MinimumSize(); - - /** - * Responds to size changes to set the size and position for - * the contents of this control. - */ - void SizeChanged(); - -private: // data - /** Variant ids */ - enum TVariantID - { - EVariantIconText = 0, - EVariantIconTextLink = 1 - }; - - /** - * Label for informative text. - * Own. - */ - CEikLabel* iText; - - /** - * Link text. - * Own. - */ - HBufC* iLinkText; - - /** - * Command observer. - * Not own. - */ - MEikCommandObserver* iCommandObserver; - - /** - * Font - * Not own - */ - const CFont* iFont; - - /** - * Status of highlighted item. - */ - TBool iHighlightedItem; - - /** - * Id for icon bitmap - */ - TInt iIconId; - - /** - * Id for icon mask - */ - TInt iMaskId; - - /** - * Icon. - * Own. - */ - CGulIcon* iIcon; - - /** - * Layout for icon - */ - // TAknLayoutRect iBitmapLayout; - - /** - * Variant, - * 0 = icon and text - * 1 = icon, text and function link - */ - TInt iVariant; - - /** - * Popup controller - * Own. - */ - // CAknPreviewPopUpController* iController; - - /** - * Rect for link - */ - TRect iLinkRect; - }; - - -#endif // CBATTERYPOPUPCONTROL_H - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batterypopupcontrol/inc/trace.h --- a/coreapplicationuis/powersaveutilities/batterypopupcontrol/inc/trace.h Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,378 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Battery Popup Control trace definitions. -* -*/ - - -#ifndef TRACE_H -#define TRACE_H - -#include "traceconfiguration.hrh" - -#ifdef TRACE_INTO_FILE -#include // RFileLogger -#else -#include // RDebug -#endif - -//----------------------------------------------------------------------------- -// Constants -//----------------------------------------------------------------------------- -// - -/** -* Prefix trace macro to complete tracing with component name. -* Returns TDesC which can be used directly with RDebug or RFileLogger. -*/ -#define _PREFIX_TRACE( aMsg ) TPtrC( (const TText*)L"[BatteryPopupControl]: " L##aMsg ) - -/** -* Prefix error trace -*/ -#define _PREFIX_ERROR( aMsg ) _PREFIX_TRACE( "[ERROR: %d]: " L##aMsg ) - -/** -* Prefix info trace. -*/ -#define _PREFIX_INFO( aMsg ) _PREFIX_TRACE( "[INFO]: " L##aMsg ) - -/** -* Prefix macro for strings -*/ -#define _PREFIX_CHAR( aMsg ) (const char*)"[BatteryPopupControl]: " ##aMsg - -/** -* Define needed directories if TRACE_INTO_FILE macro in use -*/ -#ifdef TRACE_INTO_FILE - - _LIT( KDir, "BatteryPopupControl" ); - _LIT( KFile, "BatteryPopupControl_log.txt" ); - _LIT( KFullPath, "c:\\logs\\BatteryPopupControl\\" ); - -#endif - -//----------------------------------------------------------------------------- -// Error trace macros -//----------------------------------------------------------------------------- -// -#ifdef ERROR_TRACE - - /** - * Error trace definitions. - */ - #ifdef TRACE_INTO_FILE - - #define ERROR( aErr, aMsg )\ - {\ - if( aErr < KErrNone )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr );\ - }\ - } - #define ERROR_1( aErr, aMsg, aP1 )\ - {\ - if( aErr < KErrNone )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1 );\ - }\ - } - #define ERROR_2( aErr, aMsg, aP1, aP2 )\ - {\ - if( aErr < KErrNone )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\ - }\ - } - #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\ - {\ - if( aErr < KErrNone )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\ - }\ - } - - #else//TRACE_INTO_FILE not defined - - #define ERROR( aErr, aMsg )\ - {\ - if( aErr < KErrNone )\ - {\ - RDebug::Print( _PREFIX_ERROR( aMsg ), aErr );\ - }\ - } - #define ERROR_1( aErr, aMsg, aP1 )\ - {\ - if( aErr < KErrNone )\ - {\ - RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1 );\ - }\ - } - #define ERROR_2( aErr, aMsg, aP1, aP2 )\ - {\ - if( aErr < KErrNone )\ - {\ - RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2 );\ - }\ - } - #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 )\ - {\ - if( aErr < KErrNone )\ - {\ - RDebug::Print( _PREFIX_ERROR( aMsg ), aErr, aP1, aP2, aP3 );\ - }\ - } - - #endif//TRACE_INTO_FILE - - #define ERROR_GEN( aMsg ) ERROR( KErrGeneral, aMsg ) - #define ERROR_GEN_1( aMsg, aP1 ) ERROR_1( KErrGeneral, aMsg, aP1 ) - #define ERROR_GEN_2( aMsg, aP1, aP2 ) ERROR_2( KErrGeneral, aMsg, aP1, aP2 ) - #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) ERROR_3( KErrGeneral, aMsg, aP1, aP3 ) - -#else//ERROR_TRACE not defined - - #define ERROR( aErr, aMsg ) - #define ERROR_1( aErr, aMsg, aP1 ) - #define ERROR_2( aErr, aMsg, aP1, aP2 ) - #define ERROR_3( aErr, aMsg, aP1, aP2, aP3 ) - #define ERROR_GEN( aMsg ) - #define ERROR_GEN_1( aMsg, aP1 ) - #define ERROR_GEN_2( aMsg, aP1, aP2 ) - #define ERROR_GEN_3( aMsg, aP1, aP2, aP3 ) - -#endif//ERROR_TRACE - -//----------------------------------------------------------------------------- -// Info trace macros -//----------------------------------------------------------------------------- -// -#ifdef INFO_TRACE - - /** - * Info log message definitions. - */ - #ifdef TRACE_INTO_FILE - - #define INFO( aMsg )\ - {\ - RFileLogger::Write( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ) );\ - } - #define INFO_1( aMsg, aP1 )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1 );\ - } - #define INFO_2( aMsg, aP1, aP2 )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2 );\ - } - #define INFO_3( aMsg, aP1, aP2, aP3 )\ - {\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\ - } - - #else//TRACE_INTO_FILE not defined - - #define INFO( aMsg )\ - {\ - RDebug::Print( _PREFIX_INFO( aMsg ) );\ - } - #define INFO_1( aMsg, aP1 )\ - {\ - RDebug::Print( _PREFIX_INFO( aMsg ), aP1 );\ - } - #define INFO_2( aMsg, aP1, aP2 )\ - {\ - RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2 );\ - } - #define INFO_3( aMsg, aP1, aP2, aP3 )\ - {\ - RDebug::Print( _PREFIX_INFO( aMsg ), aP1, aP2, aP3 );\ - } - - #endif//TRACE_INTO_FILE - -#else//INFO_TRACE not defined - - #define INFO( aMsg ) - #define INFO_1( aMsg, aP1 ) - #define INFO_2( aMsg, aP1, aP2 ) - #define INFO_3( aMsg, aP1, aP2, aP3 ) - -#endif//INFO_TRACE - -//----------------------------------------------------------------------------- -// Trace current client thread name and process id -//----------------------------------------------------------------------------- -// -#ifdef CLIENT_TRACE - - #define CLIENT( aMessage )\ - {\ - RThread thread;\ - TInt err = aMessage.Client( thread );\ - if( err == KErrNone )\ - {\ - RProcess process;\ - err = thread.Process( process );\ - if( err == KErrNone )\ - {\ - TPtrC thredName( thread.Name() );\ - TUid processUid( process.SecureId() );\ - INFO_2( "Current client process UID: [%x], thread name: [%S]",\ - processUid,\ - &thredName );\ - }\ - process.Close();\ - }\ - thread.Close();\ - } - -#else - - #define CLIENT( aMessage ) - -#endif - -//----------------------------------------------------------------------------- -// Function trace macros -//----------------------------------------------------------------------------- -// -#ifdef FUNC_TRACE - - /** - * Function logging definitions. - */ - #ifdef TRACE_INTO_FILE - - #define FUNC( aMsg, aP1 )\ - {\ - TPtrC8 trace( _S8( aMsg ) );\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend, trace, aP1 );\ - }\ - - #else//TRACE_INTO_FILE not defined - - #define FUNC( aMsg, aP1 )\ - {\ - RDebug::Printf( aMsg, aP1 );\ - }\ - - #endif//TRACE_INTO_FILE - - /** - * Function trace helper class. - * - * NOTE: - * LC -methods cannot be trapped. Therefore if LC -method leaves - * END trace is used instead of LEAVE trace. - * If you have an idea how to round this problem please tell. - */ - _LIT8( KFuncNameTerminator, "(" ); - _LIT8( KFuncLeavePatternL, "L" ); - class TFuncLog - { - public: - static void Cleanup( TAny* aPtr ) - { - TFuncLog* self = static_cast< TFuncLog* >( aPtr ); - self->iLeft = ETrue; - FUNC( _PREFIX_CHAR("%S-LEAVE"), &self->iFunc ); // Leave detected - } - inline TFuncLog( const char* aFunc ) : - iFunc( aFunc ? _S8( aFunc ) : _S8("") ), - iLeft( EFalse ), - iCleanupItem( Cleanup, this ), - iCanLeave( EFalse ) - { - TInt pos( iFunc.Find( KFuncNameTerminator ) ); - if( pos != KErrNotFound ) - { - iFunc.Set( iFunc.Left( pos ) ); - iCanLeave = !iFunc.Right( KFuncLeavePatternL().Length() ).Compare( KFuncLeavePatternL ); - if ( iCanLeave ) - { - CleanupStack::PushL( iCleanupItem ); // Ignore warnings - } - } - FUNC( _PREFIX_CHAR("%S-START"), &iFunc ); - } - - inline ~TFuncLog() - { - if ( !iLeft ) - { - if ( iCanLeave ) - { - CleanupStack::Pop( this ); // Pop the cleanup item - } - FUNC( _PREFIX_CHAR("%S-END"), &iFunc ); // Normally finished - } - } - - private: // Data - TPtrC8 iFunc; - TBool iLeft; - TCleanupItem iCleanupItem; - TBool iCanLeave; - }; - #define FUNC_LOG TFuncLog _fl( __PRETTY_FUNCTION__ ); - -#else//FUNC_TRACE not defined - - #define FUNC_LOG - -#endif//FUNC_TRACE - -//----------------------------------------------------------------------------- -// Timestamp trace macros -//----------------------------------------------------------------------------- -// -#ifdef TIMESTAMP_TRACE - - #ifdef TRACE_INTO_FILE - - #define TIMESTAMP( aCaption )\ - {\ - TTime t;\ - t.HomeTime();\ - TDateTime dt = t.DateTime();\ - _LIT( KCaption, aCaption );\ - RFileLogger::WriteFormat( KDir, KFile, EFileLoggingModeAppend,\ - _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\ - &KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\ - } - - #else//TRACE_INTO_FILE not defined - - #define TIMESTAMP( aCaption )\ - {\ - TTime t;\ - t.HomeTime();\ - TDateTime dt = t.DateTime();\ - _LIT( KCaption, aCaption );\ - RDebug::Print( _PREFIX_TRACE("[TIMESTAMP] %S %d:%02d:%02d.%d us"),\ - &KCaption, dt.Hour(), dt.Minute(), dt.Second(), dt.MicroSecond() );\ - } - - #endif//TRACE_INTO_FILE - -#else//TIMESTAMP_TRACE not defined - - #define TIMESTAMP( aCaption ) - -#endif//TIMESTAMP_TRACE - -#endif diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batterypopupcontrol/inc/traceconfiguration.hrh --- a/coreapplicationuis/powersaveutilities/batterypopupcontrol/inc/traceconfiguration.hrh Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,77 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Trace configuration for Battery Popup Control -* -*/ - - -#ifndef TRACECONFIGURATION_HRH -#define TRACECONFIGURATION_HRH - -//----------------------------------------------------------------------------- -// Trace definitions -//----------------------------------------------------------------------------- -// - -/** -* Error trace enabled -*/ -#ifdef _DEBUG - #define ERROR_TRACE -#else - #undef ERROR_TRACE -#endif - -/** -* Info trace enabled -*/ -#ifdef _DEBUG - #define INFO_TRACE -#else - #undef INFO_TRACE -#endif - -/** -* Function trace enabled -*/ -#ifdef _DEBUG - #define FUNC_TRACE -#else - #undef FUNC_TRACE -#endif - -/** -* Timestamp tracing on -*/ -#ifdef _DEBUG - #define TIMESTAMP_TRACE -#else - #undef TIMESTAMP_TRACE -#endif - -/** -* Tracing current client process and thread -*/ -#ifdef _DEBUG - #define CLIENT_TRACE -#else - #undef CLIENT_TRACE -#endif - -/** -* Tracing into file enabled, default RDebug -*/ -#undef TRACE_INTO_FILE - -#endif \ No newline at end of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/batterypopupcontrol/src/batterypopupcontrol.cpp --- a/coreapplicationuis/powersaveutilities/batterypopupcontrol/src/batterypopupcontrol.cpp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,589 +0,0 @@ -/* -* Copyright (c) 2007-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: BatteryPopupControl implementation -* -*/ - - -//#include -//#include -//#include -//#include -#include // TResourceReader -#include -#include -//#include -//#include -//#include -//#include -#include // KDC_RESOURCE_FILES_DIR -#include -// ----------- Touch feedback additions start -#ifdef RD_TACTILE_FEEDBACK -#include -#endif //RD_TACTILE_FEEDBACK -// ----------- Touch feedback additions end -#include -#include "batterypopupcontrol.h" -#include "trace.h" - -// Constants -//const TInt KPopupShowDelay = 0; // Show immediately -//const TInt KPopupHideDelay = 3000000; // hide after 3 sec -//const TInt KMaxLinkTextLength = 255; - -// ======== MEMBER FUNCTIONS ======== - -// ----------------------------------------------------------------------------- -// Default constructor. -// ----------------------------------------------------------------------------- -// -CBatteryPopupControl::CBatteryPopupControl(): - iHighlightedItem( EFalse ) - { - FUNC_LOG - } - -// ----------------------------------------------------------------------------- -// CBatteryPopupControl::NewL -// ----------------------------------------------------------------------------- -// -EXPORT_C CBatteryPopupControl* CBatteryPopupControl::NewL( - const TDesC& aContentText, - const TDesC& aLinkText ) - { - FUNC_LOG - CBatteryPopupControl* self = - new ( ELeave ) CBatteryPopupControl(); - - CleanupStack::PushL( self ); - self->ConstructL( aContentText, aLinkText ); - CleanupStack::Pop( self ); - return self; - } - -// ----------------------------------------------------------------------------- -// Destructor -// ----------------------------------------------------------------------------- -// -EXPORT_C CBatteryPopupControl::~CBatteryPopupControl() - { - FUNC_LOG - // delete iController; - delete iText; - delete iIcon; - delete iLinkText; - } - -// ----------------------------------------------------------------------------- -// CBatteryPopupControl::SetCommandObserver -// ----------------------------------------------------------------------------- -// -EXPORT_C void CBatteryPopupControl::SetCommandObserver( - MEikCommandObserver& aCommandObserver ) - { - FUNC_LOG - iCommandObserver = &aCommandObserver; - } - -// ----------------------------------------------------------------------------- -// CBatteryPopupControl::ShowPopUpL -// ----------------------------------------------------------------------------- -// -EXPORT_C void CBatteryPopupControl::ShowPopUpL() - { - FUNC_LOG - - /* iController = CAknPreviewPopUpController::NewL( *this, CAknPreviewPopUpController::ELayoutDefault | CAknPreviewPopUpController::EDontClose ); - iController->AddObserverL( *this ); - - // Set popup's hide/show delays - iController->SetPopUpShowDelay( KPopupShowDelay ); - iController->SetPopUpHideDelay( KPopupHideDelay ); - - // Position - TPoint uipRect; - if( AknLayoutUtils::LayoutMetricsPosition( - AknLayoutUtils::EBatteryPane, uipRect ) ) - { - iController->SetPosition( uipRect ); - } - - // Launch - iController->ShowPopUp(); */ - } - -// ----------------------------------------------------------------------------- -// From class CCoeControl. -// CBatteryPopupControl::HandleResourceChange -// ----------------------------------------------------------------------------- -// -void CBatteryPopupControl::HandleResourceChange( - TInt aType ) - { - FUNC_LOG - - /* CCoeControl::HandleResourceChange( aType ); - if ( aType == KEikDynamicLayoutVariantSwitch ) - { - SizeChanged(); - }*/ - } - - -// ----------------------------------------------------------------------------- -// From class CCoeControl. -// CBatteryPopupControl::SetContainerWindowL -// ----------------------------------------------------------------------------- -// -void CBatteryPopupControl::SetContainerWindowL( - const CCoeControl& aContainer ) - { - FUNC_LOG - - // CCoeControl::SetContainerWindowL( aContainer ); - - if( iText ) - { - iText->SetContainerWindowL( aContainer ); - } - } - -// ----------------------------------------------------------------------------- -// From class MCoeControlObserver. -// CBatteryPopupControl::HandleControlEventL -// ----------------------------------------------------------------------------- -// -void CBatteryPopupControl::HandleControlEventL( - CCoeControl* /*aControl*/, - TCoeEvent /*aEventType*/ ) - { - FUNC_LOG - } -// --------------------------------------------------------------------------- -// From MAknPreviewPopUpObserver -// --------------------------------------------------------------------------- -// -/* -void CBatteryPopupControl::HandlePreviewPopUpEventL( - CAknPreviewPopUpController aController, - TPreviewPopUpEvent aEvent ) - { - FUNC_LOG - - switch ( aEvent ) - { - case EPreviewPopUpShown: - AknGlobalPopupPriorityController::ShowPopup( *this, ETrue ); - break; - case EPreviewPopUpHidden: - AknGlobalPopupPriorityController::RemovePopupPriority( *this ); - break; - } - } - */ -// ----------------------------------------------------------------------------- -// CAknStylusActivatedPopUpContent::ConstructL -// ----------------------------------------------------------------------------- -// -void CBatteryPopupControl::ConstructL( const TDesC& aContentText, - const TDesC& aLinkText ) - { - FUNC_LOG - - if( aContentText != KNullDesC ) - { - iText = new ( ELeave ) CEikLabel; - iText->SetTextL( aContentText ); - CreateIconL(); - } - - if( aLinkText != KNullDesC ) - { - // Check if only link is displayed. - if( aContentText != KNullDesC ) - { - iVariant = EVariantIconTextLink; - } - iLinkText = aLinkText.AllocL(); - } - /* - TRect rectPopUpWindow = PopUpWindowRectFromLayout( - AknLayoutScalable_Avkon::popup_battery_window( iVariant ) ); - - TAknWindowComponentLayout infoPaneLayout = - AknLayoutScalable_Avkon::bg_popup_sub_pane_cp25( iVariant ); - - TRect rectInfoPane = RectFromLayout( rectPopUpWindow, infoPaneLayout ); - - TAknTextComponentLayout textLayout = - AknLayoutScalable_Avkon::popup_battery_window_t1( iVariant ); - TAknLayoutText textRect; - textRect.LayoutText( rectPopUpWindow, textLayout ); - */ - // Font for command links - // iFont = textRect.Font(); - } - -// ----------------------------------------------------------------------------- -// From class CCoeControl. -// CBatteryPopupControl::ComponentControl -// ----------------------------------------------------------------------------- -// -CCoeControl* CBatteryPopupControl::ComponentControl( - TInt aIndex ) const - { - FUNC_LOG - switch ( aIndex ) - { - case 0: - { - if( iText ) - { - return iText; - } - } - default: - // __ASSERT_ALWAYS( aIndex >= 0, User::Panic( - // _L("CBatteryPopupControl::ComponentControl"), EAknPanicOutOfRange ) ); - return NULL; - } - } - - -// ----------------------------------------------------------------------------- -// From class CCoeControl. -// CBatteryPopupControl::CountComponentControls -// ----------------------------------------------------------------------------- -// -TInt CBatteryPopupControl::CountComponentControls() const - { - FUNC_LOG - TInt count = 0; - - if( iText ) - { - count++; - } - - return count; - } - - -// ----------------------------------------------------------------------------- -// From class CCoeControl. -// CBatteryPopupControl::Draw -// ----------------------------------------------------------------------------- -// -void CBatteryPopupControl::Draw( const TRect& /*aRect*/ ) const - { - FUNC_LOG - - /* CWindowGc& gc = SystemGc(); - MAknsSkinInstance* skin = AknsUtils::SkinInstance(); - - if( iIcon ) - { - CFbsBitmap* bmp = NULL; - TRgb color( KRgbWhite ); // Default never used - bmp = AknsUtils::GetCachedBitmap( skin, KAknsIIDQsnComponentColorBmpCG2 ); - AknsUtils::GetCachedColor( skin, color, - KAknsIIDQsnComponentColors, EAknsCIQsnComponentColorsCG2 ); - - AknIconUtils::SetSize( iIcon->Mask(), iBitmapLayout.Rect().Size() ); - if ( bmp ) - { - iBitmapLayout.DrawImage( gc, bmp, iIcon->Mask() ); - } - else - { - AknIconUtils::SetSize( iIcon->Bitmap(), iBitmapLayout.Rect().Size() ); - bmp = iIcon->Bitmap(); - iBitmapLayout.DrawImage( gc, bmp, iIcon->Mask() ); - } - gc.Reset(); - } - TRgb textColor; - AknsUtils::GetCachedColor( skin, textColor, KAknsIIDQsnHighlightColors, - EAknsCIQsnHighlightColorsCG3 ); - - gc.SetPenStyle( CGraphicsContext::ESolidPen ); - gc.SetPenColor( textColor ); - - const CFont* font = iFont; - if ( !font ) - { - font = iCoeEnv->NormalFont(); - } - gc.UseFont( font ); - - gc.SetUnderlineStyle( EUnderlineOn ); - if(iLinkText) - { - TRect rect( iLinkRect ); - if ( Background() ) - { - Background()->Draw( gc, *this, rect ); - } - - // buffer for visually ordered text - HBufC* visualText = NULL; - TRAPD( err, visualText = HBufC::NewL( KMaxLinkTextLength + - KAknBidiExtraSpacePerLine ) ); - if ( err != KErrNone ) - { - return; - } - TPtr ptr = visualText->Des(); - TInt clipWidth = rect.Width(); - - if ( iHighlightedItem ) - { - TRgb highlightcolor = AKN_LAF_COLOR( 244 ); - AknsUtils::GetCachedColor( skin, highlightcolor, - KAknsIIDQsnHighlightColors, EAknsCIQsnHighlightColorsCG1 ); - - gc.SetBrushColor( highlightcolor ); - gc.SetBrushStyle( CGraphicsContext::ESolidBrush ); - } - else - { - gc.SetBrushStyle( CGraphicsContext::ENullBrush ); - } - - // bidi processing - using AknBidiTextUtils. - AknBidiTextUtils::ConvertToVisualAndClip( - *(iLinkText), - ptr, - *font, - clipWidth, - clipWidth ); - - TInt baselineOffset = 0; - baselineOffset = font->AscentInPixels() + - ( rect.Height() - font->AscentInPixels() ) / 2; - gc.DrawText( ptr, rect, baselineOffset, - CGraphicsContext::ELeft ); - delete visualText; - }*/ - } - - -// ----------------------------------------------------------------------------- -// From class CCoeControl. -// CBatteryPopupControl::MinimumSize -// ----------------------------------------------------------------------------- -// -TSize CBatteryPopupControl::MinimumSize() - { - FUNC_LOG - TInt nbrOfInfoLines = 0; - TInt minWidth = 0; - - if( iText ) - { - nbrOfInfoLines = iText->NumberOfLines(); - CEikLabel* textLabel; - for ( TInt i=0; i < nbrOfInfoLines; i++ ) - { - textLabel = iText; - TPtrC ptrText = ( *textLabel->Text() ); - minWidth = Max( textLabel->CalcMinimumSize( ptrText ).iWidth, minWidth ); - } - } - if(iLinkText) - { - TInt tempWidth = iFont->TextWidthInPixels( *( iLinkText ) ); - minWidth = Max( minWidth, tempWidth ); - } - // TInt rectWidth = 0; - -/* TAknWindowComponentLayout infoPaneLayout = - AknLayoutScalable_Avkon::bg_popup_sub_pane_cp25( iVariant ); - - TRect rectPopUpWindow = PopUpWindowRectFromLayout( - AknLayoutScalable_Avkon::popup_battery_window( iVariant ) ); - - TRect rectInfoPane = RectFromLayout( rectPopUpWindow, infoPaneLayout ); - - rectWidth = Max( rectInfoPane.Width(), minWidth ); - - TInt rectHeight = rectInfoPane.Height();*/ - - // return TSize( rectWidth, rectHeight ); - } - - -// ----------------------------------------------------------------------------- -// From class CCoeControl. -// CBatteryPopupControl::SizeChanged -// ----------------------------------------------------------------------------- -// -void CBatteryPopupControl::SizeChanged() - { - FUNC_LOG - // Get popup window rect - /* TRect rectPopUpWindow = PopUpWindowRectFromLayout( - AknLayoutScalable_Avkon::bg_popup_sub_pane_cp25( iVariant ) ); - - // Get pane icon and text layouts - TAknWindowLineLayout paneIconLayout( - AknLayoutScalable_Avkon::popup_battery_window_g1(iVariant)); - - //Set icon and text rects - if( iIcon ) - { - iBitmapLayout.LayoutRect( rectPopUpWindow, paneIconLayout ); - } - - if( iText ) - { - TAknTextComponentLayout textLayout = - AknLayoutScalable_Avkon::popup_battery_window_t1( iVariant ); - - TAknLayoutText textRect; - textRect.LayoutText( rectPopUpWindow, textLayout ); - - iText->SetRect( textRect.TextRect() ); - // Set text font - iText->SetFont( textRect.Font() ); - } - - // Set link text rect - if( iLinkText ) - { - TAknLayoutText linkLayoutText; - // popup_battery_window_t2 doesn't have other variants as EVariantIconTextLink - linkLayoutText.LayoutText( rectPopUpWindow, - AknLayoutScalable_Avkon::popup_battery_window_t2( EVariantIconTextLink ) ); - - iFont = linkLayoutText.Font(); - - TInt tempWidth = iFont->TextWidthInPixels( *(iLinkText) ); - TRect tempRect; - - if( iText ) - { - tempRect = TRect( linkLayoutText.TextRect() ); - } - else - { - TAknLayoutRect linkLayout; - - linkLayout.LayoutRect( rectPopUpWindow, paneIconLayout ); - - tempRect = TRect( linkLayout.Rect() ); - } - tempRect.SetWidth( tempWidth ); - iLinkRect = tempRect; - }*/ - } - -// ----------------------------------------------------------------------------- -// RectFromLayout -// ----------------------------------------------------------------------------- -// -/*TRect CBatteryPopupControl::RectFromLayout( const TRect& aParent, - const TAknWindowComponentLayout& aComponentLayout ) const - { - TAknWindowLineLayout lineLayout = aComponentLayout.LayoutLine(); - TAknLayoutRect layoutRect; - layoutRect.LayoutRect( aParent, lineLayout ); - return layoutRect.Rect(); - }*/ - -// ----------------------------------------------------------------------------- -// PopUpWindowRectFromLayout -// ----------------------------------------------------------------------------- -// -/*TRect CBatteryPopupControl::PopUpWindowRectFromLayout( const - TAknWindowComponentLayout& aComponentLayout ) const - { - FUNC_LOG - // get popup window width from the widest variety - TAknWindowLineLayout lineLayout = aComponentLayout.LayoutLine(); - - lineLayout.iW = AknLayoutScalable_Avkon:: - popup_battery_window( iVariant ).LayoutLine().iW; - TAknLayoutRect layoutRect; - layoutRect.LayoutRect( iAvkonAppUi->ApplicationRect(), lineLayout ); - - return layoutRect.Rect(); - }*/ - -// ----------------------------------------------------------------------------- -// From class CCoeControl -// CBatteryPopupControl::HandlePointerEventL -// ----------------------------------------------------------------------------- -// -void CBatteryPopupControl::HandlePointerEventL( - const TPointerEvent& aPointerEvent ) - { - FUNC_LOG - if(iLinkText) - { - if ( iLinkRect.Contains( aPointerEvent.iPosition ) ) - { - if ( !iHighlightedItem ) - { - iHighlightedItem = ETrue; - // DrawNow( iLinkRect ); - } -#ifdef RD_TACTILE_FEEDBACK - if ( aPointerEvent.iType == TPointerEvent::EButton1Down ) - { - MTouchFeedback* feedback = MTouchFeedback::Instance(); - - if ( feedback ) - { - feedback->InstantFeedback( ETouchFeedbackBasic ); - } - } -#endif // RD_TACTILE_FEEDBACK - // Nofity command observer - if ( aPointerEvent.iType == TPointerEvent::EButton1Up ) - { - // iCommandObserver->ProcessCommandL( ELinkFirst ); - iHighlightedItem = EFalse; - } - } - } - } -// ----------------------------------------------------------------------------- -// CBatteryPopupControl::CreateIconL() -// -// -// ----------------------------------------------------------------------------- -// -void CBatteryPopupControl::CreateIconL( ) - { - FUNC_LOG - - TParse* fp = new( ELeave ) TParse(); - CleanupStack::PushL( fp ); - _LIT( KBIPPluginIconDirAndName, "z:\\resource\\apps\\batterypopupcontrol.mif"); - fp->Set( KBIPPluginIconDirAndName, &KDC_BITMAP_DIR, NULL ); - - delete iIcon; - iIcon = NULL; - - /* iIcon = AknsUtils::CreateGulIconL( AknsUtils::SkinInstance(), - KAknsIIDQgnPropBatteryIcon, - fp->FullName(), - EMbmBatterypopupcontrolQgn_prop_battery_ps_deactivate, - EMbmBatterypopupcontrolQgn_prop_battery_ps_deactivate_mask ); -*/ - CleanupStack::PopAndDestroy( fp ); - } -// End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/bsutil/group/BSUtil.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/bsutil/group/BSUtil.mmp Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,46 @@ +/* +* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Project definition file for project BSUtil +* +*/ + + +#include + +TARGET bsutil.dll +TARGETTYPE dll + +UID 0x1000008D 0x2000B5E2 + +VENDORID VID_DEFAULT + +CAPABILITY CAP_GENERAL_DLL + +#if defined( ARMCC ) + deffile ../../EABI/BSUtil.DEF +#elif defined( WINSCW ) + deffile ../../BWINS/BSUtil.DEF +#endif + +SOURCEPATH ../src +SOURCE bsutil.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE + +LIBRARY euser.lib +LIBRARY centralrepository.lib + +LANG SC diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/bsutil/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/bsutil/group/bld.inf Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: Battery state utility build file. +* +*/ + + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS + +../inc/bsutil.h |../../../inc/bsutil.h +../rom/powersaveutilities.iby CORE_MW_LAYER_IBY_EXPORT_PATH(powersaveutilities.iby) + + +PRJ_MMPFILES +BSUtil.mmp + +PRJ_EXTENSIONS + + + +// End of File \ No newline at end of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/bsutil/rom/powersaveutilities.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/bsutil/rom/powersaveutilities.iby Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,25 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* +* +*/ + + +#ifndef __POWERSAVEUTILITIES_IBY__ +#define __POWERSAVEUTILITIES_IBY__ + +file=ABI_DIR\BUILD_DIR\BSUtil.dll SHARED_LIB_DIR\BSUtil.dll + +#endif // __POWERSAVEUTILITIES_IBY__ + diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/conf/powersaveutilities.confml Binary file coreapplicationuis/powersaveutilities/conf/powersaveutilities.confml has changed diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/conf/powersaveutilities_2000B5E3.crml Binary file coreapplicationuis/powersaveutilities/conf/powersaveutilities_2000B5E3.crml has changed diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/conf/powersaveutilities_2001011A.crml Binary file coreapplicationuis/powersaveutilities/conf/powersaveutilities_2001011A.crml has changed diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/cppsmplugin/cppsmplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/cppsmplugin/cppsmplugin.pro Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,66 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: Project file for the RFS Plugin. It creates the bld.inf and .mmp file on executing +# qmake command. +# +# + +TEMPLATE = lib +TARGET = cppsmplugin +DEPENDPATH += . inc src +INCLUDEPATH += . +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + +CONFIG += hb\ + plugin + +MOC_DIR = moc +OBJECTS_DIR = obj +RCC_DIR = rcc + +# Platforms +SYMBIAN_PLATFORMS = WINSCW \ + ARMV5 + +LIBS += -lcpframework -lpsmclient -lcentralrepository -lcenrepnotifhandler +HEADERS += src/cppsmplugin.h \ + src/cppsmview.h + +SOURCES += src/cppsmplugin.cpp \ + src/cppsmview.cpp + +symbian: { + TARGET.EPOCALLOWDLLDATA = 1 + DEFINES += PLUGINUID3=0x2000E51E + TARGET.UID3 = 0x2000E51E +} + +symbian { + deploy.path = C: + qtplugins.path = /resource/qt/plugins/controlpanel + qtplugins.sources += qmakepluginstubs/cppsmplugin.qtplugin + # This is for new exporting system coming in garden + for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin $$deploy.path$$qtplugins.path/$$basename(qtplugin)" +} +# common translation file for all plugins +TRANSLATIONS = powermanagement.ts + +# Build.inf rules +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "rom/cppsmplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(cppsmplugin.iby)" \ + ".\rom\cppsmplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(cppsmplugin_resources.iby)" +TARGET.CAPABILITY = All -TCB +plugin.sources = cppsmplugin.dll +plugin.path = \resource\qt\plugins\controlpanel +DEPLOYMENT += plugin diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/cppsmplugin/rom/cppsmplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/cppsmplugin/rom/cppsmplugin.iby Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,26 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef __CPPSMPLUGIN_IBY__ +#define __CPPSMPLUGIN_IBY__ + +#include +file=ABI_DIR\BUILD_DIR\cppsmplugin.dll SHARED_LIB_DIR\cppsmplugin.dll +//data=\epoc32\release\winscw\udeb\z\resource\qt\translations\powermanagement_en.qm resource\qt\translations\powermanagement_en.qm +data=\epoc32\data\c\resource\qt\plugins\controlpanel\cppsmplugin.qtplugin resource\qt\plugins\controlpanel\cppsmplugin.qtplugin + +#endif diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/cppsmplugin/rom/cppsmplugin_resources.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/cppsmplugin/rom/cppsmplugin_resources.iby Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,27 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ + +#ifndef __CPPSMPLUGIN_RESOURCES_IBY__ +#define __CPPSMPLUGIN_RESOURCES_IBY__ + +//this iby is required for language specific things to be exported to Language iby layer +#include + +data=DATAZ_\QT_TRANSLATIONS_DIR\powermanagement.qm QT_TRANSLATIONS_DIR\powermanagement.qm + + +#endif //__CPPSMPLUGIN_RESOURCES_IBY__ diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmplugin.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#include "cppsmplugin.h" +#include "cppsmview.h" +#include +#include + + +CpPsmPlugin::CpPsmPlugin() +{ + RDebug::Print( _L("CpPsmPlugin::constructor:Begin") ); + iTrans=new HbTranslator("powermanagement"); + RDebug::Print( _L("CpPsmPlugin::constructor:end") ); +} + +CpPsmPlugin::~CpPsmPlugin() +{ + RDebug::Print( _L("CpPsmPlugin::destructor:Begin") ); + delete iTrans; + RDebug::Print( _L("CpPsmPlugin::destructor:end")); +} +QList CpPsmPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +{ + //QList is represented as an array of pointers to items of type T,here T is CpSettingFormItemData + //and here the << function is used which appends object to the list + RDebug::Print( _L("CpPsmPlugin::createSettingFormItemData:Begin") ); + return QList() + << new CpSettingFormEntryItemDataImpl( + itemDataHelper, + hbTrId("txt_power_management_subhead_power_management"), + hbTrId("txt_power_list_power_save_mode"), + QString("qtg_large_power_management")); + +} + +CpBaseSettingView *CpPsmPlugin::createSettingView(const QVariant &hint) const +{ + RDebug::Print( _L("CpPsmPlugin::createSettingView:Begin") ); + if (hint.toString().compare("psm_view",Qt::CaseInsensitive) == 0) { + return new CpPsmView; + } + RDebug::Print( _L("CpPsmPlugin::createSettingView:end") ); + return 0; +} + +Q_EXPORT_PLUGIN2(cppsmplugin, CpPsmPlugin); diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmplugin.h Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,44 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef CPPSMPLUGIN_H +#define CPPSMPLUGIN_H + +#include +#include +#include +#include + +class CpBaseSettingView; +class QVariant; + +class CpPsmPlugin : public QObject, public CpPluginInterface,public CpLauncherInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginInterface) + Q_INTERFACES(CpLauncherInterface) +public: + CpPsmPlugin(); + virtual ~CpPsmPlugin(); + //from CpPluginInterface + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; + //from CpLauncherInterface + virtual CpBaseSettingView *createSettingView(const QVariant &hint) const; +private: + HbTranslator* iTrans; +}; + +#endif //CPPSMPLUGIN_H diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmview.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,204 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#include "cppsmview.h" +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + +CpPsmView::CpPsmView(QGraphicsItem *parent) : + CpBaseSettingView(0,parent),iCheckBoxItem(0),iTrans(new HbTranslator("powermanagement")) +{ + RDebug::Print( _L("CpPsmView::CpPsmView:Begin") ); + iForm = new HbDataForm(); + iModel = new HbDataFormModel(); + iForm->setHeading(hbTrId("txt_power_management_subhead_power_management")); + //our view has 3 items first one being toggle button for enabling and disabling PSM + iPowerSaveMode = iModel->appendDataFormItem(HbDataFormModelItem::ToggleValueItem, + hbTrId("txt_power_list_power_save_mode")); + iPsmClient = CPsmClient::NewL( *this ); + iPsmClient->RequestPowerSaveModeNotification(); + TInt mode; + TInt err = iPsmClient->PsmSettings().GetCurrentMode( mode ); + //setting of toggle value to on or off depends on the current mode + if( mode == EPsmsrvModePowerSave ) + { + iPowerSaveMode->setContentWidgetData(QString("text"), hbTrId("txt_power_setlabel_val_off")); + } + else + { + iPowerSaveMode->setContentWidgetData(QString("text"), hbTrId("txt_power_setlabel_val_on")); + } + + iForm->addConnection(iPowerSaveMode,SIGNAL(clicked()), this,SLOT(toggleChange())); + + RDebug::Print( _L("CpPsmView::toggle button added") ); + //this is the second item which is a text item which is readonly and describes what PSM does + HbDataFormModelItem *dataItem2 = iModel->appendDataFormItem(HbDataFormModelItem::TextItem); + //setting the maxrows property of hblineedit + dataItem2->setContentWidgetData("maxRows",11); + //setting the text property of hblineedit + dataItem2->setContentWidgetData("text",hbTrId("txt_power_list_activating_power_save_mode_will_con")); + dataItem2->setContentWidgetData("readOnly" , true); + RDebug::Print( _L("CpPsmView::text item added") ); + + //now the third item which is checkbox item for enabling psm automatically when low power + iCheckBoxItem = iModel->appendDataFormItem( + HbDataFormModelItem::CheckBoxItem); + //setting the text property of check box. + iCheckBoxItem->setContentWidgetData("text",hbTrId("txt_power_list_activate_power_save_mode_automatica")); + RDebug::Print( _L("CpPsmView::check box added") ); + + CRepository* repository( NULL ); + TRAPD(err1,repository =CRepository::NewL(KCRUidDeviceManagementSettings)); + TInt value; + err1 = repository->Get( KSettingsPowerSavingQuery, value ); + + if ( err1 == KErrNone ) + { + //checkbox state is initialised based on cenrep key and default value of the key is 1 (meaning unchecked) + if(value==0) + { + RDebug::Print( _L("CpPsmView::checkbox state is checked ") ); + iCheckBoxItem->setContentWidgetData("checkState",2); + } + } + delete repository; + iForm->addConnection(iCheckBoxItem,SIGNAL(stateChanged(int)),this,SLOT(checkBoxStateChanged(int))); + + + err = iPsmClient->PsmSettings().GetCurrentMode( mode ); + + if ( err == KErrNone && mode == EPsmsrvModePowerSave ) + { + //if device is in powersavemode then disable the checkbox + RDebug::Print( _L("CpPsmView::checkbox disabled ") ); + iCheckBoxItem->setEnabled(0); + } + + iForm->setModel(iModel); + setWidget(iForm); + RDebug::Print( _L("CpPsmView::end ")); +} + +CpPsmView::~CpPsmView() +{ +RDebug::Print( _L("CpPsmView::destructor begin ") ); +delete iTrans; +delete iPsmClient; +RDebug::Print( _L("CpPsmView::destructor end ") ); +} + + +void CpPsmView::checkBoxStateChanged(int state) +{ + // store your changes + //state=1 means ->"checked" else it is "un-checked" + RDebug::Print( _L("CpPsmView::checkBoxStateChanged begin ") ); + CRepository* repository( NULL ); + + TRAPD( err, repository = CRepository::NewL( KCRUidDeviceManagementSettings ) ); + + if ( err == KErrNone ) + { + TInt value( 0 ); + //default value of the key is 1 meaning unchecked,so if the checkbox is checked then state=1 so key is set to 0 + if(state) + { + err = repository->Set( KSettingsPowerSavingQuery, value ); + RDebug::Print( _L("CpPsmView::checkBoxStateChanged checked ") ); + } + else + { + err = repository->Set( KSettingsPowerSavingQuery, 1 ); + RDebug::Print( _L("CpPsmView::checkBoxStateChanged unchecked ") ); + } + } + + delete repository; + RDebug::Print( _L("CpPsmView::checkBoxStateChanged end ") ); + +} + +void CpPsmView::toggleChange() + { + // iPsmClient = CPsmClient::NewL( *this ); + RDebug::Print( _L("CpPsmView::toggleChange begin ") ); + TInt mode; + TInt err = iPsmClient->PsmSettings().GetCurrentMode( mode ); + + if ( err == KErrNone ) + { + if( mode == EPsmsrvModeNormal || mode == EPsmsrvPartialMode ) + { + iPsmClient->CancelPowerSaveModeNotificationRequest(); + iPsmClient->ChangePowerSaveMode( EPsmsrvModePowerSave ); + // powerSaveMode->setContentWidgetData(QString("additionalText"), QString("off")); + RDebug::Print( _L("CpPsmView::toggleChange psm on ") ); + } + else + { + iPsmClient->CancelPowerSaveModeNotificationRequest(); + iPsmClient->ChangePowerSaveMode( EPsmsrvModeNormal ); + // powerSaveMode->setContentWidgetData(QString("text"), QString("on")); + RDebug::Print( _L("CpPsmView::toggleChange psm off ") ); + } + } + RDebug::Print( _L("CpPsmView::toggleChange end ") ); + } + + +void CpPsmView::PowerSaveModeChanged( const TPsmsrvMode aMode ) + { + RDebug::Print( _L("CpPsmView::PowerSaveModeChanged begin ") ); + iPsmClient->RequestPowerSaveModeNotification(); + if( aMode == EPsmsrvModePowerSave ) + { + //device in psm mode so disable checkbox and set the value of toggle button to off + iCheckBoxItem->setEnabled(0); + iPowerSaveMode->setContentWidgetData(QString("text"), hbTrId("txt_power_setlabel_val_off")); + RDebug::Print( _L("CpPsmView::PowerSaveModeChanged powersavemode enabled ") ); + } + else + { + //device is in normal mode so enable checkbox and set the value of toggle button to on + iCheckBoxItem->setEnabled(1); + iPowerSaveMode->setContentWidgetData(QString("text"), hbTrId("txt_power_setlabel_val_on")); + RDebug::Print( _L("CpPsmView::PowerSaveModeChanged powersavemode disabled ") ); + } + RDebug::Print( _L("CpPsmView::PowerSaveModeChanged end ") ); + } + + +void CpPsmView::PowerSaveModeChangeError( const TInt aError ) + { + RDebug::Print( _L("CpPsmView::PowerSaveModeChangeError ") ); + } + diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/cppsmplugin/src/cppsmview.h Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,60 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0"" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#ifndef CPPSMVIEW_H +#define CPPSMVIEW_H + +#include +#include +#include +#include +#include // CPsmClient +#include + +class HbDataFormModel; +class HbDataFormModelItem; +class CpSettingFormItemData; +class CPsmClient; + + +class CpPsmView : public CpBaseSettingView,public MPsmClientObserver +{ + Q_OBJECT +public: + explicit CpPsmView(QGraphicsItem *parent = 0); + virtual ~CpPsmView(); + + void PowerSaveModeChanged( const TPsmsrvMode aMode ); + + /** + * @see MPsmClientObserver + */ + void PowerSaveModeChangeError( const TInt aError ); + +private slots: + //need handling your member's value change + void checkBoxStateChanged(int state); + void toggleChange(); +private: + HbDataForm *iForm; + HbDataFormModel *iModel ; + HbDataFormModelItem *iCheckBoxItem; + CPsmClient* iPsmClient; + HbDataFormModelItem *iPowerSaveMode; + HbTranslator *iTrans; + +}; +#endif// CPPSMVIEW_H diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/data/2000E51E.rss --- a/coreapplicationuis/powersaveutilities/data/2000E51E.rss Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,44 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This file contains all the resources to launch battery indicator plugin -* -*/ - - -#include - -RESOURCE REGISTRY_INFO theInfo - { - dll_uid = 0x2000E51E; - interfaces = - { - INTERFACE_INFO - { - interface_uid = 0x10275092; - implementations = - { - IMPLEMENTATION_INFO - { - implementation_uid = 0x2000E51D; - version_no = 1; - display_name = ""; - default_data = "Default"; - opaque_data = ""; - } - }; - } - }; - } - -// End of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/data/batindpaneplugin.rss --- a/coreapplicationuis/powersaveutilities/data/batindpaneplugin.rss Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Resource definitions for battery indicator pane plugin -* -*/ - - -// RESOURCE IDENTIFIER -NAME BIPP - -#include -#include - - -RESOURCE RSS_SIGNATURE { } - -RESOURCE TBUF r_qtn_deactivate_power_saving -{ -buf = qtn_battery_link_deactivate_power_saving; -} - -RESOURCE TBUF r_qtn_activate_power_saving -{ -buf = qtn_battery_link_activate_power_saving; -} - -RESOURCE TBUF r_qtn_battery_low_preview_popup -{ -buf = qtn_battery_low_preview_popup; -} - -RESOURCE TBUF r_qtn_battery_status_popup -{ -buf = qtn_battery_status_popup; -} diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/group/BSUtil.mmp --- a/coreapplicationuis/powersaveutilities/group/BSUtil.mmp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,46 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Project definition file for project BSUtil -* -*/ - - -#include - -TARGET bsutil.dll -TARGETTYPE dll - -UID 0x1000008D 0x2000B5E2 - -VENDORID VID_DEFAULT - -CAPABILITY CAP_GENERAL_DLL - -#if defined( ARMCC ) - deffile ../EABI/BSUtil.DEF -#elif defined( WINSCW ) - deffile ../BWINS/BSUtil.DEF -#endif - -SOURCEPATH ../bsutil/src -SOURCE bsutil.cpp - -USERINCLUDE ../bsutil/inc - -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib -LIBRARY centralrepository.lib - -LANG SC diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/group/batindicatorpaneplugin.mmp --- a/coreapplicationuis/powersaveutilities/group/batindicatorpaneplugin.mmp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,72 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This is project specification file for handling -* UIP taps in BatIndicatorPanePlugin -* -*/ - - -CAPABILITY CAP_ECOM_PLUGIN - -#include -#include - -// Build target -TARGET batindicatorpaneplugin.dll -TARGETTYPE PLUGIN -UID 0x10009D8D 0x2000E51E -VENDORID VID_DEFAULT - - -// Source files location -SOURCEPATH ../batindicatorpaneplugin/src -SOURCE batindicatorpanepluginimpl.cpp -SOURCE dllmain.cpp - - -// Resources -START RESOURCE ../../data/2000E51E.rss -TARGET batindicatorpaneplugin.rsc -TARGETPATH ECOM_RESOURCE_DIR -END - -START RESOURCE ../../data/batindpaneplugin.rss -TARGETPATH ECOM_RESOURCE_DIR -HEADER -LANGUAGE_IDS -END - - -// Include paths -USERINCLUDE ../batindicatorpaneplugin/inc -USERINCLUDE ../../inc - -MW_LAYER_SYSTEMINCLUDE -SYSTEMINCLUDE /epoc32/include/ecom - -// Dependencies to system components -LIBRARY eikcore.lib -LIBRARY cone.lib -LIBRARY euser.lib -LIBRARY ecom.lib -LIBRARY avkon.lib -LIBRARY commonengine.lib // stringloader -LIBRARY efsrv.lib // TParsePtrC -LIBRARY flogger.lib -LIBRARY psmclient.lib -LIBRARY bsutil.lib -LIBRARY batterypopupcontrol.lib -LIBRARY centralrepository.lib -// End of File - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/group/batterypopupcontrol.mmp --- a/coreapplicationuis/powersaveutilities/group/batterypopupcontrol.mmp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,63 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: This is project specification file for handling UIP taps -* in BatteryPopupControl -* -*/ - - -#include - -// Build target -TARGET batterypopupcontrol.dll -TARGETTYPE dll -UID 0x10009D8D 0x2000F85F -VENDORID VID_DEFAULT -CAPABILITY CAP_GENERAL_DLL - -// Source files location -SOURCEPATH ../batterypopupcontrol/src -SOURCE batterypopupcontrol.cpp - -// Include paths -USERINCLUDE ../batterypopupcontrol/inc - -MW_LAYER_SYSTEMINCLUDE - -// Dependencies to system components -LIBRARY cone.lib -LIBRARY euser.lib -LIBRARY avkon.lib -LIBRARY efsrv.lib // TParsePtrC -LIBRARY flogger.lib -LIBRARY eikcoctl.lib -LIBRARY aknlayout2.lib -LIBRARY aknlayout2scalable.lib -LIBRARY cdlengine.lib -LIBRARY aknskins.lib // Skins support -LIBRARY gdi.lib -LIBRARY aknicon.lib -LIBRARY egul.lib -LIBRARY fontprovider.lib -LIBRARY fontutils.lib -#ifndef AVKON_BATTERYPOPUP_LAYOUTS -LIBRARY aknnotify.lib -#endif //AVKON_BATTERYPOPUP_LAYOUTS -// ----------- Touch feedback additions start -#ifdef RD_TACTILE_FEEDBACK -LIBRARY touchfeedback.lib -#endif //RD_TACTILE_FEEDBACK - -// End of File - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/group/batterypopupcontrol_icons.mk --- a/coreapplicationuis/powersaveutilities/group/batterypopupcontrol_icons.mk Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,73 +0,0 @@ -# -# Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -# All rights reserved. -# This component and the accompanying materials are made available -# under the terms of "Eclipse Public License v1.0" -# which accompanies this distribution, and is available -# at the URL "http://www.eclipse.org/legal/epl-v10.html". -# -# Initial Contributors: -# Nokia Corporation - initial contribution. -# -# Contributors: -# -# Description: -# -# - - -ifeq (WINS,$(findstring WINS, $(PLATFORM))) -ZDIR=\epoc32\release\$(PLATFORM)\$(CFG)\z -else -ZDIR=\epoc32\data\z -endif - -# ---------------------------------------------------------------------------- -# Configure these -# ---------------------------------------------------------------------------- - -TARGETDIR=$(ZDIR)\resource\apps -HEADERDIR=\epoc32\include -ICONTARGETFILENAME=$(TARGETDIR)\batterypopupcontrol.mif -HEADERFILENAME=$(HEADERDIR)\batterypopupcontrol.mbg - -do_nothing : - @rem do_nothing - -MAKMAKE : do_nothing - -BLD : do_nothing - -CLEAN : do_nothing - -LIB : do_nothing - -CLEANLIB : do_nothing - -# ---------------------------------------------------------------------------- -# Configure these. -# -# NOTE 1: DO NOT DEFINE MASK FILE NAMES! They are included automatically by -# MifConv if the mask detph is defined. -# -# NOTE 2: Usually, source paths should not be included in the bitmap -# definitions. MifConv searches for the icons in all icon directories in a -# predefined order, which is currently \s60\icons, \s60\bitmaps2. -# The directory \s60\icons is included in the search only if the feature flag -# __SCALABLE_ICONS is defined. -# ---------------------------------------------------------------------------- - -#ENABLE ANIMATION: Add background bitmap and animation frames here -RESOURCE : - mifconv $(ICONTARGETFILENAME) /h$(HEADERFILENAME) \ - /c8,8 qgn_prop_battery_ps_deactivate.svg - -FREEZE : do_nothing - -SAVESPACE : do_nothing - -RELEASABLES : - @echo $(HEADERFILENAME)&& \ - @echo $(ICONTARGETFILENAME) - -FINAL : do_nothing diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/group/bld.inf --- a/coreapplicationuis/powersaveutilities/group/bld.inf Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,52 +0,0 @@ -/* -* Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Battery state utility build file. -* -*/ - - -#include - -PRJ_PLATFORMS -DEFAULT - -PRJ_EXPORTS -//Configuration tool migration -../conf/powersaveutilities.confml MW_LAYER_CONFML(powersaveutilities.confml) -../conf/powersaveutilities_2000B5E3.crml MW_LAYER_CRML(powersaveutilities_2000B5E3.crml) -../conf/powersaveutilities_2001011A.crml MW_LAYER_CRML(powersaveutilities_2001011A.crml) - -../rom/powersaveutilities.iby CORE_MW_LAYER_IBY_EXPORT_PATH(powersaveutilities.iby) -../bsutil/inc/bsutil.h |../../inc/bsutil.h - -// batterypopupcontrol -../batterypopupcontrol/inc/batterypopupcontrol.h |../../inc/batterypopupcontrol.h - -// batindicatorpaneplugin -../loc/batindicatorpaneplugin.loc MW_LAYER_LOC_EXPORT_PATH(batindicatorpaneplugin.loc) - -PRJ_MMPFILES -BSUtil.mmp -batterypopupcontrol.mmp -//batindicatorpaneplugin.mmp - -PRJ_EXTENSIONS - -START EXTENSION s60/mifconv -OPTION TARGETFILE batterypopupcontrol.mif -OPTION HEADERFILE batterypopupcontrol.mbg -OPTION SOURCES -c8,8 qgn_prop_battery_ps_deactivate -END - -// End of File \ No newline at end of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/loc/batindicatorpaneplugin.loc --- a/coreapplicationuis/powersaveutilities/loc/batindicatorpaneplugin.loc Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,53 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Localisation file for BatIndicatorPanePlugin plug-in -* -*/ - - -// LOCALISATION STRINGS - - -// ---[ touch support: strings for preview popup ]--- - - -// d: Link Label for a preview popup. -// d: Popup is shown when user taps the battery indicator from status pane popup. -// l: popup_battery_window_t2/opt1 -// r:5.0 -// -#define qtn_battery_link_deactivate_power_saving "Deactivate power saving" - -// d: Link Label for a preview popup. -// d: Popup is shown when user taps the battery indicator from status pane popup. -// l: popup_battery_window_t2/opt1 -// r:5.0 -// -#define qtn_battery_link_activate_power_saving "Activate power saving" - -// d: Label for a preview popup. -// d: Popup is shown when user taps the battery indicator from status pane popup. -// d: If battery status is low, "Battery low" is shown instead of battery capacity -// l: popup_battery_window_t1/opt1 -// r:5.0 -// -#define qtn_battery_low_preview_popup "Battery low" - -// d: Label for a preview popup. -// d: Popup is shown when user taps the battery indicator from status pane popup. -// d: %N is the battery capacity in percents. -// l: popup_battery_window_t1 -// r:5.0 -// -#define qtn_battery_status_popup "%N %" \ No newline at end of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/pluginlauncher/pluginlauncher.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/pluginlauncher/pluginlauncher.pro Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,41 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: cpframework source files +# + +TEMPLATE = app +TARGET = CpPsmPluginLauncher +DEPENDPATH += . +INCLUDEPATH += . + +HEADERS += src/*.h +SOURCES += src/*.cpp + +CONFIG += hb +CONFIG += no_icon + +MOC_DIR = moc +OBJECT_DIR = obj +RCC_DIR = rcc + +symbian: { + TARGET.UID3 = 0x2002DD0C + INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + TARGET.CAPABILITY = ReadDeviceData WriteDeviceData + TARGET.EPOCALLOWDLLDATA = 1 +} + +LIBS += -lcpframework +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "rom/pluginlauncher.iby CORE_MW_LAYER_IBY_EXPORT_PATH(pluginlauncher.iby)" \ No newline at end of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/pluginlauncher/rom/pluginlauncher.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/pluginlauncher/rom/pluginlauncher.iby Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,22 @@ + +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +file=ABI_DIR\BUILD_DIR\CpPsmPluginLauncher.exe \sys\bin\CpPsmPluginLauncher.exe +CP_UPGRADABLE_APP_REG_RSC(CpPsmPluginLauncher) +S60_APP_RESOURCE(CpPsmPluginLauncher) + diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/pluginlauncher/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/pluginlauncher/src/main.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,39 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ + +#include +#include +#include +#include +#include "mainview.h" +#include + +int main(int argc, char **argv) +{ + RDebug::Print( _L("plugin launcher main begin ") ); + HbApplication app(argc, argv); + + HbMainWindow mainWindow; + MainView *mainView = new MainView(); + mainWindow.addView(mainView); + mainWindow.show(); + RDebug::Print( _L("plugin launcher main end") ); + return app.exec(); +} + +//End of File + diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/pluginlauncher/src/mainview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/pluginlauncher/src/mainview.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,58 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#include "mainview.h" +#include +#include +#include +#include +#include +#include +#include +#include + + +MainView::MainView(QGraphicsItem *parent/* = 0*/) +: HbView(parent) +{ + RDebug::Print( _L("plugin launcher MainView begin ") ); + init(); + RDebug::Print( _L("plugin launcher MainView end ") ); +} + +MainView::~MainView() +{ +RDebug::Print( _L("plugin launcher MainView desructor ") ); +} + +void MainView::init() +{ + RDebug::Print( _L("plugin launcher MainView init begin ") ); + launchInProcessProfileView(); + RDebug::Print( _L("plugin launcher MainView init end ") ) ; +} + +void MainView::launchInProcessProfileView() +{ + RDebug::Print( _L("plugin launcher MainView launchInProcessProfileView begin ") ); + //static function which launches the psmplugin view + CpPluginLauncher::launchSettingView("C:/resource/qt/plugins/controlpanel/cppsmplugin.dll","psm_view"); + RDebug::Print( _L("plugin launcher MainView launchInProcessProfileView end ")); +} + + + +//End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/pluginlauncher/src/mainview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/pluginlauncher/src/mainview.h Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0"" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. +* +* Contributors: +* +* Description: +* +*/ +#ifndef MAINVIEW_H +#define MAINVIEW_H + +#include + +class MainView : public HbView +{ + Q_OBJECT +public: + explicit MainView(QGraphicsItem *parent = 0); + virtual ~MainView(); +private: + void init(); +private slots: + void launchInProcessProfileView(); +private: + Q_DISABLE_COPY(MainView) +}; + +#endif diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/powersaveutilities.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/powersaveutilities.pro Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,26 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# + +TEMPLATE = subdirs + +symbian: { +:BLD_INF_RULES.prj_mmpfiles += $$LITERAL_HASH"include \"bsutil/group/bld.inf\"" +SUBDIRS = cppsmplugin \ + psmindicatorplugin \ + pluginlauncher + +} +CONFIG += ordered \ No newline at end of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/psmindicatorplugin/inc/psmindicator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/psmindicatorplugin/inc/psmindicator.h Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,80 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: power save mode Indicator class + * + */ + +#ifndef PSMINDICATOR_H +#define PSMINDICATOR_H + +#include + +#include +#include + +#include +#include +#include + + +/** + * PSM indicator class. + * Handles client request and shows the indications. + */ +class PsmIndicatorPlugin : public HbIndicatorInterface, public HbIndicatorPluginInterface +{ + Q_OBJECT + Q_INTERFACES(HbIndicatorPluginInterface) + +public: + + PsmIndicatorPlugin(); + ~PsmIndicatorPlugin(); +public: + //from HbindicatorInterface + bool handleInteraction(InteractionType type); + QVariant indicatorData(int role) const; + +public: + //from HbIndicatorPluginInterface + QStringList indicatorTypes() const; + bool accessAllowed(const QString &indicatorType,const QVariantMap & securityInfo) const; + HbIndicatorInterface* createIndicator(const QString &indicatorType); + int error() const; + + +protected: + //from HbindicatorInterface + bool handleClientRequest(RequestType type, const QVariant ¶meter); + + +private: + + QString iDisplayName; + QString iIcon; + QProcess iProcess; + QStringList iIndicatorTypes; + HbTranslator *iTrans; + + +private slots: + void processError(QProcess::ProcessError err); // handler for error codes + +private: + Q_DISABLE_COPY(PsmIndicatorPlugin) + int mError; + }; + +#endif // PSMINDICATOR_H + diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/psmindicatorplugin/psmindicatorplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/psmindicatorplugin/psmindicatorplugin.pro Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,40 @@ +# +# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +# All rights reserved. +# This component and the accompanying materials are made available +# under the terms of "Eclipse Public License v1.0" +# which accompanies this distribution, and is available +# at the URL "http://www.eclipse.org/legal/epl-v10.html". +# +# Initial Contributors: +# Nokia Corporation - initial contribution. +# +# Contributors: +# +# Description: +# +TEMPLATE = lib +TARGET = psmindicatorplugin +CONFIG += plugin +CONFIG += hb +INCLUDEPATH += . +DEPENDPATH += . +INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE + +# Input +HEADERS += inc/psmindicator.h +SOURCES += src/psmindicator.cpp +RESOURCES = +symbian { + TARGET.EPOCALLOWDLLDATA = 1 + TARGET.CAPABILITY = CAP_GENERAL_DLL + SYMBIAN_PLATFORMS = WINSCW ARMV5 + TARGET.UID3 = 0x2000F85F + pluginstub.sources = psmindicatorplugin.dll + pluginstub.path = /resource/plugins/indicators + DEPLOYMENT += pluginstub + LIBS += -lcpframework + +} +BLD_INF_RULES.prj_exports += "$${LITERAL_HASH}include " \ + "rom/psmindicatorplugin.iby CORE_MW_LAYER_IBY_EXPORT_PATH(psmindicatorplugin.iby)" diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/psmindicatorplugin/rom/psmindicatorplugin.iby --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/psmindicatorplugin/rom/psmindicatorplugin.iby Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,24 @@ +/* +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.eclipse.org/legal/epl-v10.html". +* +* Initial Contributors: +* Nokia Corporation - initial contribution. Y:\epoc32\s60\icons\qgn_note_batt_charging.svg +* +* Contributors: +* +* Description: +* +*/ +#ifndef __PSMINDICATORPLUGIN_IBY__ +#define __PSMINDICATORPLUGIN_IBY__ + +REM DLL +file=ABI_DIR\UREL\psmindicatorplugin.dll SHARED_LIB_DIR\psmindicatorplugin.dll +data=\epoc32\data\z\resource\plugins\indicators\psmindicatorplugin.qtplugin \resource\plugins\indicators\psmindicatorplugin.qtplugin + +#endif diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/psmindicatorplugin/src/psmindicator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/coreapplicationuis/powersaveutilities/psmindicatorplugin/src/psmindicator.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -0,0 +1,224 @@ +/* + * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). + * All rights reserved. + * This component and the accompanying materials are made available + * under the terms of "Eclipse Public License v1.0" + * which accompanies this distribution, and is available + * at the URL "http://www.eclipse.org/legal/epl-v10.html". + * + * Initial Contributors: + * Nokia Corporation - initial contribution. + * + * Contributors: + * + * Description: + * + */ +#include "psmindicator.h" + +#include +#include +#include +#include +#include +#include +#include +#include +#include +#include + + +Q_EXPORT_PLUGIN(PsmIndicatorPlugin) +const static char IndicatorType[] = "com.nokia.hb.powersavemodeplugin/1.0"; +QString KPsm = "PSM"; +QString KCharging = "Charging"; + +PsmIndicatorPlugin::PsmIndicatorPlugin():HbIndicatorInterface(IndicatorType,HbIndicatorInterface::NotificationCategory,InteractionActivated) + { + RDebug::Print( _L("PsmIndicatorPlugin constructor begin ") ); + iIndicatorTypes << "com.nokia.hb.powersavemodeplugin/1.0"; + RDebug::Print( _L("PsmIndicatorPlugin constructor end ") ); + } + +PsmIndicatorPlugin::~PsmIndicatorPlugin() + { + RDebug::Print( _L("PsmIndicatorPlugin destructor begin ") ); + } + +// ---------------------------------------------------------------------------- +// psmIndicatorPlugin::indicatorTypes +// returns the indicator types handled by this plugin +// ---------------------------------------------------------------------------- + +QStringList PsmIndicatorPlugin::indicatorTypes() const + { + RDebug::Print( _L("PsmIndicatorPlugin indicatortypes ")); + return iIndicatorTypes; + } + +// ---------------------------------------------------------------------------- +// psmIndicatorPlugin::createIndicator +// creates an indicator. +// ---------------------------------------------------------------------------- + +HbIndicatorInterface* PsmIndicatorPlugin::createIndicator( + const QString &indicatorType) + { + Q_UNUSED(indicatorType) + RDebug::Print( _L("PsmIndicatorPlugin createindicator ") ); + return this; + } + +// ---------------------------------------------------------------------------- +// psmIndicatorPlugin::error +// returns the error code. +// ---------------------------------------------------------------------------- + +int PsmIndicatorPlugin::error() const + { + RDebug::Print( _L("PsmIndicatorPlugin error ") ); + return mError; + } + +// ---------------------------------------------------------------------------- +// psmIndicatorPlugin::accessAllowed +// check for the access rights of the client. As there are no restrictions for +// this plugin it always returns true. +// ---------------------------------------------------------------------------- + +bool PsmIndicatorPlugin::accessAllowed(const QString &indicatorType, + const QVariantMap & securityInfo) const + { + Q_UNUSED(indicatorType) + Q_UNUSED(securityInfo) + + RDebug::Print( _L("PsmIndicatorPlugin accessallowed ") ); + return true; + } + +// ---------------------------------------------------------------------------- +// psmIndicator::handleInteraction +// called when the user interacts with the indicator.Enable the interaction +// for psm enabled and charger connected +// ---------------------------------------------------------------------------- +bool PsmIndicatorPlugin::handleInteraction(InteractionType type) + { + bool handled = false; + RDebug::Print( _L("PsmIndicatorPlugin handleinteraction begin ")); + if (type == InteractionActivated) + { + RDebug::Print( _L("PsmIndicatorPlugin handleinteraction inside interactionactivated ") ); + QObject::connect( &iProcess, SIGNAL(error(QProcess::ProcessError)), + this, SLOT(processError(QProcess::ProcessError))); + + // Launch the process to show the view. + iProcess.start("CpPsmPluginLauncher"); + handled = true; + + } + RDebug::Print( _L("PsmIndicatorPlugin handleinteraction end ") ); + return handled; + } + +// ---------------------------------------------------------------------------- +// psmIndicator::indicatorData +// returns the name and icon to be displayed in the universal indicator menu. +// ---------------------------------------------------------------------------- +QVariant PsmIndicatorPlugin::indicatorData(int role) const + { + RDebug::Print( _L("PsmIndicatorPlugin indicatordata begin ") ); + switch(role) + { + //for displaying the string in indicator. + case PrimaryTextRole: + { + return iDisplayName; + } + //for displaying the icon in indicator. + case DecorationNameRole: + { + return iIcon; + } + default: + return QVariant(); + } + } + +// ---------------------------------------------------------------------------- +// psmIndicatorPlugin::handleClientRequest +// this function gets called when client activates plugin +// ---------------------------------------------------------------------------- +bool PsmIndicatorPlugin::handleClientRequest( RequestType type, + const QVariant ¶meter) + { + RDebug::Print( _L("PsmIndicatorPlugin handleclientrequest begin ") ); + bool handled(false); + switch (type) + { + case RequestActivate: + { + RDebug::Print( _L("PsmIndicatorPlugin handleclientrequest requestactivate ") ); + // Get the param from the hbindicator.activate() which is called from sysap. + HbTranslator trans("powermanagement"); + iDisplayName.clear(); + //if it's a PSM indicator then prepare the string and icon accordingly + if((parameter.operator ==(QString("PSM")))) + { + RDebug::Print( _L("PsmIndicatorPlugin handleclientrequest requestactivate PSM ")); + iDisplayName.append(hbTrId("txt_power_management_dpopinfo_psm_activated_automa")); + iIcon.append(QString("qtg_large_psm")); + } + //else it's a charging indicator then prepare the string and icon accordingly + else + { + RDebug::Print( _L("PsmIndicatorPlugin handleclientrequest requestactivate charging ") ); + iDisplayName.append(hbTrId("txt_power_management_dblist_charging")); + iIcon.append(QString("qtg_mono_flash_charging")); + } + + + emit dataChanged(); + handled = true; + } + break; + case RequestDeactivate: + { + RDebug::Print( _L("PsmIndicatorPlugin handleclientrequest requestdeactivate ") ); + // reset data + iDisplayName = QString(); + iIcon=QString(); + + emit deactivate(); + } + break; + default: + break; + } + RDebug::Print( _L("PsmIndicatorPlugin handleclientrequest end ") ); + return handled; + } + + +// ---------------------------------------------------------------------------- +// psmIndicator::processError +// handle the error conditions returned by the QProcess. +// ---------------------------------------------------------------------------- + +void PsmIndicatorPlugin::processError(QProcess::ProcessError err) + { + RDebug::Print( _L("PsmIndicatorPlugin processerror begin ")); + switch (err) + { + case QProcess::FailedToStart: + case QProcess::Crashed: + case QProcess::Timedout: + case QProcess::ReadError: + case QProcess::WriteError: + case QProcess::UnknownError: + break; + default: + break; + } + } + + diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/powersaveutilities/rom/powersaveutilities.iby --- a/coreapplicationuis/powersaveutilities/rom/powersaveutilities.iby Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: powesaveutilities files needed to image -* -*/ - - -#ifndef __POWERSAVEUTILITIES_IBY__ -#define __POWERSAVEUTILITIES_IBY__ - -file=ABI_DIR\BUILD_DIR\BSUtil.dll SHARED_LIB_DIR\BSUtil.dll -file=ABI_DIR\BUILD_DIR\batterypopupcontrol.dll SHARED_LIB_DIR\batterypopupcontrol.dll - -//ECOM_PLUGIN_UDEB( batindicatorpaneplugin.dll, batindicatorpaneplugin.rsc ) -//ECOM_PLUGIN( batindicatorpaneplugin.dll, batindicatorpaneplugin.rsc ) - -data=DATAZ_\ECOM_RESOURCE_DIR\batindicatorpaneplugin.rsc ECOM_RESOURCE_DIR\batindicatorpaneplugin.rsc -data=DATAZ_\ECOM_RESOURCE_DIR\batindpaneplugin.rsc ECOM_RESOURCE_DIR\batindpaneplugin.rsc -data=DATAZ_\APP_RESOURCE_DIR\batterypopupcontrol.mif APP_RESOURCE_DIR\batterypopupcontrol.mif - -#endif // __POWERSAVEUTILITIES_IBY__ - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/cenrep/keys_favouritesplugin.xls Binary file coreapplicationuis/rfsplugins/FavouritesRFSPlugin/cenrep/keys_favouritesplugin.xls has changed diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/conf/favouritesplugin.confml Binary file coreapplicationuis/rfsplugins/FavouritesRFSPlugin/conf/favouritesplugin.confml has changed diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/conf/favouritesplugin_2000F8EF.crml Binary file coreapplicationuis/rfsplugins/FavouritesRFSPlugin/conf/favouritesplugin_2000F8EF.crml has changed diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/group/FavouritesRFSPlugin.mmp --- a/coreapplicationuis/rfsplugins/FavouritesRFSPlugin/group/FavouritesRFSPlugin.mmp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -* -*/ - - -#include - -TARGET favouritesrfsplugin.dll - -TARGETTYPE PLUGIN - -CAPABILITY CAP_ECOM_PLUGIN -VENDORID VID_DEFAULT - -UID 0x10009D8D 0x102071F6 - -SOURCEPATH ../src -SOURCE FavouritesRFSPlugin.cpp -SOURCE Proxy.cpp - -START RESOURCE 102071F6.rss -#ifdef SYMBIAN_SECURE_ECOM - TARGET favouritesrfsplugin.rsc -#endif -END - -LANG SC - -USERINCLUDE ../inc - -MW_LAYER_SYSTEMINCLUDE - -LIBRARY euser.lib // Base library -LIBRARY ecom.lib // ECom library -LIBRARY favouritesengine.lib // Favourites engine library diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/group/bld.inf --- a/coreapplicationuis/rfsplugins/FavouritesRFSPlugin/group/bld.inf Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* This file provides the information required for building RFS Favourites -* plugin -* -*/ - - -#include - -PRJ_PLATFORMS - -PRJ_MMPFILES - -../group/FavouritesRFSPlugin.mmp - -PRJ_EXPORTS -../conf/favouritesplugin.confml APP_LAYER_CONFML(favouritesplugin.confml) -../conf/favouritesplugin_2000F8EF.crml APP_LAYER_CRML(favouritesplugin_2000F8EF.crml) - -PRJ_TESTMMPFILES diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/inc/FavouritesRFSPlugin.h --- a/coreapplicationuis/rfsplugins/FavouritesRFSPlugin/inc/FavouritesRFSPlugin.h Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,90 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -* -*/ - - -#ifndef FAVOURITESRFSPLUGIN_H -#define FAVOURITESRFSPLUGIN_H - -// INCLUDES -#include -#include -#include "rfsPlugin.h" - -// CLASS DECLARATION - -class CFavouritesRFSPlugin: public CRFSPlugin, public MRfsApMapper - { -public: - - /** - * Two-phased constructor. - * @param aInitParams initial parameters - */ - static CFavouritesRFSPlugin* NewL(TAny* aInitParams); - - /** - * Destructor. - */ - virtual ~CFavouritesRFSPlugin(); - - /** - * - * @param - */ - void RestoreFactorySettingsL( const TRfsReason aType ); - - /** - * - * @param - */ - void GetScriptL( const TRfsReason aType, TDes& aPath ); - - /** - * - * @param - */ - void ExecuteCustomCommandL( const TRfsReason aType, TDesC& aCommand ); - -public: // from MRfsApMapper - - TBool MapAccessPoint( TUint aOldUid, TUint& aNewUid ); - -private: - - /** - * C++ default constructor. - */ - CFavouritesRFSPlugin(); - - /** - * Constructor. - * @param aInitParams initial parameters - */ - CFavouritesRFSPlugin(TAny* aInitParams); - - /** - * Constructor - */ - void ConstructL(); - }; - - - -#endif // FAVOURITESRFSPLUGIN_H - -// End of File diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/inc/FavouritesRFSPluginPrivateCRKeys.h --- a/coreapplicationuis/rfsplugins/FavouritesRFSPlugin/inc/FavouritesRFSPluginPrivateCRKeys.h Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,30 +0,0 @@ -/* -* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: Private Central Repository keys. -* -* -*/ - - -#ifndef __FAVOURITESRFSPLUGINPRIVATECRKEYS_H__ -#define __FAVOURITESRFSPLUGINPRIVATECRKEYS_H__ - -const TUid KCRUidFavouritesRFSPlugin = {0x2000F8EF}; - -/* - * Used to store init RFS scripts of FavouritesPlugin - */ -const TUint32 KInitFavouritesRFSPlugin = 0x00000001; - -#endif // __FAVOURITESRFSPLUGINPRIVATECRKEYS_H__ diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/src/102071F6.rss --- a/coreapplicationuis/rfsplugins/FavouritesRFSPlugin/src/102071F6.rss Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,49 +0,0 @@ -/* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -* -*/ - - -#include "ecom/registryinfo.rh" - -// Declares info for two implementations -RESOURCE REGISTRY_INFO theInfo - { - // UID for the DLL - dll_uid = 0x102071F6; - // Declare array of interface info - interfaces = - { - INTERFACE_INFO - { - // UID of interface that is implemented - interface_uid = 0x102073BB; - implementations = - { - // Info for CSrcsBTConnection - IMPLEMENTATION_INFO - { - implementation_uid = 0x102073BE; - version_no = 1; - display_name = "FavouritesRFSPlugin"; - default_data = "NI"; // N = Normal RFS, D = Deep RFS, I = Init RFS (FirstBoot RFS) - opaque_data = ""; - } - }; - } - }; - } - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/src/FavouritesRFSPlugin.cpp --- a/coreapplicationuis/rfsplugins/FavouritesRFSPlugin/src/FavouritesRFSPlugin.cpp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* -*/ - - -// INCLUDE FILES -#include -#include -#include "FavouritesRFSPluginPrivateCRKeys.h" -#include "FavouritesRFSPlugin.h" - -_LIT( KRfsDefaultBookmarkDbPath, "Z:\\private\\10008D38\\DBS_101FD685_BrowserBookmarks.db" ); - -const TInt KHexLength = 8; -// ================= MEMBER FUNCTIONS ======================= - -// C++ default constructor can NOT contain any code, that -// might leave. -// -CFavouritesRFSPlugin::CFavouritesRFSPlugin() - { - } - -CFavouritesRFSPlugin::CFavouritesRFSPlugin(TAny* /*aInitParams*/) - { - } - -// Destructor -CFavouritesRFSPlugin::~CFavouritesRFSPlugin() - { - } - -// --------------------------------------------------------- -// NewL -// --------------------------------------------------------- -// -CFavouritesRFSPlugin* CFavouritesRFSPlugin::NewL(TAny* aInitParams) - { - #ifdef _DEBUG - RDebug::Print(_L("CFavouritesRFSPlugin::NewL()")); - #endif - CFavouritesRFSPlugin* self = new (ELeave) CFavouritesRFSPlugin(aInitParams); - CleanupStack::PushL(self); - self->ConstructL(); - CleanupStack::Pop(); - return self; - } - - -// --------------------------------------------------------- -// ConstructL -// --------------------------------------------------------- -// -void CFavouritesRFSPlugin::ConstructL() - { - #ifdef _DEBUG - RDebug::Print(_L("CFavouritesRFSPlugin::ConstructL()")); - #endif - } - -void CFavouritesRFSPlugin::RestoreFactorySettingsL( const TRfsReason aType ) - { - #ifdef _DEBUG - RDebug::Print(_L("CFavouritesRFSPlugin::RestoreFactorySettingsL(%d)"), aType); - #endif - if (aType == ENormalRfs) - { - RFavouritesDb::RestoreFactorySettingsL(KBrowserBookmarks, KRfsDefaultBookmarkDbPath, *this ); - } - #ifdef _DEBUG - RDebug::Print(_L("CFavouritesRFSPlugin::RestoreFactorySettingsL: End")); - #endif - } - -void CFavouritesRFSPlugin::GetScriptL( const TRfsReason aType, TDes& aPath ) - { - if (aType == EInitRfs) - { - // Add CenRep UID and key - TUid hexuid(KCRUidFavouritesRFSPlugin); - TUint32 hexkey(KInitFavouritesRFSPlugin); - HBufC* hbuf = HBufC::New( KMaxPath ); - TPtr buf = hbuf->Des(); - buf.Zero(); - buf.AppendNumFixedWidthUC( hexuid.iUid, EHex, KHexLength ); - buf.Append(_L(":")); - buf.AppendNumFixedWidthUC( hexkey, EHex, KHexLength ); - buf.Append(_L(";")); - RDebug::Print( buf ); - aPath.Copy( buf ); - delete hbuf; - } - } - -void CFavouritesRFSPlugin::ExecuteCustomCommandL( const TRfsReason /*aType*/, - TDesC& aCommand ) - { - #ifdef _DEBUG - RDebug::Print(_L("CFavouritesRFSPlugin::ExecuteCustomCommandL")); - RDebug::Print(_L("CFavouritesRFSPlugin::ExecuteCustomCommandL Command: %S"), &aCommand); - #endif - } - -TBool CFavouritesRFSPlugin::MapAccessPoint( TUint aOldUid, TUint& aNewUid ) - { - aNewUid = aOldUid; - return ETrue; - } - -// End of file diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/FavouritesRFSPlugin/src/Proxy.cpp --- a/coreapplicationuis/rfsplugins/FavouritesRFSPlugin/src/Proxy.cpp Tue Jul 06 14:26:20 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +0,0 @@ -/* -* Copyright (c) 2005 Nokia Corporation and/or its subsidiary(-ies). -* All rights reserved. -* This component and the accompanying materials are made available -* under the terms of "Eclipse Public License v1.0" -* which accompanies this distribution, and is available -* at the URL "http://www.eclipse.org/legal/epl-v10.html". -* -* Initial Contributors: -* Nokia Corporation - initial contribution. -* -* Contributors: -* -* Description: -* This class export ECom interface implementations. -* -*/ - - -#include -#include - -#include "FavouritesRFSPlugin.h" - -// Map the interface UIDs to implementation factory functions -const TImplementationProxy ImplementationTable[] = - { - IMPLEMENTATION_PROXY_ENTRY(0x102073BE, CFavouritesRFSPlugin::NewL) - }; - -// Exported proxy for instantiation method resolution -EXPORT_C const TImplementationProxy* ImplementationGroupProxy(TInt& aTableCount) - { - aTableCount = sizeof(ImplementationTable) / sizeof(TImplementationProxy); - - return ImplementationTable; - } - diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/group/bld.inf --- a/coreapplicationuis/rfsplugins/group/bld.inf Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/rfsplugins/group/bld.inf Wed Aug 18 09:58:19 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2008 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -37,7 +37,6 @@ #include "../AIRFSPlugin/group/bld.inf" #include "../DisplayContrastPlugin/group/bld.inf" -#include "../FavouritesRFSPlugin/group/bld.inf" #include "../CertRFSPlugin/group/bld.inf" #include "../ClockRFSPlugin/group/bld.inf" #include "../DatastoreRFSPlugin/group/bld.inf" diff -r 76883296a0d5 -r 11a052f4b02e coreapplicationuis/rfsplugins/rom/RFSPlugins.iby --- a/coreapplicationuis/rfsplugins/rom/RFSPlugins.iby Tue Jul 06 14:26:20 2010 +0300 +++ b/coreapplicationuis/rfsplugins/rom/RFSPlugins.iby Wed Aug 18 09:58:19 2010 +0300 @@ -1,5 +1,5 @@ /* -* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). +* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies). * All rights reserved. * This component and the accompanying materials are made available * under the terms of "Eclipse Public License v1.0" @@ -26,7 +26,6 @@ ECOM_PLUGIN(DatastoreRFSPlugin.dll,2000F8C2.rsc) ECOM_PLUGIN(DefaultFolderRFSPlugin.dll,2000F8BA.rsc) ECOM_PLUGIN(RfsDisplayContrastPlugin.dll,102071F7.rsc) -ECOM_PLUGIN(FavouritesRFSPlugin.dll,102071F6.rsc) ECOM_PLUGIN(NitzRFSPlugin.dll,2000F8BF.rsc) ECOM_PLUGIN(StarterRFSPlugin.dll,2000F8BB.rsc) ECOM_PLUGIN(SyncMLRFSPlugin.dll,2000F8BC.rsc) diff -r 76883296a0d5 -r 11a052f4b02e mediakeys/MMKeyBearer/src/MMKeyBearerImplementation.cpp --- a/mediakeys/MMKeyBearer/src/MMKeyBearerImplementation.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/mediakeys/MMKeyBearer/src/MMKeyBearerImplementation.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -360,7 +360,7 @@ // Check for keypadlock if the events are from device keypad // If events are from accessory device,then do not check for keypadlock - if (aKeyType != EAccessoryVolumeKeys) + if (aKeyType != EAccessoryVolumeKeys && aKeyType != ESideVolumeKeys ) { TInt err=iKeyguardAccess->ShowKeysLockedNote(); @@ -370,10 +370,7 @@ // Device is locked , Discard the key event //Start the listener once again - if (aKeyType == ESideVolumeKeys) - { - iMMKeyBearerObserver->Start(); - } + if (aKeyType == EMediaKeys) { iMediaKeyObserver->Start(); diff -r 76883296a0d5 -r 11a052f4b02e sysresmonitoring/oodmonitor/oodmonitor2/inc/outofdiskglobalnote.h --- a/sysresmonitoring/oodmonitor/oodmonitor2/inc/outofdiskglobalnote.h Tue Jul 06 14:26:20 2010 +0300 +++ b/sysresmonitoring/oodmonitor/oodmonitor2/inc/outofdiskglobalnote.h Wed Aug 18 09:58:19 2010 +0300 @@ -45,7 +45,7 @@ * @lib None * @since S60 3.2 */ -NONSHARABLE_CLASS(COutOfDiskGlobalNote) : public CActive +NONSHARABLE_CLASS(COutOfDiskGlobalNote) : public MHbDeviceMessageBoxObserver { public: COutOfDiskGlobalNote( COutOfDiskMonitor* aOutOfDiskMonitor, RFs& aFs ); @@ -53,19 +53,21 @@ ~COutOfDiskGlobalNote(); void DisplayL(const TDesC& aMessage); void ShowGlobalQueryL(TInt aStatus, TInt aDrive); - void CancelNoteL(); TBool NoteOnDisplay(); TNoteInfo GetNoteInfo(); + + void MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox, + CHbDeviceMessageBoxSymbian::TButtonId aButton); + private: void ConstructL(); HBufC* FormatStringL(const TDesC& aSource, const MDesCArray& aStrings); - private: // From CActive - void DoCancel(); - void RunL(); + private: // Data COutOfDiskMonitor* iOutOfDiskMonitor; //uses RFs& iFs; RResourceFile iOODResourceFile; TNoteInfo iNoteInfo; + CHbDeviceMessageBoxSymbian *iNote; }; #endif //__OUTOFDISKGLOBALNOTE_H__ diff -r 76883296a0d5 -r 11a052f4b02e sysresmonitoring/oodmonitor/oodmonitor2/src/outofdiskglobalnote.cpp --- a/sysresmonitoring/oodmonitor/oodmonitor2/src/outofdiskglobalnote.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/sysresmonitoring/oodmonitor/oodmonitor2/src/outofdiskglobalnote.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -57,8 +57,8 @@ { TRACES("COutOfDiskGlobalNote::~COutOfDiskGlobalNote"); iOODResourceFile.Close(); - Cancel(); // Cancel active object - TRACES("COutOfDiskGlobalNote::~COutOfDiskGlobalNote: End"); + delete iNote; + iNote=NULL; } // --------------------------------------------------------- @@ -66,12 +66,10 @@ // --------------------------------------------------------- // COutOfDiskGlobalNote::COutOfDiskGlobalNote( COutOfDiskMonitor* aOutOfDiskMonitor, RFs& aFs ) : - CActive( EPriorityStandard ), iOutOfDiskMonitor( aOutOfDiskMonitor ), iFs( aFs ) { TRACES("COutOfDiskGlobalNote::COutOfDiskGlobalNote"); - CActiveScheduler::Add( this ); TRACES("COutOfDiskGlobalNote::COutOfDiskGlobalNote: End"); } @@ -85,7 +83,7 @@ iNoteInfo.iNoteId = KErrNotFound; iNoteInfo.iStatus = DISK_SPACE_OK; iNoteInfo.iDrive = KErrNotFound; - + iNote= CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning); TRACES("COutOfDiskGlobalNote::ConstructL: Open OOD resource file"); TFileName OODFileName; OODFileName.Append(_L("Z")); @@ -106,14 +104,12 @@ { TRACES("COutOfDiskGlobalNote::DisplayL"); - TRACES("COutOfDiskGlobalNote::COutOfDiskGlobalNote::DisplayL: Create iQuery"); - CHbDeviceMessageBoxSymbian* globalNote = CHbDeviceMessageBoxSymbian::NewL(CHbDeviceMessageBoxSymbian::EWarning); - CleanupStack::PushL(globalNote); - globalNote->SetTextL(aMessage); - globalNote->SetTimeout(0); - globalNote->ExecL(); - CleanupStack::PopAndDestroy(globalNote); - + TRACES("COutOfDiskGlobalNote::COutOfDiskGlobalNote::DisplayL: set text and observer for the note"); + iNote->SetTextL(aMessage); + iNote->SetObserver(this); + iNote->SetTimeout(0); + iNote->ShowL(); + TRACES("COutOfDiskGlobalNote::DisplayL: End"); } @@ -288,21 +284,13 @@ } // ----------------------------------------------------------------------------- -// COutOfDiskGlobalNote::DoCancel +// COutOfDiskGlobalNote::MessageBoxClosed // ----------------------------------------------------------------------------- // -void COutOfDiskGlobalNote::DoCancel() +void COutOfDiskGlobalNote::MessageBoxClosed(const CHbDeviceMessageBoxSymbian* aMessageBox, + CHbDeviceMessageBoxSymbian::TButtonId aButton) { - TRACES("COutOfDiskGlobalNote::DoCancel"); - } - -// ----------------------------------------------------------------------------- -// COutOfDiskGlobalNote::RunL -// ----------------------------------------------------------------------------- -// -void COutOfDiskGlobalNote::RunL() - { - TRACES("COutOfDiskGlobalNote::RunL"); + TRACES("COutOfDiskGlobalNote::closed"); iNoteInfo.iNoteId = KErrNotFound; iNoteInfo.iStatus = DISK_SPACE_OK; iNoteInfo.iDrive = KErrNotFound; @@ -316,17 +304,6 @@ TRACES("COutOfDiskGlobalNote::RunL: End"); } -// ----------------------------------------------------------------------------- -// COutOfDiskGlobalNote::CancelNoteL -// ----------------------------------------------------------------------------- -// -void COutOfDiskGlobalNote::CancelNoteL() - { - TRACES("COutOfDiskGlobalNote::CancelNoteL"); - - Cancel(); - TRACES("COutOfDiskGlobalNote::CancelNoteL: End"); - } // ----------------------------------------------------------------------------- // COutOfDiskGlobalNote::NoteOnDisplay diff -r 76883296a0d5 -r 11a052f4b02e systemsettings/accindicatorplugin/accindicatorsettings/accindicatorsettings.pro --- a/systemsettings/accindicatorplugin/accindicatorsettings/accindicatorsettings.pro Tue Jul 06 14:26:20 2010 +0300 +++ b/systemsettings/accindicatorplugin/accindicatorsettings/accindicatorsettings.pro Wed Aug 18 09:58:19 2010 +0300 @@ -6,6 +6,7 @@ DEPENDPATH += . inc resources src INCLUDEPATH += . CONFIG += Hb +CONFIG += no_icon INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE # Input diff -r 76883296a0d5 -r 11a052f4b02e tzservices/tzloc/inc/TzLocalizationDbAccessor.h --- a/tzservices/tzloc/inc/TzLocalizationDbAccessor.h Tue Jul 06 14:26:20 2010 +0300 +++ b/tzservices/tzloc/inc/TzLocalizationDbAccessor.h Wed Aug 18 09:58:19 2010 +0300 @@ -88,8 +88,10 @@ private: TInt CreateFrequentlyUsedZoneTableL(); TInt CreateUserCityTableL(); + TBool IsTableCreatedL(const TDesC& aTableName) const; void CloseDb(); void OpenDbL(); + protected: //Member data diff -r 76883296a0d5 -r 11a052f4b02e tzservices/tzloc/src/TzLocalizationDbAccessor.cpp --- a/tzservices/tzloc/src/TzLocalizationDbAccessor.cpp Tue Jul 06 14:26:20 2010 +0300 +++ b/tzservices/tzloc/src/TzLocalizationDbAccessor.cpp Wed Aug 18 09:58:19 2010 +0300 @@ -103,29 +103,21 @@ { //Database file doesn't exist. Attempt to create a new one. error = iLocalizedTimeZoneDb.Create(iDbsSession,KTzLocalizationDbName,KTzLocalizationDbSecurityPolicy); - if (error == KErrNone) - { - User::LeaveIfError(CreateFrequentlyUsedZoneTableL()); - User::LeaveIfError(CreateUserCityTableL()); - } - } - User::LeaveIfError(error); - // Check if both tables are created. - CDbColSet *colSet = NULL; - TRAP(error, colSet = iLocalizedTimeZoneDb.ColSetL(KCZTableName)); - delete colSet; - if (error) - { - User::LeaveIfError(CreateFrequentlyUsedZoneTableL()); - } - TRAP(error, colSet = iLocalizedTimeZoneDb.ColSetL(KUCTableName)); - delete colSet; - if (error) - { - User::LeaveIfError(CreateUserCityTableL()); - } + User::LeaveIfError(error); + + //Check whether tables exist and create them if they do not + if (!IsTableCreatedL(KCZTableName)) + { + User::LeaveIfError(CreateFrequentlyUsedZoneTableL()); + } + if (!IsTableCreatedL(KUCTableName)) + { + User::LeaveIfError(CreateUserCityTableL()); + } + } } + /** Destructor Closes the database tables, the database and the database session @@ -317,3 +309,24 @@ User::LeaveIfError(iZoneView.EvaluateAll()); } +TBool CTzLocalizationDbAccessor::IsTableCreatedL(const TDesC& aTableName) const + { + TBool result = EFalse; + CDbTableNames* tableNames = iLocalizedTimeZoneDb.TableNamesL(); + CleanupStack::PushL(tableNames); + if(tableNames) + { + const TInt count = tableNames->Count(); + for(TInt i = 0; i < count; i++) + { + if((*tableNames)[i] == aTableName) + { + result = ETrue; + break; + } + } + } + CleanupStack::PopAndDestroy(tableNames); + return result; + } +