# HG changeset patch # User Dremov Kirill (Nokia-D-MSW/Tampere) # Date 1272879126 -10800 # Node ID 624337f114fe1b2c3c8b0ec2ebfd7f04561af96e # Parent 10d0dd0e43f156964953ce7417cb3852d6a623dc Revision: 201015 Kit: 201018 diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemechanger.cpp --- a/controlpanelplugins/themeplugin/src/cpthemechanger.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemechanger.cpp Mon May 03 12:32:06 2010 +0300 @@ -97,6 +97,12 @@ return d->currentTheme(); } +int CpThemeChanger::indexOf(const ThemeInfo& theme) const +{ + Q_D(const CpThemeChanger); + return d->indexOf(theme); +} + /*! Change a theme. Returns true on success, false otherwise. */ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemechanger.h --- a/controlpanelplugins/themeplugin/src/cpthemechanger.h Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemechanger.h Mon May 03 12:32:06 2010 +0300 @@ -41,15 +41,26 @@ { QString name; HbIcon icon; + HbIcon portraitPreviewIcon; + HbIcon landscapePreviewIcon; bool operator < (const struct ThemeInfo &other) const { return name.localeAwareCompare(other.name) < 0; - } + } + bool operator == (const struct ThemeInfo &other) const { + return name.localeAwareCompare(other.name) == 0; + } }; - + + enum ThemeListUserRole { + PortraitPreviewRole = Qt::UserRole, + LandscapePreviewRole + }; + const QList themes() const; QAbstractItemModel& model(); const ThemeInfo& currentTheme() const; + int indexOf(const ThemeInfo& theme) const; bool changeTheme(const QString& newtheme); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp --- a/controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp Mon May 03 12:32:06 2010 +0300 @@ -20,7 +20,8 @@ #include #include #include -#include +#include +#include #include #include "cpthemeclient_p.h" #include "cpthemecommon_p.h" @@ -36,8 +37,7 @@ static const char* KThemePathKey = "HB_THEMES_DIR"; #endif - static const char* KDefaultTheme = "hbdefault"; - static const char* KSettingsGroup = "hborbit"; + static const QString KDefaultTheme = "hbdefault"; static const char* KSettingsCategory = "currenttheme"; static const bool KDefaultPreviewAvailable = true; } @@ -105,6 +105,11 @@ return mCurrentTheme.name.isEmpty() ? KDefaultTheme : mCurrentTheme.name; } +int CpThemeChangerPrivate::indexOf(const CpThemeChanger::ThemeInfo& theme) const +{ + return themeList.indexOf(theme); +} + void CpThemeChangerPrivate::updateThemeList(const QString& newThemeName) { if(!themeList.isEmpty()) { @@ -166,17 +171,49 @@ //if no preview graphics path specified,look for the background graphic. //first look in /scalable folder. if not there, look in pixmap folder. - if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg").exists()){ + + //Set thumbnail + if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_theme_preview_thumbnail.svg").exists()){ + nameIconPair.icon = HbIcon(fullPathToIcon + "/scalable/qtg_graf_theme_preview_thumbnail.svg"); + }else if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg").exists()){ nameIconPair.icon = HbIcon(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg"); + qreal width = nameIconPair.icon.width(); + nameIconPair.icon.setHeight(width); } else if(QFileInfo(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_prt.png").exists()){ nameIconPair.icon = HbIcon(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_prt.png"); + qreal width = nameIconPair.icon.width(); + nameIconPair.icon.setHeight(width); } else{ nameIconPair.icon = HbIcon(":/image/themePreview.svg"); } } else { nameIconPair.icon = HbIcon(fullPathToIcon); } + + //set portrait preview + if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_theme_preview_prt.svg").exists()){ + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + "/scalable/qtg_graf_theme_preview_prt.svg"); + }else if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg").exists()){ + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg"); + } else if(QFileInfo(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_prt.png").exists()){ + nameIconPair.portraitPreviewIcon = HbIcon(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_prt.png"); + } else{ + nameIconPair.portraitPreviewIcon = HbIcon(":/image/themePreview.svg"); + } + + //set landscape preview + if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_theme_preview_lsc.svg").exists()){ + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + "/scalable/qtg_graf_theme_preview_lsc.svg"); + }else if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_screen_bg_lsc.svg").exists()){ + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + "/scalable/qtg_graf_screen_bg_lsc.svg"); + } else if(QFileInfo(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_lsc.png").exists()){ + nameIconPair.landscapePreviewIcon = HbIcon(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_lsc.png"); + } else{ + nameIconPair.landscapePreviewIcon = HbIcon(":/image/themePreview.svg"); + } + nameIconPair.name = name; + themeList.append(nameIconPair); if (name == mCurrentTheme.name) { @@ -209,8 +246,6 @@ mCurrentTheme = def; } - // Sort the themes list - qSort(themeList.begin(), themeList.end()); } const QList& CpThemeChangerPrivate::themes() const @@ -316,6 +351,11 @@ case Qt::SizeHintRole: retVal = mThemeChangerPrivate->themeList.at(index.row()).icon.size(); break; + case CpThemeChanger::PortraitPreviewRole: + retVal = mThemeChangerPrivate->themeList.at(index.row()).portraitPreviewIcon; + break; + case CpThemeChanger::LandscapePreviewRole: + retVal = mThemeChangerPrivate->themeList.at(index.row()).landscapePreviewIcon; default: // do nothing diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemechanger_p.h --- a/controlpanelplugins/themeplugin/src/cpthemechanger_p.h Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemechanger_p.h Mon May 03 12:32:06 2010 +0300 @@ -42,6 +42,7 @@ Q_OBJECT public: + HbThemeListModel(CpThemeChangerPrivate* dd, QObject *parent = 0); virtual ~HbThemeListModel(); @@ -73,6 +74,7 @@ const QStringList directories() const; const CpThemeChanger::ThemeInfo& currentTheme() const; + int indexOf(const CpThemeChanger::ThemeInfo& theme) const; const QString& currentThemeName() const; bool changeTheme(const QString& newtheme); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemecontrol.cpp --- a/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp Mon May 03 12:32:06 2010 +0300 @@ -33,6 +33,7 @@ #include #include #include +#include #include #include @@ -63,7 +64,8 @@ CpThemeControl::CpThemeControl(): mThemeListView(0), mThemePreview(0), mThemeChanger(0), - mListModel(0) + mListModel(0), + mSortModel(0) { mThemeChanger = new CpThemeChanger(); @@ -103,9 +105,19 @@ mThemeListView = new CpThemeListView(); mListModel = &mThemeChanger->model(); + + mSortModel = new QSortFilterProxyModel(this); + mSortModel->setDynamicSortFilter(true); + mSortModel->setSortCaseSensitivity(Qt::CaseInsensitive); + mSortModel->sort(0); + mSortModel->setSourceModel(mListModel); // Set the model for theme list. - mThemeListView->setModel(mListModel); + mThemeListView->setModel(mSortModel); + mThemeListView->themeList()->setSelectionMode(HbAbstractItemView::SingleSelection); + + setActiveThemeIndex(); + //connect to signal for selecting a list item. connect(mThemeListView,SIGNAL(newThemeSelected(const QModelIndex&)), @@ -154,8 +166,36 @@ return; } - CpThemeChanger::ThemeInfo themeInfo = mThemeChanger->themes().at(index.row()); - + + CpThemeChanger::ThemeInfo themeInfo; + QVariant data; + + //reset the current index to active theme, so that the selection remains on current + //theme even though another list item is selected. + setActiveThemeIndex(); + + //get the theme name. + data = index.data(Qt::DisplayRole); + if(data.isValid()) { + themeInfo.name = data.toString(); + } + //get theme icon. + data = index.data(Qt::DecorationRole); + if(data.isValid()) { + themeInfo.icon = data.value(); + } + + data = index.data(CpThemeChanger::PortraitPreviewRole); + if(data.isValid()) { + themeInfo.portraitPreviewIcon = data.value(); + } + + data = index.data(CpThemeChanger::LandscapePreviewRole); + if(data.isValid()) { + themeInfo.landscapePreviewIcon = data.value(); + } + + //Set up the theme preview and set it to //the current view of main window. HbMainWindow* mWindow = ::mainWindow(); @@ -211,7 +251,10 @@ mainWindow->removeView(mThemePreview); mThemePreview->deleteLater(); mThemePreview = 0; - + + //reset the current index to active theme, so that the selection remains on current + //theme even though another list item is selected. + setActiveThemeIndex(); mainWindow->setCurrentView(mThemeListView); } @@ -236,6 +279,22 @@ mThemeListView->closeView(); } +/*! + * Private function that sets the current index of theme list view to indicate + * the active theme. + */ +void CpThemeControl::setActiveThemeIndex() +{ + //Get the index of current theme. + QModelIndex sourceIndex = mListModel->index(mThemeChanger->indexOf(mThemeChanger->currentTheme()),0); + //Map it to the sort model index. + QModelIndex sortedIndex = mSortModel->mapFromSource(sourceIndex); + //set current index. + mThemeListView->themeList()->setCurrentIndex(sortedIndex, QItemSelectionModel::SelectCurrent); +} + + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemecontrol.h --- a/controlpanelplugins/themeplugin/src/cpthemecontrol.h Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.h Mon May 03 12:32:06 2010 +0300 @@ -27,7 +27,7 @@ QT_BEGIN_NAMESPACE class QModelIndex; class QString; -class QStandardItemModel; +class QSortFilterProxyModel; QT_END_NAMESPACE class CpThemeListView; @@ -59,12 +59,14 @@ private: void createThemeList(); void triggerThemeListClose(); + void setActiveThemeIndex(); private: CpThemeListView* mThemeListView; CpThemePreview* mThemePreview; CpThemeChanger* mThemeChanger; QAbstractItemModel* mListModel; + QSortFilterProxyModel* mSortModel; }; #endif //CPTHEMECONTROL_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemelistview.cpp --- a/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemelistview.cpp Mon May 03 12:32:06 2010 +0300 @@ -20,7 +20,7 @@ #include #include -#include +#include #include #include diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemepluginentryitemdata.cpp --- a/controlpanelplugins/themeplugin/src/cpthemepluginentryitemdata.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemepluginentryitemdata.cpp Mon May 03 12:32:06 2010 +0300 @@ -15,8 +15,8 @@ * */ -#include -#include +#include +#include #include #include "cpthemecontrol.h" diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelplugins/themeplugin/src/cpthemepreview.cpp --- a/controlpanelplugins/themeplugin/src/cpthemepreview.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelplugins/themeplugin/src/cpthemepreview.cpp Mon May 03 12:32:06 2010 +0300 @@ -19,12 +19,13 @@ #include #include -#include -#include +#include +#include #include #include #include #include +#include #include "cpthemepreview.h" @@ -54,9 +55,12 @@ QString themeHeading = tr("Preview: ") + mTheme.name; HbLabel* label = new HbLabel(themeHeading, this); label->setFontSpec(HbFontSpec(HbFontSpec::Primary)); - + + label->setPreferredHeight(5.0); layout->addItem(label); + layout->setAlignment(layout->itemAt(0), Qt::AlignTop); + //Create the toolbar and "Select" and "Cancel" actions. HbToolBar* mToolBar = new HbToolBar(this); @@ -74,9 +78,17 @@ QObject::connect( cancelAction, SIGNAL(triggered()), this, SIGNAL(aboutToClose())); + HbIconItem* layoutItem; //layout->addItem(&HbIconItem(mTheme.icon, this )); - HbIconItem* layoutItem = new HbIconItem(mTheme.icon, this); + if(mainWindow()->orientation() == Qt::Horizontal) { + layoutItem = new HbIconItem(mTheme.landscapePreviewIcon, this); + } + else { + layoutItem = new HbIconItem(mTheme.portraitPreviewIcon, this); + } layout->addItem(layoutItem); + layout->setAlignment(layout->itemAt(0), Qt::AlignTop); + setToolBar(mToolBar); setLayout(layout); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/cpcfg_win.pl --- a/controlpanelui/cpcfg_win.pl Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/cpcfg_win.pl Mon May 03 12:32:06 2010 +0300 @@ -11,10 +11,7 @@ # # Contributors: # -# Description: -# - -# description: copy all cpcfg files to destination directory when building control panel in window envionment +# Description: Copy all cpcfg files to destination directory when building control panel in window envionment # usage: go to control panel source directory, # run cpcfg_win.pl if you want to build control panel in debug mode or cpcfg_win -R in release mode. diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/rom/controlpanelui.iby --- a/controlpanelui/rom/controlpanelui.iby Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/rom/controlpanelui.iby Mon May 03 12:32:06 2010 +0300 @@ -32,22 +32,19 @@ file=ABI_DIR\BUILD_DIR\seccodeui.dll SHARED_LIB_DIR\seccodeui.dll file=ABI_DIR\BUILD_DIR\cpprofilewrapper.dll SHARED_LIB_DIR\cpprofilewrapper.dll -file=ABI_DIR\BUILD_DIR\cpapplicationsettingsplugin.dll SHARED_LIB_DIR\cpapplicationsettingsplugin.dll file=ABI_DIR\BUILD_DIR\cppersonalizationplugin.dll SHARED_LIB_DIR\cppersonalizationplugin.dll file=ABI_DIR\BUILD_DIR\cpcommunicationplugin.dll SHARED_LIB_DIR\cpcommunicationplugin.dll file=ABI_DIR\BUILD_DIR\cpdeviceplugin.dll SHARED_LIB_DIR\cpdeviceplugin.dll -file=ABI_DIR\BUILD_DIR\cpplaceholderplugin.dll SHARED_LIB_DIR\cpplaceholderplugin.dll file=ABI_DIR\BUILD_DIR\cpprivacyplugin.dll SHARED_LIB_DIR\cpprivacyplugin.dll -file=ABI_DIR\BUILD_DIR\cpplaceholdernoiconplugin.dll SHARED_LIB_DIR\cpplaceholdernoiconplugin.dll -file=ABI_DIR\BUILD_DIR\cpdisplayplugin.dll SHARED_LIB_DIR\cpdisplayplugin.dll file=ABI_DIR\BUILD_DIR\cplookfeelplugin.dll SHARED_LIB_DIR\cplookfeelplugin.dll file=ABI_DIR\BUILD_DIR\cpkeytouchfdbkplugin.dll SHARED_LIB_DIR\cpkeytouchfdbkplugin.dll -file=ABI_DIR\BUILD_DIR\cpaccountsplugin.dll SHARED_LIB_DIR\cpaccountsplugin.dll file=ABI_DIR\BUILD_DIR\cppincodeplugin.dll SHARED_LIB_DIR\cppincodeplugin.dll file=ABI_DIR\BUILD_DIR\cpdevicelockplugin.dll SHARED_LIB_DIR\cpdevicelockplugin.dll - +file=ABI_DIR\BUILD_DIR\cpprofileactivator.dll SHARED_LIB_DIR\cpprofileactivator.dll +file=ABI_DIR\BUILD_DIR\cpvolumeplugin.dll SHARED_LIB_DIR\cpvolumeplugin.dll +file=ABI_DIR\BUILD_DIR\cpringtoneplugin.dll SHARED_LIB_DIR\cpringtoneplugin.dll + data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\mainview.cpcfg resource\qt\plugins\controlpanel\config\mainview.cpcfg -data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\cpapplicationsettingsplugin.cpcfg resource\qt\plugins\controlpanel\config\cpapplicationsettingsplugin.cpcfg data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\cppersonalizationplugin.cpcfg resource\qt\plugins\controlpanel\config\cppersonalizationplugin.cpcfg data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\cpcommunicationplugin.cpcfg resource\qt\plugins\controlpanel\config\cpcommunicationplugin.cpcfg data=\epoc32\data\c\resource\qt\plugins\controlpanel\config\cpdeviceplugin.cpcfg resource\qt\plugins\controlpanel\config\cpdeviceplugin.cpcfg @@ -56,17 +53,16 @@ data=\epoc32\data\c\resource\qt\plugins\controlpanel\cppersonalizationplugin.qtplugin resource\qt\plugins\controlpanel\cppersonalizationplugin.qtplugin -data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpapplicationsettingsplugin.qtplugin resource\qt\plugins\controlpanel\cpapplicationsettingsplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpcommunicationplugin.qtplugin resource\qt\plugins\controlpanel\cpcommunicationplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpdeviceplugin.qtplugin resource\qt\plugins\controlpanel\cpdeviceplugin.qtplugin -data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpplaceholderplugin.qtplugin resource\qt\plugins\controlpanel\cpplaceholderplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpprivacyplugin.qtplugin resource\qt\plugins\controlpanel\cpprivacyplugin.qtplugin -data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpplaceholdernoiconplugin.qtplugin resource\qt\plugins\controlpanel\cpplaceholdernoiconplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cplookfeelplugin.qtplugin resource\qt\plugins\controlpanel\cplookfeelplugin.qtplugin -data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpdisplayplugin.qtplugin resource\qt\plugins\controlpanel\cpdisplayplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpkeytouchfdbkplugin.qtplugin resource\qt\plugins\controlpanel\cpkeytouchfdbkplugin.qtplugin -data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpaccountsplugin.qtplugin resource\qt\plugins\controlpanel\cpaccountsplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cppincodeplugin.qtplugin resource\qt\plugins\controlpanel\cppincodeplugin.qtplugin data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpdevicelockplugin.qtplugin resource\qt\plugins\controlpanel\cpdevicelockplugin.qtplugin +data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpprofileactivator.qtplugin resource\qt\plugins\controlpanel\cpprofileactivator.qtplugin +data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpvolumeplugin.qtplugin resource\qt\plugins\controlpanel\cpvolumeplugin.qtplugin +data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpringtoneplugin.qtplugin resource\qt\plugins\controlpanel\cpringtoneplugin.qtplugin + #endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/bwins/cpprofilewrapperu.def --- a/controlpanelui/src/bwins/cpprofilewrapperu.def Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/bwins/cpprofilewrapperu.def Mon May 03 12:32:06 2010 +0300 @@ -1,32 +1,57 @@ EXPORTS - ?ringVolume@CpProfileModel@@QAEHXZ @ 1 NONAME ; int CpProfileModel::ringVolume(void) - ??1CpProfileModel@@QAE@XZ @ 2 NONAME ; CpProfileModel::~CpProfileModel(void) - ?profileName@CpProfileModel@@QAE?AVQString@@H@Z @ 3 NONAME ; class QString CpProfileModel::profileName(int) - ?setScreenVibra@CpProfileModel@@QAEXH@Z @ 4 NONAME ; void CpProfileModel::setScreenVibra(int) - ?setScreenVolume@CpProfileModel@@QAEXH@Z @ 5 NONAME ; void CpProfileModel::setScreenVolume(int) - ?screenVolume@CpProfileModel@@QAEHXZ @ 6 NONAME ; int CpProfileModel::screenVolume(void) - ?setRingTone@CpProfileModel@@QAEHABVQString@@@Z @ 7 NONAME ; int CpProfileModel::setRingTone(class QString const &) - ?keyVolume@CpProfileModel@@QAEHXZ @ 8 NONAME ; int CpProfileModel::keyVolume(void) - ?setVibraStatus@CpProfileModel@@QAEX_N@Z @ 9 NONAME ; void CpProfileModel::setVibraStatus(bool) - ?calendarTone@CpProfileModel@@QAE?AVQString@@XZ @ 10 NONAME ; class QString CpProfileModel::calendarTone(void) - ?vibraStatus@CpProfileModel@@QAE_NXZ @ 11 NONAME ; bool CpProfileModel::vibraStatus(void) - ?setKeyVolume@CpProfileModel@@QAEXH@Z @ 12 NONAME ; void CpProfileModel::setKeyVolume(int) - ?activateSilent@CpProfileModel@@QAEXXZ @ 13 NONAME ; void CpProfileModel::activateSilent(void) - ?ringTone@CpProfileModel@@QAE?AVQString@@XZ @ 14 NONAME ; class QString CpProfileModel::ringTone(void) - ?activeProfileId@CpProfileModel@@QAEHXZ @ 15 NONAME ; int CpProfileModel::activeProfileId(void) - ?emailTone@CpProfileModel@@QAE?AVQString@@XZ @ 16 NONAME ; class QString CpProfileModel::emailTone(void) - ?activateBeep@CpProfileModel@@QAEXXZ @ 17 NONAME ; void CpProfileModel::activateBeep(void) - ?setEmailTone@CpProfileModel@@QAEHABVQString@@@Z @ 18 NONAME ; int CpProfileModel::setEmailTone(class QString const &) - ?setRingVolume@CpProfileModel@@QAEXH@Z @ 19 NONAME ; void CpProfileModel::setRingVolume(int) - ?messageTone@CpProfileModel@@QAE?AVQString@@XZ @ 20 NONAME ; class QString CpProfileModel::messageTone(void) - ?initiationFlag@CpProfileModel@@QAEHXZ @ 21 NONAME ; int CpProfileModel::initiationFlag(void) - ?isBeep@CpProfileModel@@QAE_NXZ @ 22 NONAME ; bool CpProfileModel::isBeep(void) - ?activateProfile@CpProfileModel@@QAEHH@Z @ 23 NONAME ; int CpProfileModel::activateProfile(int) - ?setAlarmTone@CpProfileModel@@QAEXABVQString@@@Z @ 24 NONAME ; void CpProfileModel::setAlarmTone(class QString const &) - ??0CpProfileModel@@QAE@XZ @ 25 NONAME ; CpProfileModel::CpProfileModel(void) - ?screenVibra@CpProfileModel@@QAEHXZ @ 26 NONAME ; int CpProfileModel::screenVibra(void) - ?alarmTone@CpProfileModel@@QAE?AVQString@@XZ @ 27 NONAME ; class QString CpProfileModel::alarmTone(void) - ?setMessageTone@CpProfileModel@@QAEHABVQString@@@Z @ 28 NONAME ; int CpProfileModel::setMessageTone(class QString const &) - ?isSilent@CpProfileModel@@QAE_NXZ @ 29 NONAME ; bool CpProfileModel::isSilent(void) - ?setCalendarTone@CpProfileModel@@QAEXABVQString@@@Z @ 30 NONAME ; void CpProfileModel::setCalendarTone(class QString const &) + ?setKeyTouchScreenVibra@CpProfileModel@@QAEXHH@Z @ 1 NONAME ; void CpProfileModel::setKeyTouchScreenVibra(int, int) + ?tr@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString CpProfileModel::tr(char const *, char const *, int) + ?setReminderVibra@CpProfileModel@@QAEXH_N@Z @ 3 NONAME ; void CpProfileModel::setReminderVibra(int, bool) + ?masterVibra@CpProfileModel@@QBE_NXZ @ 4 NONAME ; bool CpProfileModel::masterVibra(void) const + ?ringTone@CpProfileModel@@QBE?AVQString@@XZ @ 5 NONAME ; class QString CpProfileModel::ringTone(void) const + ?qt_metacast@CpProfileModel@@UAEPAXPBD@Z @ 6 NONAME ; void * CpProfileModel::qt_metacast(char const *) + ?setRingTone@CpProfileModel@@QAEXABVQString@@@Z @ 7 NONAME ; void CpProfileModel::setRingTone(class QString const &) + ?setReminderTone@CpProfileModel@@QAEXHABVQString@@@Z @ 8 NONAME ; void CpProfileModel::setReminderTone(int, class QString const &) + ?activeProfileId@CpProfileModel@@QAEHXZ @ 9 NONAME ; int CpProfileModel::activeProfileId(void) + ?trUtf8@CpProfileModel@@SA?AVQString@@PBD0@Z @ 10 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *) + ?profileSettings@CpProfileModel@@QAEHHAAVCpProfileSettings@@@Z @ 11 NONAME ; int CpProfileModel::profileSettings(int, class CpProfileSettings &) + ?reminderVibra@CpProfileModel@@QBE_NH@Z @ 12 NONAME ; bool CpProfileModel::reminderVibra(int) const + ?setEmailTone@CpProfileModel@@QAEXHABVQString@@@Z @ 13 NONAME ; void CpProfileModel::setEmailTone(int, class QString const &) + ?ringAlertVibra@CpProfileModel@@QBE_NH@Z @ 14 NONAME ; bool CpProfileModel::ringAlertVibra(int) const + ?emailTone@CpProfileModel@@QBE?AVQString@@H@Z @ 15 NONAME ; class QString CpProfileModel::emailTone(int) const + ?masterVolume@CpProfileModel@@QBEHXZ @ 16 NONAME ; int CpProfileModel::masterVolume(void) const + ?notificationTone@CpProfileModel@@QBE_NH@Z @ 17 NONAME ; bool CpProfileModel::notificationTone(int) const + ?tr@CpProfileModel@@SA?AVQString@@PBD0@Z @ 18 NONAME ; class QString CpProfileModel::tr(char const *, char const *) + ?getStaticMetaObject@CpProfileModel@@SAABUQMetaObject@@XZ @ 19 NONAME ; struct QMetaObject const & CpProfileModel::getStaticMetaObject(void) + ?keyTouchScreenTone@CpProfileModel@@QBEHH@Z @ 20 NONAME ; int CpProfileModel::keyTouchScreenTone(int) const + ?setRingTone@CpProfileModel@@QAEXHABVQString@@@Z @ 21 NONAME ; void CpProfileModel::setRingTone(int, class QString const &) + ?reminderTone@CpProfileModel@@QBE?AVQString@@H@Z @ 22 NONAME ; class QString CpProfileModel::reminderTone(int) const + ?profileName@CpProfileModel@@QBE?AVQString@@H@Z @ 23 NONAME ; class QString CpProfileModel::profileName(int) const + ?setKeyTouchScreenTone@CpProfileModel@@QAEXHH@Z @ 24 NONAME ; void CpProfileModel::setKeyTouchScreenTone(int, int) + ?setMasterVolume@CpProfileModel@@QAEXH@Z @ 25 NONAME ; void CpProfileModel::setMasterVolume(int) + ?staticMetaObject@CpProfileModel@@2UQMetaObject@@B @ 26 NONAME ; struct QMetaObject const CpProfileModel::staticMetaObject + ?profileNames@CpProfileModel@@QBE?AVQStringList@@XZ @ 27 NONAME ; class QStringList CpProfileModel::profileNames(void) const + ?activateProfile@CpProfileModel@@QAEHH@Z @ 28 NONAME ; int CpProfileModel::activateProfile(int) + ?setNotificationVibra@CpProfileModel@@QAEXH_N@Z @ 29 NONAME ; void CpProfileModel::setNotificationVibra(int, bool) + ?setNotificationTone@CpProfileModel@@QAEXH_N@Z @ 30 NONAME ; void CpProfileModel::setNotificationTone(int, bool) + ?isOffLineMode@CpProfileModel@@QBE_NXZ @ 31 NONAME ; bool CpProfileModel::isOffLineMode(void) const + ?metaObject@CpProfileModel@@UBEPBUQMetaObject@@XZ @ 32 NONAME ; struct QMetaObject const * CpProfileModel::metaObject(void) const + ?setRingAlertVibra@CpProfileModel@@QAEXH_N@Z @ 33 NONAME ; void CpProfileModel::setRingAlertVibra(int, bool) + ??0CpProfileModel@@QAE@PAVQObject@@@Z @ 34 NONAME ; CpProfileModel::CpProfileModel(class QObject *) + ?emailVibra@CpProfileModel@@QBE_NH@Z @ 35 NONAME ; bool CpProfileModel::emailVibra(int) const + ?setProfileSettings@CpProfileModel@@QAEHHAAVCpProfileSettings@@@Z @ 36 NONAME ; int CpProfileModel::setProfileSettings(int, class CpProfileSettings &) + ?setEmailVibra@CpProfileModel@@QAEXH_N@Z @ 37 NONAME ; void CpProfileModel::setEmailVibra(int, bool) + ?setOffLineMode@CpProfileModel@@QAEX_N@Z @ 38 NONAME ; void CpProfileModel::setOffLineMode(bool) + ??1CpProfileModel@@UAE@XZ @ 39 NONAME ; CpProfileModel::~CpProfileModel(void) + ?isSilenceMode@CpProfileModel@@QBE_NXZ @ 40 NONAME ; bool CpProfileModel::isSilenceMode(void) const + ?notificationVibra@CpProfileModel@@QBE_NH@Z @ 41 NONAME ; bool CpProfileModel::notificationVibra(int) const + ?qt_metacall@CpProfileModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 42 NONAME ; int CpProfileModel::qt_metacall(enum QMetaObject::Call, int, void * *) + ?messageTone@CpProfileModel@@QBE?AVQString@@H@Z @ 43 NONAME ; class QString CpProfileModel::messageTone(int) const + ?d_func@CpProfileModel@@ABEPBVCpProfileModelPrivate@@XZ @ 44 NONAME ; class CpProfileModelPrivate const * CpProfileModel::d_func(void) const + ?setSilenceMode@CpProfileModel@@QAEX_N@Z @ 45 NONAME ; void CpProfileModel::setSilenceMode(bool) + ?setMessageVibra@CpProfileModel@@QAEXH_N@Z @ 46 NONAME ; void CpProfileModel::setMessageVibra(int, bool) + ?keyTouchScreenVibra@CpProfileModel@@QBEHH@Z @ 47 NONAME ; int CpProfileModel::keyTouchScreenVibra(int) const + ?d_func@CpProfileModel@@AAEPAVCpProfileModelPrivate@@XZ @ 48 NONAME ; class CpProfileModelPrivate * CpProfileModel::d_func(void) + ?messageVibra@CpProfileModel@@QBE_NH@Z @ 49 NONAME ; bool CpProfileModel::messageVibra(int) const + ?initiationFlag@CpProfileModel@@QAEHXZ @ 50 NONAME ; int CpProfileModel::initiationFlag(void) + ??_ECpProfileModel@@UAE@I@Z @ 51 NONAME ; CpProfileModel::~CpProfileModel(unsigned int) + ?ringTone@CpProfileModel@@QBE?AVQString@@H@Z @ 52 NONAME ; class QString CpProfileModel::ringTone(int) const + ?trUtf8@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 53 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *, int) + ?setMessageTone@CpProfileModel@@QAEXHABVQString@@@Z @ 54 NONAME ; void CpProfileModel::setMessageTone(int, class QString const &) + ?setMasterVibra@CpProfileModel@@QAEX_N@Z @ 55 NONAME ; void CpProfileModel::setMasterVibra(bool) diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpapplication/data/mainview.cpcfg --- a/controlpanelui/src/cpapplication/data/mainview.cpcfg Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpapplication/data/mainview.cpcfg Mon May 03 12:32:06 2010 +0300 @@ -1,6 +1,8 @@ - + + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpapplication/src/main.cpp --- a/controlpanelui/src/cpapplication/src/main.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpapplication/src/main.cpp Mon May 03 12:32:06 2010 +0300 @@ -17,8 +17,12 @@ #include #include +#include #include +#include +#include #include +#include #include "cpmainview.h" int main(int argc, char **argv) @@ -43,18 +47,18 @@ { qApp->installTranslator(&translator); } + + HbStyleLoader::registerFilePath(CP_RESOURCE_PATH + QDir::separator() + WIDGETML_SUB_PATH); HbMainWindow mainWindow; CpMainView *mainView = new CpMainView(); -#ifdef WIN32 - mainWindow.setOrientation(Qt::Vertical); -#endif + QObject::connect(mainView,SIGNAL(aboutToClose()),&app, SLOT(quit())); mainWindow.addView(mainView); mainWindow.show(); int ret = app.exec(); - + CPFW_LOG("Exiting ControlPanel.exe."); Logger::closeAll(); @@ -62,4 +66,4 @@ return ret; } -// +// End of File diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpcategorymodel/cpcategorymodel.pri --- a/controlpanelui/src/cpcategorymodel/cpcategorymodel.pri Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpcategorymodel/cpcategorymodel.pri Mon May 03 12:32:06 2010 +0300 @@ -14,8 +14,7 @@ # Description: cpframework source files # -HEADERS += $$PWD/src/cpbasepath.h \ - $$PWD/src/cpplaceholderitemdata.h \ +HEADERS += $$PWD/src/cpplaceholderitemdata.h \ $$PWD/src/cppluginconfigreader.h \ $$PWD/src/cputility.h diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpcategorymodel/src/cpbasepath.h --- a/controlpanelui/src/cpcategorymodel/src/cpbasepath.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,34 +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: -* -*/ - -#ifndef CPBASEPATH_H -#define CPBASEPATH_H - -#ifdef Q_OS_SYMBIAN - #define CP_PLUGIN_PATH QString("/resource/qt/plugins/controlpanel") - #define CP_PLUGIN_CONFIG_PATH QString("/resource/qt/plugins/controlpanel/config") -#else - #ifdef _DEBUG - #define CP_PLUGIN_PATH QString("/ControlPanel/debug/bin") - #define CP_PLUGIN_CONFIG_PATH QString("/ControlPanel/debug/bin/config") - #else - #define CP_PLUGIN_PATH QString("/ControlPanel/release/bin") - #define CP_PLUGIN_CONFIG_PATH QString("/ControlPanel/release/bin/config") - #endif -#endif - -#endif /* CPBASEPATH_H */ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpcategorymodel/src/cpplaceholderitemdata.cpp --- a/controlpanelui/src/cpcategorymodel/src/cpplaceholderitemdata.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpcategorymodel/src/cpplaceholderitemdata.cpp Mon May 03 12:32:06 2010 +0300 @@ -40,7 +40,6 @@ stream << "Load plugin:" << description() << " faild." - << "this is only a placeholder." << "Please check:\n" << "1. if the dll name is correct in configuration file.\n" << "2 if the dll has been generated.\n" diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpcategorymodel/src/cputility.cpp --- a/controlpanelui/src/cpcategorymodel/src/cputility.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpcategorymodel/src/cputility.cpp Mon May 03 12:32:06 2010 +0300 @@ -18,7 +18,7 @@ #include #include #include -#include "cpbasepath.h" +#include #include #include #include @@ -28,6 +28,34 @@ #include "cppluginconfigreader.h" #include "cpplaceholderitemdata.h" + +static bool setEntryItemContentIfEmpty(CpSettingFormItemData *itemData, + const CpPluginConfig &pluginConfig) +{ + CpSettingFormEntryItemData *entryItemData = qobject_cast< CpSettingFormEntryItemData* > (itemData); + if (!entryItemData) { + return false; + } + + if (entryItemData->text().isEmpty()) { + entryItemData->setText(pluginConfig.mDisplayName); + } + if (entryItemData->description().isEmpty()) { + entryItemData->setDescription(pluginConfig.mDescription); + } + if (entryItemData->iconName().isEmpty()) { + entryItemData->setIconName( + CP_RESOURCE_PATH + + QDir::separator() + + ICON_SUB_PATH + + QDir::separator() + + QLatin1String("qgn_prop_set_default_sub.svg") ); + } + + return true; +} + + void CpUtility::buildConfigPluginItems(HbDataFormModelItem *parent, const QString &configFile, CpItemDataHelper &itemDataHelper) @@ -58,7 +86,7 @@ QList itemDataList; //firstly, handle CpPluginInterface - if (CpPluginInterface *plugin = CpPluginLoader().loadCpPlugin(pluginConfig.mPluginFile)) { + if (CpPluginInterface *plugin = CpPluginLoader().loadCpPluginInterface(pluginConfig.mPluginFile)) { CPFW_LOG("Load root component CpPluginInterface succeed."); itemDataList = plugin->createSettingFormItemData(itemDataHelper); } @@ -76,7 +104,7 @@ CPFW_LOG(QLatin1String("Load plugin:") + pluginConfig.mPluginFile + QLatin1String(" failed.")); #ifdef _DEBUG CPFW_LOG(QLatin1String("***Add a placeholder.")); - parent->appendChild(new CpPlaceHolderItemData(itemDataHelper,pluginConfig)); + itemDataList.append(new CpPlaceHolderItemData(itemDataHelper,pluginConfig)); #endif } @@ -91,17 +119,8 @@ categoryItemData->initialize(itemDataHelper); } - //set the description from config if it is empty. - if (CpSettingFormEntryItemData *cpEntryItemData - = qobject_cast(itemData)) { - if (cpEntryItemData->text().isEmpty()) { - cpEntryItemData->setText(pluginConfig.mDisplayName); - } - if (cpEntryItemData->description().isEmpty()) { - cpEntryItemData->setDescription(pluginConfig.mDescription); - } - } - + //set the text and description from config if it is empty. + setEntryItemContentIfEmpty(itemData,pluginConfig); } } //end foreach } diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/accountsplugin/accountsplugin.pri --- a/controlpanelui/src/cpplugins/accountsplugin/accountsplugin.pri Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,20 +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: controlpanel project - common qmake settings -# - -HEADERS += src/cpaccountsgroup.h \ - src/cpaccountsplugin.h -SOURCES += src/cpaccountsgroup.cpp \ - src/cpaccountsplugin.cpp \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/accountsplugin/accountsplugin.pro --- a/controlpanelui/src/cpplugins/accountsplugin/accountsplugin.pro Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +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: -# - -TEMPLATE = lib -TARGET = cpaccountsplugin - -CONFIG += hb plugin - - -include ( ../cpplugincommon.pri ) -include ( accountsplugin.pri ) - -symbian { - TARGET.UID3 = 0x2feed8de -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/accountsplugin/src/cpaccountsgroup.cpp --- a/controlpanelui/src/cpplugins/accountsplugin/src/cpaccountsgroup.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +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 "cpaccountsgroup.h" -#include -#include - -CpAccountsGroup::CpAccountsGroup(CpItemDataHelper &itemDataHelper) : - CpSettingFormItemData(HbDataFormModelItem::GroupItem,QString("Accounts")) -{ - Q_UNUSED(itemDataHelper); - // Initializing the data form item of accounts group here - // You can use CpItemDataHelper for adding connection or adding new proto type - // For more detail information, please refer to controlpanel's wiki -} -CpAccountsGroup::~CpAccountsGroup() -{ - // release resource when necessary -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/accountsplugin/src/cpaccountsgroup.h --- a/controlpanelui/src/cpplugins/accountsplugin/src/cpaccountsgroup.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: - * - */ -#ifndef CPACCOUNTSGROUP_H -#define CPACCOUNTSGROUP_H - -#include - -class CpSettingFormItemData; -class CpItemDataHelper; - -class CpAccountsGroup : public CpSettingFormItemData -{ - Q_OBJECT -public: - explicit CpAccountsGroup(CpItemDataHelper &itemDataHelper); - ~CpAccountsGroup(); -}; - -#endif // CPACCOUNTSGROUP_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/accountsplugin/src/cpaccountsplugin.cpp --- a/controlpanelui/src/cpplugins/accountsplugin/src/cpaccountsplugin.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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 "cpaccountsplugin.h" -#include "cpaccountsgroup.h" - -CpAccountsPlugin::CpAccountsPlugin() -{ -} - -CpAccountsPlugin::~CpAccountsPlugin() -{ -} - -QList CpAccountsPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - return QList() << new CpAccountsGroup(itemDataHelper); -} - -Q_EXPORT_PLUGIN2(cpaccountsplugin, CpAccountsPlugin); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/accountsplugin/src/cpaccountsplugin.h --- a/controlpanelui/src/cpplugins/accountsplugin/src/cpaccountsplugin.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,32 +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: - * - */ -#ifndef CPACCOUNTSPLUGIN_H -#define CPACCOUNTSPLUGIN_H - -#include -#include - -class CpAccountsPlugin : public QObject, public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpAccountsPlugin(); - ~CpAccountsPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; -#endif // CPACCOUNTSPLUGIN_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/applicationsettingsplugin/applicationsettingsplugin.pri --- a/controlpanelui/src/cpplugins/applicationsettingsplugin/applicationsettingsplugin.pri Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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: cpapplicationsettingsplugin source files -# - -# Input -HEADERS += src/cpapplicationsettingsplugin.h \ - src/cpapplicationsettingsitemdata.h -SOURCES += src/cpapplicationsettingsplugin.cpp \ - src/cpapplicationsettingsitemdata.cpp \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/applicationsettingsplugin/applicationsettingsplugin.pro --- a/controlpanelui/src/cpplugins/applicationsettingsplugin/applicationsettingsplugin.pro Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,38 +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: -# - - -TEMPLATE = lib -TARGET = cpapplicationsettingsplugin - -CONFIG += hb plugin - -include ( ../cpplugincommon.pri ) -include ( applicationsettingsplugin.pri ) - -symbian { - TARGET.UID3 = 0x20025FDC -} - -symbian { - deploy.path = C: - headers.sources = data/cpapplicationsettingsplugin.cpcfg - headers.path = /resource/qt/plugins/controlpanel/config - DEPLOYMENT += exportheaders - - # This is for new exporting system coming in garden - for(header, headers.sources):BLD_INF_RULES.prj_exports += "./$$header $$deploy.path$$headers.path/$$basename(header)" -} \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/applicationsettingsplugin/data/cpapplicationsettingsplugin.cpcfg --- a/controlpanelui/src/cpplugins/applicationsettingsplugin/data/cpapplicationsettingsplugin.cpcfg Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,21 +0,0 @@ - - - - Message settings - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/applicationsettingsplugin/src/cpapplicationsettingsitemdata.cpp --- a/controlpanelui/src/cpplugins/applicationsettingsplugin/src/cpapplicationsettingsitemdata.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,79 +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 "cpapplicationsettingsitemdata.h" -#include -#include -//#include -#include -#include - -CpApplicationSettingsItemData::CpApplicationSettingsItemData() -: CpCategorySettingFormItemData(HbDataFormModelItem::GroupItem, - tr("Application Settings"), - QString("cpapplicationsettingsplugin.cpcfg")) -{ -} - -CpApplicationSettingsItemData::~CpApplicationSettingsItemData() -{ -} - -/* -struct ItemDataNameLessThan -{ - bool operator() (CpSettingFormItemData *left,CpSettingFormItemData *right) const { - QString leftName; - if (CpSettingFormEntryItemData *leftEntry = qobject_cast(left)) { - leftName = leftEntry->text(); - } - else { - leftName = left->label(); - } - - QString rightName; - if (CpSettingFormEntryItemData *rightEntry = qobject_cast(right)) { - rightName = rightEntry->text(); - } - else { - rightName = right->label(); - } - - return leftName.compare(rightName,Qt::CaseInsensitive) < 0; - } -}; -*/ - -void CpApplicationSettingsItemData::afterLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/) -{ - /* - QList allItemData; - - QList appplugins = CpPluginLoader::loadApplicationCpPlugins(); - foreach (CpPluginInterface *plugin, appplugins) { - allItemData += plugin->createSettingFormItemData(itemDataHelper); - } - - //sort by name - qSort(allItemData.begin(),allItemData.end(),ItemDataNameLessThan()); - - foreach(CpSettingFormItemData *itemData,allItemData) { - appendChild(itemData); - } - */ -} - -// End of File diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/applicationsettingsplugin/src/cpapplicationsettingsitemdata.h --- a/controlpanelui/src/cpplugins/applicationsettingsplugin/src/cpapplicationsettingsitemdata.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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: - * - */ - -#ifndef CPAPPLICATIONSETTINGSITEMDATA_H -#define CPAPPLICATIONSETTINGSITEMDATA_H - -#include - -class CpApplicationSettingsItemData : public CpCategorySettingFormItemData -{ - Q_OBJECT -public: - CpApplicationSettingsItemData(); - virtual ~CpApplicationSettingsItemData(); -private: - virtual void afterLoadingConfigPlugins(CpItemDataHelper &itemDataHelper); -}; - -#endif //CPAPPLICATIONSETTINGSITEMDATA_H - -//End of File diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/applicationsettingsplugin/src/cpapplicationsettingsplugin.cpp --- a/controlpanelui/src/cpplugins/applicationsettingsplugin/src/cpapplicationsettingsplugin.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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 "cpapplicationsettingsplugin.h" -#include "cpapplicationsettingsitemdata.h" - -CpApplicationSettingsPlugin::CpApplicationSettingsPlugin() -{ -} - -CpApplicationSettingsPlugin::~CpApplicationSettingsPlugin() -{ -} - - -QList CpApplicationSettingsPlugin::createSettingFormItemData(CpItemDataHelper &/*itemDataHelper*/) const -{ - return QList() << new CpApplicationSettingsItemData(); -} - -Q_EXPORT_PLUGIN2(cpapplicationsettingsplugin, CpApplicationSettingsPlugin); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/applicationsettingsplugin/src/cpapplicationsettingsplugin.h --- a/controlpanelui/src/cpplugins/applicationsettingsplugin/src/cpapplicationsettingsplugin.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,35 +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: - * - */ - -#ifndef CPAPPLICATIONSETTINGSPLUGIN_H -#define CPAPPLICATIONSETTINGSPLUGIN_H - -#include -#include - -class CpApplicationSettingsPlugin - : public QObject, public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpApplicationSettingsPlugin(); - virtual ~CpApplicationSettingsPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; - -#endif /* CPAPPLICATIONSETTINGSPLUGIN_H */ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/communicationplugin/data/cpcommunicationplugin.cpcfg --- a/controlpanelui/src/cpplugins/communicationplugin/data/cpcommunicationplugin.cpcfg Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/communicationplugin/data/cpcommunicationplugin.cpcfg Mon May 03 12:32:06 2010 +0300 @@ -7,7 +7,7 @@ WLAN status - + Status text diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/cpplugins.pro --- a/controlpanelui/src/cpplugins/cpplugins.pro Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/cpplugins.pro Mon May 03 12:32:06 2010 +0300 @@ -20,9 +20,12 @@ privacyplugin \ personalizationplugin \ lookfeelplugin \ - keytouchfdbkplugin \ - pincodeplugin \ - devicelockplugin + pincodeplugin \ + devicelockplugin \ + profileactivatorplugin \ + volumeplugin \ + ringtoneplugin + #keytouchfdbkplugin \ #displayplugin \ #applicationsettingsplugin \ #accountsplugin diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/displayplugin.pri --- a/controlpanelui/src/cpplugins/displayplugin/displayplugin.pri Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,24 +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: display plugin source files -# - -# Input -HEADERS += src/cpdisplayplugin.h \ - src/cpdisplayview.h \ - src/cpdisplaymodel.h - -SOURCES += src/cpdisplayplugin.cpp \ - src/cpdisplayview.cpp \ - src/cpdisplaymodel.cpp \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/displayplugin.pro --- a/controlpanelui/src/cpplugins/displayplugin/displayplugin.pro Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,37 +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: -# - -TEMPLATE = lib -TARGET = cpdisplayplugin - -CONFIG += hb plugin - - -include ( ../cpplugincommon.pri ) -include ( displayplugin.pri ) - -symbian { - INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ - $$MOC_DIR - HEADERS += src/cpdisplaymodel_p.h - SOURCES += src/cpdisplaymodel_p.cpp - - LIBS += -lcentralrepository \ - -lfeatmgr - TARGET.UID3 = 0X20028735 - TARGET.CAPABILITY = All -TCB - TARGET.EPOCALLOWDLLDATA = 1 -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel.cpp --- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,123 +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 "cpdisplaymodel.h" - -#ifdef Q_OS_SYMBIAN -#include "cpdisplaymodel_p.h" -#endif - -#include - -CpDisplayModel::CpDisplayModel() -{ -#ifdef Q_OS_SYMBIAN - ptr = new CpDisplayModelPrivate(); -#endif -} - -CpDisplayModel::~CpDisplayModel() -{ -#ifdef Q_OS_SYMBIAN - delete ptr; - ptr = 0; -#endif -} - -bool CpDisplayModel::isKeyguardSupported() -{ -#ifdef Q_OS_SYMBIAN - return ptr->isKeyguardSupported(); -#else - return 0; -#endif -} - -int CpDisplayModel::keyguard() -{ -#ifdef Q_OS_SYMBIAN - return ptr->keyguard(); -#else - return 0; -#endif -} - -void CpDisplayModel::setKeyguard(int value) -{ -#ifdef Q_OS_SYMBIAN - ptr->setKeyguard(value); -#else - Q_UNUSED(value); -#endif -} - -bool CpDisplayModel::isBacklightSupported() -{ -#ifdef Q_OS_SYMBIAN - return ptr->isBacklightSupported(); -#else - return false; -#endif -} - -int CpDisplayModel::backlight() -{ -#ifdef Q_OS_SYMBIAN - return ptr->backlight(); -#else - return 0; -#endif -} - -void CpDisplayModel::setBacklight(int value) -{ -#ifdef Q_OS_SYMBIAN - ptr->setBacklight(value); -#else - Q_UNUSED(value); -#endif -} - -bool CpDisplayModel::isBrightnessSupported() -{ -#ifdef Q_OS_SYMBIAN - return ptr->isBrightnessSupported(); -#else - return false; -#endif -} - -int CpDisplayModel::brightness() -{ -#ifdef Q_OS_SYMBIAN - return ptr->brightness(); -#else - return 0; -#endif -} - -void CpDisplayModel::setBrightness(int value) -{ -#ifdef Q_OS_SYMBIAN - ptr->setBrightness(value); -#else - Q_UNUSED(value); -#endif -} - -// End of the file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel.h --- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel.h Fri Apr 16 14:59:22 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: - * - */ - -#ifndef CPDISPLAYMODEL_H -#define CPDISPLAYMODEL_H - -class CpDisplayModelPrivate; - -class CpDisplayModel - { -public: - CpDisplayModel(); - ~CpDisplayModel(); - -public: - bool isKeyguardSupported(); - int keyguard(); - void setKeyguard(int value); - bool isBacklightSupported(); - int backlight(); - void setBacklight(int value); - bool isBrightnessSupported(); - int brightness(); - void setBrightness(int value); - -private: - CpDisplayModelPrivate* ptr; - }; - -#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel_p.cpp --- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel_p.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,105 +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 "cpdisplaymodel_p.h" -#include -#include -#include -#include -#include // KCRUidSecuritySettings -#include // KCRUidLightSettings -#include - -CpDisplayModelPrivate::CpDisplayModelPrivate() -{ - mLightCenRep = CRepository::NewL( KCRUidLightSettings ); - mSecurityCenRep = CRepository::NewL( KCRUidSecuritySettings ); -} - -CpDisplayModelPrivate::~CpDisplayModelPrivate() -{ - delete mLightCenRep; - mLightCenRep = 0; - - delete mSecurityCenRep; - mSecurityCenRep = 0; -} - -bool CpDisplayModelPrivate::isKeyguardSupported() -{ - return true; -} - -int CpDisplayModelPrivate::keyguard() -{ - int period = 0; - - if ( mSecurityCenRep-> - Get( KSettingsAutomaticKeyguardTime, period ) != KErrNone ){ - period = 60; - mSecurityCenRep->Set( KSettingsAutomaticKeyguardTime, period ); - } - - return period/5; -} - -void CpDisplayModelPrivate::setKeyguard(int value) -{ - value *= 5; - mSecurityCenRep->Set( KSettingsAutomaticKeyguardTime, value ); -} - -bool CpDisplayModelPrivate::isBacklightSupported() -{ - return true; -} - -int CpDisplayModelPrivate::backlight() -{ - int time = 0; - mLightCenRep->Get( KDisplayLightsTimeout, time ); - return time/5; -} - -void CpDisplayModelPrivate::setBacklight(int value) -{ - value *=5; - mLightCenRep->Set( KDisplayLightsTimeout, value ); -} - -bool CpDisplayModelPrivate::isBrightnessSupported() -{ - if ( FeatureManager::FeatureSupported( KFeatureIdBrightnessControl ) ){ - return true; - } else { - return false; - } -} - -int CpDisplayModelPrivate::brightness() -{ - int time = 0; - mLightCenRep->Get( KLightIntensity, time ); - return time; -} - -void CpDisplayModelPrivate::setBrightness(int value) -{ - mLightCenRep->Set( KLightIntensity, value ); -} - -// End of the file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel_p.h --- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplaymodel_p.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: - * - */ - -#ifndef CPDISPLAYMODEL_P_H -#define CPDISPLAYMODEL_P_H - -class CRepository; - -class CpDisplayModelPrivate - { -public: - CpDisplayModelPrivate(); - ~CpDisplayModelPrivate(); - -public: - int keyguard(); - bool isKeyguardSupported(); - void setKeyguard(int value); - bool isBacklightSupported(); - int backlight(); - void setBacklight(int value); - bool isBrightnessSupported(); - int brightness(); - void setBrightness(int value); - -private: - CRepository* mLightCenRep; - CRepository* mSecurityCenRep; - }; - -#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/src/cpdisplayplugin.cpp --- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplayplugin.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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 "cpdisplayplugin.h" -#include "cpdisplayview.h" -#include - -CpDisplayPlugin::CpDisplayPlugin() -{ -} - -CpDisplayPlugin::~CpDisplayPlugin() -{ -} - -QList CpDisplayPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - CpSettingFormItemData* itemData = 0; - CpDisplayView* view = new CpDisplayView(); - if ( view->isHidden() ){ // If there is no any items in the view, the view should be hidden. - itemData = 0; - } else { - itemData = new CpSettingFormEntryItemDataImpl( - itemDataHelper, - tr("Display "), - ""); - } - delete view; - return QList() << itemData; -} - -Q_EXPORT_PLUGIN2(cpdisplayplugin, CpDisplayPlugin); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/src/cpdisplayplugin.h --- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplayplugin.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: - * - */ -#ifndef CPDISPLAYPLUGIN_H -#define CPDISPLAYPLUGIN_H - -#include -#include - -class CpDisplayPlugin : public QObject, public CpPluginInterface -{ -Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpDisplayPlugin(); - virtual ~CpDisplayPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; - -#endif //CPDISPLAYPLUGIN_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/src/cpdisplayview.cpp --- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplayview.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,133 +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 "cpdisplayview.h" -#include "cpdisplaymodel.h" -#include -#include -#include -#include -#include -#include - - -CpDisplayView::CpDisplayView(QGraphicsItem *parent) : - CpBaseSettingView(0,parent), - mScreenRadioButton(0), - mDisplayRadioButton(0), - mBrightSliderItem(0), - mModel(0) -{ - HbDataForm *form = settingForm(); - if (form) { - form->setHeading(tr("Display")); - mModel = new CpDisplayModel(); - HbDataFormModel *model = new HbDataFormModel; - - bool screen = false; - bool backlight = false; - bool brightness = false; - if ( mModel->isKeyguardSupported() ) { - makeScreenItem(model); - screen = true; - } - - if ( mModel->isBacklightSupported() ) { - makeBacklightItem(model); - backlight = true; - } - - if ( mModel->isBrightnessSupported() ) { - makeBrightnessItem(model); - brightness = true; - } - - if ( screen || backlight || brightness ){ - mIsHidden = false; - } else { - mIsHidden = true; - } - - settingForm()->setModel(model); - } -} - -bool CpDisplayView::isHidden() -{ - return mIsHidden; -} - -void CpDisplayView::makeScreenItem(HbDataFormModel* model) -{ - mScreenRadioButton = new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, - QString("Keys & screen locked after")); - settingForm()->addConnection(mScreenRadioButton,SIGNAL(itemSelected(int)),this,SLOT(ScreenValueChanged(int))); - model->appendDataFormItem(mScreenRadioButton, model->invisibleRootItem()); - - QStringList sList; - sList<< "0 seconds"<< "5 seconds"<< "10 seconds"<< "15 seconds"<< "20 seconds"<< "25 seconds"; - mScreenRadioButton->setContentWidgetData( QString("items"), sList ); - mScreenRadioButton->setContentWidgetData( QString("selected"), mModel->keyguard() ); -} - -void CpDisplayView::makeBacklightItem(HbDataFormModel* model) -{ - mDisplayRadioButton = new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem, - QString("Display dimmed after")); - settingForm()->addConnection(mDisplayRadioButton,SIGNAL(itemSelected(int)),this,SLOT(DisplayValueChanged(int))); - model->appendDataFormItem(mDisplayRadioButton, model->invisibleRootItem()); - - QStringList sList; - sList<< "0 seconds"<< "5 seconds"<< "10 seconds"<< "15 seconds"<< "20 seconds"<< "25 seconds"; - mDisplayRadioButton->setContentWidgetData( QString("items"), sList ); - mDisplayRadioButton->setContentWidgetData( QString("selected"), mModel->backlight() ); -} - -void CpDisplayView::makeBrightnessItem(HbDataFormModel* model) -{ - mBrightSliderItem = new CpSettingFormItemData(HbDataFormModelItem::SliderItem, - QString("Brightness")); - settingForm()->addConnection(mBrightSliderItem,SIGNAL(valueChanged(int)),this,SLOT(BrightValueChanged(int))); - model->appendDataFormItem(mBrightSliderItem, model->invisibleRootItem()); - - mBrightSliderItem->setContentWidgetData( QString("value"), mModel->brightness() ); - mBrightSliderItem->setContentWidgetData( QString("minimum"), 0 ); - mBrightSliderItem->setContentWidgetData( QString("maximum"), 100 ); -} - -CpDisplayView::~CpDisplayView() -{ - delete mModel; - mModel = 0; -} - -void CpDisplayView::ScreenValueChanged(int value) -{ - mModel->setKeyguard(value); -} - -void CpDisplayView::DisplayValueChanged(int value) -{ - mModel->setBacklight(value); -} - -void CpDisplayView::BrightValueChanged(int value) -{ - mModel->setBrightness(value); -} - - diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/displayplugin/src/cpdisplayview.h --- a/controlpanelui/src/cpplugins/displayplugin/src/cpdisplayview.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,56 +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: - * - */ -#ifndef CPDISPLAYVIEW_H -#define CPDISPLAYVIEW_H - -#include - -class HbDataFormModelItem; -class HbDataFormModel; -class CpSettingFormItemData; -class CpDisplayModel; - -class CpDisplayView : public CpBaseSettingView -{ - Q_OBJECT -public: - explicit CpDisplayView(QGraphicsItem *parent = 0); - virtual ~CpDisplayView(); - -private: - void makeScreenItem(HbDataFormModel* model); - void makeBacklightItem(HbDataFormModel* model); - void makeBrightnessItem(HbDataFormModel* model); - -public: - bool isHidden(); - -private slots: - //need handling your member's value change - void ScreenValueChanged(int value); - void DisplayValueChanged(int value); - void BrightValueChanged(int value); - -private: - CpSettingFormItemData *mScreenRadioButton; - CpSettingFormItemData *mDisplayRadioButton; - CpSettingFormItemData *mBrightSliderItem; - CpDisplayModel* mModel; - bool mIsHidden; - -}; -#endif// CPDISPLAYVIEW_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/data/cppersonalizationplugin.cpcfg --- a/controlpanelui/src/cpplugins/personalizationplugin/data/cppersonalizationplugin.cpcfg Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/personalizationplugin/data/cppersonalizationplugin.cpcfg Mon May 03 12:32:06 2010 +0300 @@ -1,2 +1,9 @@ + + + + + + + \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pri --- a/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pri Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/personalizationplugin/personalizationplugin.pri Mon May 03 12:32:06 2010 +0300 @@ -18,17 +18,15 @@ HEADERS += src/cppersonalizationplugin.h \ src/cppersonalizationgroupitemdata.h \ src/cpmastervolumeslider.h \ - src/cppersonalizationcustomviewitem.h \ - src/cpmastervolumevaluecontroller.h \ - src/cpprofilesgroupitemdata.h \ - src/cpprofilesettingform.h \ - src/cppersonalizationentryitemdata.h + src/cpprofilesettingform.h \ + src/cppersonalizationentryitemdata.h \ + src/cppersonalizationadvanceview.h \ + src/cpprofilenameeditdialog.h \ SOURCES += src/cppersonalizationplugin.cpp \ src/cppersonalizationgroupitemdata.cpp \ src/cpmastervolumeslider.cpp \ - src/cppersonalizationcustomviewitem.cpp \ - src/cpmastervolumevaluecontroller.cpp \ - src/cpprofilesgroupitemdata.cpp \ - src/cpprofilesettingform.cpp \ - src/cppersonalizationentryitemdata.cpp + src/cpprofilesettingform.cpp \ + src/cppersonalizationentryitemdata.cpp \ + src/cppersonalizationadvanceview.cpp \ + src/cpprofilenameeditdialog.cpp \ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumevaluecontroller.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumevaluecontroller.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,92 +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 "cpmastervolumevaluecontroller.h" -#include -#include - -#ifdef Q_OS_SYMBIAN - #include -#endif - -CpMasterVolumeValueController::CpMasterVolumeValueController(CpProfileModel *profileModel, - HbDataFormModelItem *masterVolumeItem, - CpItemDataHelper &itemDataHelper, - HbDataFormModelItem *profileItem) - : mProfileModel(profileModel), - mMasterVolumeItem(masterVolumeItem), - mProfileItem(profileItem) -{ - //itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(beepActivated()),this,SLOT(onBeepActivated())); - itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(silentActivated()),this,SLOT(onSilentActivated())); - itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(normalValueChanged(int)),this,SLOT(onNormalValueChanged(int))); - updateMasterVolumeValue(); -} - -CpMasterVolumeValueController::~CpMasterVolumeValueController() -{ - -} - -/*void CpMasterVolumeValueController::onBeepActivated() -{ -#ifdef Q_OS_SYMBIAN - mProfileModel->activateBeep(); -#endif -}*/ - -void CpMasterVolumeValueController::onSilentActivated() -{ -#ifdef Q_OS_SYMBIAN - //mProfileModel->activateSilent(); - int err = mProfileModel->activateProfile(EProfileWrapperSilentId); - if (err == KErrNone) { - //update the radio buttonlist of profile - mProfileItem->setContentWidgetData("selected",2); - //mMasterVolumeItem->setContentWidgetData("value",0); - //mMasterVolumeItem->setContentWidgetData("enabled",false); - updateMasterVolumeValue(); - } -#endif -} - -void CpMasterVolumeValueController::onNormalValueChanged(int value) -{ -#ifdef Q_OS_SYMBIAN - mProfileModel->setRingVolume(value); -#endif -} - -void CpMasterVolumeValueController::updateMasterVolumeValue() -{ -#ifdef Q_OS_SYMBIAN - /*if (mProfileModel->isBeep()) { - mMasterVolumeItem->setContentWidgetData(QString("value"),QVariant(1)); - } - else*/ - if (mProfileModel->isSilent()) { - mMasterVolumeItem->setContentWidgetData(QString("value"),QVariant(0)); - - mMasterVolumeItem->setEnabled(false); - } - else { - mMasterVolumeItem->setContentWidgetData(QString("value"),QVariant(mProfileModel->ringVolume())); - } -#endif -} - diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumevaluecontroller.h --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpmastervolumevaluecontroller.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,47 +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: - * - */ -#ifndef CPMASTERVOLUMEVALUECONTROLLER_H -#define CPMASTERVOLUMEVALUECONTROLLER_H - -#include - -class CpProfileModel; -class HbDataFormModelItem; -class CpItemDataHelper; - -class CpMasterVolumeValueController : public QObject -{ - Q_OBJECT -public: - CpMasterVolumeValueController(CpProfileModel *profileModel, - HbDataFormModelItem *masterVolumeItem, - CpItemDataHelper &itemDataHelper, - HbDataFormModelItem *profileItem); - virtual ~CpMasterVolumeValueController(); -private slots: - //void onBeepActivated(); - void onSilentActivated(); - void onNormalValueChanged(int value); -private: - void updateMasterVolumeValue(); -private: - CpProfileModel *mProfileModel; - HbDataFormModelItem *mMasterVolumeItem; - HbDataFormModelItem *mProfileItem; -}; - -#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,61 @@ +/* + * 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 "cppersonalizationadvanceview.h" +#include +#include +/*#include +#include +#include +#include +*/ +#include "cpprofilesettingform.h" +#include "cpprofilenameeditdialog.h" + +#include +#include +CpPersonalizationAdvanceView::CpPersonalizationAdvanceView(QGraphicsItem *parent /*=0*/): + CpBaseSettingView(0,parent) +{ + // 1.init the dataform for advance settings here + // 2.please modify the cpprofilesettingform.h/ cpp according to current ui spec + // 3.NOTICE! you can get controlpanel's text map from the controlpanel ui wiki, use current text id for strings + // 4.use cppersonalizationentryitemdata class to create ringtone, message tone... + // 5.ignore cpmastervolumeslider class, please use default slideritem to create keyandscreen slider, new property added in slider, if any question, please contact me. + // 6. don't forget the cfg file in data folder, you can try to add the profile activator plugin and ringtone plugin here + setSettingForm( new CpProfileSettingForm() ); + initMenu(); +} +CpPersonalizationAdvanceView::~CpPersonalizationAdvanceView() +{ + +} + +void CpPersonalizationAdvanceView::initMenu() +{ + HbAction *editNameAction = new HbAction( this ); + editNameAction->setObjectName( "editNameAction" ); + editNameAction->setText( hbTrId( "txt_cp_list_edit_name" ) ); + + menu()->addAction( editNameAction ); + connect( editNameAction, SIGNAL( triggered() ), this, SLOT( on_editNameAction_triggered() )); +} + +void CpPersonalizationAdvanceView::on_editNameAction_triggered() +{ + QString string = QString( "general" ); + bool ret = CpProfileNameEditDialog::launchProfileNameEditDialog( string ); +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationadvanceview.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,37 @@ +/* + * 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: + * + */ + +#ifndef CPPERSONALIZATIONADVANCEVIEW_H +#define CPPERSONALIZATIONADVANCEVIEW_H + +#include +class CpItemDataHelper; + +class CpPersonalizationAdvanceView: public CpBaseSettingView +{ + Q_OBJECT +public: + explicit CpPersonalizationAdvanceView(QGraphicsItem *parent = 0); + ~CpPersonalizationAdvanceView(); + +private slots: + void on_editNameAction_triggered(); + +private: + void initMenu(); +}; +#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationcustomviewitem.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationcustomviewitem.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,122 +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 "cppersonalizationcustomviewitem.h" -#include "cpmastervolumeslider.h" -#include -#include -#include -#include - -CpPersonalizationCustomViewItem::CpPersonalizationCustomViewItem(QGraphicsItem *parent ) - : HbDataFormViewItem(parent) -{ -} -CpPersonalizationCustomViewItem::~CpPersonalizationCustomViewItem() -{ -} -HbAbstractViewItem* CpPersonalizationCustomViewItem::createItem() -{ - return new CpPersonalizationCustomViewItem(*this); -} -bool CpPersonalizationCustomViewItem::canSetModelIndex(const QModelIndex &index) const -{ - int type = index.data(HbDataFormModelItem::ItemTypeRole).toInt(); - if (type == MasterVolumeSliderItem) { - return true; - } - else { - return false; - } -} - -HbWidget *CpPersonalizationCustomViewItem::createCustomWidget() -{ - int type = modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt(); - if (type == MasterVolumeSliderItem) { - CpMasterVolumeSlider *masterVolumeSlider = new CpMasterVolumeSlider(); - connect(masterVolumeSlider, SIGNAL(valueChanged(int)), this, SLOT(store())); - mWidget = masterVolumeSlider; - return masterVolumeSlider; - } - else { - return 0; - } -} - -void CpPersonalizationCustomViewItem::load() -{ - HbDataFormViewItem::load(); - if (mWidget) { - HbDataFormModelItem::DataItemType itemType = static_cast( - modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); - - if(itemType == MasterVolumeSliderItem) { - - QModelIndex itemIndex = modelIndex(); - HbDataFormModel *model = static_cast(itemView()->model());; - HbDataFormModelItem *modelItem = static_cast( - model->itemFromIndex(itemIndex)); - - const QMetaObject *metaObj = mWidget->metaObject(); - int count = metaObj->propertyCount(); - for (int i = 0; i < count; i++) { - QMetaProperty metaProperty = metaObj->property(i); - if (metaProperty.isValid() && metaProperty.isWritable()) { - metaProperty.write(mWidget,modelItem->contentWidgetData(metaProperty.name())); - } - - } - } - } -} - -void CpPersonalizationCustomViewItem::store() -{ - HbDataFormViewItem::store(); - if (mWidget) { - HbDataFormModelItem::DataItemType itemType = static_cast( - modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); - - if(itemType == MasterVolumeSliderItem) { - - QModelIndex itemIndex = modelIndex(); - HbDataFormModel *model = static_cast(itemView()->model());; - HbDataFormModelItem *modelItem = static_cast( - model->itemFromIndex(itemIndex)); - if (CpMasterVolumeSlider *slider = qobject_cast(mWidget)) { - modelItem->setContentWidgetData("value",slider->value()); - } - - } - } -} - -void CpPersonalizationCustomViewItem::onValueChanged(int value) -{ - HbDataFormModelItem::DataItemType itemType = static_cast( - modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); - - if(itemType == MasterVolumeSliderItem) { - - QModelIndex itemIndex = modelIndex(); - HbDataFormModel *model = static_cast(itemView()->model());; - HbDataFormModelItem *modelItem = static_cast( - model->itemFromIndex(itemIndex)); - modelItem->setContentWidgetData("value",value); - } -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationcustomviewitem.h --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationcustomviewitem.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,45 +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: - * - */ -#ifndef CP_PERSONALIZATION_CUSTOMVIEWITEM_H -#define CP_PERSONALIZATION_CUSTOMVIEWITEM_H - -#include -#include - -class HbWidget; - -const int MasterVolumeSliderItem = HbDataFormModelItem::CustomItemBase+21; - -class CpPersonalizationCustomViewItem: public HbDataFormViewItem -{ - Q_OBJECT -public: - explicit CpPersonalizationCustomViewItem(QGraphicsItem *parent = 0); - ~CpPersonalizationCustomViewItem(); - virtual HbAbstractViewItem* createItem(); - virtual bool canSetModelIndex(const QModelIndex &index) const; -public slots: - virtual void load(); - virtual void store(); -private slots: - void onValueChanged(int value); -protected: - virtual HbWidget* createCustomWidget(); -private: - HbWidget *mWidget; -}; -#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp Mon May 03 12:32:06 2010 +0300 @@ -15,115 +15,46 @@ * */ #include "cppersonalizationgroupitemdata.h" +#include #include #include #include #include #include -#include "cppersonalizationcustomviewitem.h" -#include "cpmastervolumevaluecontroller.h" #include +#include "cppersonalizationadvanceview.h" +#include "cppersonalizationentryitemdata.h" CpPersonalizationGroupItemData::CpPersonalizationGroupItemData(HbDataFormModelItem::DataItemType type, const QString &label, const QString &configFile, const HbDataFormModelItem *parent): - CpCategorySettingFormItemData(type, label, configFile, parent), - mMasterVolume(0), - mMasterVibra(0), - mRingTone(0), - mMessageTone(0), - mEmailTone(0), - mReminderTone(0), - mClockTone(0), - mSayCallerName(0), - mProfileModel(0), - mMasterVolumeValueController(0) + CpCategorySettingFormItemData(type, label, configFile, parent) + { - mProfileModel = new CpProfileModel(); + CPFW_LOG("CpPersonalizationGroupItemData::CpPersonalizationGroupItemData(), START"); + CPFW_LOG("CpPersonalizationGroupItemData::CpPersonalizationGroupItemData(), END"); } CpPersonalizationGroupItemData::~CpPersonalizationGroupItemData() { - delete mProfileModel; - delete mMasterVolumeValueController; } void CpPersonalizationGroupItemData::beforeLoadingConfigPlugins(CpItemDataHelper &itemDataHelper) { - /* - itemDataHelper.addItemPrototype(new CpPersonalizationCustomViewItem); - mMasterVolume = new HbDataFormModelItem(static_cast(MasterVolumeSliderItem)); - mMasterVolumeValueController = new CpMasterVolumeValueController(mProfileModel,mMasterVolume,itemDataHelper); - - //mMasterVolume->setContentWidgetData("maxmum",10); - //mMasterVolume->setContentWidgetData("minmum",1); - //itemDataHelper.addConnection(mMasterVolume,SIGNAL(valueChanged (int)),this,SLOT(masterVolumeValueChanged(int)) ); - this->appendChild(mMasterVolume); - mMasterVibra = new HbDataFormModelItem(HbDataFormModelItem::CheckBoxItem, - QString()); - mMasterVibra->setContentWidgetData("text",QObject::tr("Vibrating alerts")); - itemDataHelper.addConnection(mMasterVibra,SIGNAL(stateChanged(int)),this,SLOT(onVibraValueChange(int))); - - - if (mProfileModel->vibraStatus()) { - mMasterVibra->setContentWidgetData("checkState", Qt::Checked); - } - else { - mMasterVibra->setContentWidgetData("checkState", Qt::Unchecked); - } - - this->appendChild(mMasterVibra); - - */ - + // keep this interface for development in the futrue + CPFW_LOG("CpPersonalizationGroupItemData::beforeLoadingConfigPlugins(), START"); - mRingTone = new CpSettingFormEntryItemDataImpl(itemDataHelper, - tr("Ring tone"), - tr("Nokia tone")); - this->appendChild(mRingTone); - - /*mSayCallerName = new HbDataFormModelItem(HbDataFormModelItem::CheckBoxItem, QString()); - mSayCallerName->setContentWidgetData("text", tr("Say caller's name")); - this->appendChild(mSayCallerName);*/ - - - mMessageTone = new CpSettingFormEntryItemDataImpl(itemDataHelper, - tr("Message tone"), - tr("Nokia message tone")); - this->appendChild(mMessageTone); - mEmailTone = new CpSettingFormEntryItemDataImpl(itemDataHelper, - tr("E-mail tone"), - tr("Nokia e-mail tone")); - this->appendChild(mEmailTone); - mReminderTone = new CpSettingFormEntryItemDataImpl(itemDataHelper, - tr("Reminder tone"), - tr("Nokia calendar tone")); - this->appendChild(mReminderTone); - mClockTone = new CpSettingFormEntryItemDataImpl(itemDataHelper, - tr("Clock tone"), - tr("Nokia clock tone")); - this->appendChild(mClockTone); - - + CPFW_LOG("CpPersonalizationGroupItemData::beforeLoadingConfigPlugins(), END"); +} +void CpPersonalizationGroupItemData::afterLoadingConfigPlugins(CpItemDataHelper &itemDataHelper) +{ + CPFW_LOG("CpPersonalizationGroupItemData::afterLoadingConfigPlugins(), START"); + CpSettingFormEntryItemData *advanceSettingItem = + new CpSettingFormEntryItemDataImpl(itemDataHelper, hbTrId("txt_cp_button_advanced_settings")); + appendChild(advanceSettingItem); + CPFW_LOG("CpPersonalizationGroupItemData::afterLoadingConfigPlugins(), END"); } -void CpPersonalizationGroupItemData::masterVolumeValueChanged(int value) -{ - Q_UNUSED(value); - HbMessageBox::information(QString("volume changed to:%1").arg(value)); -} -void CpPersonalizationGroupItemData::onVibraValueChange(int isVibra) -{ - //Q_UNUSED(isVibra); - if (isVibra) { - mProfileModel->setVibraStatus(true); - } - else { - mProfileModel->setVibraStatus(false); - } -} - - diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.h --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.h Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.h Mon May 03 12:32:06 2010 +0300 @@ -35,22 +35,12 @@ const HbDataFormModelItem *parent = 0); ~CpPersonalizationGroupItemData(); -private slots: - void masterVolumeValueChanged(int value); - void onVibraValueChange(int isVibra); +//private slots: + //void masterVolumeValueChanged(int value); +// void onVibraValueChange(int isVibra); private: virtual void beforeLoadingConfigPlugins(CpItemDataHelper &itemDataHelper); -private: - HbDataFormModelItem *mMasterVolume; - HbDataFormModelItem *mMasterVibra; - CpSettingFormEntryItemData *mRingTone; - CpSettingFormEntryItemData *mMessageTone; - CpSettingFormEntryItemData *mEmailTone; - CpSettingFormEntryItemData *mReminderTone; - CpSettingFormEntryItemData *mClockTone; - HbDataFormModelItem *mSayCallerName; - CpProfileModel *mProfileModel; - CpMasterVolumeValueController *mMasterVolumeValueController; + virtual void afterLoadingConfigPlugins(CpItemDataHelper &itemDataHelper); }; #endif /* CPPERSONALIZATIONGROUPITEMDATA_H */ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp Mon May 03 12:32:06 2010 +0300 @@ -17,7 +17,6 @@ #include "cppersonalizationplugin.h" #include "cppersonalizationgroupitemdata.h" -#include "cpprofilesgroupitemdata.h" #include #include @@ -31,16 +30,14 @@ QList CpPersonalizationPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const { - CpProfilesGroupItemData *profileItemData = - new CpProfilesGroupItemData(itemDataHelper); - + CpPersonalizationGroupItemData *personalItemData = new CpPersonalizationGroupItemData( HbDataFormModelItem::GroupItem, - tr("Tones"), + tr("Personalization"), QString("cppersonalizationplugin.cpcfg") ); - return QList() << profileItemData << personalItemData; + return QList() << personalItemData; } Q_EXPORT_PLUGIN2(cppersonalizationplugin, CpPersonalizationPlugin); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,92 @@ +/* + * 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 "cpprofilenameeditdialog.h" + +#include +#include +#include + +#include + +CpProfileNameEditDialog::CpProfileNameEditDialog( QGraphicsItem *parent ) + :HbDialog( parent ) +{ + init(); +} + +CpProfileNameEditDialog::~CpProfileNameEditDialog() +{ +} + +void CpProfileNameEditDialog::init() +{ + setDismissPolicy( HbPopup::NoDismiss ); + setHeadingWidget( new HbLabel( hbTrId( "txt_cp_title_edit_name" ), this )); + + QGraphicsLinearLayout *vLayout = new QGraphicsLinearLayout(); + vLayout->setOrientation( Qt::Vertical ); + HbWidget *contentWidget = new HbWidget( this ); + mTextEdit = new HbLineEdit( this ); + mTextEdit->setFontSpec( HbFontSpec( HbFontSpec::Primary ) ); + vLayout->addItem( mTextEdit ); + contentWidget->setLayout( vLayout ); + setContentWidget( contentWidget ); + + connect( mTextEdit, SIGNAL( contentsChanged() ), this, SLOT( checkPrimaryAction() ) ); + + setPrimaryAction( new HbAction( hbTrId( "txt_common_button_ok" ), this )); + setSecondaryAction( new HbAction( hbTrId( "txt_common_button_cancel" ), this ) ); + + setTimeout( NoTimeout ); +} + +void CpProfileNameEditDialog::setLineEditText( const QString &text ) +{ + mTextEdit->setText( text ); + mTextEdit->setSelection( 0, text.length() ); +} + +QString CpProfileNameEditDialog::getLineEditText() +{ + QString text = mTextEdit->text(); + return text; +} + +bool CpProfileNameEditDialog::launchProfileNameEditDialog( QString &profileName ) +{ + CpProfileNameEditDialog * profileEditNameDialog = new CpProfileNameEditDialog(); + profileEditNameDialog->setLineEditText( profileName ); + profileEditNameDialog->checkPrimaryAction(); + + if( profileEditNameDialog->exec() == profileEditNameDialog->secondaryAction() ){ + return false; + } + else{ + profileName = profileEditNameDialog->getLineEditText(); + return true; + } +} + +void CpProfileNameEditDialog::checkPrimaryAction() +{ + if( !mTextEdit->text().isEmpty() ){ + primaryAction()->setEnabled( true ); + } else { + primaryAction()->setEnabled( false ); + } +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilenameeditdialog.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,49 @@ +/* + * 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: + * + */ + +#ifndef CPPROFILENAMEEDITDIALOG_H +#define CPPROFILENAMEEDITDIALOG_H + +#include + +class HbWidget; +class HbLineEdit; + +class CpProfileNameEditDialog : public HbDialog +{ + Q_OBJECT + +public: + CpProfileNameEditDialog( QGraphicsItem *parent = 0 ); + virtual ~CpProfileNameEditDialog(); + + static bool launchProfileNameEditDialog( QString &profileName ); + +private slots: + void checkPrimaryAction(); + +private: + void init(); + void setLineEditText( const QString &text ); + QString getLineEditText(); + +private: + HbWidget *mContentWidget; + HbLineEdit *mTextEdit; +}; + +#endif /* CPPROFILENAMEEDITDIALOG_H */ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp Mon May 03 12:32:06 2010 +0300 @@ -16,159 +16,341 @@ */ #include "cpprofilesettingform.h" +#include "cppersonalizationentryitemdata.h" #include #include -#include "cppersonalizationcustomviewitem.h" +#include +#include +#include + +#include +#include +#include +#include +#include CpProfileSettingForm::CpProfileSettingForm() -: mModel(0) + : mModel(0), mItemDataHelper(new CpItemDataHelper( this )), + mProfileModel(new CpProfileModel()), mFileIconProvider(new QFileIconProvider), + mGeneralPage(0),mMeetingPage(0),mCurrentPage( 0 ) { - this->setHeading(tr("Profiles")); - this->setDescription(tr("With profiles you can quickly change audio settings of your device")); - - QList protoTypeList = itemPrototypes(); - protoTypeList.append(new CpPersonalizationCustomViewItem); - setItemPrototypes(protoTypeList); - + this->setHeading(hbTrId("txt_cp_button_advanced_settings")); + this->setDescription(hbTrId("txt_cp_info_select_tones_that_play_when_you_select")); + initModel(); } CpProfileSettingForm::~CpProfileSettingForm() { delete mModel; + delete mProfileModel; + delete mFileIconProvider; } void CpProfileSettingForm::initModel() { mModel = new HbDataFormModel(); - QStringList profileList; - profileList << "General" << "Meeting" << "Silent"; //should be got from engine. - foreach (const QString &profile,profileList) { - HbDataFormModelItem *profilePage = mModel->appendDataFormPage(profile); - //hard code: profile name should be got from profile engine - if (profile != "Silent") { - initVolumeGroup(profilePage); - } - initVibraGroup(profilePage); - //initRingToneGroup(profilePage); - //initMessageToneGroup(profilePage); - //initAlertToneGroup(profilePage); - //initKeyAndScreenToneGroup(profilePage); + QString generalString( mProfileModel->profileName( EProfileWrapperGeneralId ) ); + if( generalString.isEmpty() ) { + qDebug( "warning: general profile name is empty"); + generalString = hbTrId("txt_cp_list_general"); + } + QString meetingString( mProfileModel->profileName( EProfileWrapperMeetingId ) ); + if( meetingString.isEmpty() ) { + qDebug( "warning: meeting profile name is empty"); + meetingString = hbTrId("txt_cp_list_meeting"); } + + mGeneralPage = mModel->appendDataFormPage( generalString ); + initGeneralTonesGroup(); + //initGeneralVibraGroup(); + + mMeetingPage = mModel->appendDataFormPage( meetingString ); + initMeetingTonesGroup(); + //initMeetingVibraGroup(); + setModel(mModel); } -void CpProfileSettingForm::initVolumeGroup(HbDataFormModelItem *parent) +void CpProfileSettingForm::initGeneralTonesGroup() { - HbDataFormModelItem *volumeGroup = mModel->appendDataFormGroup( - tr("Volume"),parent); - // mModel->appendDataFormItem(static_cast(MasterVolumeSliderItem),QString("Master volume"),volumeGroup); - HbDataFormModelItem *informationTone = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),volumeGroup); - informationTone->setContentWidgetData("text", tr("information tones")); - mModel->appendDataFormItem(static_cast(MasterVolumeSliderItem),QString("Key and touch screen tones"),volumeGroup); + CpProfileSettings profileSettings; + mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings ); + + /*HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup( + hbTrId("txt_cp_subhead_tones"),mGeneralPage);*/ + QFileInfo ringToneFileInfo( profileSettings.mRingTone ); + mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, + hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mGeneralPage); + + QFileInfo messageToneFileInfo( profileSettings.mMessageTone ); + mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, + hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mGeneralPage); + + QFileInfo emailToneFileInfo( profileSettings.mEmailTone ); + mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, + hbTrId("txt_cp_dblist_email_tone"), emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mGeneralPage); + + QFileInfo reminderToneFileInfo( profileSettings.mReminderTone ); + mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, + hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mGeneralPage); + + HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mGeneralPage); + notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones")); + notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 ); + + mGeneralKeysAndScreenToneSlider = + mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mGeneralPage); + /* + QMap< QString, QVariant > elements; + elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); + elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); + elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") ); + mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "elementIcons" ), elements ); + */ + //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 + mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 ); + mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 ); + mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone ); + + + mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mGeneralPage ); + //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 + mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 ); + mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 ); + mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); + + addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationTones_stateChanged( int ))); + addConnection( mGeneralKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_general_keysAndScreenToneSlider_ValueChanged( int ))); + addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int ))); } -void CpProfileSettingForm::initVibraGroup(HbDataFormModelItem *parent) + +/*void CpProfileSettingForm::initGeneralVibraGroup() { + CpProfileSettings profileSettings; + mProfileModel->profileSettings( EProfileWrapperGeneralId, profileSettings ); + HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup( - tr("Vibra"),parent); - HbDataFormModelItem *ringVibar = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup); - ringVibar->setContentWidgetData("text", tr("Ring alert vibra")); + hbTrId( "txt_cp_subhead_vibra" ), mGeneralPage ); + HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) ); + ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 ); + + HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) ); + messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 ); + + HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) ); + emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 ); - HbDataFormModelItem *messageVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup); - messageVibra->setContentWidgetData("text", tr("New message alert vibra")); + HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" )); + reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 ); + + HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) ); + notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 ); + + mGeneralSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup ); + //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 + mGeneralSreenVibra->setContentWidgetData( QString( "minimum" ), 0 ); + mGeneralSreenVibra->setContentWidgetData( QString( "maximum" ), 5 ); + mGeneralSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); + + addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_general_ringVibar_stateChanged( int ))); + addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_messageVibra_stateChanged( int ))); + addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_emailVibra_stateChanged( int ))); + addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_reminderVibra_stateChanged( int ))); + addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_general_notificationVibra_stateChanged( int ))); + + addConnection( mGeneralSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int ))); +}*/ - HbDataFormModelItem *emailVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup); - emailVibra->setContentWidgetData("text", tr("New e-mail alert vibra")); +//////////////////////////////////////////////////////////// +void CpProfileSettingForm::initMeetingTonesGroup() +{ + CpProfileSettings profileSettings; + mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings ); + + /* HbDataFormModelItem *tonesGroup = mModel->appendDataFormGroup( + hbTrId("txt_cp_subhead_tones"),mMeetingPage);*/ + QFileInfo ringToneFileInfo( profileSettings.mRingTone ); + mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, + hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ) ), mMeetingPage); + + QFileInfo messageToneFileInfo( profileSettings.mMessageTone ); + mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, + hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ) ), mMeetingPage); + + QFileInfo emailToneFileInfo( profileSettings.mEmailTone ); + mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, + hbTrId("txt_cp_dblist_email_tone"), emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ) ), mMeetingPage); + + QFileInfo reminderToneFileInfo( profileSettings.mReminderTone ); + mModel->appendDataFormItem( new CpPersonalizationEntryItemData( *mItemDataHelper, + hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ) ), mMeetingPage); + + HbDataFormModelItem *notificationTones = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),mMeetingPage); + notificationTones->setContentWidgetData("text", hbTrId("txt_cp_list_notification_tones")); + notificationTones->setContentWidgetData( "checkState", profileSettings.mNotificationTone?2:0 ); + + mMeetingKeysAndScreenToneSlider = + mModel->appendDataFormItem(HbDataFormModelItem::SliderItem ,QString(hbTrId("txt_cp_setlabel_key_and_touchscreen_tones")),mMeetingPage); + /* + QMap< QString, QVariant > elements; + elements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg")); + elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") ); + elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") ); + mMeetingkeysAndScreenSlider->setContentWidgetData( QString( "elementIcons" ), elements ); + */ + //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 + mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "minimum" ), 0 ); + mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString( "maximum" ), 5 ); + mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenTone ); + + mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), mMeetingPage ); + //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 + mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 ); + mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 ); + mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); + + addConnection( notificationTones, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationTones_stateChanged( int ))); + addConnection( mMeetingKeysAndScreenToneSlider, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_keysAndScreenSlider_ValueChanged( int ))); + addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int ))); +} - HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup); - reminderVibra->setContentWidgetData("text", tr("Reminder alarm vibra")); +/*void CpProfileSettingForm::initMeetingVibraGroup() +{ + CpProfileSettings profileSettings; + mProfileModel->profileSettings( EProfileWrapperMeetingId, profileSettings ); + + HbDataFormModelItem *vibraGroup = mModel->appendDataFormGroup( + hbTrId( "txt_cp_subhead_vibra" ), mMeetingPage ); + HbDataFormModelItem *ringVibar = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + ringVibar->setContentWidgetData( "text", hbTrId( "txt_cp_list_ring_alet" ) ); + ringVibar->setContentWidgetData( "checkState", profileSettings.mRingAlertVibra?2:0 ); - HbDataFormModelItem *clockVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup); - clockVibra->setContentWidgetData("text", tr("Clock alarm vibra")); + HbDataFormModelItem *messageVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + messageVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_message" ) ); + messageVibra->setContentWidgetData( "checkState", profileSettings.mMessageVibra?2:0 ); + + HbDataFormModelItem *emailVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + emailVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_received_email" ) ); + emailVibra->setContentWidgetData( "checkState", profileSettings.mEmailVibra?2:0 ); + + HbDataFormModelItem *reminderVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + reminderVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_reminder_alert" )); + reminderVibra->setContentWidgetData( "checkState", profileSettings.mReminderAlertVibra?2:0 ); + + HbDataFormModelItem *notificationVibra = mModel->appendDataFormItem( HbDataFormModelItem::CheckBoxItem, QString(), vibraGroup ); + notificationVibra->setContentWidgetData( "text", hbTrId( "txt_cp_list_notification" ) ); + notificationVibra->setContentWidgetData( "checkState", profileSettings.mNotificationVibra?2:0 ); + + mMeetingSreenVibra = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), vibraGroup ); + //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3 + mMeetingSreenVibra->setContentWidgetData( QString( "minimum" ), 0 ); + mMeetingSreenVibra->setContentWidgetData( QString( "maximum" ), 5 ); + mMeetingSreenVibra->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra ); + + addConnection( ringVibar, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_ringVibar_stateChanged( int ))); + addConnection( messageVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_messageVibra_stateChanged( int ))); + addConnection( emailVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_emailVibra_stateChanged( int ))); + addConnection( reminderVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_reminderVibra_stateChanged( int ))); + addConnection( notificationVibra, SIGNAL( stateChanged( int )), this, SLOT( on_meeting_notificationVibra_stateChanged( int ))); + + addConnection( mMeetingSreenVibra, SIGNAL( valueChanged( int )), this, SLOT( on_meeting_screenVibra_ValueChanged( int ))); +}*/ - HbDataFormModelItem *informationVibra = mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,QString(),vibraGroup); - informationVibra->setContentWidgetData("text", tr("Information vibra")); +//////////////////////////////////////////////////// +//general tones +void CpProfileSettingForm::on_general_notificationTones_stateChanged(int state) +{ + mProfileModel->setNotificationTone( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); +} + +void CpProfileSettingForm::on_general_keysAndScreenToneSlider_ValueChanged( int value ) +{ + mProfileModel->setKeyTouchScreenTone( EProfileWrapperGeneralId, value ); + mGeneralKeysAndScreenToneSlider->setContentWidgetData( QString("value"), value ); +} + + +//general vibra +void CpProfileSettingForm::on_general_ringVibar_stateChanged( int state ) +{ + mProfileModel->setRingAlertVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_general_messageVibra_stateChanged( int state ) +{ + mProfileModel->setMessageVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_general_emailVibra_stateChanged( int state ) +{ + mProfileModel->setEmailVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_general_reminderVibra_stateChanged( int state ) +{ + mProfileModel->setReminderVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_general_notificationVibra_stateChanged( int state ) +{ + mProfileModel->setNotificationVibra( EProfileWrapperGeneralId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_general_screenVibra_ValueChanged( int value ) +{ + mProfileModel->setKeyTouchScreenVibra( EProfileWrapperGeneralId, value ); + mGeneralSreenVibra->setContentWidgetData( QString("value"), value ); } -/*void CpProfileSettingForm::initRingToneGroup(HbDataFormModelItem *parent) +//////////////////////////////////////////////////// +//meeting Tones +void CpProfileSettingForm::on_meeting_notificationTones_stateChanged(int state) { - HbDataFormModelItem *ringToneGroup = mModel->appendDataFormGroup( - tr("Ring tone"),parent); - - QStringList tonesList; - tonesList << "Off" << "Beep" << "Default ring tone" << "set profile-specific tone"; + mProfileModel->setNotificationTone( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); +} - foreach (const QString &tone,tonesList) { - HbDataFormModelItem *toneGroup = mModel->appendDataFormGroupPage(tone,ringToneGroup); - mModel->appendDataFormItem(HbDataFormModelItem::CheckBoxItem,tr("Say caller name"),toneGroup); - HbDataFormModelItem *threeDEffect = mModel->appendDataFormItem( - HbDataFormModelItem::ComboBoxItem,tr("3D effect"),toneGroup); - - threeDEffect->setContentWidgetData("items",QStringList() - << tr("Off") << tr("Circular") << tr("Fly-by") << tr("Zigzag") - << tr("Meander") << tr("Chaos") << tr("Stereo widening")); - threeDEffect->setContentWidgetData("currentIndex",0); - - HbDataFormModelItem *treeEcho = mModel->appendDataFormItem( - HbDataFormModelItem::ComboBoxItem,tr("3D echo"),toneGroup); - treeEcho->setContentWidgetData("items",QStringList() - << tr("Off") << tr("Living room") << tr("Cave") << tr("Railway station") - << tr("Forest") << tr("Duct") << tr("underwater")); - treeEcho->setContentWidgetData("currentIndex",0); - } +void CpProfileSettingForm::on_meeting_keysAndScreenSlider_ValueChanged( int value ) +{ + mProfileModel->setKeyTouchScreenTone( EProfileWrapperMeetingId, value ); + mMeetingKeysAndScreenToneSlider->setContentWidgetData( QString("value"), value ); } -void CpProfileSettingForm::initMessageToneGroup(HbDataFormModelItem *parent) + +//meeting vibra +void CpProfileSettingForm::on_meeting_ringVibar_stateChanged( int state ) +{ + mProfileModel->setRingAlertVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_meeting_messageVibra_stateChanged( int state ) +{ + mProfileModel->setMessageVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_meeting_emailVibra_stateChanged( int state ) { - HbDataFormModelItem *messageToneGroup = mModel->appendDataFormGroup( - tr("Message tones"),parent); - - HbDataFormModelItem *messageTone = mModel->appendDataFormItem( - HbDataFormModelItem::ComboBoxItem,tr("Message tone"),messageToneGroup); - - messageTone->setContentWidgetData("items",QStringList() - << tr("Off") << tr("Beep") << tr("Default mesage tone") << tr("set profile-specific tone")); - messageTone->setContentWidgetData("currentIndex",2); - - HbDataFormModelItem *emailTone = mModel->appendDataFormItem( - HbDataFormModelItem::ComboBoxItem,tr("E-mail tone"),messageToneGroup); - - emailTone->setContentWidgetData("items",QStringList() - << tr("Off") << tr("Beep") << tr("Default e-mail tone") << tr("set profile-specific tone")); - emailTone->setContentWidgetData("currentIndex",2); - + mProfileModel->setEmailVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_meeting_reminderVibra_stateChanged( int state ) +{ + mProfileModel->setReminderVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_meeting_notificationVibra_stateChanged( int state ) +{ + mProfileModel->setNotificationVibra( EProfileWrapperMeetingId, checkBoxStateToBool( state ) ); +} +void CpProfileSettingForm::on_meeting_screenVibra_ValueChanged( int value ) +{ + mProfileModel->setKeyTouchScreenVibra( EProfileWrapperMeetingId, value ); + mMeetingSreenVibra->setContentWidgetData( QString("value"), value ); } -void CpProfileSettingForm::initAlertToneGroup(HbDataFormModelItem *parent) +bool CpProfileSettingForm::checkBoxStateToBool( int state ) { - HbDataFormModelItem *alertToneGroup = mModel->appendDataFormGroup( - tr("Alert tones"),parent); - - HbDataFormModelItem *reminderTone = mModel->appendDataFormItem( - HbDataFormModelItem::ComboBoxItem,tr("Reminder tone"),alertToneGroup); - - reminderTone->setContentWidgetData("items",QStringList() - << tr("Off") << tr("Beep") << tr("Default reminder tone") << tr("set profile-specific tone")); - reminderTone->setContentWidgetData("currentIndex",2); - - HbDataFormModelItem *clockAlarmTone = mModel->appendDataFormItem( - HbDataFormModelItem::ComboBoxItem,tr("Clock alarm tone"),alertToneGroup); - - clockAlarmTone->setContentWidgetData("items",QStringList() - << tr("Off") << tr("Beep") << tr("Default clock alarm tone") << tr("set profile-specific tone")); - clockAlarmTone->setContentWidgetData("currentIndex",2); - + if( state == Qt::Checked ) { + return true; + } else { + return false; + } } - -void CpProfileSettingForm::initKeyAndScreenToneGroup(HbDataFormModelItem *parent) -{ - HbDataFormModelItem *keyAndScreenToneGroup= mModel->appendDataFormGroup( - tr("Key and screen tones"),parent); - mModel->appendDataFormItem(static_cast(MasterVolumeSliderItem), - tr("Key and touch screen tones"),keyAndScreenToneGroup); - mModel->appendDataFormItem(HbDataFormModelItem::SliderItem, - tr("Touch screen vibra"),keyAndScreenToneGroup); -} -*/ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h Mon May 03 12:32:06 2010 +0300 @@ -22,6 +22,9 @@ class HbDataFormModel; class HbDataFormModelItem; +class CpItemDataHelper; +class CpProfileModel; +class QFileIconProvider; class CpProfileSettingForm : public HbDataForm { @@ -29,16 +32,58 @@ public: CpProfileSettingForm(); virtual ~CpProfileSettingForm(); + +private slots: + + //general tones + void on_general_notificationTones_stateChanged(int state); + void on_general_keysAndScreenToneSlider_ValueChanged( int value ); + + //general vibra + void on_general_ringVibar_stateChanged( int state ); + void on_general_messageVibra_stateChanged( int state ); + void on_general_emailVibra_stateChanged( int state ); + void on_general_reminderVibra_stateChanged( int state ); + void on_general_notificationVibra_stateChanged( int state ); + void on_general_screenVibra_ValueChanged( int value ); + + //meeting tones + void on_meeting_notificationTones_stateChanged(int state); + void on_meeting_keysAndScreenSlider_ValueChanged( int value ); + + //meeting vibar + void on_meeting_ringVibar_stateChanged( int state ); + void on_meeting_messageVibra_stateChanged( int state ); + void on_meeting_emailVibra_stateChanged( int state ); + void on_meeting_reminderVibra_stateChanged( int state ); + void on_meeting_notificationVibra_stateChanged( int state ); + void on_meeting_screenVibra_ValueChanged( int value ); private: void initModel(); - void initVolumeGroup(HbDataFormModelItem *parent); - void initVibraGroup(HbDataFormModelItem *parent); + void initGeneralTonesGroup(); + //void initGeneralVibraGroup(); + void initMeetingTonesGroup(); + //void initMeetingVibraGroup(); + bool checkBoxStateToBool( int state ); // void initRingToneGroup(HbDataFormModelItem *parent); // void initMessageToneGroup(HbDataFormModelItem *parent); // void initAlertToneGroup(HbDataFormModelItem *parent); // void initKeyAndScreenToneGroup(HbDataFormModelItem *parent); private: HbDataFormModel *mModel; + CpItemDataHelper *mItemDataHelper; + CpProfileModel *mProfileModel; + QFileIconProvider *mFileIconProvider; + + HbDataFormModelItem *mGeneralPage; + HbDataFormModelItem *mMeetingPage; + + HbDataFormModelItem *mCurrentPage; + + HbDataFormModelItem *mGeneralKeysAndScreenToneSlider; + HbDataFormModelItem *mGeneralSreenVibra; + HbDataFormModelItem *mMeetingKeysAndScreenToneSlider; + HbDataFormModelItem *mMeetingSreenVibra; }; diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesgroupitemdata.cpp --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesgroupitemdata.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,128 +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 "cpprofilesgroupitemdata.h" -#include -#include -#include -#include -#include -#include "cpprofilesettingform.h" -#include "cpmastervolumevaluecontroller.h" -#include "cppersonalizationcustomviewitem.h" - - -CpProfilesGroupItemData::CpProfilesGroupItemData(CpItemDataHelper &itemDataHelper) -: CpSettingFormItemData(HbDataFormModelItem::GroupItem,tr("Profiles")),mProfileModel(0) -{ - mProfileModel = new CpProfileModel(); - initItems(itemDataHelper); -} - -CpProfilesGroupItemData::~CpProfilesGroupItemData() -{ - delete mProfileModel; - if (mMasterVolumeValueController != 0) { - delete mMasterVolumeValueController; - } -} - -namespace -{ - class CpProfileSettingView : public CpBaseSettingView - { - public: - CpProfileSettingView() : CpBaseSettingView(new CpProfileSettingForm()) - { - } - }; -} - -void CpProfilesGroupItemData::initItems(CpItemDataHelper &itemDataHelper) -{ - itemDataHelper.addItemPrototype(new CpPersonalizationCustomViewItem); - HbDataFormModelItem *activeProfileItem = new HbDataFormModelItem( - HbDataFormModelItem::RadioButtonListItem,tr("Profiles")); - //enable the profile activating - // why come into slots twice when select a item? - itemDataHelper.addConnection(activeProfileItem,SIGNAL(itemSelected(int)),this,SLOT(activateProfile(int))); - - mCurrentProfileId = static_cast(mProfileModel->activeProfileId()); - // QString warnningNote = "Profile Id = "+ mCurrentProfileId; - //HbMessageBox::information(warnningNote); - QStringList items; - items << tr("General") << tr("Meeting") << tr("Silent"); - activeProfileItem->setContentWidgetData("items",items); - switch (mCurrentProfileId) { - case EProfileWrapperGeneralId: - activeProfileItem->setContentWidgetData("selected",0); - break; - case EProfileWrapperSilentId: - activeProfileItem->setContentWidgetData("selected",2); - break; - case EProfileWrapperMeetingId: - activeProfileItem->setContentWidgetData("selected",1); - break; - default: - // HbMessageBox::information("unknown id of profile"); - break; - }; - - appendChild(activeProfileItem); - - mMasterVolume = new HbDataFormModelItem(static_cast(MasterVolumeSliderItem)); - - mMasterVolumeValueController = new CpMasterVolumeValueController(mProfileModel, mMasterVolume, - itemDataHelper, activeProfileItem); - this->appendChild(mMasterVolume); - - HbDataFormModelItem *editProfileItem = new CpSettingFormEntryItemDataImpl( - itemDataHelper,tr("Edit profiles")); - appendChild(editProfileItem); -} -void CpProfilesGroupItemData::activateProfile(int profileIndex) -{ - switch (profileIndex) { - case 0: // general - { - mProfileModel->activateProfile(EProfileWrapperGeneralId); - int volumeValue = mProfileModel->ringVolume(); - // update the master volume when profile changed - // should be used profileChangedObserver in the future; - mMasterVolume->setEnabled(true); - mMasterVolume->setContentWidgetData("value", volumeValue); - break; - } - case 1: // meeting - { - mProfileModel->activateProfile(EProfileWrapperMeetingId); - int volumeValue = mProfileModel->ringVolume(); - mMasterVolume->setEnabled(true); - mMasterVolume->setContentWidgetData("value", volumeValue); - break; - } - case 2: // silent - { - mProfileModel->activateProfile(EProfileWrapperSilentId); - mMasterVolume->setContentWidgetData("value", 0); - mMasterVolume->setEnabled(false); - break; - } - default: - break; - - } -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesgroupitemdata.h --- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesgroupitemdata.h Fri Apr 16 14:59:22 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: - * - */ - -#ifndef CPPROFILESGROUPITEMDATA_H -#define CPPROFILESGROUPITEMDATA_H - -#include -#include - -class CpProfileModel; -class CpItemDataHelper; -class CpMasterVolumeValueController; -class CpProfilesGroupItemData : public CpSettingFormItemData -{ - Q_OBJECT -public: - explicit CpProfilesGroupItemData(CpItemDataHelper &itemDataHelper); - virtual ~CpProfilesGroupItemData(); -private slots: - void activateProfile(int profileIndex); -private: - Q_DISABLE_COPY(CpProfilesGroupItemData) - void initItems(CpItemDataHelper &itemDataHelper); - CpProfileModel *mProfileModel; - ProfileWrapperProfileId mCurrentProfileId; - HbDataFormModelItem *mMasterVolume; - CpMasterVolumeValueController *mMasterVolumeValueController; -}; - -#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholdernoiconplugin/placeholdernoiconplugin.pri --- a/controlpanelui/src/cpplugins/placeholdernoiconplugin/placeholdernoiconplugin.pri Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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: cpplaceholderplugin source files -# - -# Input -HEADERS += src/cpplaceholderplugin.h \ - src/cpplaceholderentryitemdata.h - -SOURCES += src/cpplaceholderplugin.cpp \ - src/cpplaceholderentryitemdata.cpp \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholdernoiconplugin/placeholdernoiconplugin.pro --- a/controlpanelui/src/cpplugins/placeholdernoiconplugin/placeholdernoiconplugin.pro Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,28 +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: -# - -TEMPLATE = lib -TARGET = cpplaceholdernoiconplugin - -CONFIG += hb plugin - - -include ( ../cpplugincommon.pri ) -include ( placeholdernoiconplugin.pri ) - -symbian: { - TARGET.UID3 = 0X20025FDD -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholdernoiconplugin/src/cpplaceholderentryitemdata.cpp --- a/controlpanelui/src/cpplugins/placeholdernoiconplugin/src/cpplaceholderentryitemdata.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +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 "cpplaceholderentryitemdata.h" -#include -#include -#include -#include - -CpPlaceholderEntryItemData::CpPlaceholderEntryItemData(CpItemDataHelper &itemDataHelper) -: CpSettingFormEntryItemData(itemDataHelper) -{ - -} - -CpPlaceholderEntryItemData::~CpPlaceholderEntryItemData() -{ -} - -CpBaseSettingView *CpPlaceholderEntryItemData::createSettingView() const -{ - HbDataForm *dataform = new HbDataForm(); - dataform->setHeading(text()); - CpBaseSettingView *view = new CpBaseSettingView(dataform); - return view; -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholdernoiconplugin/src/cpplaceholderentryitemdata.h --- a/controlpanelui/src/cpplugins/placeholdernoiconplugin/src/cpplaceholderentryitemdata.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: -* -*/ - -#ifndef CPPLACEHOLDERENTRYITEMDATA_H -#define CPPLACEHOLDERENTRYITEMDATA_H - -#include - -class CpItemDataHelper; -class CpPlaceholderEntryItemData : public CpSettingFormEntryItemData -{ -public: - explicit CpPlaceholderEntryItemData(CpItemDataHelper &itemDataHelper); - virtual ~CpPlaceholderEntryItemData(); -private: - virtual CpBaseSettingView *createSettingView() const; -}; - -#endif /* CPPLACEHOLDERENTRYITEMDATA_H */ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholdernoiconplugin/src/cpplaceholderplugin.cpp --- a/controlpanelui/src/cpplugins/placeholdernoiconplugin/src/cpplaceholderplugin.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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 "cpplaceholderplugin.h" -#include "cpplaceholderentryitemdata.h" - -CpPlaceholderPlugin::CpPlaceholderPlugin() -{ -} - -CpPlaceholderPlugin::~CpPlaceholderPlugin() -{ -} - -QList CpPlaceholderPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - return QList() << new CpPlaceholderEntryItemData(itemDataHelper); -} - -Q_EXPORT_PLUGIN2(cpplaceholderplugin, CpPlaceholderPlugin); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholdernoiconplugin/src/cpplaceholderplugin.h --- a/controlpanelui/src/cpplugins/placeholdernoiconplugin/src/cpplaceholderplugin.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: - * - */ -#ifndef CPPLACEHOLDERPLUGIN_H -#define CPPLACEHOLDERPLUGIN_H - -#include -#include - -class CpPlaceholderPlugin : public QObject, public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpPlaceholderPlugin(); - virtual ~CpPlaceholderPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; - -#endif //CPPLACEHOLDERPLUGIN_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholderplugin/image/qgn_menu_note.svg --- a/controlpanelui/src/cpplugins/placeholderplugin/image/qgn_menu_note.svg Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,88 +0,0 @@ - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholderplugin/placeholderplugin.pri --- a/controlpanelui/src/cpplugins/placeholderplugin/placeholderplugin.pri Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,22 +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: cpplaceholderplugin source files -# - -# Input -HEADERS += src/cpplaceholderplugin.h \ - src/cpplaceholderentryitemdata.h - -SOURCES += src/cpplaceholderplugin.cpp \ - src/cpplaceholderentryitemdata.cpp \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholderplugin/placeholderplugin.pro --- a/controlpanelui/src/cpplugins/placeholderplugin/placeholderplugin.pro Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,29 +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: -# - -TEMPLATE = lib -TARGET = cpplaceholderplugin - -CONFIG += hb plugin - -RESOURCES += placeholderplugin.qrc - -include ( ../cpplugincommon.pri ) -include ( placeholderplugin.pri ) - -symbian: { - TARGET.UID3 = 0X20025FE8 -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholderplugin/placeholderplugin.qrc --- a/controlpanelui/src/cpplugins/placeholderplugin/placeholderplugin.qrc Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,5 +0,0 @@ - - - image/qgn_menu_note.svg - - \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholderplugin/src/cpplaceholderentryitemdata.cpp --- a/controlpanelui/src/cpplugins/placeholderplugin/src/cpplaceholderentryitemdata.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,39 +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 "cpplaceholderentryitemdata.h" -#include -#include -#include -#include - -CpPlaceholderEntryItemData::CpPlaceholderEntryItemData(CpItemDataHelper &itemDataHelper) -: CpSettingFormEntryItemData(itemDataHelper) -{ - this->setEntryItemIcon(HbIcon(":/image/qgn_menu_note.svg")); -} - -CpPlaceholderEntryItemData::~CpPlaceholderEntryItemData() -{ -} - -CpBaseSettingView *CpPlaceholderEntryItemData::createSettingView() const -{ - HbDataForm *dataform = new HbDataForm(); - dataform->setHeading(text()); - CpBaseSettingView *view = new CpBaseSettingView(dataform); - return view; -} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholderplugin/src/cpplaceholderentryitemdata.h --- a/controlpanelui/src/cpplugins/placeholderplugin/src/cpplaceholderentryitemdata.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: -* -*/ - -#ifndef CPPLACEHOLDERENTRYITEMDATA_H -#define CPPLACEHOLDERENTRYITEMDATA_H - -#include - -class CpItemDataHelper; -class CpPlaceholderEntryItemData : public CpSettingFormEntryItemData -{ -public: - explicit CpPlaceholderEntryItemData(CpItemDataHelper &itemDataHelper); - virtual ~CpPlaceholderEntryItemData(); -private: - virtual CpBaseSettingView *createSettingView() const; -}; - -#endif /* CPPLACEHOLDERENTRYITEMDATA_H */ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholderplugin/src/cpplaceholderplugin.cpp --- a/controlpanelui/src/cpplugins/placeholderplugin/src/cpplaceholderplugin.cpp Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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 "cpplaceholderplugin.h" -#include "cpplaceholderentryitemdata.h" - -CpPlaceholderPlugin::CpPlaceholderPlugin() -{ -} - -CpPlaceholderPlugin::~CpPlaceholderPlugin() -{ -} - -QList CpPlaceholderPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const -{ - return QList() << new CpPlaceholderEntryItemData(itemDataHelper); -} - -Q_EXPORT_PLUGIN2(cpplaceholderplugin, CpPlaceholderPlugin); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/placeholderplugin/src/cpplaceholderplugin.h --- a/controlpanelui/src/cpplugins/placeholderplugin/src/cpplaceholderplugin.h Fri Apr 16 14:59:22 2010 +0300 +++ /dev/null Thu Jan 01 00:00:00 1970 +0000 @@ -1,33 +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: - * - */ -#ifndef CPPLACEHOLDERPLUGIN_H -#define CPPLACEHOLDERPLUGIN_H - -#include -#include - -class CpPlaceholderPlugin : public QObject, public CpPluginInterface -{ - Q_OBJECT - Q_INTERFACES(CpPluginInterface) -public: - CpPlaceholderPlugin(); - virtual ~CpPlaceholderPlugin(); - virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; -}; - -#endif //CPPLACEHOLDERPLUGIN_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pri Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,20 @@ +# +# 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: display plugin source files +# + +# Input +HEADERS += src/*.h + +SOURCES += src/*.cpp \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pro Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,30 @@ +# +# 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: +# + +TEMPLATE = lib +TARGET = cpprofileactivator + +CONFIG += hb plugin + + +include ( ../cpplugincommon.pri ) +include ( profileactivatorplugin.pri ) +LIBS += -lcpprofilewrapper +symbian { + TARGET.UID3 = 0X20028739 + TARGET.CAPABILITY = All -TCB + TARGET.EPOCALLOWDLLDATA = 1 +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,81 @@ +/* + * 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 "cpprofileactivatordialog.h" + +#include +#include +#include +#include +#include "cpprofileactivatorentryitem.h" +CpProfileActivatorDialog::CpProfileActivatorDialog(CpSettingFormItemData *profileActivator, + CpProfileModel &profileModel, + QGraphicsItem *parent):HbDialog(parent), + mProfileModel(profileModel), + mProfileList(0), + mProfileActivator(profileActivator), + mConfirmProfile(0), + mCancelProfile(0) +{ + mProfileIds << EProfileWrapperGeneralId + << EProfileWrapperMeetingId; + mProfileList = new HbRadioButtonList(); + mProfileList->setItems(profileModel.profileNames()); + + int currentId = mProfileModel.activeProfileId(); + mProfileList->setSelected(mProfileIds.indexOf(static_cast(currentId))); + + + + mConfirmProfile = new HbAction(hbTrId("txt_common_button_ok")); + mCancelProfile = new HbAction(hbTrId("txt_common_button_cancel")); + + connect(mConfirmProfile, SIGNAL(triggered(bool)), this, SLOT(confirmProfileSelection())); + connect(mCancelProfile, SIGNAL(triggered(bool)), this, SLOT(cancelProfileSelection())); + + + this->setPrimaryAction(mConfirmProfile); + this->setSecondaryAction(mCancelProfile); + + this->setContentWidget(mProfileList); + this->setModal(true); + this->setDismissPolicy(HbPopup::NoDismiss); + this->setTimeout(HbPopup::NoTimeout); +} + +CpProfileActivatorDialog::~CpProfileActivatorDialog() +{ + delete mConfirmProfile; + delete mCancelProfile; +} +void CpProfileActivatorDialog::confirmProfileSelection() +{ + int currentIndex = mProfileList->selected(); + + // the best choice is no need to convert the index to id + mProfileModel.activateProfile(mProfileIds.at(currentIndex)); + // ret should be remove from here + // no invalid profile exsit + QString profileName = mProfileModel.profileName(mProfileModel.activeProfileId()); + //change the descripton of entry item + if (CpSettingFormEntryItemData *entryItem = qobject_cast(mProfileActivator)) { + entryItem->setDescription(profileName); + } +} +void CpProfileActivatorDialog::cancelProfileSelection() +{ + +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,47 @@ +/* + * 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: + * + */ +#ifndef CPPROFILEACTIVATORDIALOG_H +#define CPPROFILEACTIVATORDIALOG_H + +#include +#include +class HbRadioButtonList; +class HbDataFormModelItem; +class CpProfileActivatorEntryItem; +class CpSettingFormItemData; + +class CpProfileActivatorDialog: public HbDialog +{ + Q_OBJECT +public: + explicit CpProfileActivatorDialog(CpSettingFormItemData *profileActivator, + CpProfileModel &profileModel, + QGraphicsItem *parent = 0); + ~CpProfileActivatorDialog(); + +private slots: + void confirmProfileSelection(); + void cancelProfileSelection(); +private: + CpProfileModel &mProfileModel; + HbRadioButtonList *mProfileList; + CpSettingFormItemData *mProfileActivator; + HbAction *mConfirmProfile; + HbAction *mCancelProfile; + QList mProfileIds; +}; +#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,96 @@ +/* + * 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 "cpprofileactivatorentryitem.h" + +#include "cpprofileactivatordialog.h" +#include +#include +#include +CpProfileActivatorEntryItem::CpProfileActivatorEntryItem(CpItemDataHelper &itemDataHelper, + const QString &text, + const QString &description, + const HbIcon &icon, + const HbDataFormModelItem *parent) + :CpSettingFormEntryItemData(itemDataHelper,text,description, + icon,parent) +{ + mProfileModel = new CpProfileModel(); + int currentId = mProfileModel->activeProfileId(); + QString currentName = mProfileModel->profileName(currentId); + this->setDescription(currentName); +} +CpProfileActivatorEntryItem::~CpProfileActivatorEntryItem() +{ + delete mProfileModel; +} +void CpProfileActivatorEntryItem::onLaunchView() +{ + QScopedPointer dialog + (new CpProfileActivatorDialog(this, *mProfileModel)); + dialog->exec(); +// //launch media fetcher +// if (!mReq) +// { +// mReq = mAppMgr.create("com.nokia.services.media.Music", "fetch(QString)", true); +// +// if (!mReq) +// { +// return; +// } +// else +// { +// connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&))); +// connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&))); +// } +// } +// +// // Set arguments for request (music fetcher application title) +// QList args; +// args << QVariant( text() ); +// mReq->setArguments(args); +// +// // Make the request +// if (!mReq->send()) +// { +// //report error +// return; +// } + +} +/*void CpPersonalizationEntryItemData::handleOk(const QVariant &result) +{ + if (!result.canConvert()) + { + setDescription( "Corrupt result" ); + } + else + { + setDescription( result.value() ); + } +} +void CpPersonalizationEntryItemData::handleError(int errorCode, const QString& errorMessage) +{ + // + Q_UNUSED(errorCode); + Q_UNUSED(errorMessage); + setDescription("Error"); +}*/ + +CpBaseSettingView *CpProfileActivatorEntryItem::createSettingView() const +{ + return 0; +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,42 @@ +/* + * 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: + * + */ +#ifndef CPPERSONALIZATIONENTRYITEMDATA_H +#define CPPERSONALIZATIONENTRYITEMDATA_H + +#include + +class CpProfileModel; +class CpProfileActivatorEntryItem : public CpSettingFormEntryItemData +{ +Q_OBJECT +public: + explicit CpProfileActivatorEntryItem(CpItemDataHelper &itemDataHelper, + const QString &text = QString(), const QString &description = + QString(), const HbIcon &icon = HbIcon(), + const HbDataFormModelItem *parent = 0); + virtual ~CpProfileActivatorEntryItem(); +private slots: + void onLaunchView(); + //void handleOk(const QVariant &result); + //void handleError(int errorCode, const QString& errorMessage); +private: + virtual CpBaseSettingView *createSettingView() const; +private: + CpProfileModel *mProfileModel; +}; + +#endif // CPPERSONALIZATIONENTRYITEMDATA_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorplugin.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,37 @@ +/* + * 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 "cpprofileactivatorplugin.h" +#include "cpprofileactivatorentryitem.h" + +CpProfileActivatorPlugin::CpProfileActivatorPlugin() +{ +} + +CpProfileActivatorPlugin::~CpProfileActivatorPlugin() +{ +} + +QList CpProfileActivatorPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +{ + CpSettingFormItemData* itemData = new CpProfileActivatorEntryItem( + itemDataHelper, + hbTrId("txt_cp_dblist_profile")); + return QList() << itemData; +} + +Q_EXPORT_PLUGIN2(cpprofileactivatorplugin, CpProfileActivatorPlugin); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorplugin.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,33 @@ +/* + * 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: + * + */ +#ifndef CPPROFILEACTIVATOR_H +#define CPPROFILEACTIVATOR_H + +#include +#include + +class CpProfileActivatorPlugin : public QObject, public CpPluginInterface +{ +Q_OBJECT + Q_INTERFACES(CpPluginInterface) +public: + CpProfileActivatorPlugin(); + virtual ~CpProfileActivatorPlugin(); + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; +}; + +#endif //CPPROFILEACTIVATOR_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/ringtoneplugin/ringtoneplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/ringtoneplugin/ringtoneplugin.pri Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,20 @@ +# +# 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: display plugin source files +# + +# Input +HEADERS += src/*.h + +SOURCES += src/*.cpp \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/ringtoneplugin/ringtoneplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/ringtoneplugin/ringtoneplugin.pro Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,33 @@ +# +# 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: +# + +TEMPLATE = lib +TARGET = cpringtoneplugin + + +CONFIG += hb plugin + +LIBS += -lcpprofilewrapper +LIBS += -lxqservice -lxqserviceutil + +include ( ../cpplugincommon.pri ) +include ( ringtoneplugin.pri ) + +symbian { + TARGET.UID3 = 0X20028738 + TARGET.CAPABILITY = All -TCB + TARGET.EPOCALLOWDLLDATA = 1 +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/ringtoneplugin/src/cppersonalizationentryitemdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/ringtoneplugin/src/cppersonalizationentryitemdata.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,120 @@ +/* + * 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 "cppersonalizationentryitemdata.h" +#include +#include +#include +#include +#include + +CpPersonalizationEntryItemData::CpPersonalizationEntryItemData(CpItemDataHelper &itemDataHelper, + const QString &text, + const QString &description, + const HbIcon &icon, + const HbDataFormModelItem *parent) + :CpSettingFormEntryItemData(itemDataHelper,text,description, + icon,parent),mReq(0),mProfileModel(0) +{ + CPFW_LOG("CpPersonalizationEntryItemData::CpPersonalizationEntryItemData(), START"); + mProfileModel = new CpProfileModel(); + if(mProfileModel) + { + setDescription( mProfileModel->ringTone().section(QDir::separator (),-1) ); + } + else + { + CPFW_LOG("CpPersonalizationEntryItemData::mProfileModel:NULL!"); + } +} +CpPersonalizationEntryItemData::~CpPersonalizationEntryItemData() +{ + if( mProfileModel ) + { + delete mProfileModel; + mProfileModel = NULL; + } +} +void CpPersonalizationEntryItemData::onLaunchView() +{ + CPFW_LOG("CpPersonalizationEntryItemData::onLaunchView, START"); + + //launch media fetcher + if (!mReq) + { + mReq = mAppMgr.create("com.nokia.services.media.Music", "fetch(QString)", true); + + if (!mReq) + { + CPFW_LOG("CpPersonalizationEntryItemData::onLaunchView, Mediafetcher start failed"); + return; + } + else + { + connect(mReq, SIGNAL(requestOk(const QVariant&)), SLOT(handleOk(const QVariant&))); + connect(mReq, SIGNAL(requestError(int,const QString&)), SLOT(handleError(int,const QString&))); + } + } + + // Set arguments for request (music fetcher application title) + QList args; + args << QVariant( text() ); + mReq->setArguments(args); + + // Make the request + if (!mReq->send()) + { + CPFW_LOG("CpPersonalizationEntryItemData::onLaunchView, Mediafetcher calling failed"); + //report error + return; + } + CPFW_LOG("CpPersonalizationEntryItemData::onLaunchView, successful END"); + +} +void CpPersonalizationEntryItemData::handleOk(const QVariant &result) +{ + CPFW_LOG("CpPersonalizationEntryItemData::handleOk"); + if (!result.canConvert()) + { + setDescription( "Corrupt result" ); + } + else + { + QString strRet = result.value(); + if(strRet.length()) + { + setDescription( strRet.section(QDir::separator (),-1) ); + } + else + { + setDescription( "No tone" ); + } + mProfileModel->setRingTone( strRet ); + } +} +void CpPersonalizationEntryItemData::handleError(int errorCode, const QString& errorMessage) +{ + CPFW_LOG("CpPersonalizationEntryItemData::handleError"); + //handling error return + Q_UNUSED(errorCode); + Q_UNUSED(errorMessage); + setDescription("Error media fetcher"); +} + +CpBaseSettingView *CpPersonalizationEntryItemData::createSettingView() const +{ + return NULL; +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/ringtoneplugin/src/cppersonalizationentryitemdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/ringtoneplugin/src/cppersonalizationentryitemdata.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,50 @@ +/* + * 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: + * + */ +#ifndef CPPERSONALIZATIONENTRYITEMDATA_H +#define CPPERSONALIZATIONENTRYITEMDATA_H + +#include +#include + +class CpProfileModel; +class XQApplicationManager; +class XQAiwRequest; + + +class CpPersonalizationEntryItemData : public CpSettingFormEntryItemData +{ + Q_OBJECT +public: + explicit CpPersonalizationEntryItemData(CpItemDataHelper &itemDataHelper, + const QString &text = QString(), + const QString &description = QString(), + const HbIcon &icon = HbIcon(), + const HbDataFormModelItem *parent = 0); + virtual ~CpPersonalizationEntryItemData(); +private slots: + void onLaunchView(); + void handleOk(const QVariant &result); + void handleError(int errorCode, const QString& errorMessage); +private: + virtual CpBaseSettingView *createSettingView() const; +private: + XQApplicationManager mAppMgr; + XQAiwRequest* mReq; + CpProfileModel *mProfileModel; +}; + +#endif // CPPERSONALIZATIONENTRYITEMDATA_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/ringtoneplugin/src/cpringtoneplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/ringtoneplugin/src/cpringtoneplugin.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,36 @@ +/* + * 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 "cpringtoneplugin.h" +#include "cppersonalizationentryitemdata.h" + +CpRingTonePlugin::CpRingTonePlugin() +{ +} + +CpRingTonePlugin::~CpRingTonePlugin() +{ +} + +QList CpRingTonePlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +{ + CpPersonalizationEntryItemData *itemData = new CpPersonalizationEntryItemData(itemDataHelper, + tr("Ring tone"), + tr("Default ring tone")); + return QList() << itemData; +} + +Q_EXPORT_PLUGIN2(cpringtoneplugin, CpRingTonePlugin); diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/ringtoneplugin/src/cpringtoneplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/ringtoneplugin/src/cpringtoneplugin.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,33 @@ +/* + * 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: + * + */ +#ifndef CPRINGTONEPLUGIN_H +#define CPRINGTONEPLUGIN_H + +#include +#include + +class CpRingTonePlugin : public QObject, public CpPluginInterface +{ +Q_OBJECT + Q_INTERFACES(CpPluginInterface) +public: + CpRingTonePlugin(); + virtual ~CpRingTonePlugin(); + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; +}; + +#endif //CPRINGTONEPLUGIN_H diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_decrement.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_decrement.svg Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_decrement_pressed.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_decrement_pressed.svg Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_increment.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_increment.svg Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_increment_pressed.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_increment_pressed.svg Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_muted.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_muted.svg Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,8 @@ + + + + + + + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_unmuted.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/icon/hb_vol_slider_unmuted.svg Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,9 @@ + + + + + + + + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cpmastervolumeslider.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpmastervolumeslider.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,166 @@ +/* + * 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 "cpmastervolumeslider.h" + +CpMasterVolumeSlider::CpMasterVolumeSlider(QGraphicsItem *parent /* =0 */) + :HbSlider(parent), + mPreviousValue(0) +{ +// QList elements; +// elements << HbSlider::IncreaseElement +// << HbSlider::TrackElement +// << HbSlider::DecreaseElement +// << HbSlider::IconElement +// << HbSlider::TextElement; +// +// setElements( elements ); +// setOrientation(Qt::Horizontal); +// setMaximum(10); +// setMinimum(1); +// +// setIcon(HbSlider::DecreaseElement, HbIcon(":/icon/hb_vol_slider_decrement.svg")); +// setIcon(HbSlider::IncreaseElement, HbIcon(":/icon/hb_vol_slider_increment.svg")); +// setIcon(HbSlider::IconElement, HbIcon(":/icon/hb_vol_slider_muted.svg")); +// +// setIconCheckable(true); +// +// // set tick and beep label +// +//#if 1 +//// setMajorTickInterval(1); +//// setTickPosition(Hb::SliderTicksBothSides); +//// QStringList labelList; +//// labelList<< tr("") +//// << tr("Beep"); +// +//// this->setMajorTickLabels(labelList); +//#endif +// /* +// connect(this, SIGNAL(iconToggled(bool)), +// this, SLOT(onMuteIconToggled(bool)));*/ +// connect(this, SIGNAL(valueChanged(int)), +// this, SLOT(onValueChanged(int))); +//// onValueChanged(value()); +} + +CpMasterVolumeSlider::~CpMasterVolumeSlider() +{ +} + +/*bool CpMasterVolumeSlider::isBeepMode() +{ + if (value() == minimum()+1) { + return true; + } + else { + return false; + } +} + +void CpMasterVolumeSlider::setBeepMode(bool isBeepMode) +{ + if (isBeepMode == true) { + setValue(minimum()+1); + } + else { + setValue(mPreviousValue); + } +}*/ + +/*bool CpMasterVolumeSlider::isSilentMode() +{ + if (value() == minimum()) { + return true; + } + else { + return false; + } +} + +void CpMasterVolumeSlider::setSilentMode(bool isSilentMode) +{ + if (isSilentMode == true) { + setValue(minimum()); + } + else { + setValue(mPreviousValue); + } +} + +int CpMasterVolumeSlider::normalValue() +{ + return (value()-1); +} + +void CpMasterVolumeSlider::setNormalValue(int normalValue) +{ + setValue(normalValue+1); +} +*/ +void CpMasterVolumeSlider::onValueChanged(int value) +{ +// if (this->minimum( ) == value) { +// // volume is mute +// this->setIconChecked( true ); +// emit silentActivated(); +// } +// else { +// // unmute volume +// this->setIconEnabled( true ); +// //this->setIconCheckable(false); +// //this->setIconChecked( false ); +// this->setIcon(HbSlider::IconElement, HbIcon(":/icon/hb_vol_slider_unmuted.svg")); +// this->setIconCheckable(true); +// +// +// /*if (value == 1) { +// emit beepActivated(); +// }*/ +// //else { +// int valueMap = value; +// emit normalValueChanged(valueMap); +// //} +// } +} + +/*void CpMasterVolumeSlider::onIncreaseIconClicked() +{ +} + +void CpMasterVolumeSlider::onDecreaseIconClicked() +{ +}*/ + +void CpMasterVolumeSlider::onMuteIconToggled(bool isToggled) +{ +// if (isToggled) { +// mPreviousValue = value(); +// this->setIcon(HbSlider::IconElement, HbIcon(":/icon/hb_vol_slider_muted.svg")); +// setValue(minimum()); +// } +// else { +// this->setIcon(HbSlider::IconElement, HbIcon(":/icon/hb_vol_slider_unmuted.svg")); +// if (mPreviousValue == minimum()||mPreviousValue == minimum()+1) { +// setValue(minimum()+1); +// } +// else { +// setValue(mPreviousValue); +// } +// mPreviousValue = 0; +// } +} + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cpmastervolumeslider.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpmastervolumeslider.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,55 @@ +/* + * 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: + * + */ +#ifndef CP_MASTERVOLUMESLIDER_H +#define CP_MASTERVOLUMESLIDER_H + +#include +#include +class CpMasterVolumeSlider: public HbSlider +{ + Q_OBJECT + //Q_PROPERTY(bool beepMode READ isBeepMode WRITE setBeepMode) + //Q_PROPERTY(bool silentMode READ isSilentMode WRITE setSilentMode) + //Q_PROPERTY(int normalValue READ normalValue WRITE setNormalValue) + +public: + explicit CpMasterVolumeSlider(QGraphicsItem *parent = 0); + ~CpMasterVolumeSlider(); + +public: + //bool isBeepMode(); + //void setBeepMode(bool isBeepMode); + //bool isSilentMode(); + //void setSilentMode(bool isSilentMode); + //int normalValue(); + //void setNormalValue(int normalValue); + +signals: + //void beepActivated(); + void silentActivated(); + void normalValueChanged(int value); +private slots: + void onValueChanged(int value); + //void onIncreaseIconClicked(); + //void onDecreaseIconClicked(); + void onMuteIconToggled(bool isToggled); +private: + int mPreviousValue; +}; + +#endif + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cppersonalizationcustomviewitem.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cppersonalizationcustomviewitem.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,139 @@ +/* + * 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 "cppersonalizationcustomviewitem.h" +#include "cpmastervolumeslider.h" +#include +#include +#include +#include +#include + +CpPersonalizationCustomViewItem::CpPersonalizationCustomViewItem(QGraphicsItem *parent ) + : HbDataFormViewItem(parent), + mWidget(0) +{ +} +CpPersonalizationCustomViewItem::~CpPersonalizationCustomViewItem() +{ +} +HbAbstractViewItem* CpPersonalizationCustomViewItem::createItem() +{ + return new CpPersonalizationCustomViewItem(*this); +} +bool CpPersonalizationCustomViewItem::canSetModelIndex(const QModelIndex &index) const +{ + CpVolumeCustomItemType type = static_cast(index.data(HbDataFormModelItem::ItemTypeRole).toInt()); + /*if (type == MasterVolumeSliderItem) { + return true; + } + else*/ if (type == SilenceIndicatorItem) { + return true; + } + else { + return false; + } +} + +HbWidget *CpPersonalizationCustomViewItem::createCustomWidget() +{ + CpVolumeCustomItemType type = static_cast + (modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + /*if (type == MasterVolumeSliderItem) { + CpMasterVolumeSlider *masterVolumeSlider = new CpMasterVolumeSlider(); + connect(masterVolumeSlider, SIGNAL(valueChanged(int)), this, SLOT(store())); + mWidgetMap.insert(type,masterVolumeSlider); + return masterVolumeSlider; + } else*/ if (type == SilenceIndicatorItem ) { + HbPushButton *slienceIndicator = new HbPushButton(); + slienceIndicator->setCheckable(true); + connect(slienceIndicator, SIGNAL(toggled(bool)),this,SLOT(store())); + mWidget = slienceIndicator; + return slienceIndicator; + } + else { + return 0; + } +} + +void CpPersonalizationCustomViewItem::load() +{ + HbDataFormViewItem::load(); + + CpVolumeCustomItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if(itemType == SilenceIndicatorItem) { + + QModelIndex itemIndex = modelIndex(); + HbDataFormModel *model = static_cast(itemView()->model());; + HbDataFormModelItem *modelItem = static_cast( + model->itemFromIndex(itemIndex)); + + + if (mWidget != 0) { + const QMetaObject *metaObj = mWidget->metaObject(); + int count = metaObj->propertyCount(); + for (int i = 0; i < count; i++) { + QMetaProperty metaProperty = metaObj->property(i); + if (metaProperty.isValid() && metaProperty.isWritable()) { + metaProperty.write(mWidget,modelItem->contentWidgetData(metaProperty.name())); + } + } + } + } +} + + +void CpPersonalizationCustomViewItem::store() +{ + HbDataFormViewItem::store(); + + CpVolumeCustomItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if(itemType == SilenceIndicatorItem) { + + QModelIndex itemIndex = modelIndex(); + HbDataFormModel *model = static_cast(itemView()->model()); + HbDataFormModelItem *modelItem = static_cast( + model->itemFromIndex(itemIndex)); + + + /*if (CpMasterVolumeSlider *slider = qobject_cast(widget)) { + modelItem->setContentWidgetData("value",slider->value()); + }*/ + if (HbPushButton *silenceIndicator = qobject_cast(mWidget)) { + modelItem->setContentWidgetData("checked",silenceIndicator->isChecked()); + } + } +} + +/*void CpPersonalizationCustomViewItem::onValueChanged(int value) +{ + HbDataFormModelItem::DataItemType itemType = static_cast( + modelIndex().data(HbDataFormModelItem::ItemTypeRole).toInt()); + + if(itemType == MasterVolumeSliderItem) { + + QModelIndex itemIndex = modelIndex(); + HbDataFormModel *model = static_cast(itemView()->model());; + HbDataFormModelItem *modelItem = static_cast( + model->itemFromIndex(itemIndex)); + modelItem->setContentWidgetData("value",value); + } +}*/ diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cppersonalizationcustomviewitem.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cppersonalizationcustomviewitem.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,50 @@ +/* + * 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: + * + */ +#ifndef CP_PERSONALIZATION_CUSTOMVIEWITEM_H +#define CP_PERSONALIZATION_CUSTOMVIEWITEM_H + +#include +#include +#include + +class HbWidget; + +enum CpVolumeCustomItemType { + MasterVolumeSliderItem = HbDataFormModelItem::CustomItemBase+21, + SilenceIndicatorItem = HbDataFormModelItem::CustomItemBase+22 +}; + +class CpPersonalizationCustomViewItem: public HbDataFormViewItem +{ + Q_OBJECT +public: + explicit CpPersonalizationCustomViewItem(QGraphicsItem *parent = 0); + ~CpPersonalizationCustomViewItem(); + virtual HbAbstractViewItem* createItem(); + virtual bool canSetModelIndex(const QModelIndex &index) const; +public slots: + virtual void load(); + virtual void store(); +/*private slots: + void onValueChanged(int value);*/ +protected: + virtual HbWidget* createCustomWidget(); +private: + //QMap mWidgetMap; + HbWidget *mWidget; +}; +#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,144 @@ + +/* + * 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 "cpvolumecontroller.h" +#include +#include +#include +#include "cpvolumegroupitemdata.h" +#ifdef Q_OS_SYMBIAN + #include +#endif +//#include +//#include + +CpVolumeController::CpVolumeController(CpProfileModel *profileModel, + const QList &itemList, + CpItemDataHelper &itemDataHelper): + mProfileModel(profileModel), + mItemList(itemList) + +{ + //itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(beepActivated()),this,SLOT(onBeepActivated())); + //itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(silentActivated()),this,SLOT(onSilentActivated())); + //itemDataHelper.addConnection(mMasterVolumeItem,SIGNAL(normalValueChanged(int)),this,SLOT(onNormalValueChanged(int))); + //updateMasterVolumeValue(); + itemDataHelper.addConnection( + mItemList.at(CpVolumeGroupItemData::EVolumeSilenceItem), SIGNAL(toggled(bool)), + this, SLOT(silenceModeChange(bool)) + ); + itemDataHelper.addConnection( + mItemList.at(CpVolumeGroupItemData::EVolumeMasterVolumeItem), SIGNAL(valueChanged(int)), + this, SLOT(masterVolumeChange(int)) + ); + itemDataHelper.addConnection( + mItemList.at(CpVolumeGroupItemData::EVolumeMasterVibraItem), SIGNAL(stateChanged(int)), + this, SLOT(masterVibraChange(int)) + ); + update(); +} + +CpVolumeController::~CpVolumeController() +{ + +} + +/*void CpMasterVolumeValueController::onBeepActivated() +{ +#ifdef Q_OS_SYMBIAN + mProfileModel->activateBeep(); +#endif +}*/ + +void CpVolumeController::silenceModeChange(bool isSilence) +{ +#ifdef Q_OS_SYMBIAN + mProfileModel->setSilenceMode(isSilence); + HbDataFormModelItem *masterVolume = mItemList.at(CpVolumeGroupItemData::EVolumeMasterVolumeItem); + masterVolume->setEnabled(!isSilence); +#endif +} + +void CpVolumeController::masterVolumeChange(int value) +{ +#ifdef Q_OS_SYMBIAN + mProfileModel->setMasterVolume( volumeLevelToInt( (CpVolumeController::VolumeLevel)value ) ); + HbDataFormModelItem *masterVolume = mItemList.at(CpVolumeGroupItemData::EVolumeMasterVolumeItem); + masterVolume->setContentWidgetData("value",value); +#endif +} + +void CpVolumeController::masterVibraChange(int state) +{ +#ifdef Q_OS_SYMBIAN + mProfileModel->setMasterVibra(state); +#endif +} + +void CpVolumeController::update() +{ +#ifdef Q_OS_SYMBIAN + bool isSilenceMode = mProfileModel->isSilenceMode(); + HbDataFormModelItem *silenceIndicator = mItemList.at(CpVolumeGroupItemData::EVolumeSilenceItem); + silenceIndicator->setContentWidgetData("checked",isSilenceMode); + HbDataFormModelItem *masterVolume = mItemList.at(CpVolumeGroupItemData::EVolumeMasterVolumeItem); + if (masterVolume) { + CPFW_LOG("::updateMasterVolumeValue(), Start using profile model."); + QMap iconMaps; + if (isSilenceMode) { + CPFW_LOG("::updateMasterVolumeValue(), Got silent state."); + iconMaps.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg")); + } + else { + iconMaps.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg")); + CPFW_LOG("::updateMasterVolumeValue(), Got ring volume."); + } + masterVolume->setContentWidgetData("elementIcons", iconMaps); + masterVolume->setEnabled(!isSilenceMode); + //masterVolume->setContentWidgetData("enabled",!isSilenceMode); + masterVolume->setContentWidgetData("value",intToVolumeLevel(mProfileModel->masterVolume())); + } + HbDataFormModelItem *masterVibra = mItemList.at(CpVolumeGroupItemData::EVolumeMasterVibraItem); + if (masterVibra) { + masterVibra->setContentWidgetData("checkState",(mProfileModel->masterVibra()?2:0)); + } + +#endif +} + +int CpVolumeController::volumeLevelToInt( CpVolumeController::VolumeLevel volumeLevel ) +{ + switch( volumeLevel ){ + case VolumenLevelSoft: + return 1; + case VolumeLevelMed: + return 5; + case VolumeLevelLoud: + return 10; + } +} +CpVolumeController::VolumeLevel CpVolumeController::intToVolumeLevel( int value ) +{ + if( value < 4 ) { + return VolumenLevelSoft; + } else if( value < 8 ) + return VolumeLevelMed; + else{ + return VolumeLevelLoud; + } +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,54 @@ +/* + * 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: + * + */ +#ifndef CPVOLUMECONTROLLER_H +#define CPVOLUMECONTROLLER_H + +#include + +class CpProfileModel; +class HbDataFormModelItem; +class CpItemDataHelper; + +class CpVolumeController : public QObject +{ + Q_OBJECT +public: + CpVolumeController(CpProfileModel *profileModel, + const QList &itemList, + CpItemDataHelper &itemDataHelper); + virtual ~CpVolumeController(); +private: + enum VolumeLevel{ + VolumenLevelSoft = 1, + VolumeLevelMed = 2 , + VolumeLevelLoud = 3 + }; +private slots: + void silenceModeChange(bool isSilence); + void masterVolumeChange(int value); + void masterVibraChange(int state); +private: + void update(); + int volumeLevelToInt( CpVolumeController::VolumeLevel volumeLevel ); + CpVolumeController::VolumeLevel intToVolumeLevel( int value ); + +private: + CpProfileModel *mProfileModel; + QList mItemList; +}; + +#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,125 @@ +/* + * 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 "cpvolumegroupitemdata.h" +#include +#include +#include +#include +#include +#include +#include +//#include "cpmastervolumevaluecontroller.h" +#include "cpvolumecontroller.h" +#include "cppersonalizationcustomviewitem.h" +#include + +CpVolumeGroupItemData::CpVolumeGroupItemData(CpItemDataHelper &itemDataHelper) +: CpSettingFormItemData(HbDataFormModelItem::GroupItem,tr("txt_cp_subhead_volume")),//mSilenceIndicator(0), + //mMasterVolume(0), + //mMasterVibra(0), + mVolumeController(0), + mProfileModel(0) +{ + initItems(itemDataHelper); +} + +CpVolumeGroupItemData::~CpVolumeGroupItemData() +{ + delete mProfileModel; +} + +void CpVolumeGroupItemData::initItems(CpItemDataHelper &itemDataHelper) +{ + mProfileModel = new CpProfileModel(); + + itemDataHelper.addItemPrototype(new CpPersonalizationCustomViewItem); + CPFW_LOG("CpVolumeGroupItemData::initItems(), get active profile id"); + CPFW_LOG("CpVolumeGroupItemData::initItems(), succeed in getting id"); + + HbDataFormModelItem *silenceIndicator = new HbDataFormModelItem(static_cast(SilenceIndicatorItem)); + mItemList.insert(CpVolumeGroupItemData::EVolumeSilenceItem, silenceIndicator); + silenceIndicator->setContentWidgetData("text",hbTrId("txt_cp_button_silence")); + this->appendChild(silenceIndicator); + + HbDataFormModelItem *masterVolume = new HbDataFormModelItem(HbDataFormModelItem::SliderItem, + hbTrId("txt_cp_setlabel_volume")); + mItemList.insert(CpVolumeGroupItemData::EVolumeMasterVolumeItem, masterVolume); + QList elements; + elements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement) + << QVariant(HbSlider::DecreaseElement) << QVariant(HbSlider::IconElement) + << QVariant(HbSlider::TextElement); + masterVolume->setContentWidgetData("sliderElements",elements); + + QMap iconMaps; + iconMaps.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg")); + iconMaps.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg")); + //iconMaps.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg")); + + masterVolume->setContentWidgetData("elementIcons", iconMaps); + masterVolume->setContentWidgetData("minimum", 1); + masterVolume->setContentWidgetData("maximum", 3); + masterVolume->setContentWidgetData("majorTickInterval",1); + + QStringList tickLabels; + tickLabels<setContentWidgetData("majorTickLabels",tickLabels); + + this->appendChild(masterVolume); + + HbDataFormModelItem *masterVibra = new HbDataFormModelItem(HbDataFormModelItem::CheckBoxItem); + mItemList.insert(CpVolumeGroupItemData::EVolumeMasterVibraItem, masterVibra); + masterVibra->setContentWidgetData("text",hbTrId("txt_cp_list_vibrate")); + + this->appendChild(masterVibra); + + mVolumeController = new CpVolumeController(mProfileModel, mItemList, itemDataHelper); +} +//void CpVolumeGroupItemData::activateProfile(int profileIndex) +//{ +// switch (profileIndex) { +// case 0: // general +// { +// mProfileModel->activateProfile(EProfileWrapperGeneralId); +// int volumeValue = mProfileModel->ringVolume(); +// // update the master volume when profile changed +// // should be used profileChangedObserver in the future; +// mMasterVolume->setContentWidgetData(/*"visible"*/"enabled",true); +// mMasterVolume->setContentWidgetData("value", volumeValue); +// break; +// } +// case 1: // meeting +// { +// mProfileModel->activateProfile(EProfileWrapperMeetingId); +// int volumeValue = mProfileModel->ringVolume(); +// mMasterVolume->setContentWidgetData(/*"visible"*/"enabled",true); +// mMasterVolume->setContentWidgetData("value", volumeValue); +// break; +// } +// case 2: // silent +// { +// mProfileModel->activateProfile(EProfileWrapperSilentId); +// mMasterVolume->setContentWidgetData("value", 0); +// mMasterVolume->setContentWidgetData(/*"visible"*/"enabled",false); +// break; +// } +// default: +// break; +// +// } +//} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,48 @@ +/* + * 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: + * + */ + +#ifndef CPPROFILESGROUPITEMDATA_H +#define CPPROFILESGROUPITEMDATA_H + +#include +#include + +class CpProfileModel; +class CpItemDataHelper; +class CpVolumeController; +class CpVolumeGroupItemData : public CpSettingFormItemData +{ + Q_OBJECT +public: + enum VolumeGroupModelItem { + EVolumeSilenceItem, + EVolumeMasterVolumeItem, + EVolumeMasterVibraItem, + EVolumeItemEnd + }; +public: + explicit CpVolumeGroupItemData(CpItemDataHelper &itemDataHelper); + virtual ~CpVolumeGroupItemData(); +private: + Q_DISABLE_COPY(CpVolumeGroupItemData) + void initItems(CpItemDataHelper &itemDataHelper); + QList mItemList; + CpVolumeController *mVolumeController; + CpProfileModel *mProfileModel; +}; + +#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cpvolumeplugin.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumeplugin.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,40 @@ +/* + * 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 "cpvolumeplugin.h" +#include "cpvolumegroupitemdata.h" +#include + +CpVolumePlugin::CpVolumePlugin() +{ +} + +CpVolumePlugin::~CpVolumePlugin() +{ +} + +QList CpVolumePlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const +{ + + CpVolumeGroupItemData *volumeGroupItem = new CpVolumeGroupItemData(itemDataHelper); + + return QList() << volumeGroupItem ; +} + +Q_EXPORT_PLUGIN2(cpvolumeplugin, CpVolumePlugin); + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/src/cpvolumeplugin.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumeplugin.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,38 @@ +/* + * 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: + * + */ + +#ifndef CPVOLUMEPLUGIN_H +#define CPVOLUMEPLUGIN_H + +#include +#include + +class CpVolumePlugin + : public QObject, + public CpPluginInterface +{ + Q_OBJECT + Q_INTERFACES(CpPluginInterface) +public: + CpVolumePlugin(); + virtual ~CpVolumePlugin(); + virtual QList createSettingFormItemData(CpItemDataHelper &itemDataHelper) const; +}; + +#endif /* CPVOLUMEPLUGIN_H */ + + diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/volumeplugin.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/volumeplugin.pri Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,21 @@ +# +# 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: controlpanel project - common qmake settings +# + +HEADERS += src/*.h +SOURCES += src/*.cpp + + + \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/volumeplugin.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/volumeplugin.pro Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,29 @@ +# +# 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: +# + +TEMPLATE = lib +TARGET = cpvolumeplugin + +CONFIG += hb plugin +RESOURCES += volumeplugin.qrc +LIBS += -lcpprofilewrapper + +include ( ../cpplugincommon.pri ) +include ( volumeplugin.pri ) + +symbian { + TARGET.UID3 = 0X20028737 +} diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpplugins/volumeplugin/volumeplugin.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpplugins/volumeplugin/volumeplugin.qrc Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,10 @@ + + + icon/hb_vol_slider_decrement.svg + icon/hb_vol_slider_decrement_pressed.svg + icon/hb_vol_slider_increment.svg + icon/hb_vol_slider_increment_pressed.svg + icon/hb_vol_slider_muted.svg + icon/hb_vol_slider_unmuted.svg + + \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpprofilewrapper/cpprofilewrapper.pro --- a/controlpanelui/src/cpprofilewrapper/cpprofilewrapper.pro Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpprofilewrapper/cpprofilewrapper.pro Mon May 03 12:32:06 2010 +0300 @@ -52,7 +52,7 @@ ../inc/cpprofilewrappermacro.h \ src/cpprofilemodel_p.h SOURCES += src/cpprofilemodel.cpp - +CONFIG += hb win32 { INCLUDEPATH += $$PWD/src INCLUDEPATH += ../inc @@ -61,14 +61,16 @@ symbian { INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE \ - $$APP_LAYER_SYSTEMINCLUDE \ - $$MOC_DIR + $$APP_LAYER_SYSTEMINCLUDE \ + $$MOC_DIR + INCLUDEPATH += $$MW_LAYER_PLATFORM_EXPORT_PATH(cplogger) SOURCES += src/cpprofilemodel_p.cpp LIBS += -lprofileeng \ -lcentralrepository \ - -lcharconv + -lcharconv \ + -lcpframework # For cplogger TARGET.CAPABILITY = All -TCB TARGET.EPOCALLOWDLLDATA = 1 TARGET.UID3 = 0x20025FE6 diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpprofilewrapper/src/cpprofilemodel.cpp --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel.cpp Mon May 03 12:32:06 2010 +0300 @@ -17,15 +17,17 @@ #include "cpprofilemodel.h" #include "cpprofilemodel_p.h" +#include -CpProfileModel::CpProfileModel() +CpProfileModel::CpProfileModel(QObject *parent /*=0*/):QObject(parent), + d_ptr(new CpProfileModelPrivate()) { - dptr = new CpProfileModelPrivate(); + d_ptr->initialize(this); } CpProfileModel::~CpProfileModel() { - delete dptr; + delete d_ptr; } /* @@ -33,23 +35,29 @@ */ int CpProfileModel::initiationFlag() { - return dptr->initiationFlag(); + return d_ptr->initiationFlag(); } /* * Get profile name with its id */ -QString CpProfileModel::profileName(int profileId) +QString CpProfileModel::profileName(int profileId) const { - return dptr->profileName(profileId); + return d_ptr->profileName(profileId); } - +/*! + * get profile name list + */ +QStringList CpProfileModel::profileNames()const +{ + return d_ptr->profileNames(); +} /* * Activate a profile with its id, return the operation code. */ int CpProfileModel::activateProfile(int profileId) { - return dptr->activateProfile(profileId); + return d_ptr->activateProfile(profileId); } /* @@ -57,206 +65,434 @@ */ int CpProfileModel::activeProfileId() { - return dptr->activeProfileId(); + return d_ptr->activeProfileId(); +} + +/*! + Get profile settings, store in center repository keys + */ +int CpProfileModel::profileSettings(int profileId, CpProfileSettings& profileSettings) +{ + return d_ptr->profileSettings(profileId, profileSettings); +} + +/*! + Set profile settings from center repository keys + */ +int CpProfileModel::setProfileSettings(int profileId, CpProfileSettings& profileSettings ) +{ + return d_ptr->setProfileSettings(profileId, profileSettings); } -/* - * Get path and file name of ring tone file +/*! + Get ring tone of profiles, if the general profile's ring tone is different with + meeting ring tone, it returns the general profile's ring tone */ -QString CpProfileModel::ringTone() +QString CpProfileModel::ringTone() const { - return dptr->ringTone(); + return d_ptr->ringTone(); } -/* - * Set path and file to ring tone +/*! + Set ring tone for all profiles */ -int CpProfileModel::setRingTone(const QString& filePath) +void CpProfileModel::setRingTone(const QString& filePath) { - int err = dptr->setRingTone(filePath); - return err; + d_ptr->setRingTone(filePath); +} + +/*! + Return master volume for device + */ +int CpProfileModel::masterVolume() const +{ + return d_ptr->masterVolume(); } -/* - * Get path and file name of message tone file +/*! + Set device's master volume + */ +void CpProfileModel::setMasterVolume(int volume) +{ + return d_ptr->setMasterVolume(volume); +} + +/*! + Return the master vibra's status of device */ -QString CpProfileModel::messageTone() +bool CpProfileModel::masterVibra() const { - return dptr->messageTone(); + return d_ptr->masterVibra(); +} + +/*! + Set the master vibra's status of device, if the master vibra is on, + the vibra settings in profiles are valid, if the master is off, the + vibra settings in profiles are invalid. + */ +void CpProfileModel::setMasterVibra(bool isVibra) +{ + d_ptr->setMasterVibra(isVibra); } -/* - * Set path and file to message tone +/*! + Return the silence mode of device, silence mode will kill all outgoing + audio. */ -int CpProfileModel::setMessageTone(const QString& filePath) +bool CpProfileModel::isSilenceMode() const { - int err = dptr->setMessageTone(filePath); - return err; + return d_ptr->isSilenceMode(); } -/* - * Get path and file name of email tone file +/*! + Set silence mode for deivce + */ +void CpProfileModel::setSilenceMode(bool isSilence) +{ + d_ptr->setSilenceMode(isSilence); +} + +/*! + Return the status of off line mode (air plane mode) of device */ -QString CpProfileModel::emailTone() +bool CpProfileModel::isOffLineMode() const { - return dptr->emailTone(); + return d_ptr->isOffLineMode(); +} + +/*! + Set off line mode of device + */ +void CpProfileModel::setOffLineMode(bool isOffLine) +{ + d_ptr->setOffLineMode(isOffLine); } -/* - * Set path and file to email tone - */ -int CpProfileModel::setEmailTone(const QString& filePath) +QString CpProfileModel::ringTone(int profileId)const +{ + return d_ptr->ringTone(profileId); +} + +void CpProfileModel::setRingTone(int profileId, const QString& filePath) { - int err = dptr->setEmailTone(filePath); - return err; + d_ptr->setRingTone(profileId, filePath); +} + +QString CpProfileModel::messageTone(int profileId) const +{ + return d_ptr->messageTone(profileId); +} + +void CpProfileModel::setMessageTone(int profileId, const QString& filePath) +{ + d_ptr->setMessageTone(profileId, filePath); } -/* - * Get path and file name of calendar event tone file - */ -QString CpProfileModel::calendarTone() +QString CpProfileModel::emailTone(int profileId) const +{ + return d_ptr->emailTone(profileId); +} + +void CpProfileModel::setEmailTone(int profileId, const QString& filePath) +{ + d_ptr->setEmailTone(profileId,filePath); +} + +QString CpProfileModel::reminderTone(int profileId) const { - return dptr->calendarTone(); + return d_ptr->reminderTone(profileId); +} + +void CpProfileModel::setReminderTone(int profileId, const QString& filePath) +{ + d_ptr->setReminderTone(profileId,filePath); +} + +bool CpProfileModel::notificationTone(int profileId) const +{ + return d_ptr->notificationTone(profileId); +} + +void CpProfileModel::setNotificationTone(int profileId, bool isActive) +{ + d_ptr->setNotificationTone(profileId, isActive); } -/* - * Set path and file to calendar event tone - */ -void CpProfileModel::setCalendarTone(const QString& filePath) +int CpProfileModel::keyTouchScreenTone(int profileId) const +{ + return d_ptr->keyTouchScreenTone(profileId); +} + +void CpProfileModel::setKeyTouchScreenTone(int profileId, int level) +{ + d_ptr->setKeyTouchScreenTone(profileId,level); +} + +bool CpProfileModel::ringAlertVibra(int profileId) const { - dptr->setCalendarTone(filePath); + return d_ptr->ringAlertVibra(profileId); +} + +void CpProfileModel::setRingAlertVibra(int profileId, bool isActive) +{ + d_ptr->setRingAlertVibra(profileId,isActive); +} + +bool CpProfileModel::messageVibra(int profileId) const +{ + return d_ptr->messageVibra(profileId); } -/* - * Get path and file name of clock alarm tone file - */ -QString CpProfileModel::alarmTone() +void CpProfileModel::setMessageVibra(int profileId, bool isActive) +{ + return d_ptr->setMessageVibra(profileId,isActive); +} + +bool CpProfileModel::emailVibra(int profileId) const { - return dptr->alarmTone(); + return d_ptr->emailVibra(profileId); +} + +void CpProfileModel::setEmailVibra(int profileId, bool isActive) +{ + d_ptr->setEmailVibra(profileId,isActive); } -/* - * Set path and file to clock alarm tone - */ -void CpProfileModel::setAlarmTone(const QString& filePath) +bool CpProfileModel::reminderVibra(int profileId) const { - dptr->setAlarmTone(filePath); + return d_ptr->reminderVibra(profileId); } -/* - * Get the value of master volume - */ -int CpProfileModel::ringVolume() +void CpProfileModel::setReminderVibra(int profileId, bool isActive) +{ + d_ptr->setReminderVibra(profileId,isActive); +} + +bool CpProfileModel::notificationVibra(int profileId) const { - return dptr->ringVolume(); + return d_ptr->notificationVibra(profileId); +} + +void CpProfileModel::setNotificationVibra(int profileId, bool isActive) +{ + d_ptr->setNotificationVibra(profileId,isActive); } -/* - * Set master volume, the value should be between 1-10 - */ -void CpProfileModel::setRingVolume(int volume) +int CpProfileModel::keyTouchScreenVibra(int profileId)const { - dptr->setRingVolume(volume); -} - -/* - * Activate master volume to beep - */ -void CpProfileModel::activateBeep() -{ - dptr->activateBeep(); + return d_ptr->keyTouchScreenVibra(profileId); } -/* - * Get beep status in master volume - */ -bool CpProfileModel::isBeep() -{ - return dptr->isBeep(); -} - -/* - * Activate master volume to silent - */ -void CpProfileModel::activateSilent() +void CpProfileModel::setKeyTouchScreenVibra(int profileId, int level) { - dptr->activateSilent(); -} - -/* - * Get silent status in master volume - */ -bool CpProfileModel::isSilent() -{ - return dptr->isSilent(); -} - -/* - * Get master vibra's status - */ -bool CpProfileModel::vibraStatus() -{ - return dptr->vibraStatus(); + d_ptr->setKeyTouchScreenVibra(profileId,level); } -/* - * Set master vibra's status - */ -void CpProfileModel::setVibraStatus(bool status) -{ - dptr->setVibraStatus(status); -} - -/* - * Get keypad' volume - */ -int CpProfileModel::keyVolume() -{ - return dptr->keyVolume(); -} - -/* - * Set keypad's volume, - * the value of the volume should be between 0-3 - */ -void CpProfileModel::setKeyVolume(int volume) -{ - dptr->setKeyVolume(volume); -} - -/* - * Get screen tone's volume - */ -int CpProfileModel::screenVolume() -{ - return dptr->screenVolume(); -} - -/* - * Set screen tone's volume, - * the value of the volume should be between 0-3 - */ -void CpProfileModel::setScreenVolume(int volume) -{ - dptr->setScreenVolume(volume); -} - -/* - * Get screen vibra's level - */ -int CpProfileModel::screenVibra() -{ - return dptr->screenVibra(); -} - -/* - * Set screen vibra's level, - * the value of the level should be between 0-3 - */ -void CpProfileModel::setScreenVibra(int volume) -{ - dptr->setScreenVibra(volume); -} +///* +// * Set a profile as current editing profile +// */ +//int CpProfileModel::setEditingProfile(int profileId) +//{ +// return d_ptr->setEditingProfile(profileId); +//} +// +///* +// * Get path and file name of ring tone file +// */ +//QString CpProfileModel::ringTone() +//{ +// return d_ptr->ringTone(); +//} +// +///* +// * Set path and file to ring tone +// */ +//int CpProfileModel::setRingTone(const QString& filePath) +//{ +// int err = d_ptr->setRingTone(filePath); +// return err; +//} +// +///* +// * Get path and file name of message tone file +// */ +//QString CpProfileModel::messageTone() +//{ +// return d_ptr->messageTone(); +//} +// +///* +// * Set path and file to message tone +// */ +//int CpProfileModel::setMessageTone(const QString& filePath) +//{ +// int err = d_ptr->setMessageTone(filePath); +// return err; +//} +// +///* +// * Get path and file name of email tone file +// */ +//QString CpProfileModel::emailTone() +//{ +// return d_ptr->emailTone(); +//} +// +///* +// * Set path and file to email tone +// */ +//int CpProfileModel::setEmailTone(const QString& filePath) +//{ +// int err = d_ptr->setEmailTone(filePath); +// return err; +//} +// +///* +// * Get path and file name of calendar event tone file +// */ +//QString CpProfileModel::calendarTone() +//{ +// return d_ptr->calendarTone(); +//} +// +///* +// * Set path and file to calendar event tone +// */ +//void CpProfileModel::setCalendarTone(const QString& filePath) +//{ +// d_ptr->setCalendarTone(filePath); +//} +// +///* +// * Get path and file name of clock alarm tone file +// */ +//QString CpProfileModel::alarmTone() +//{ +// return d_ptr->alarmTone(); +//} +// +///* +// * Set path and file to clock alarm tone +// */ +//void CpProfileModel::setAlarmTone(const QString& filePath) +//{ +// d_ptr->setAlarmTone(filePath); +//} +// +///* +// * Get the value of master volume +// */ +//int CpProfileModel::ringVolume() +//{ +// return d_ptr->ringVolume(); +//} +// +///* +// * Set master volume, the value should be between 1-10 +// */ +//void CpProfileModel::setRingVolume(int volume) +//{ +// d_ptr->setRingVolume(volume); +//} +// +///* +// * Activate master volume to beep +// */ +//void CpProfileModel::activateBeep() +//{ +// d_ptr->activateBeep(); +//} +// +///* +// * Get beep status in master volume +// */ +//bool CpProfileModel::isBeep() +//{ +// return d_ptr->isBeep(); +//} +// +///* +// * Activate master volume to silent +// */ +//void CpProfileModel::activateSilent() +//{ +// d_ptr->activateSilent(); +//} +// +///* +// * Get silent status in master volume +// */ +//bool CpProfileModel::isSilent() +//{ +// return d_ptr->isSilent(); +//} +// +///* +// * Get master vibra's status +// */ +//bool CpProfileModel::vibraStatus() +//{ +// return d_ptr->vibraStatus(); +//} +// +///* +// * Set master vibra's status +// */ +//void CpProfileModel::setVibraStatus(bool status) +//{ +// d_ptr->setVibraStatus(status); +//} +// +///* +// * Get keypad' volume +// */ +//int CpProfileModel::keyVolume() +//{ +// return d_ptr->keyVolume(); +//} +// +///* +// * Set keypad's volume, +// * the value of the volume should be between 0-3 +// */ +//void CpProfileModel::setKeyVolume(int volume) +//{ +// d_ptr->setKeyVolume(volume); +//} +// +///* +// * Get screen tone's volume +// */ +//int CpProfileModel::screenVolume() +//{ +// return d_ptr->screenVolume(); +//} +// +///* +// * Set screen tone's volume, +// * the value of the volume should be between 0-3 +// */ +//void CpProfileModel::setScreenVolume(int volume) +//{ +// d_ptr->setScreenVolume(volume); +//} +// +///* +// * Get screen vibra's level +// */ +//int CpProfileModel::screenVibra() +//{ +// return d_ptr->screenVibra(); +//} +// +///* +// * Set screen vibra's level, +// * the value of the level should be between 0-3 +// */ +//void CpProfileModel::setScreenVibra(int volume) +//{ +// d_ptr->setScreenVibra(volume); +//} // End of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp Mon May 03 12:32:06 2010 +0300 @@ -16,10 +16,11 @@ */ #include "cpprofilemodel_p.h" -#include +#include "cpprofilemodel.h" +#include #include #include -#include +#include #include #include #include @@ -30,7 +31,15 @@ #include #include #include - +#include +#include +#include +#include +#include +#include +#include +#include +#include #include #include #include @@ -48,18 +57,45 @@ } CpProfileModelPrivate::CpProfileModelPrivate() + : mEngine(0), + //mProfileExt(0), + //mToneSettings(0), + //mFeedbackSettings(0), + //mSetFeedbackSettings(0), + //mVibraCenRep(0), + mEditingProfileId(0), + mInitErrFlag(false), + mOffLineCenRep(0), + q_ptr(0) { - TRAPD( err, - mEngine = CreateProfileEngineExtendedL(); - UpdateProfileL(); - mVibraCenRep = CRepository::NewL( KCRUidVibraCtrl ); - ); - mInitErrFlag = err; + } -void CpProfileModelPrivate::UpdateProfileL() +void CpProfileModelPrivate::initialize(CpProfileModel *parent) { - mProfileExt = mEngine->ProfileL( mEngine->ActiveProfileId() ); + q_ptr = parent; + CPFW_LOG("CpProfileModelPrivate::CpProfileModelPrivate(), START."); + TRAPD( err, + mEngine = CreateProfileEngineExtended2L(); + //int proId = mEngine->ActiveProfileId(); + //UpdateProfileSettingsL( proId ); + //mVibraCenRep = CRepository::NewL( KCRUidVibraCtrl ); + mOffLineCenRep = CRepository::NewL( KCRUidCommunicationSettings ); + ); + mInitErrFlag = err; + CPFW_LOG("CpProfileModelPrivate::CpProfileModelPrivate(), END, err is." + QString(err) ); +} +void CpProfileModelPrivate::UpdateProfileSettingsL(int profileId) +{ + CPFW_LOG("CpProfileModelPrivate::UpdateProfileSettingsL(), START. profile id is: " + QString(profileId)); + /*if ( profileId <= EProfileWrapperErrorId || profileId >= EProfileWrapperOverflowId ){ + CPFW_LOG("CpProfileModelPrivate::UpdateProfileSettingsL(), End with invalid profile id."); + //User::Leave(KErrNotFound); + return; + } +*/ +/* mProfileExt = mEngine->Profile2L( profileId ); + CPFW_LOG("CpProfileModelPrivate::UpdateProfileSettingsL(), Succeded in getting mProfileExt. "); // General tones TProfileToneSettings& toneSettings = mProfileExt->ProfileSetTones().SetToneSettings(); @@ -74,12 +110,20 @@ MProfileSetFeedbackSettings& setFeedback = mProfileExt->ProfileSetExtraSettings().ProfileSetFeedbackSettings(); mSetFeedbackSettings = &setFeedback; + + mEditingProfileId = profileId; + CPFW_LOG("CpProfileModelPrivate::UpdateProfileSettingsL(), END.");*/ } CpProfileModelPrivate::~CpProfileModelPrivate() { - delete mVibraCenRep; - mVibraCenRep = 0; + //delete mEngine; + if (mEngine!=0) { + mEngine->Release(); + } + //delete mVibraCenRep; + //mVibraCenRep = 0; + delete mOffLineCenRep; } /* @@ -93,38 +137,53 @@ /* * Get profile name with its id */ -QString CpProfileModelPrivate::profileName(int profileId) +QString CpProfileModelPrivate::profileName(int profileId) const { - if ( profileId > 2 || profileId < 0 ){ - return ""; - } + CPFW_LOG("CpProfileModelPrivate::profileName(), START."); - MProfileName* name = 0; - TRAPD( err, - *name = mEngine->ProfileL(profileId)->ProfileName(); - ); - - if (name){ - return stringFromDescriptor( name->Name() ); - } else { - return ""; +// MProfileName* name = 0; +// TRAPD( err, *name = mEngine->ProfileL(profileId)->ProfileName(); ); +// +// if ( !err && name){ +// CPFW_LOG("CpProfileModelPrivate::profileName(), have name, END."); +// return stringFromDescriptor( name->Name() ); +// } else { +// CPFW_LOG("CpProfileModelPrivate::profileName(), no name, END."); +// return ""; +// } + // should return qt localized profile name + // engine return symbian localized name, that is a wrong way to got it + switch (profileId) { + case EProfileWrapperGeneralId: + return hbTrId("txt_cp_setlabel_active_profile_val_general"); + case EProfileWrapperMeetingId: + return hbTrId("txt_cp_setlabel_active_profile_val_meeting"); + default: + return QString(""); } - } +QStringList CpProfileModelPrivate::profileNames() const +{ + //hard code, until engine part support qt localized name + QStringList nameList; + nameList< 2 || profileId < 0 ){ - return -1; - } + CPFW_LOG("CpProfileModelPrivate::activateProfile(), START."); TRAPD( err, mEngine->SetActiveProfileL( profileId ); - UpdateProfileL(); + //UpdateProfileSettingsL( profileId ); ); + CPFW_LOG("CpProfileModelPrivate::activateProfile(), END."); return err; } @@ -136,262 +195,1025 @@ return mEngine->ActiveProfileId(); } -/* - * Get path and file name of ring tone file - */ -QString CpProfileModelPrivate::ringTone() +int CpProfileModelPrivate::profileSettings(int profileId, + CpProfileSettings& profileSettings) { - return stringFromDescriptor( mProfileExt->ProfileTones().RingingTone1() ); + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); +// CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return err; + } + CleanupReleasePushL(*profileExtend); + const MProfileTones &setTones = profileExtend->ProfileTones(); + const TProfileToneSettings &toneSettings = setTones.ToneSettings(); + const MProfileExtraTones2 &extTones = profileExtend->ProfileExtraTones2(); + const MProfileVibraSettings &vibraSettings = + profileExtend->ProfileVibraSettings(); + const MProfileExtraSettings &extraSettings = + profileExtend->ProfileExtraSettings(); + const MProfileFeedbackSettings &feedbackSettings = + extraSettings.ProfileFeedbackSettings(); + + + profileSettings.mRingTone = stringFromDescriptor(setTones.RingingTone1()); + profileSettings.mMessageTone = stringFromDescriptor(setTones.MessageAlertTone()); + profileSettings.mEmailTone = stringFromDescriptor(extTones.EmailAlertTone()); + profileSettings.mReminderTone = stringFromDescriptor(extTones.ReminderTone()); + profileSettings.mNotificationTone = toneSettings.iWarningAndGameTones; + profileSettings.mKeyTouchScreenTone = toneSettings.iKeypadVolume; + + profileSettings.mRingAlertVibra = vibraSettings.RingAlertVibra(); + profileSettings.mMessageVibra = vibraSettings.MessageAlertVibra(); + profileSettings.mEmailVibra = vibraSettings.EmailAlertVibra(); + profileSettings.mReminderAlertVibra = vibraSettings.ReminderAlarmVibra(); + profileSettings.mNotificationVibra = vibraSettings.InformationVibra(); + profileSettings.mKeyTouchScreenVibra = feedbackSettings.TactileFeedback(); + + CleanupStack::PopAndDestroy(profileExtend); + return err; +} +int CpProfileModelPrivate::setProfileSettings(int profileId, CpProfileSettings& profileSettings) +{ + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + + ) + if (err!=KErrNone) { + return err; + } + CleanupReleasePushL(*profileExtend); + MProfileSetTones &setTones = profileExtend->ProfileSetTones(); + TProfileToneSettings &toneSettings = setTones.SetToneSettings(); + MProfileSetExtraTones2 &setExtTones = profileExtend->ProfileSetExtraTones2(); + MProfileSetVibraSettings &setVibraSettings = profileExtend->ProfileSetVibraSettings(); + MProfileSetExtraSettings &extraSettings = profileExtend->ProfileSetExtraSettings(); + MProfileSetFeedbackSettings &setFeedbackSettings = extraSettings.ProfileSetFeedbackSettings(); + + TRAP_IGNORE( + setTones.SetRingingTone1L( *descriptorFromString(profileSettings.mRingTone) ); + setTones.SetMessageAlertToneL( *descriptorFromString(profileSettings.mMessageTone) ); + setExtTones.SetEmailAlertToneL( *descriptorFromString(profileSettings.mEmailTone) ); + setExtTones.SetReminderToneL( *descriptorFromString(profileSettings.mReminderTone) ); + ) + + toneSettings.iWarningAndGameTones = profileSettings.mNotificationTone; + toneSettings.iKeypadVolume = static_cast(profileSettings.mKeyTouchScreenTone); + setVibraSettings.SetRingAlertVibra( profileSettings.mRingAlertVibra ); + setVibraSettings.SetMessageAlertVibra ( profileSettings.mMessageVibra ); + setVibraSettings.SetEmailAlertVibra ( profileSettings.mEmailVibra ); + setVibraSettings.SetReminderAlarmVibra ( profileSettings.mReminderAlertVibra ); + setVibraSettings.SetInformationVibra ( profileSettings.mNotificationVibra ); + setFeedbackSettings.SetTactileFeedback(static_cast(profileSettings.mKeyTouchScreenVibra)); + + TRAPD(err2, + mEngine->CommitChangeL(*profileExtend); + CleanupStack::PopAndDestroy(profileExtend); + ) + return err2; } -/* - * Set path and file to ring tone - */ -int CpProfileModelPrivate::setRingTone(const QString& filePath) +QString CpProfileModelPrivate::ringTone() const { - TRAPD(err, mProfileExt->ProfileSetTones().SetRingingTone1L( *descriptorFromString(filePath) )); - commitChange(); - return err; + MProfileExtended2 *profileExtend = 0; + + TRAPD(err, + profileExtend = mEngine->Profile2L(EProfileWrapperGeneralId); + //CleanupReleasePushL(*profileExtend); + ) + if (err!=KErrNone) { + return QString(""); + } + CleanupReleasePushL(*profileExtend); + + QString ringTone = stringFromDescriptor(profileExtend->ProfileTones().RingingTone1()); + CleanupStack::PopAndDestroy(profileExtend); + return ringTone; + CPFW_LOG("CpProfileModelPrivate::ringTone(), END with invalid mProfileExt. "); + +} + +void CpProfileModelPrivate::setRingTone(const QString& filePath) +{ + TInt ids[] = {EProfileGeneralId,EProfileMeetingId}; + + for (TInt i = 0; i < sizeof(ids)/sizeof(ids[0]); ++i) + { + MProfileExtended2 *profileExtend = 0; + TRAP_IGNORE( + profileExtend = mEngine->Profile2L(ids[i]); + ) + CleanupReleasePushL(*profileExtend); + MProfileSetTones &setTones = profileExtend->ProfileSetTones(); + setTones.SetRingingTone1L( *descriptorFromString(filePath) ); + mEngine ->CommitChangeL(*profileExtend); + CleanupStack::PopAndDestroy(profileExtend); + } } -/* - * Get path and file name of message tone file - */ -QString CpProfileModelPrivate::messageTone() +int CpProfileModelPrivate::masterVolume() const +{ + //NEED L FUNCTION? + TInt masterVolume = mEngine->MasterVolumeL(); + return masterVolume; +} + +void CpProfileModelPrivate::setMasterVolume(int volume) +{ + //NEED L FUNCTION ? + TRAP_IGNORE(mEngine->SetMasterVolumeL( volume );) +} + +bool CpProfileModelPrivate::masterVibra() const +{ + bool masterVibra = mEngine->MasterVibraL(); + return masterVibra; +} +void CpProfileModelPrivate::setMasterVibra(bool isVibra) { - return stringFromDescriptor( mProfileExt->ProfileTones().MessageAlertTone() ); + TRAP_IGNORE(mEngine->SetMasterVibraL( isVibra );) +} + +bool CpProfileModelPrivate::isSilenceMode() const +{ + bool isSlience = mEngine->SilenceModeL(); + return isSlience; +} +void CpProfileModelPrivate::setSilenceMode(bool isSilence) +{ + TRAP_IGNORE(mEngine->SetSilenceModeL( isSilence );) +} + +bool CpProfileModelPrivate::isOffLineMode() const +{ + int offLineMode = 0; + User::LeaveIfError(mOffLineCenRep->Get( KSettingsAirplaneMode, offLineMode )); + + return offLineMode; +} +void CpProfileModelPrivate::setOffLineMode(bool isOffLine) +{ + User::LeaveIfError(mOffLineCenRep->Set(KSettingsAirplaneMode, isOffLine)); } -/* - * Set path and file to message tone - */ -int CpProfileModelPrivate::setMessageTone(const QString& filePath) +QString CpProfileModelPrivate::ringTone(int profileId) const { - TRAPD(err, mProfileExt->ProfileSetTones().SetMessageAlertToneL( *descriptorFromString(filePath) )); - commitChange(); - return err; + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return QString(""); + } + CleanupReleasePushL(*profileExtend); + const MProfileTones &setTones = profileExtend->ProfileTones(); + + + QString ringTone = stringFromDescriptor(setTones.RingingTone1()); + CleanupStack::PopAndDestroy(profileExtend); + return ringTone; +} + +void CpProfileModelPrivate::setRingTone(int profileId, const QString& filePath) +{ + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetTones &setTones = profileExtend->ProfileSetTones(); + + TRAP_IGNORE( + setTones.SetRingingTone1L( *descriptorFromString(filePath) ); + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } } -/* - * Get path and file name of email tone file - */ -QString CpProfileModelPrivate::emailTone() +QString CpProfileModelPrivate::messageTone(int profileId) const { - return stringFromDescriptor( mProfileExt->ProfileExtraTones().EmailAlertTone() ); + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return QString(""); + } + CleanupReleasePushL(*profileExtend); + const MProfileTones &setTones = profileExtend->ProfileTones(); + + QString messageTone = stringFromDescriptor(setTones.MessageAlertTone()); + + CleanupStack::PopAndDestroy(profileExtend); + return messageTone; + +} + +void CpProfileModelPrivate::setMessageTone(int profileId, const QString& filePath) +{ + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetTones &setTones = profileExtend->ProfileSetTones(); + + TRAP_IGNORE( + setTones.SetMessageAlertToneL( *descriptorFromString(filePath) ); + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } + } -/* - * Set path and file to email tone - */ -int CpProfileModelPrivate::setEmailTone(const QString& filePath) +QString CpProfileModelPrivate::emailTone(int profileId) const +{ + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return QString(""); + } + CleanupReleasePushL(*profileExtend); + const MProfileExtraTones2 &extTones = profileExtend->ProfileExtraTones2(); + + QString emailTone = stringFromDescriptor(extTones.EmailAlertTone()); + + CleanupStack::PopAndDestroy(profileExtend); + return emailTone; + +} + +void CpProfileModelPrivate::setEmailTone(int profileId, const QString& filePath) { - TRAPD(err, mProfileExt->ProfileSetExtraTones().SetEmailAlertToneL( *descriptorFromString(filePath) )); - commitChange(); - return err; + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetExtraTones2 &setExtTones = profileExtend->ProfileSetExtraTones2(); + + TRAP_IGNORE( + setExtTones.SetEmailAlertToneL( *descriptorFromString(filePath) ); + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } +} + +QString CpProfileModelPrivate::reminderTone(int profileId) const +{ + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return QString(""); + } + CleanupReleasePushL(*profileExtend); + const MProfileExtraTones2 &extTones = profileExtend->ProfileExtraTones2(); + + QString reminderTone = stringFromDescriptor(extTones.ReminderTone()); + + CleanupStack::PopAndDestroy(profileExtend); + return reminderTone; + } -/* - * Get path and file name of calendar event tone file - */ -QString CpProfileModelPrivate::calendarTone() +void CpProfileModelPrivate::setReminderTone(int profileId, const QString& filePath) +{ + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetExtraTones2 &setExtTones = profileExtend->ProfileSetExtraTones2(); + + TRAP_IGNORE( + setExtTones.SetReminderToneL( *descriptorFromString(filePath) ); + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } +} + +bool CpProfileModelPrivate::notificationTone(int profileId) const { - return ""; + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return false; // ?????? + } + CleanupReleasePushL(*profileExtend); + const MProfileTones &setTones = profileExtend->ProfileTones(); + const TProfileToneSettings &toneSettings = setTones.ToneSettings(); + + bool notificationTone = toneSettings.iWarningAndGameTones; + + CleanupStack::PopAndDestroy(profileExtend); + return notificationTone; +} + +void CpProfileModelPrivate::setNotificationTone(int profileId, bool isActive) +{ + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetTones &setTones = profileExtend->ProfileSetTones(); + TProfileToneSettings &toneSettings = setTones.SetToneSettings(); + + + toneSettings.iWarningAndGameTones = isActive; + + TRAP_IGNORE( + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } } -/* - * Set path and file to calendar event tone - */ -void CpProfileModelPrivate::setCalendarTone(const QString& filePath) +int CpProfileModelPrivate::keyTouchScreenTone(int profileId) const { - Q_UNUSED(filePath); + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return -1; + } + CleanupReleasePushL(*profileExtend); + const MProfileTones &setTones = profileExtend->ProfileTones(); + const TProfileToneSettings &toneSettings = setTones.ToneSettings(); + + int keyTouchScreenTone = toneSettings.iKeypadVolume; + + CleanupStack::PopAndDestroy(profileExtend); + return keyTouchScreenTone; + +} + +void CpProfileModelPrivate::setKeyTouchScreenTone(int profileId, int level) +{ + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetTones &setTones = profileExtend->ProfileSetTones(); + TProfileToneSettings &toneSettings = setTones.SetToneSettings(); + + toneSettings.iKeypadVolume = static_cast(level); + + TRAP_IGNORE( + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } + } -/* - * Get path and file name of clock alarm tone file - */ -QString CpProfileModelPrivate::alarmTone() +bool CpProfileModelPrivate::ringAlertVibra(int profileId) const { - return ""; + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return false; + } + CleanupReleasePushL(*profileExtend); + const MProfileVibraSettings &vibraSettings = + profileExtend->ProfileVibraSettings(); + + + bool ringAlertVibra = vibraSettings.RingAlertVibra(); + CleanupStack::PopAndDestroy(profileExtend); + return ringAlertVibra; + } -/* - * Set path and file to clock alarm tone - */ -void CpProfileModelPrivate::setAlarmTone(const QString& filePath) +void CpProfileModelPrivate::setRingAlertVibra(int profileId, bool isActive) { - Q_UNUSED(filePath); + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetVibraSettings &setVibraSettings = profileExtend->ProfileSetVibraSettings(); + + setVibraSettings.SetRingAlertVibra(isActive); + + TRAP_IGNORE( + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } } -/* - * Get the value of master volume - */ -int CpProfileModelPrivate::ringVolume() +bool CpProfileModelPrivate::messageVibra(int profileId) const { - return mToneSettings->iRingingVolume; + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return false; + } + CleanupReleasePushL(*profileExtend); + const MProfileVibraSettings &vibraSettings = + profileExtend->ProfileVibraSettings(); + + + bool messageVibra = vibraSettings.MessageAlertVibra(); + CleanupStack::PopAndDestroy(profileExtend); + return messageVibra; + +} + +void CpProfileModelPrivate::setMessageVibra(int profileId, bool isActive) +{ + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetVibraSettings &setVibraSettings = profileExtend->ProfileSetVibraSettings(); + + setVibraSettings.SetMessageAlertVibra(isActive); + + TRAP_IGNORE( + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } } -/* - * Set master volume, the value should be between 1-10 - */ -void CpProfileModelPrivate::setRingVolume(int volume) +bool CpProfileModelPrivate::emailVibra(int profileId) const { - if (volume < 0 || volume >10) - { - return; - } - mProfileExt = mEngine->ProfileL( EProfileWrapperGeneralId ); - - // General tones volume - TProfileToneSettings& toneSettingsGeneral = mProfileExt->ProfileSetTones().SetToneSettings(); - mToneSettings = &toneSettingsGeneral; + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return false; + } + CleanupReleasePushL(*profileExtend); + const MProfileVibraSettings &vibraSettings = + profileExtend->ProfileVibraSettings(); + + + bool emailVibra = vibraSettings.EmailAlertVibra(); + + CleanupStack::PopAndDestroy(profileExtend); + return emailVibra; - mToneSettings->iRingingType = EProfileRingingTypeRinging; - mToneSettings->iRingingVolume = volume; - commitChange(); - - mProfileExt = mEngine->ProfileL( EProfileWrapperMeetingId ); +} - // meeting tones volume - TProfileToneSettings& toneSettingsMeeting = mProfileExt->ProfileSetTones().SetToneSettings(); - mToneSettings = &toneSettingsMeeting; +void CpProfileModelPrivate::setEmailVibra(int profileId, bool isActive) +{ + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetVibraSettings &setVibraSettings = profileExtend->ProfileSetVibraSettings(); + + setVibraSettings.SetEmailAlertVibra ( isActive ); + + TRAP_IGNORE( + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } +} + +bool CpProfileModelPrivate::reminderVibra(int profileId) const +{ + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return false; + } + CleanupReleasePushL(*profileExtend); + const MProfileVibraSettings &vibraSettings = + profileExtend->ProfileVibraSettings(); - mToneSettings->iRingingType = EProfileRingingTypeRinging; - mToneSettings->iRingingVolume = volume; - - commitChange(); + + bool reminderAlarmVibra = vibraSettings.ReminderAlarmVibra(); - mProfileExt = mEngine->ProfileL(mEngine->ActiveProfileId()); - // currently implementation: keep the two profiles same volume + CleanupStack::PopAndDestroy(profileExtend); + return reminderAlarmVibra; + } -/* - * Activate master volume to beep - */ -void CpProfileModelPrivate::activateBeep() +void CpProfileModelPrivate::setReminderVibra(int profileId, bool isActive) { - mToneSettings->iRingingType = EProfileRingingTypeBeepOnce; - commitChange(); + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetVibraSettings &setVibraSettings = profileExtend->ProfileSetVibraSettings(); + + setVibraSettings.SetReminderAlarmVibra ( isActive ); + + TRAP_IGNORE( + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } } -/* - * Get beep status in master volume - */ -bool CpProfileModelPrivate::isBeep() +bool CpProfileModelPrivate::notificationVibra(int profileId) const { - return (EProfileRingingTypeBeepOnce == mToneSettings->iRingingType) ? true : false; + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return false; + } + CleanupReleasePushL(*profileExtend); + const MProfileVibraSettings &vibraSettings = + profileExtend->ProfileVibraSettings(); + + + bool notificationVibra = vibraSettings.InformationVibra(); + + CleanupStack::PopAndDestroy(profileExtend); + return notificationVibra; + } -/* - * Activate master volume to silent - */ -void CpProfileModelPrivate::activateSilent() +void CpProfileModelPrivate::setNotificationVibra(int profileId, bool isActive) { - mToneSettings->iRingingType = EProfileRingingTypeSilent; - commitChange(); + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetVibraSettings &setVibraSettings = profileExtend->ProfileSetVibraSettings(); + + setVibraSettings.SetInformationVibra( isActive ); + + TRAP_IGNORE( + mEngine->CommitChangeL(*profileExtend); + ) + CleanupStack::PopAndDestroy(profileExtend); + } } -/* - * Get silent status in master volume - */ -bool CpProfileModelPrivate::isSilent() +int CpProfileModelPrivate::keyTouchScreenVibra(int profileId)const { - return (EProfileRingingTypeSilent == mToneSettings->iRingingType) ? true : false; -} - -/* - * Get master vibra's status - */ -bool CpProfileModelPrivate::vibraStatus() -{ - return mToneSettings->iVibratingAlert; + MProfileExtended2 *profileExtend = 0; + TRAPD(err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err != KErrNone) { + return -1; + } + CleanupReleasePushL(*profileExtend); + const MProfileExtraSettings &extraSettings = + profileExtend->ProfileExtraSettings(); + const MProfileFeedbackSettings &feedbackSettings = + extraSettings.ProfileFeedbackSettings(); + + + bool keyTouchScreenVibra = feedbackSettings.TactileFeedback(); + + CleanupStack::PopAndDestroy(profileExtend); + return keyTouchScreenVibra; + } -/* - * Set master vibra's status - */ -void CpProfileModelPrivate::setVibraStatus(bool status) -{ - mVibraCenRep->Set(KVibraCtrlProfileVibraEnabled, status ); - mToneSettings->iVibratingAlert = status; - commitChange(); -} - -/* - * Get keypad' volume - */ -int CpProfileModelPrivate::keyVolume() -{ - return mToneSettings->iKeypadVolume; -} - -/* - * Set keypad's volume, - * the value of the volume should be between 0-3 - */ -void CpProfileModelPrivate::setKeyVolume(int volume) -{ - if (volume < 0 || volume > 3) - { - return; - } - - mToneSettings->iKeypadVolume = (TProfileKeypadVolume)volume; - commitChange(); -} - -/* - * Get screen tone's volume - */ -int CpProfileModelPrivate::screenVolume() +void CpProfileModelPrivate::setKeyTouchScreenVibra(int profileId, int level) { - return mFeedbackSettings->AudioFeedback(); -} + MProfileExtended2 *profileExtend = 0; + TRAPD( err, + profileExtend = mEngine->Profile2L(profileId); + //CleanupReleasePushL(*profileExtend); + ) + if (err==KErrNone) { + CleanupReleasePushL(*profileExtend); + MProfileSetExtraSettings &extraSettings = profileExtend->ProfileSetExtraSettings(); + MProfileSetFeedbackSettings &setFeedbackSettings = extraSettings.ProfileSetFeedbackSettings(); + setFeedbackSettings.SetTactileFeedback(static_cast(level)); -/* - * Set screen tone's volume, - * the value of the volume should be between 0-3 - */ -void CpProfileModelPrivate::setScreenVolume(int volume) -{ - if (volume < 0 || volume > 3) - { - return; - } - - mSetFeedbackSettings->SetAudioFeedback( (TProfileAudioFeedback)volume ); - commitChange(); -} + TRAP_IGNORE( + mEngine->CommitChangeL(*profileExtend); + ) -/* - * Get screen vibra's level - */ -int CpProfileModelPrivate::screenVibra() -{ - return mFeedbackSettings->TactileFeedback(); + CleanupStack::PopAndDestroy(profileExtend); + } } - -/* - * Set screen vibra's level, - * the value of the level should be between 0-3 - */ -void CpProfileModelPrivate::setScreenVibra(int volume) -{ - if (volume < 0 || volume > 3) - { - return; - } - - mSetFeedbackSettings->SetTactileFeedback( (TProfileTactileFeedback)volume ); - commitChange(); -} +///* +// * Set a profile as current editing profile +// */ +//int CpProfileModelPrivate::setEditingProfile(int profileId) +//{ +// CPFW_LOG("CpProfileModelPrivate::setEditingProfile(), START."); +// TRAPD( err, UpdateProfileSettingsL( profileId );); +// CPFW_LOG("CpProfileModelPrivate::setEditingProfile(), END."); +// return err; +//} +// +///* +// * Get path and file name of ring tone file +// */ +//QString CpProfileModelPrivate::ringTone() +//{ +// if ( mProfileExt ){ +// return stringFromDescriptor( mProfileExt->ProfileTones().RingingTone1() ); +// } +// CPFW_LOG("CpProfileModelPrivate::ringTone(), END with invalid mProfileExt. "); +// return ""; +//} +// +///* +// * Set path and file to ring tone +// */ +//int CpProfileModelPrivate::setRingTone(const QString& filePath) +//{ +// if ( mProfileExt ){ +// TRAPD(err, mProfileExt->ProfileSetTones().SetRingingTone1L( *descriptorFromString(filePath) )); +// commitChange(); +// return err; +// } +// CPFW_LOG("CpProfileModelPrivate::setRingTone(), END with invalid mProfileExt."); +// return -1; +//} +// +///* +// * Get path and file name of message tone file +// */ +//QString CpProfileModelPrivate::messageTone() +//{ +// if ( mProfileExt ){ +// return stringFromDescriptor( mProfileExt->ProfileTones().MessageAlertTone() ); +// } +// CPFW_LOG("CpProfileModelPrivate::messageTone(), END with invalid mProfileExt."); +// return ""; +//} +// +///* +// * Set path and file to message tone +// */ +//int CpProfileModelPrivate::setMessageTone(const QString& filePath) +//{ +// if ( mProfileExt ){ +// TRAPD(err, mProfileExt->ProfileSetTones().SetMessageAlertToneL( *descriptorFromString(filePath) )); +// commitChange(); +// return err; +// } +// CPFW_LOG("CpProfileModelPrivate::setMessageTone(), END with invalid mProfileExt."); +// return -1; +//} +// +///* +// * Get path and file name of email tone file +// */ +//QString CpProfileModelPrivate::emailTone() +//{ +// if ( mProfileExt ){ +// return stringFromDescriptor( mProfileExt->ProfileExtraTones().EmailAlertTone() ); +// } +// CPFW_LOG("CpProfileModelPrivate::emailTone(), END with invalid mProfileExt."); +// return ""; +//} +// +///* +// * Set path and file to email tone +// */ +//int CpProfileModelPrivate::setEmailTone(const QString& filePath) +//{ +// if ( mProfileExt ){ +// TRAPD(err, mProfileExt->ProfileSetExtraTones().SetEmailAlertToneL( *descriptorFromString(filePath) )); +// commitChange(); +// return err; +// } +// CPFW_LOG("CpProfileModelPrivate::setEmailTone(), END with invalid mProfileExt."); +// return -1; +//} +// +///* +// * Get path and file name of calendar event tone file +// */ +//QString CpProfileModelPrivate::calendarTone() +//{ +// return ""; +//} +// +///* +// * Set path and file to calendar event tone +// */ +//void CpProfileModelPrivate::setCalendarTone(const QString& filePath) +//{ +// Q_UNUSED(filePath); +//} +// +///* +// * Get path and file name of clock alarm tone file +// */ +//QString CpProfileModelPrivate::alarmTone() +//{ +// return ""; +//} +// +///* +// * Set path and file to clock alarm tone +// */ +//void CpProfileModelPrivate::setAlarmTone(const QString& filePath) +//{ +// Q_UNUSED(filePath); +//} +// +///* +// * Get the value of master volume +// */ +//int CpProfileModelPrivate::ringVolume() +//{ +// CPFW_LOG("CpProfileModelPrivate::ringVolume(), START."); +// if ( mToneSettings ){ +// CPFW_LOG("CpProfileModelPrivate::ringVolume(), End."); +// return mToneSettings->iRingingVolume; +// } +// CPFW_LOG("CpProfileModelPrivate::ringVolume(), END with invalid mToneSettings."); +// return -1; +//} +// +///* +// * Set master volume, the value should be between 1-10 +// */ +//void CpProfileModelPrivate::setRingVolume(int volume) +//{ +// CPFW_LOG("CpProfileModelPrivate::setRingVolume(), START."); +// if ( !mToneSettings ) { +// CPFW_LOG("CpProfileModelPrivate::setRingVolume(), END with invalid mToneSettings."); +// return; +// } +// if ( EProfileWrapperSilentId == mEditingProfileId || volume < 0 || volume >10 ) +// { +// return; +// } +// +// mToneSettings->iRingingType = EProfileRingingTypeRinging; +// mToneSettings->iRingingVolume = volume; +// commitChange(); +// +// // General profile and meeting profile should have same ring tone volume +// int profileId = activeProfileId(); +// if ( EProfileWrapperMeetingId == profileId ){ +// profileId = EProfileWrapperGeneralId; +// } else if ( EProfileWrapperGeneralId == profileId ) { +// profileId = EProfileWrapperMeetingId; +// } +// MProfileExtended* profileExt = 0; +// TRAPD( err0, profileExt = mEngine->ProfileL( profileId );); +// Q_UNUSED(err0); +// TProfileToneSettings& toneSettings = profileExt->ProfileSetTones().SetToneSettings(); +// toneSettings.iRingingType = EProfileRingingTypeRinging; +// toneSettings.iRingingVolume = volume; +// TRAPD( err, mEngine->CommitChangeL(*profileExt) ); +// Q_UNUSED(err); +// CPFW_LOG("CpProfileModelPrivate::setRingVolume(), END."); +// // currently implementation: keep the two profiles same volume +//} +// +///* +// * Activate master volume to beep +// */ +//void CpProfileModelPrivate::activateBeep() +//{ +// if ( mToneSettings ){ +// mToneSettings->iRingingType = EProfileRingingTypeBeepOnce; +// commitChange(); +// } else { +// CPFW_LOG("CpProfileModelPrivate::activateBeep(), END with invalid mToneSettings."); +// } +//} +// +///* +// * Get beep status in master volume +// */ +//bool CpProfileModelPrivate::isBeep() +//{ +// if ( mToneSettings ){ +// return (EProfileRingingTypeBeepOnce == mToneSettings->iRingingType) ? true : false; +// } +// CPFW_LOG("CpProfileModelPrivate::isBeep(), END with invalid mToneSettings."); +// return false; +//} +// +///* +// * Activate master volume to silent +// */ +//void CpProfileModelPrivate::activateSilent() +//{ +// if ( mToneSettings ){ +// mToneSettings->iRingingType = EProfileRingingTypeSilent; +// commitChange(); +// } else { +// CPFW_LOG("CpProfileModelPrivate::vibraStatus(), END with invalid mToneSettings."); +// } +//} +// +///* +// * Get silent status in master volume +// */ +//bool CpProfileModelPrivate::isSilent() +//{ +// if ( mToneSettings ){ +// return (EProfileRingingTypeSilent == mToneSettings->iRingingType) ? true : false; +// } else { +// CPFW_LOG("CpProfileModelPrivate::vibraStatus(), END with invalid mToneSettings."); +// return false; +// } +//} +// +///* +// * Get master vibra's status +// */ +//bool CpProfileModelPrivate::vibraStatus() +//{ +// CPFW_LOG("CpProfileModelPrivate::vibraStatus(), Start."); +// if ( mToneSettings ){ +// CPFW_LOG("CpProfileModelPrivate::vibraStatus(), End."); +// return mToneSettings->iVibratingAlert; +// } +// CPFW_LOG("CpProfileModelPrivate::vibraStatus(), END with invalid mToneSettings."); +// return false; +//} +// +///* +// * Set master vibra's status +// */ +//void CpProfileModelPrivate::setVibraStatus(bool status) +//{ +// CPFW_LOG("CpProfileModelPrivate::setVibraStatus(), Start."); +// if ( mVibraCenRep ){ +// mVibraCenRep->Set(KVibraCtrlProfileVibraEnabled, status ); +// } +// +// if ( mToneSettings ){ +// mToneSettings->iVibratingAlert = status; +// commitChange(); +// } +// CPFW_LOG("CpProfileModelPrivate::setVibraStatus(), END."); +//} +// +///* +// * Get keypad' volume +// */ +//int CpProfileModelPrivate::keyVolume() +//{ +// CPFW_LOG("CpProfileModelPrivate::keyVolume(), Start."); +// if ( mToneSettings ){ +// CPFW_LOG("CpProfileModelPrivate::keyVolume(), END."); +// return mToneSettings->iKeypadVolume; +// } +// CPFW_LOG("CpProfileModelPrivate::keyVolume(), END with invalid mToneSettings."); +// return -1; +//} +// +///* +// * Set keypad's volume, +// * the value of the volume should be between 0-3 +// */ +//void CpProfileModelPrivate::setKeyVolume(int volume) +//{ +// CPFW_LOG("CpProfileModelPrivate::setKeyVolume(), Start."); +// if (volume < 0 || volume > 3) +// { +// CPFW_LOG("CpProfileModelPrivate::setKeyVolume(), End with invalid volume."); +// return; +// } +// +// if ( mToneSettings ){ +// mToneSettings->iKeypadVolume = (TProfileKeypadVolume)volume; +// commitChange(); +// } +// CPFW_LOG("CpProfileModelPrivate::setKeyVolume(), End."); +//} +// +///* +// * Get screen tone's volume +// */ +//int CpProfileModelPrivate::screenVolume() +//{ +// CPFW_LOG("CpProfileModelPrivate::screenVolume(), Start."); +// if ( mFeedbackSettings ){ +// CPFW_LOG("CpProfileModelPrivate::screenVolume(), End."); +// return mFeedbackSettings->AudioFeedback(); +// } +// CPFW_LOG("CpProfileModelPrivate::screenVolume(), End."); +// return -1; +//} +// +///* +// * Set screen tone's volume, +// * the value of the volume should be between 0-3 +// */ +//void CpProfileModelPrivate::setScreenVolume(int volume) +//{ +// CPFW_LOG("CpProfileModelPrivate::setScreenVolume(), Start."); +// if (volume < 0 || volume > 3) +// { +// CPFW_LOG("CpProfileModelPrivate::setScreenVolume(), End with invalid volume."); +// return; +// } +// +// if ( mSetFeedbackSettings ){ +// mSetFeedbackSettings->SetAudioFeedback( (TProfileAudioFeedback)volume ); +// commitChange(); +// } +// CPFW_LOG("CpProfileModelPrivate::setScreenVolume(), End."); +//} +// +///* +// * Get screen vibra's level +// */ +//int CpProfileModelPrivate::screenVibra() +//{ +// CPFW_LOG("CpProfileModelPrivate::screenVibra(), Start."); +// if ( mFeedbackSettings ){ +// CPFW_LOG("CpProfileModelPrivate::screenVibra(), End."); +// return mFeedbackSettings->TactileFeedback(); +// } +// CPFW_LOG("CpProfileModelPrivate::screenVibra(), End with invalid mFeedbackSettings."); +// return -1; +//} +// +///* +// * Set screen vibra's level, +// * the value of the level should be between 0-3 +// */ +//void CpProfileModelPrivate::setScreenVibra(int volume) +//{ +// if (volume < 0 || volume > 3) +// { +// return; +// } +// +// if ( mSetFeedbackSettings ){ +// mSetFeedbackSettings->SetTactileFeedback( (TProfileTactileFeedback)volume ); +// commitChange(); +// } +//} /* * Commit changes when change settings value in profile. */ int CpProfileModelPrivate::commitChange() { - TRAPD( err, mEngine->CommitChangeL(*mProfileExt) ); - return err; + /* TRAPD( err, mEngine->CommitChangeL(*mProfileExt) ); + return err;*/ + return 0; } // End of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.h --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.h Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.h Mon May 03 12:32:06 2010 +0300 @@ -1,83 +1,144 @@ /* -* 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: -* -*/ + * 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: + * + */ #ifndef CPPROFILEMODEL_P_H #define CPPROFILEMODEL_P_H #include - -class MProfileEngineExtended; -class MProfileExtended; +class CpProfileSettings; +class CpProfileModel; +class MProfileEngineExtended2; +class MProfileExtended2; class MProfileFeedbackSettings; class MProfileSetFeedbackSettings; class CRepository; +class QStringList; struct TProfileToneSettings; - class CpProfileModelPrivate - { +{ + Q_DECLARE_PUBLIC(CpProfileModel) public: CpProfileModelPrivate(); ~CpProfileModelPrivate(); - + void initialize(CpProfileModel *parent); public: int initiationFlag(); - QString profileName(int profileId); + QString profileName(int profileId)const; + QStringList profileNames() const; int activateProfile(int profileId); int activeProfileId(); - QString ringTone(); - int setRingTone(const QString& filePath); - QString messageTone(); - int setMessageTone(const QString& filePath); - QString emailTone(); - int setEmailTone(const QString& filePath); - QString calendarTone(); - void setCalendarTone(const QString& filePath); - QString alarmTone(); - void setAlarmTone(const QString& filePath); - int ringVolume(); - void setRingVolume(int volume); - void activateBeep(); - bool isBeep(); - void activateSilent(); - bool isSilent(); - bool vibraStatus(); - void setVibraStatus(bool status); - int keyVolume(); - void setKeyVolume(int volume); - int screenVolume(); - void setScreenVolume(int volume); - int screenVibra(); - void setScreenVibra(int volume); + int setEditingProfile(int profileId); + int profileSettings(int profileId, CpProfileSettings& profileSettings); + int setProfileSettings(int profileId, CpProfileSettings& profileSettings); + + /*! + * set ring tone in personalization group in control panel's homeview + */ + QString ringTone() const; + void setRingTone(const QString& filePath); + + int masterVolume() const; + void setMasterVolume(int volume); + + bool masterVibra() const; + void setMasterVibra(bool isVibra); + + bool isSilenceMode() const; + void setSilenceMode(bool isSlience); + + bool isOffLineMode() const; + void setOffLineMode(bool isOffLine); + QString ringTone(int profileId)const; + void setRingTone(int profileId, const QString& filePath); + QString messageTone(int profileId) const; + void setMessageTone(int profileId, const QString& filePath); + QString emailTone(int profileId) const; + void setEmailTone(int profileId, const QString& filePath); + QString reminderTone(int profileId) const; + void setReminderTone(int profileId, const QString& filePath); + + bool notificationTone(int profileId) const; + void setNotificationTone(int profileId, bool isActive); + + int keyTouchScreenTone(int profileId) const; + void setKeyTouchScreenTone(int profileId, int level); + + bool ringAlertVibra(int profileId) const; + void setRingAlertVibra(int profileId, bool isActive); + + bool messageVibra(int profileId) const; + void setMessageVibra(int profileId, bool isActive); + + bool emailVibra(int profileId) const; + void setEmailVibra(int profileId, bool isActive); + + bool reminderVibra(int profileId) const; + void setReminderVibra(int profileId, bool isActive) ; + + bool notificationVibra(int profileId) const; + void setNotificationVibra(int profileId, bool isActive); + + int keyTouchScreenVibra(int profileId)const; + void setKeyTouchScreenVibra(int profileId, int level); + /* int setEditingProfile(int profileId); + QString ringTone(); + int setRingTone(const QString& filePath); + QString messageTone(); + int setMessageTone(const QString& filePath); + QString emailTone(); + int setEmailTone(const QString& filePath); + QString calendarTone(); + void setCalendarTone(const QString& filePath); + QString alarmTone(); + void setAlarmTone(const QString& filePath); + int ringVolume(); + void setRingVolume(int volume); + void activateBeep(); + bool isBeep(); + void activateSilent(); + bool isSilent(); + bool vibraStatus(); + void setVibraStatus(bool status); + int keyVolume(); + void setKeyVolume(int volume); + int screenVolume(); + void setScreenVolume(int volume); + int screenVibra(); + void setScreenVibra(int volume); + */ #ifdef Q_OS_SYMBIAN private: - void UpdateProfileL(); + void UpdateProfileSettingsL(int profileId); int commitChange(); private: - MProfileEngineExtended* mEngine; - MProfileExtended* mProfileExt; - TProfileToneSettings* mToneSettings; - const MProfileFeedbackSettings* mFeedbackSettings; - MProfileSetFeedbackSettings* mSetFeedbackSettings; - CRepository* mVibraCenRep; + MProfileEngineExtended2 *mEngine; + //MProfileExtended2 *mProfileExt; + //TProfileToneSettings *mToneSettings; + //const MProfileFeedbackSettings *mFeedbackSettings; + //MProfileSetFeedbackSettings *mSetFeedbackSettings; + //CRepository *mVibraCenRep; + int mEditingProfileId; bool mInitErrFlag; + CRepository *mOffLineCenRep; + CpProfileModel *q_ptr; #endif // Q_OS_SYMBIAN - }; +}; #endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_win_p.cpp --- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_win_p.cpp Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_win_p.cpp Mon May 03 12:32:06 2010 +0300 @@ -62,6 +62,15 @@ } /* + * Set a profile as current editing profile + */ +int CpProfileModelPrivate::setEditingProfile(int profileId) +{ + Q_UNUSED(profileId); + return -1; +} + +/* * Get path and file name of ring tone file */ QString CpProfileModelPrivate::ringTone() diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/cpserviceprovider.pri --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/cpserviceprovider.pri Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,22 @@ +# +# 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: cpserviceprovider project - included files +# + +HEADERS += src/cpservicemainwindow.h \ + src/cplauncherservice.h + +SOURCES += src/cpservicemainwindow.cpp \ + src/cplauncherservice.cpp \ + src/main.cpp \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/cpserviceprovider.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/cpserviceprovider.pro Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,34 @@ +# +# 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: cpserviceprovider project - qmake settings +# + +TEMPLATE=app +TARGET=cpserviceprovider + +CONFIG += hb service +symbian:TARGET.UID3 = 0x2002873F + +include( ../common.pri ) +include( cpserviceprovider.pri ) + +LIBS+=-lxqservice -lxqserviceutil -lcpframework + +SERVICE.FILE = service_conf.xml +SERVICE.OPTIONS = embeddable +SERVICE.OPTIONS += hidden embeddable + +libFiles.sources = xqservice.dll +libFiles.path = "!:\sys\bin" +DEPLOYMENT += libFiles \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/service_conf.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/service_conf.xml Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,11 @@ + + + com.nokia.services.cpserviceprovider + ="must-not-be-empty" + ControlPanel service + + Launcher + 1.0 + Launch a setting view which comes from a specific plugin + + \ No newline at end of file diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/src/cplauncherservice.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/src/cplauncherservice.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,85 @@ +/* +* 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 "cplauncherservice.h" +#include +#include +#include +#include +#include "cpsplogger.h" + +CpLauncherService::CpLauncherService(HbMainWindow *mainWindow /* = 0*/) +: XQServiceProvider("com.nokia.services.cpserviceprovider.Launcher",mainWindow), + mMainWindow(mainWindow), + mAsyncRequestIndex(-1), + mReturnValue(false) +{ + CPSP_LOG("CpLauncherService Constructing..."); + publishAll(); +} + +CpLauncherService::~CpLauncherService() +{ + CPSP_LOG("CpLauncherService Destructing..."); +} + +void CpLauncherService::complete() +{ + CPSP_LOG( QString("CpLauncherService::complete() mAsyncRequestIndex = %1, mReturnValue = %2").arg( + mAsyncRequestIndex).arg(mReturnValue.toBool()) ); + completeRequest(mAsyncRequestIndex, mReturnValue); +} + + +bool CpLauncherService::launchSettingView(const QString &pluginFile,const QVariant &hint) +{ + CPSP_LOG("Entering CpLauncherService::launchSettingView"); + + mAsyncRequestIndex = setCurrentRequestAsync(); + mReturnValue.setValue(false); + + if (mMainWindow) { + mMainWindow->show(); + CpLauncherInterface *plugin = CpPluginLoader::loadCpLauncherInterface(pluginFile); + if (plugin) { + CpBaseSettingView *view = plugin->createSettingView(hint); + if (view) { + connect(view, SIGNAL(aboutToClose()), mMainWindow, SLOT(quit())); + mMainWindow->addView(view); + mMainWindow->setCurrentView(view); + + mReturnValue.setValue(true); + } + else { + CPSP_LOG("Create setting view failed."); + } + } + else { + CPSP_LOG(QLatin1String("Load plugin interface(CpLauncherInterface) failed: ") + pluginFile); + } + + if (!mReturnValue.toBool()) { + qobject_cast(mMainWindow)->quit(); + } + } + + CPSP_LOG("Leaving CpLauncherService::launchSettingView"); + + return mReturnValue.toBool(); +} + +//End of File diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/src/cplauncherservice.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/src/cplauncherservice.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,41 @@ +/* +* 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: +* +*/ + +#ifndef CPLAUNCHERSERVICE_H +#define CPLAUNCHERSERVICE_H + +#include + +class HbMainWindow; +class CpLauncherService : public XQServiceProvider +{ + Q_OBJECT +public: + explicit CpLauncherService(HbMainWindow *mainWindow = 0); + virtual ~CpLauncherService(); + void complete(); +public slots: + bool launchSettingView(const QString &pluginFile,const QVariant &hint); +private: + HbMainWindow *mMainWindow; + int mAsyncRequestIndex; + QVariant mReturnValue; +}; + +#endif //CPLAUNCHERSERVICE_H + +//End of File diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/src/cpservicemainwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/src/cpservicemainwindow.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,55 @@ +/* +* 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 "cpservicemainwindow.h" +#include +#include +#include "cplauncherservice.h" +#include "cpsplogger.h" + +CpServiceMainWindow::CpServiceMainWindow(QWidget *parent /* = 0*/) +: HbMainWindow(parent), mLauncherService(0) +{ + CPSP_LOG("CpServiceMainWindow Constructing..."); + mLauncherService = new CpLauncherService(this); +} + +CpServiceMainWindow::~CpServiceMainWindow() +{ + CPSP_LOG("CpServiceMainWindow Destructing..."); +} + +void CpServiceMainWindow::quit() +{ + CPSP_LOG("CpServiceMainWindow::quit()"); + + connect(mLauncherService, SIGNAL(returnValueDelivered()), qApp, SLOT(quit())); + mLauncherService->complete(); + qApp->quit(); + + /* + hide(); + mLauncherService->complete(); + HbView *currView = currentView(); + if (currView) { + removeView(currView); + currView->deleteLater(); + } + */ +} + +//End of File diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/src/cpservicemainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/src/cpservicemainwindow.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,39 @@ +/* +* 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: +* +*/ + +#ifndef CPSERVICEMAINWINDOW_H +#define CPSERVICEMAINWINDOW_H + +#include + +class CpLauncherService; + +class CpServiceMainWindow : public HbMainWindow +{ + Q_OBJECT +public: + explicit CpServiceMainWindow(QWidget *parent = 0); + virtual ~CpServiceMainWindow(); +public slots: + void quit(); +private: + CpLauncherService *mLauncherService; +}; + +#endif // CPSERVICEMAINWINDOW_H + +//End of File diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/src/cpsplogger.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/src/cpsplogger.h Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,38 @@ +/* +* 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: +* +*/ + +#ifndef CPSPLOGGER_H +#define CPSPLOGGER_H + +#include +#include + +#define CPSP_LOGGER_NAME QLatin1String("CpServiceProvider") + +#if defined (Q_OS_SYMBIAN) + #define CPSP_LOGGER_CONFIG_PATH QLatin1String("C:/data/.config/cpserviceproviderlog.conf") +#elif defined (Q_WS_WIN) + #ifdef _DEBUG + #define CPSP_LOGGER_CONFIG_PATH QLatin1String("C:/controlpanel/debug/bin/cpserviceproviderlog.conf") + #else + #define CPSP_LOGGER_CONFIG_PATH QLatin1String("C:/controlpanel/release/bin/cpserviceproviderlog.conf") + #endif +#endif + +#define CPSP_LOG(str) Logger::instance(CPSP_LOGGER_NAME)->log(str); + +#endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/cpserviceprovider/src/main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/controlpanelui/src/cpserviceprovider/src/main.cpp Mon May 03 12:32:06 2010 +0300 @@ -0,0 +1,41 @@ +/* +* 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: main.cpp +* +*/ +#include +#include "cpservicemainwindow.h" +#include "cpsplogger.h" + +int main(int argc, char **argv) +{ + HbApplication app(argc,argv ); + + Logger::instance(CPSP_LOGGER_NAME)->configure( + CPSP_LOGGER_CONFIG_PATH,QSettings::IniFormat); + CPSP_LOG("Entering CpServiceProvider.exe..."); + + CpServiceMainWindow wnd; + wnd.show(); + + int ret = app.exec(); + + CPSP_LOG("Exiting CpServiceProvider.exe."); + + Logger::closeAll(); + + return ret; +} + +//End of File diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/eabi/cpprofilewrapperu.def --- a/controlpanelui/src/eabi/cpprofilewrapperu.def Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/eabi/cpprofilewrapperu.def Mon May 03 12:32:06 2010 +0300 @@ -1,34 +1,55 @@ EXPORTS - _ZN14CpProfileModel10ringVolumeEv @ 1 NONAME - _ZN14CpProfileModel11messageToneEv @ 2 NONAME - _ZN14CpProfileModel11profileNameEi @ 3 NONAME - _ZN14CpProfileModel11screenVibraEv @ 4 NONAME - _ZN14CpProfileModel11setRingToneERK7QString @ 5 NONAME - _ZN14CpProfileModel11vibraStatusEv @ 6 NONAME - _ZN14CpProfileModel12activateBeepEv @ 7 NONAME - _ZN14CpProfileModel12calendarToneEv @ 8 NONAME - _ZN14CpProfileModel12screenVolumeEv @ 9 NONAME - _ZN14CpProfileModel12setAlarmToneERK7QString @ 10 NONAME - _ZN14CpProfileModel12setEmailToneERK7QString @ 11 NONAME - _ZN14CpProfileModel12setKeyVolumeEi @ 12 NONAME - _ZN14CpProfileModel13setRingVolumeEi @ 13 NONAME - _ZN14CpProfileModel14activateSilentEv @ 14 NONAME - _ZN14CpProfileModel14initiationFlagEv @ 15 NONAME - _ZN14CpProfileModel14setMessageToneERK7QString @ 16 NONAME - _ZN14CpProfileModel14setScreenVibraEi @ 17 NONAME - _ZN14CpProfileModel14setVibraStatusEb @ 18 NONAME - _ZN14CpProfileModel15activateProfileEi @ 19 NONAME - _ZN14CpProfileModel15activeProfileIdEv @ 20 NONAME - _ZN14CpProfileModel15setCalendarToneERK7QString @ 21 NONAME - _ZN14CpProfileModel15setScreenVolumeEi @ 22 NONAME - _ZN14CpProfileModel6isBeepEv @ 23 NONAME - _ZN14CpProfileModel8isSilentEv @ 24 NONAME - _ZN14CpProfileModel8ringToneEv @ 25 NONAME - _ZN14CpProfileModel9alarmToneEv @ 26 NONAME - _ZN14CpProfileModel9emailToneEv @ 27 NONAME - _ZN14CpProfileModel9keyVolumeEv @ 28 NONAME - _ZN14CpProfileModelC1Ev @ 29 NONAME - _ZN14CpProfileModelC2Ev @ 30 NONAME - _ZN14CpProfileModelD1Ev @ 31 NONAME - _ZN14CpProfileModelD2Ev @ 32 NONAME + _ZN14CpProfileModel11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME + _ZN14CpProfileModel11qt_metacastEPKc @ 2 NONAME + _ZN14CpProfileModel11setRingToneERK7QString @ 3 NONAME + _ZN14CpProfileModel11setRingToneEiRK7QString @ 4 NONAME + _ZN14CpProfileModel12setEmailToneEiRK7QString @ 5 NONAME + _ZN14CpProfileModel13setEmailVibraEib @ 6 NONAME + _ZN14CpProfileModel14initiationFlagEv @ 7 NONAME + _ZN14CpProfileModel14setMasterVibraEb @ 8 NONAME + _ZN14CpProfileModel14setMessageToneEiRK7QString @ 9 NONAME + _ZN14CpProfileModel14setOffLineModeEb @ 10 NONAME + _ZN14CpProfileModel14setSilenceModeEb @ 11 NONAME + _ZN14CpProfileModel15activateProfileEi @ 12 NONAME + _ZN14CpProfileModel15activeProfileIdEv @ 13 NONAME + _ZN14CpProfileModel15profileSettingsEiR17CpProfileSettings @ 14 NONAME + _ZN14CpProfileModel15setMasterVolumeEi @ 15 NONAME + _ZN14CpProfileModel15setMessageVibraEib @ 16 NONAME + _ZN14CpProfileModel15setReminderToneEiRK7QString @ 17 NONAME + _ZN14CpProfileModel16setReminderVibraEib @ 18 NONAME + _ZN14CpProfileModel16staticMetaObjectE @ 19 NONAME DATA 16 + _ZN14CpProfileModel17setRingAlertVibraEib @ 20 NONAME + _ZN14CpProfileModel18setProfileSettingsEiR17CpProfileSettings @ 21 NONAME + _ZN14CpProfileModel19getStaticMetaObjectEv @ 22 NONAME + _ZN14CpProfileModel19setNotificationToneEib @ 23 NONAME + _ZN14CpProfileModel20setNotificationVibraEib @ 24 NONAME + _ZN14CpProfileModel21setKeyTouchScreenToneEii @ 25 NONAME + _ZN14CpProfileModel22setKeyTouchScreenVibraEii @ 26 NONAME + _ZN14CpProfileModelC1EP7QObject @ 27 NONAME + _ZN14CpProfileModelC2EP7QObject @ 28 NONAME + _ZN14CpProfileModelD0Ev @ 29 NONAME + _ZN14CpProfileModelD1Ev @ 30 NONAME + _ZN14CpProfileModelD2Ev @ 31 NONAME + _ZNK14CpProfileModel10emailVibraEi @ 32 NONAME + _ZNK14CpProfileModel10metaObjectEv @ 33 NONAME + _ZNK14CpProfileModel11masterVibraEv @ 34 NONAME + _ZNK14CpProfileModel11messageToneEi @ 35 NONAME + _ZNK14CpProfileModel11profileNameEi @ 36 NONAME + _ZNK14CpProfileModel12masterVolumeEv @ 37 NONAME + _ZNK14CpProfileModel12messageVibraEi @ 38 NONAME + _ZNK14CpProfileModel12profileNamesEv @ 39 NONAME + _ZNK14CpProfileModel12reminderToneEi @ 40 NONAME + _ZNK14CpProfileModel13isOffLineModeEv @ 41 NONAME + _ZNK14CpProfileModel13isSilenceModeEv @ 42 NONAME + _ZNK14CpProfileModel13reminderVibraEi @ 43 NONAME + _ZNK14CpProfileModel14ringAlertVibraEi @ 44 NONAME + _ZNK14CpProfileModel16notificationToneEi @ 45 NONAME + _ZNK14CpProfileModel17notificationVibraEi @ 46 NONAME + _ZNK14CpProfileModel18keyTouchScreenToneEi @ 47 NONAME + _ZNK14CpProfileModel19keyTouchScreenVibraEi @ 48 NONAME + _ZNK14CpProfileModel8ringToneEi @ 49 NONAME + _ZNK14CpProfileModel8ringToneEv @ 50 NONAME + _ZNK14CpProfileModel9emailToneEi @ 51 NONAME + _ZTI14CpProfileModel @ 52 NONAME + _ZTV14CpProfileModel @ 53 NONAME diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/inc/cpprofilemodel.h --- a/controlpanelui/src/inc/cpprofilemodel.h Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/inc/cpprofilemodel.h Mon May 03 12:32:06 2010 +0300 @@ -21,57 +21,118 @@ #include "cpprofilewrappermacro.h" #include #include - +#include class CpProfileModelPrivate; +/*! + Profile id is defined in profile engine + */ enum ProfileWrapperProfileId - { - EProfileWrapperGeneralId = 0, - EProfileWrapperSilentId = 1, - EProfileWrapperMeetingId = 2 - }; - -class PROFILE_WRAPPER_EXPORT CpProfileModel - { +{ + EProfileWapperStart = -1, + EProfileWrapperGeneralId = 0, + EProfileWrapperMeetingId = 2, + EPRofileWrapperEnd +}; +class CpProfileSettings +{ public: - CpProfileModel(); + QString mRingTone; + QString mMessageTone; + QString mEmailTone; + QString mReminderTone; + bool mNotificationTone; + int mKeyTouchScreenTone; // 0-5 + + bool mRingAlertVibra; + bool mMessageVibra; + bool mEmailVibra; + bool mReminderAlertVibra; + bool mNotificationVibra; + int mKeyTouchScreenVibra; //0-5 +}; +class PROFILE_WRAPPER_EXPORT CpProfileModel : QObject +{ + Q_OBJECT +public: + CpProfileModel(QObject *parent = 0); ~CpProfileModel(); public: int initiationFlag(); - QString profileName(int profileId); + QString profileName(int profileId)const; + QStringList profileNames()const; int activateProfile(int profileId); int activeProfileId(); - QString ringTone(); - int setRingTone(const QString& filePath); - QString messageTone(); - int setMessageTone(const QString& filePath); - QString emailTone(); - int setEmailTone(const QString& filePath); - QString calendarTone(); - void setCalendarTone(const QString& filePath); - QString alarmTone(); - void setAlarmTone(const QString& filePath); - int ringVolume(); - void setRingVolume(int volume); - void activateBeep(); - bool isBeep(); - void activateSilent(); - bool isSilent(); - bool vibraStatus(); - void setVibraStatus(bool status); - int keyVolume(); - void setKeyVolume(int volume); - int screenVolume(); - void setScreenVolume(int volume); - int screenVibra(); - void setScreenVibra(int volume); + int setEditingProfile(int profileId); + int profileSettings(int profileId, CpProfileSettings& profileSettings); + int setProfileSettings(int profileId, CpProfileSettings& profileSettings ); + + /*! + * set ring tone in personalization group in control panel's homeview + */ + QString ringTone() const; + void setRingTone(const QString& filePath); + + /* QString alarmTone(); + void setAlarmTone(const QString& filePath);*/ + + int masterVolume() const; + void setMasterVolume(int volume); + + + bool masterVibra() const; + void setMasterVibra(bool isVibra); + + bool isSilenceMode() const; + void setSilenceMode(bool isSlience); + + bool isOffLineMode() const; + void setOffLineMode(bool isOffLine); + + /*! + * For profile settings + */ + + QString ringTone(int profileId)const; + void setRingTone(int profileId, const QString& filePath); + QString messageTone(int profileId) const; + void setMessageTone(int profileId, const QString& filePath); + QString emailTone(int profileId) const; + void setEmailTone(int profileId, const QString& filePath); + QString reminderTone(int profileId) const; + void setReminderTone(int profileId, const QString& filePath); + + bool notificationTone(int profileId) const; + void setNotificationTone(int profileId, bool isActive); + + int keyTouchScreenTone(int profileId) const; + void setKeyTouchScreenTone(int profileId, int level); + + bool ringAlertVibra(int profileId) const; + void setRingAlertVibra(int profileId, bool isActive); + + bool messageVibra(int profileId) const; + void setMessageVibra(int profileId, bool isActive); + + bool emailVibra(int profileId) const; + void setEmailVibra(int profileId, bool isActive); + + bool reminderVibra(int profileId) const; + void setReminderVibra(int profileId, bool isActive); + + bool notificationVibra(int profileId) const; + void setNotificationVibra(int profileId, bool isActive); + + int keyTouchScreenVibra(int profileId)const; + void setKeyTouchScreenVibra(int profileId, int level); private: + CpProfileModelPrivate *const d_ptr; + +private: Q_DISABLE_COPY(CpProfileModel) - -private: - CpProfileModelPrivate* dptr; - }; + Q_DECLARE_PRIVATE_D(d_ptr,CpProfileModel) +}; #endif diff -r 10d0dd0e43f1 -r 624337f114fe controlpanelui/src/inc/cpuids.h --- a/controlpanelui/src/inc/cpuids.h Fri Apr 16 14:59:22 2010 +0300 +++ b/controlpanelui/src/inc/cpuids.h Mon May 03 12:32:06 2010 +0300 @@ -43,15 +43,15 @@ #define QUID_CPCATEGORYMODEL_DLL 0X20028736 -#define QUID_RESERVED4 0X20028737 -#define QUID_RESERVED5 0X20028738 -#define QUID_RESERVED6 0X20028739 +#define QUID_CPVOLUME 0X20028737 +#define QUID_RINGTONE 0X20028738 +#define QUID_PROFILEACTIVATOR 0X20028739 #define QUID_RESERVED7 0X2002873A #define QUID_RESERVED8 0X2002873B #define QUID_RESERVED9 0X2002873C #define QUID_RESERVED10 0X2002873D #define QUID_RESERVED11 0X2002873E -#define QUID_RESERVED12 0X2002873F +#define QUID_CPSERVICEPROVIDER 0X2002873F #define QUID_DE_GSPLUGIN 0X20028740 //reserved by 9.2 #endif //QCPUIDS_H