--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/profilesmodel.h Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,44 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles model for profiles widget
+*
+*/
+
+#ifndef PROFILESMODEL_H
+#define PROFILESMODEL_H
+
+// System includes
+#include <QObject>
+
+// Forward declarations
+class ProfilesModelPrivate;
+
+// Class declaration
+class ProfilesModel : public QObject
+{
+public:
+ ProfilesModel(QObject *parent = 0);
+ ~ProfilesModel();
+ int activeProfileId();
+ int activateProfile(int profileId);
+ QString activeProfileName();
+
+private:
+ Q_DISABLE_COPY(ProfilesModel)
+
+private:
+ ProfilesModelPrivate *dptr;
+};
+
+#endif //PROFILESMODEL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/profilesmodel_p.h Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,43 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles model private
+*
+*/
+
+#ifndef PROFILESMODEL_P_H
+#define PROFILESMODEL_P_H
+
+// Forward declarations
+class MProfileEngineExtended;
+class QString;
+
+// Class declaration
+class ProfilesModelPrivate
+{
+public:
+ static ProfilesModelPrivate *NewL();
+ ~ProfilesModelPrivate();
+ int activeProfileId();
+ int activateProfile(int profileId);
+ QString activeProfileName();
+
+private:
+ ProfilesModelPrivate();
+ void ConstructL();
+
+private:
+ MProfileEngineExtended *mEngine;
+};
+
+#endif //PROFILESMODEL_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/profilesobserver.h Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles model for profiles widget
+*
+*/
+
+#ifndef PROFILESOBSERVER_H
+#define PROFILESOBSERVER_H
+
+// System includes
+#include <QObject>
+
+// Forward declarations
+class ProfilesObserverPrivate;
+
+// Class declaration
+class ProfilesObserver : public QObject
+{
+public:
+ ProfilesObserver(QObject *parent = 0);
+ ~ProfilesObserver();
+
+private:
+ Q_DISABLE_COPY(ProfilesObserver)
+
+private:
+ ProfilesObserverPrivate *dptr;
+};
+
+#endif //PROFILESOBSERVER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/profilesobserver_p.h Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,48 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles model private
+*
+*/
+
+#ifndef PROFILESOBSERVER_P_H
+#define PROFILESOBSERVER_P_H
+
+// System includes
+#include <e32base.h>
+#include <QObject>
+#include <MProfileChangeObserver.h>
+
+// Forward declarations
+class CProfileChangeNotifyHandler;
+
+// Class declaration
+class ProfilesObserverPrivate : public CBase, public MProfileChangeObserver
+{
+public:
+ static ProfilesObserverPrivate* NewL(QObject *parent);
+ ProfilesObserverPrivate();
+ ~ProfilesObserverPrivate();
+
+private:
+ void ConstructL(QObject *parent);
+ virtual void HandleActiveProfileEventL(
+ TProfileEvent aProfileEvent,
+ TInt aProfileId);
+
+private:
+ CProfileChangeNotifyHandler *iHandler;
+ QObject *iParent;
+};
+
+#endif //PROFILESOBSERVER_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/profileswidget.h Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,55 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget
+*
+*/
+
+#ifndef PROFILESWIDGET_H
+#define PROFILESWIDGET_H
+
+// System includes
+#include <HbWidget>
+
+// Forward declarations
+class HbPushButton;
+class ProfilesModel;
+class ProfilesObserver;
+
+// Class declaration
+class ProfilesWidget : public HbWidget
+{
+ Q_OBJECT
+
+public:
+ ProfilesWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
+ ~ProfilesWidget();
+ QRectF boundingRect() const;
+ QPainterPath shape() const;
+ void changeIcon();
+
+public slots:
+ void onShow();
+ void onHide();
+
+private slots:
+ void onButtonPressed();
+
+private:
+ Q_DISABLE_COPY(ProfilesWidget)
+ HbPushButton *mButton;
+ ProfilesModel *mModel;
+ ProfilesObserver *mObserver;
+};
+
+#endif //PROFILESWIDGET_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/profileswidgetconsts.h Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget constants
+*
+*/
+
+#ifndef PROFILESWIDGETCONSTS_H
+#define PROFILESWIDGETCONSTS_H
+
+const int ProfilesWidgetGeneralProfileId = 0;
+const int ProfilesWidgetSilentProfileId = 1;
+const int ProfilesWidgetMeetingProfileId = 2;
+
+#endif //PROFILESWIDGETCONSTS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/profileswidgetplugin.h Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,37 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget plugin
+*
+*/
+
+#ifndef PROFILESWIDGETPLUGIN_H
+#define PROFILESWIDGETPLUGIN_H
+
+// System includes
+#include <QObject>
+#include <qserviceplugininterface.h>
+
+// Class declaration
+QTM_USE_NAMESPACE
+class ProfilesWidgetPlugin : public QObject, public QServicePluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+ QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+ QServiceContext *context, QAbstractSecuritySession *session);
+};
+
+#endif // PROFILESWIDGETPLUGIN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,19 @@
+<?xml version="1.0"?>
+<!DOCTYPE SystemDefinition SYSTEM "sysdef_1_5_1.dtd" [
+ <!ENTITY layer_real_source_path "sf/app/profileswidgetplugin" >
+]>
+
+<SystemDefinition name="profileswidgetplugin" schema="1.5.1">
+ <systemModel>
+ <layer name="app_layer">
+ <module name="profileswidgetplugin">
+ <unit unitID="profileswidgetplugin_qt" mrp="" bldFile="&layer_real_source_path;" name="profileswidgetplugin_qt" proFile="profileswidgetplugin.pro" qmakeArgs="-r" filter="dfs_build" />
+ </module>
+ <module name="t_profileswidgetplugin">
+ <unit unitID="t_profileswidgetplugin_qt" mrp="" bldFile="&layer_real_source_path;/tsrc" name="t_profileswidgetplugin_qt" proFile="tsrc.pro" qmakeArgs="-r" filter="dfs_build" />
+ </module>
+ </layer>
+ </systemModel>
+</SystemDefinition>
+
+
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_definition.xml Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,19 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<SystemDefinition schema="3.0.0" xmlns:qt="http://www.nokia.com/qt">
+ <package id="profileswidgetplugin" name="Profiles Widget" levels="build app">
+ <collection id="profileswidgetplugin_info" name="Profiles Widget Info" level="build">
+ <component id="profileswidgetplugin_rom" name="profiles Widget ROM" filter="s60,dfs_build" introduced="^4">
+ <unit bldFile="rom"/>
+ </component>
+ </collection>
+ <collection id="profileswidgetplugin" name="Profiles Widget Plugin" level="app">
+ <!-- collection is really a component, need to move down a directory -->
+ <component id="profileswidgetplugin_build" name="Profiles Widget Plugin Build" filter="s60,dfs_build" introduced="^4" class="plugin">
+ <unit bldFile="." qt:proFile="profileswidgetplugin.pro"/>
+ </component>
+ <component id="profileswidgetplugin_test" name="Profiles Widget Plugin Test" filter="s60,dfs_build" introduced="^4">
+ <unit bldFile="tsrc" qt:proFile="tsrc.pro"/>
+ </component>
+ </collection>
+ </package>
+</SystemDefinition>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/package_map.xml Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="app"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/profileswidgetplugin.docml Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,12 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.0">
+ <widget name="dialog" type="HbDialog"/>
+ <widget name="pushButton" type="HbPushButton">
+ <real name="z" value="1"/>
+ <string name="text" value=""/>
+ <sizehint height="5un" type="PREFERRED" width="15un"/>
+ </widget>
+ <metadata activeUIState="Common ui state" display="NHD portrait" unit="un">
+ <uistate name="Common ui state" sections="#common"/>
+ </metadata>
+</hbdocument>
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/profileswidgetplugin.pri Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,31 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Profiles widget
+#
+
+HEADERS += ./inc/*.h
+SOURCES += src/profileswidgetplugin.cpp \
+ src/profileswidget.cpp \
+ src/profilesmodel.cpp \
+ src/profilesobserver.cpp \
+
+symbian : {
+ SOURCES += src/profilesmodel_p_symbian.cpp \
+ src/profilesobserver_p_symbian.cpp
+}
+
+win32 : {
+ SOURCES += src/profilesmodel_p_win.cpp \
+ src/profilesobserver_p_win.cpp
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/profileswidgetplugin.pro Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,70 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Profiles widget
+#
+
+TEMPLATE = lib
+CONFIG += plugin mobility hb
+MOBILITY = serviceframework
+
+include(../../common.pri)
+include(profileswidgetplugin.pri)
+include(rom/profileswidgetplugin_rom.pri)
+
+INCLUDEPATH += ./inc
+RESOURCES += resources.qrc
+
+TRANSLATIONS = profiles_widget.ts
+
+symbian: {
+
+ PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/2002EAD2
+
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+ TARGET.UID3 = 0x2002EAD2
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = ALL -TCB
+
+ LIBS += -lprofileeng -lxqutils
+
+ plugins.path = $${PLUGIN_SUBDIR}
+ plugins.sources = $${TARGET}.dll
+
+ widgetResources.path = $${PLUGIN_SUBDIR}
+ widgetResources.sources += resource/$${TARGET}.xml
+ widgetResources.sources += resource/$${TARGET}.manifest
+ widgetResources.sources += resource/$${TARGET}.png
+
+ DEPLOYMENT += plugins \
+ widgetResources
+}
+
+win32: {
+
+ CONFIG(debug, debug|release) {
+ SUBDIRPART = debug
+ } else {
+ SUBDIRPART = release
+ }
+
+ PLUGIN_SUBDIR = /hsresources/import/widgetregistry/2002EAD2
+
+ DESTDIR = $$PWD/../../../../../bin/$${SUBDIRPART}/$${PLUGIN_SUBDIR}
+
+ manifest.path = $${DESTDIR}
+ manifest.files = ./resource/*.manifest ./resource/*.xml ./resource/*.png
+
+ INSTALLS += manifest
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/resource/profileswidgetplugin.manifest Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<hswidgetmanifest>
+ <uri>profileswidgetplugin</uri>
+ <title>txt_applib_grid_profiles_widget</title>
+ <description>Change profiles.</description>
+ <icon>profileswidgetplugin.png</icon>
+ <hidden>false</hidden>
+ <servicexml>profileswidgetplugin.xml</servicexml>
+ <translationfile>profiles_widget</translationfile>
+</hswidgetmanifest>
Binary file resource/profileswidgetplugin.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/resource/profileswidgetplugin.xml Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+ <name>profileswidgetplugin</name>
+ <filepath>profileswidgetplugin</filepath>
+ <description>Profiles Widget</description>
+ <interface>
+ <name>com.nokia.symbian.IHomeScreenWidget</name>
+ <version>1.0</version>
+ <description>Profiles Widget</description>
+ <capabilities></capabilities>
+ <customproperty key="iconuri">profileswidgetplugin.png</customproperty>
+ <customproperty key="title">Profiles Widget</customproperty>
+ </interface>
+</service>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/resource/profileswidgetplugin.xml_for_sisx Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+ <name>profileswidgetplugin</name>
+ <filepath>c:/private/20022F35/import/widgetregistry/2002EAD2/profileswidgetplugin.qtplugin</filepath>
+ <description>Profiles Widget</description>
+ <interface>
+ <name>com.nokia.symbian.IHomeScreenWidget</name>
+ <version>1.0</version>
+ <description>Profiles Widget</description>
+ <capabilities></capabilities>
+ <customproperty key="iconuri">profileswidgetplugin.png</customproperty>
+ <customproperty key="title">Profiles Widget</customproperty>
+ </interface>
+</service>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/resources.qrc Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RCC>
+ <qresource>
+ <file alias="profileswidgetplugin">profileswidgetplugin.docml</file>
+ </qresource>
+</RCC>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/bld.inf Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,28 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:
+*
+*/
+
+
+PRJ_MMPFILES
+
+
+
+prj_extensions
+
+PRJ_EXPORTS
+
+profileswidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(profileswidgetplugin.iby)
+profileswidgetplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(profileswidgetplugin_resources.iby)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/profileswidgetplugin.iby Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:
+ * The iby file for profileswidgetplugin component
+ *
+ */
+
+#ifndef PROFILESWIDGETPLUGIN_IBY
+#define PROFILESWIDGETPLUGIN_IBY
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\profileswidgetplugin.dll SHARED_LIB_DIR\profileswidgetplugin.dll
+
+data=ZPRIVATE\20022F35\import\widgetregistry\2002EAD2\profileswidgetplugin.qtplugin private\20022f35\import\widgetregistry\2002EAD2\profileswidgetplugin.qtplugin
+data=ZPRIVATE\20022F35\import\widgetregistry\2002EAD2\profileswidgetplugin.manifest private\20022f35\import\widgetregistry\2002EAD2\profileswidgetplugin.manifest
+data=ZPRIVATE\20022F35\import\widgetregistry\2002EAD2\profileswidgetplugin.png private\20022f35\import\widgetregistry\2002EAD2\profileswidgetplugin.png
+data=ZPRIVATE\20022F35\import\widgetregistry\2002EAD2\profileswidgetplugin.xml private\20022f35\import\widgetregistry\2002EAD2\profileswidgetplugin.xml
+
+#endif // PROFILESWIDGETPLUGIN_IBY
+
+// End of file --Don't remove this.
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/profileswidgetplugin_resources.iby Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* 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 __PROFILESWIDGETRLUGIN_RESOURCE_IBY__
+#define __PROFILESWIDGETRLUGIN_RESOURCE_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\profiles_widget.qm QT_TRANSLATIONS_DIR\profiles_widget.qm
+
+#endif
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/profileswidgetplugin_rom.pri Fri Sep 17 09:20:42 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:
+#
+
+symbian {
+ BLD_INF_RULES.prj_exports += \
+ "$${LITERAL_HASH}include<platform_paths.hrh>" \
+ "rom/profileswidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(profileswidgetplugin.iby)" \
+ "rom/profileswidgetplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(profileswidgetplugin_resources.iby)"
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/profilesmodel.cpp Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,71 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles model
+*
+*/
+
+// User includes
+#include "profilesmodel.h"
+#include "profilesmodel_p.h"
+#include "profileswidgetconsts.h"
+
+/*!
+ \class ProfilesModelPrivate
+ \profiles widget model class
+
+ This class is used to create profiles widget model
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ Constructor
+*/
+ProfilesModel::ProfilesModel(QObject *parent/*= 0*/)
+ : QObject(parent)
+{
+ QT_TRAP_THROWING(dptr = ProfilesModelPrivate::NewL());
+}
+
+/*!
+ Destroyer
+*/
+ProfilesModel::~ProfilesModel()
+{
+ delete dptr;
+}
+
+/*!
+ Get the actived profile ID
+*/
+int ProfilesModel::activeProfileId()
+{
+ return dptr->activeProfileId();
+}
+
+/*!
+ Set active profile to specified ID
+*/
+int ProfilesModel::activateProfile(int profileId)
+{
+ return dptr->activateProfile(profileId);
+}
+
+/*!
+ Get actived profile name
+*/
+QString ProfilesModel::activeProfileName()
+{
+ return dptr->activeProfileName();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/profilesmodel_p_symbian.cpp Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,104 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget plugin.
+*
+*/
+
+// System includes
+#include <e32base.h>
+#include <MProfileEngineExtended.h>
+#include <xqconversions.h>
+#include <mprofilename.h>
+#include <mprofile.h>
+
+// User includes
+#include "profilesmodel_p.h"
+#include "profileswidgetconsts.h"
+
+/*!
+ \class ProfilesModelPrivate
+ \profiles widget model class
+
+ This class is used to create profiles widget model
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ NewL
+*/
+ProfilesModelPrivate* ProfilesModelPrivate::NewL()
+{
+ ProfilesModelPrivate *self = new (ELeave)ProfilesModelPrivate();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(); //self
+ return self;
+}
+
+/*!
+ Constructor
+*/
+ProfilesModelPrivate::ProfilesModelPrivate()
+{
+ mEngine = NULL;
+}
+
+/*!
+ ConstructL
+*/
+void ProfilesModelPrivate::ConstructL()
+{
+ mEngine = CreateProfileEngineExtendedL();
+}
+
+/*!
+ Destroyer
+*/
+ProfilesModelPrivate::~ProfilesModelPrivate()
+{
+ mEngine->Release();
+}
+
+/*!
+ Get the actived profile ID
+*/
+int ProfilesModelPrivate::activeProfileId()
+{
+ return mEngine->ActiveProfileId();
+}
+
+/*!
+ Set active profile to specified ID
+*/
+int ProfilesModelPrivate::activateProfile(int profileId)
+{
+ TRAPD(err, mEngine->SetActiveProfileL(profileId));
+ return err;
+}
+
+/*!
+ Get actived profile name
+*/
+QString ProfilesModelPrivate::activeProfileName()
+{
+ MProfile *lProfile = mEngine->ActiveProfileL();
+ CleanupReleasePushL(*lProfile);
+
+ const MProfileName &lMProfileName = lProfile->ProfileName();
+ TBuf<10> lProfileName = lMProfileName.Name();
+ CleanupStack::PopAndDestroy();
+ QString profileName = XQConversions::s60DescToQString(lProfileName);
+ return profileName;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/profilesmodel_p_win.cpp Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,81 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget model
+*
+*/
+
+// User includes
+#include "profilesmodel_p.h"
+
+/*!
+ \class ProfilesModelPrivate
+ \profiles widget model class
+
+ This class is used to create profiles widget model
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ NewL
+*/
+ProfilesModelPrivate* ProfilesModelPrivate::NewL()
+{
+}
+
+/*!
+ Constructor
+*/
+ProfilesModelPrivate::ProfilesModelPrivate()
+{
+}
+
+/*!
+ ConstructL
+*/
+void ProfilesModelPrivate::ConstructL()
+{
+}
+
+/*!
+ Destroyer
+*/
+ProfilesModelPrivate::~ProfilesModelPrivate()
+{
+
+}
+
+/*!
+ Get the actived profile ID
+*/
+int ProfilesModelPrivate::activeProfileId()
+{
+ return 0;
+}
+
+/*!
+ Set active profile to specified ID
+*/
+int ProfilesModelPrivate::activateProfile(int)
+{
+ return 0;
+}
+
+/*!
+ Get actived profile name
+*/
+QString ProfilesModelPrivate::activeProfileName()
+{
+ return NULL;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/profilesobserver.cpp Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,46 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget
+*
+*/
+
+// User includes
+#include "profilesobserver.h"
+#include "profilesobserver_p.h"
+
+/*!
+ \class ProfilesObserver
+ \profiles widget observer
+
+ This class is used to create profiles widget observer
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ Constructor
+*/
+ProfilesObserver::ProfilesObserver(QObject *parent/*= 0*/)
+ : QObject(parent)
+{
+ QT_TRAP_THROWING(dptr = ProfilesObserverPrivate::NewL(parent));
+}
+
+/*!
+ Destroyer
+*/
+ProfilesObserver::~ProfilesObserver()
+{
+ delete dptr;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/profilesobserver_p_symbian.cpp Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,82 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget plugin.
+*
+*/
+
+// System includes
+#include <CProfileChangeNotifyHandler.h>
+
+// User includes
+#include "profilesobserver_p.h"
+#include "profileswidget.h"
+
+/*!
+ \class ProfilesObserverPrivate
+ \profiles observer class
+
+ This class is used to create profiles observer
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ NewL
+*/
+ProfilesObserverPrivate* ProfilesObserverPrivate::NewL(QObject *parent)
+{
+ ProfilesObserverPrivate* self = new (ELeave) ProfilesObserverPrivate();
+ CleanupStack::PushL(self);
+ self->ConstructL(parent);
+ CleanupStack::Pop(); //self
+ return self;
+}
+
+/*!
+ Constructor
+*/
+ProfilesObserverPrivate::ProfilesObserverPrivate()
+{
+}
+
+/*!
+ ConstructL
+*/
+void ProfilesObserverPrivate::ConstructL(QObject *parent)
+{
+ iHandler = CProfileChangeNotifyHandler::NewL(this);
+ iParent = parent;
+}
+
+/*!
+ Destroyer
+*/
+ProfilesObserverPrivate::~ProfilesObserverPrivate()
+{
+ if(iHandler) {
+ delete iHandler;
+ iHandler = NULL;
+ }
+}
+
+/*!
+ Handle the active profile events
+*/
+void ProfilesObserverPrivate::HandleActiveProfileEventL(
+ TProfileEvent /*aProfileEvent*/,
+ TInt /*aProfileId*/ )
+{
+ // handle event
+ (reinterpret_cast<ProfilesWidget*>(iParent))->changeIcon();
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/profilesobserver_p_win.cpp Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,65 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget plugin.
+*
+*/
+
+// User includes
+#include "profilesobserver_p.h"
+
+/*!
+ \class ProfilesObserverPrivate
+ \profiles observer class
+
+ This class is used to create profiles observer
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ NewL
+*/
+ProfilesObserverPrivate* ProfilesObserverPrivate::NewL(QObject *parent)
+{
+}
+
+/*!
+ Constructor
+*/
+ProfilesObserverPrivate::ProfilesObserverPrivate()
+{
+}
+
+/*!
+ ConstructL
+*/
+void ProfilesObserverPrivate::ConstructL(QObject *parent)
+{
+}
+
+/*!
+ Destroyer
+*/
+ProfilesObserverPrivate::~ProfilesObserverPrivate()
+{
+}
+
+/*!
+ Handle the active profile events
+*/
+void ProfilesObserverPrivate::HandleActiveProfileEventL(
+ TProfileEvent aProfileEvent,
+ TInt aProfileId )
+{
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/profileswidget.cpp Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,136 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget
+*
+*/
+
+// System includes
+#include <HbPushButton>
+#include <QGraphicsLinearLayout>
+#include <HbStyle>
+#include <HbDocumentLoader>
+#include <HbFrameDrawer>
+
+// User includes
+#include "profileswidget.h"
+#include "profileswidgetconsts.h"
+#include "profilesmodel.h"
+#include "profilesobserver.h"
+
+/*!
+ \class ProfilesWidget
+ \implementation for home screen profiles widget
+*/
+
+/*!
+ Constructor
+*/
+ProfilesWidget::ProfilesWidget(QGraphicsItem* parent, Qt::WindowFlags flags)
+ : HbWidget(parent, flags),
+ mButton(0),
+ mModel(new ProfilesModel),
+ mObserver(new ProfilesObserver(this))
+{
+ //QGraphicsProxyWidget *proxy = new QGraphicsProxyWidget(this);
+ QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(
+ Qt::Vertical, this);
+
+ // load the widget from .docml
+ HbDocumentLoader loader;
+ bool ok = false;
+ loader.load(":/profileswidgetplugin", &ok);
+ if (!ok) {
+ // fail to load .docml file
+ return;
+ }
+ mButton = (HbPushButton *) loader.findWidget("pushButton");
+ if (!mButton) {
+ // fail to find push button
+ return;
+ }
+
+ mButton->setText(mModel->activeProfileName());
+ HbFrameDrawer *background = new HbFrameDrawer("qtg_fr_hsshortcut_normal",
+ HbFrameDrawer::NinePieces);
+ mButton->setFrameBackground(background);
+ mainLayout->addItem(mButton);
+ connect(mButton, SIGNAL(pressed()), this, SLOT(onButtonPressed()));
+
+ setLayout(mainLayout);
+}
+
+/*!
+ Handle toggled event of button
+*/
+void ProfilesWidget::onButtonPressed()
+{
+ int profileId = mModel->activeProfileId();
+ if (profileId != ProfilesWidgetGeneralProfileId) {
+ mModel->activateProfile(ProfilesWidgetGeneralProfileId);
+ } else {
+ mModel->activateProfile(ProfilesWidgetMeetingProfileId);
+ }
+ mButton->setText(mModel->activeProfileName());
+}
+
+/*!
+ Change icon of widget
+*/
+void ProfilesWidget::changeIcon()
+{
+ mButton->setText(mModel->activeProfileName());
+}
+
+/*!
+ Destroyer
+*/
+ProfilesWidget::~ProfilesWidget()
+{
+ if (mModel) {
+ delete mModel;
+ mModel = NULL;
+ }
+}
+
+/*!
+ Return bounding rect
+*/
+QRectF ProfilesWidget::boundingRect() const
+{
+ return childrenBoundingRect();
+}
+
+/*!
+ Return shape
+*/
+QPainterPath ProfilesWidget::shape() const
+{
+ QPainterPath path;
+ path.addRect(boundingRect());
+ return path;
+}
+
+/*!
+ Called when widget is shown in the home screen
+*/
+void ProfilesWidget::onShow()
+{
+}
+
+/*!
+ Called when widget is hidden from the home screen
+*/
+void ProfilesWidget::onHide()
+{
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/profileswidgetplugin.cpp Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,51 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Profiles widget plugin
+*
+*/
+
+// System includes
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+// User includes
+#include "profileswidgetplugin.h"
+#include "profileswidget.h"
+
+/*!
+ \class ProfilesWidgetPlugin
+ \implementation of profiles widget plugin
+*/
+
+/*!
+ Initialize plugin of profiles widget
+*/
+QObject *ProfilesWidgetPlugin::createInstance(const
+ QServiceInterfaceDescriptor &descriptor,
+ QServiceContext *context,
+ QAbstractSecuritySession *session)
+{
+ Q_UNUSED(context);
+ Q_UNUSED(session);
+
+ if (descriptor.interfaceName() ==
+ QLatin1String("com.nokia.symbian.IHomeScreenWidget")) {
+ return new ProfilesWidget();
+ } else {
+ return 0;
+ }
+}
+
+Q_EXPORT_PLUGIN2(profileswidgetplugin, ProfilesWidgetPlugin)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_5_1.dtd Fri Sep 17 09:20:42 2010 +0300
@@ -0,0 +1,88 @@
+ <!ELEMENT SystemDefinition (systemModel?, build?)>
+ <!ATTLIST SystemDefinition
+ name CDATA #REQUIRED
+ schema CDATA #REQUIRED>
+ <!ELEMENT systemModel (layer+)>
+ <!ELEMENT layer (logicalset* | module*)*>
+ <!ATTLIST layer
+ name CDATA #REQUIRED
+ levels CDATA #IMPLIED
+ span CDATA #IMPLIED>
+ <!ELEMENT logicalset (logicalsubset* | module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalset name CDATA #REQUIRED>
+ <!ELEMENT logicalsubset (module* | unit* | package* | prebuilt*)*>
+ <!ATTLIST logicalsubset name CDATA #REQUIRED>
+ <!ELEMENT module (component* | unit* | package* | prebuilt*)*>
+ <!ATTLIST module
+ name CDATA #REQUIRED
+ level CDATA #IMPLIED>
+ <!ELEMENT component (unit* | package* | prebuilt*)*>
+ <!ATTLIST component name CDATA #REQUIRED>
+ <!ELEMENT unit EMPTY>
+ <!ATTLIST unit
+ unitID ID #REQUIRED
+ name CDATA #REQUIRED
+ mrp CDATA #REQUIRED
+ filter CDATA #IMPLIED
+ bldFile CDATA #REQUIRED
+ priority CDATA #IMPLIED
+ contract CDATA #IMPLIED
+ proFile CDATA #IMPLIED
+ qmakeArgs CDATA #IMPLIED>
+ <!ELEMENT package EMPTY>
+ <!ATTLIST package
+ name CDATA #REQUIRED
+ mrp CDATA #REQUIRED
+ filter CDATA #IMPLIED
+ contract CDATA #IMPLIED>
+ <!ELEMENT prebuilt EMPTY>
+ <!ATTLIST prebuilt
+ name CDATA #REQUIRED
+ version CDATA #REQUIRED
+ late (Y|N) #IMPLIED
+ filter CDATA #IMPLIED
+ contract CDATA #IMPLIED>
+ <!ELEMENT build (option* | target+ | targetList+ | unitList+ | configuration+)*>
+ <!ELEMENT unitList (unitRef+)>
+ <!ATTLIST unitList
+ name ID #REQUIRED
+ description CDATA #REQUIRED>
+ <!ELEMENT unitRef EMPTY>
+ <!ATTLIST unitRef unit IDREF #REQUIRED>
+ <!ELEMENT targetList EMPTY>
+ <!ATTLIST targetList
+ name ID #REQUIRED
+ description CDATA #REQUIRED
+ target IDREFS #REQUIRED>
+ <!ELEMENT target EMPTY>
+ <!ATTLIST target
+ name ID #REQUIRED
+ abldTarget CDATA #REQUIRED
+ description CDATA #REQUIRED>
+ <!ELEMENT option EMPTY>
+ <!ATTLIST option
+ name ID #REQUIRED
+ abldOption CDATA #REQUIRED
+ description CDATA #REQUIRED
+ enable (Y | N | y | n) #REQUIRED>
+ <!ELEMENT configuration (unitListRef+ | layerRef+ | task+)*>
+ <!ATTLIST configuration
+ name ID #REQUIRED
+ description CDATA #REQUIRED
+ filter CDATA #REQUIRED>
+ <!ELEMENT task ( unitListRef* , (buildLayer | specialInstructions))>
+ <!ELEMENT unitListRef EMPTY>
+ <!ATTLIST unitListRef unitList IDREF #REQUIRED>
+ <!ELEMENT layerRef EMPTY>
+ <!ATTLIST layerRef layerName CDATA #REQUIRED>
+ <!ELEMENT buildLayer EMPTY>
+ <!ATTLIST buildLayer
+ command CDATA #REQUIRED
+ targetList IDREFS #IMPLIED
+ unitParallel (Y | N | y | n) #REQUIRED
+ targetParallel (Y | N | y | n) #IMPLIED>
+ <!ELEMENT specialInstructions EMPTY>
+ <!ATTLIST specialInstructions
+ name CDATA #REQUIRED
+ cwd CDATA #REQUIRED
+ command CDATA #REQUIRED>