--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/silentmodel.h Fri Sep 17 09:20:19 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: Silent model for silent widget
+*
+*/
+
+#ifndef SILENTMODEL_H
+#define SILENTMODEL_H
+
+// System includes
+#include <QObject>
+
+// Forward declarations
+class SilentModelPrivate;
+
+// Class declaration
+class SilentModel : public QObject
+{
+public:
+ SilentModel(QObject *parent = 0);
+ ~SilentModel();
+ bool silenceMode() const;
+ void setSilenceMode(bool isSlience);
+
+private:
+ Q_DISABLE_COPY(SilentModel)
+
+private:
+ SilentModelPrivate *dptr;
+};
+
+#endif //SILENTMODEL_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/silentmodel_p.h Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Silent model private
+*
+*/
+
+#ifndef SILENTMODEL_P_H
+#define SILENTMODEL_P_H
+
+// Forward declarations
+class MProfileEngineExtended2;
+
+// Class declaration
+class SilentModelPrivate
+{
+public:
+ static SilentModelPrivate *NewL();
+ ~SilentModelPrivate();
+ bool silenceMode() const;
+ void setSilenceMode(bool isSlience);
+
+private:
+ SilentModelPrivate();
+ void ConstructL();
+
+private:
+ MProfileEngineExtended2 *mEngine;
+};
+
+#endif //SILENTMODEL_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/silentobserver.h Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,41 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Silent profiles observer
+*
+*/
+
+#ifndef SILENTOBSERVER_H
+#define SILENTOBSERVER_H
+
+// System includes
+#include <QObject>
+
+// Forward declarations
+class SilentObserverPrivate;
+
+// Class declaration
+class SilentObserver : public QObject
+{
+public:
+ SilentObserver(QObject *parent = 0);
+ ~SilentObserver();
+
+private:
+ Q_DISABLE_COPY(SilentObserver)
+
+private:
+ SilentObserverPrivate *dptr;
+ };
+
+#endif //SILENTOBSERVER_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/silentobserver_p.h Fri Sep 17 09:20:19 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: Silent profiles observer
+*
+*/
+
+#ifndef SILENTOBSERVER_P_H
+#define SILENTOBSERVER_P_H
+
+// System includes
+#include <e32base.h>
+#include <QObject>
+#include <MProfileChangeObserver.h>
+
+// Forward declarations
+class CProfileChangeNotifyHandler;
+
+// Class declaration
+class SilentObserverPrivate : public CBase, public MProfileChangeObserver
+{
+public:
+ static SilentObserverPrivate *NewL(QObject *parent);
+ SilentObserverPrivate();
+ ~SilentObserverPrivate();
+
+private:
+ void ConstructL(QObject *parent);
+ virtual void HandleActiveProfileEventL(
+ TProfileEvent aProfileEvent,
+ TInt aProfileId );
+
+private:
+ CProfileChangeNotifyHandler *iHandler;
+ QObject *iParent;
+};
+
+#endif //SILENTOBSERVER_P_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/silentwidget.h Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,59 @@
+/*
+* 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: Silent widget
+*
+*/
+
+#ifndef SILENTWIDGET_H
+#define SILENTWIDGET_H
+
+// System includes
+#include <HbWidget>
+
+// Forward declarations
+class HbPushButton;
+class SilentModel;
+class SilentObserver;
+class XQSettingsManager;
+class XQSettingsKey;
+
+// Class declaration
+class SilentWidget : public HbWidget
+{
+ Q_OBJECT
+
+public:
+ SilentWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
+ ~SilentWidget();
+ QRectF boundingRect() const;
+ QPainterPath shape() const;
+ void changeIcon();
+
+public slots:
+ void onShow();
+ void onHide();
+ void settingValueChanged(const XQSettingsKey &key, const QVariant &value);
+
+private slots:
+ void handleClickEvent(bool state);
+
+private:
+ Q_DISABLE_COPY(SilentWidget)
+ HbPushButton *mButton;
+ SilentModel *mModel;
+ SilentObserver *mObserver;
+ XQSettingsManager *mSettingManager;
+};
+
+#endif // SILENTWIDGET_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/silentwidgetconsts.h Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,25 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Silent widget constants
+*
+*/
+
+#ifndef SILENTWIDGETCONSTS_H
+#define SILENTWIDGETCONSTS_H
+
+const int SilentWidgetGeneralProfileId = 0;
+const int SilentWidgetSilentProfileId = 1;
+const int SilentWidgetMeetingProfileId = 2;
+
+#endif //SILENTWIDGETCONSTS_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/inc/silentwidgetplugin.h Fri Sep 17 09:20:19 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: Silent widget plugin
+*
+*/
+
+#ifndef SILENTWIDGETPLUGIN_H
+#define SILENTWIDGETPLUGIN_H
+
+// System includes
+#include <QObject>
+#include <qserviceplugininterface.h>
+
+// Class declaration
+QTM_USE_NAMESPACE
+class SilentWidgetPlugin : public QObject, public QServicePluginInterface
+{
+ Q_OBJECT
+ Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+ QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+ QServiceContext *context, QAbstractSecuritySession *session);
+};
+
+#endif // SILENTWIDGETPLUGIN_H
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml Fri Sep 17 09:20:19 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/silentwidgetplugin" >
+]>
+
+<SystemDefinition name="silentwidgetplugin" schema="1.5.1">
+ <systemModel>
+ <layer name="app_layer">
+ <module name="silentwidgetplugin">
+ <unit unitID="silentwidgetplugin_qt" mrp="" bldFile="&layer_real_source_path;" name="silentwidgetplugin_qt" proFile="silentwidgetplugin.pro" qmakeArgs="-r" filter="dfs_build" />
+ </module>
+ <module name="t_silentwidgetplugin">
+ <unit unitID="t_silentwidgetplugin_qt" mrp="" bldFile="&layer_real_source_path;/tsrc" name="t_silentwidgetplugin_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:19 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="silentwidgetplugin" name="Silent Widget" levels="build app">
+ <collection id="silentwidgetplugin_info" name="Silent Widget Info" level="build">
+ <component id="silentwidgetplugin_rom" name="Silent Widget ROM" filter="s60,dfs_build" introduced="^4">
+ <unit bldFile="rom"/>
+ </component>
+ </collection>
+ <collection id="silentwidgetplugin" name="Silent Widget Plugin" level="app">
+ <!-- collection is really a component, need to move down a directory -->
+ <component id="silentwidgetplugin_build" name="Silent Widget Plugin Build" filter="s60,dfs_build" introduced="^4" class="plugin">
+ <unit bldFile="." qt:proFile="silentwidgetplugin.pro"/>
+ </component>
+ <component id="silentwidgetplugin_test" name="Silent 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:19 2010 +0300
@@ -0,0 +1,1 @@
+<PackageMap root="sf" layer="app"/>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/resource/silentwidgetplugin.manifest Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,10 @@
+<?xml version="1.0" encoding="utf-8"?>
+<hswidgetmanifest>
+ <uri>silentwidgetplugin</uri>
+ <title>txt_applib_list_silent_widget</title>
+ <description>Set volume on/off.</description>
+ <icon>silentwidgetplugin.png</icon>
+ <hidden>false</hidden>
+ <servicexml>silentwidgetplugin.xml</servicexml>
+ <translationfile>silent_widget</translationfile>
+</hswidgetmanifest>
Binary file resource/silentwidgetplugin.png has changed
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/resource/silentwidgetplugin.xml Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+ <name>silentwidgetplugin</name>
+ <filepath>silentwidgetplugin</filepath>
+ <description>Silent widget</description>
+ <interface>
+ <name>com.nokia.symbian.IHomeScreenWidget</name>
+ <version>1.0</version>
+ <description>Silent widget</description>
+ <capabilities></capabilities>
+ <customproperty key="iconuri">silentwidgetplugin.png</customproperty>
+ <customproperty key="title">Silent widget</customproperty>
+ </interface>
+</service>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/resource/silentwidgetplugin.xml_for_sisx Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+ <name>silentwidgetplugin</name>
+ <filepath>c:/private/20022F35/import/widgetregistry/2002EAD3/silentwidgetplugin.qtplugin</filepath>
+ <description>Silent widget</description>
+ <interface>
+ <name>com.nokia.symbian.IHomeScreenWidget</name>
+ <version>1.0</version>
+ <description>Silent widget</description>
+ <capabilities></capabilities>
+ <customproperty key="iconuri">silentwidgetplugin.png</customproperty>
+ <customproperty key="title">Silent widget</customproperty>
+ </interface>
+</service>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/bld.inf Fri Sep 17 09:20:19 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
+
+silentwidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(silentwidgetplugin.iby)
+silentwidgetplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(silentwidgetplugin_resources.iby)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/silentwidgetplugin.iby Fri Sep 17 09:20:19 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 silentwidgetplugin component
+ *
+ */
+
+#ifndef SILENTWIDGETPLUGIN_IBY
+#define SILENTWIDGETPLUGIN_IBY
+
+#include <bldvariant.hrh>
+#include <data_caging_paths_for_iby.hrh>
+
+file=ABI_DIR\BUILD_DIR\silentwidgetplugin.dll SHARED_LIB_DIR\silentwidgetplugin.dll
+
+data=ZPRIVATE\20022F35\import\widgetregistry\2002EAD3\silentwidgetplugin.qtplugin private\20022f35\import\widgetregistry\2002EAD3\silentwidgetplugin.qtplugin
+data=ZPRIVATE\20022F35\import\widgetregistry\2002EAD3\silentwidgetplugin.manifest private\20022f35\import\widgetregistry\2002EAD3\silentwidgetplugin.manifest
+data=ZPRIVATE\20022F35\import\widgetregistry\2002EAD3\silentwidgetplugin.png private\20022f35\import\widgetregistry\2002EAD3\silentwidgetplugin.png
+data=ZPRIVATE\20022F35\import\widgetregistry\2002EAD3\silentwidgetplugin.xml private\20022f35\import\widgetregistry\2002EAD3\silentwidgetplugin.xml
+
+#endif // SILENTWIDGETPLUGIN_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/silentwidgetplugin_resources.iby Fri Sep 17 09:20:19 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 __SILENTWIDGETRLUGIN_RESOURCE_IBY__
+#define __SILENTWIDGETRLUGIN_RESOURCE_IBY__
+
+#include <data_caging_paths_for_iby.hrh>
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\silent_widget.qm QT_TRANSLATIONS_DIR\silent_widget.qm
+
+#endif
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/silentwidgetplugin_rom.pri Fri Sep 17 09:20:19 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/silentwidgetplugin.iby CORE_APP_LAYER_IBY_EXPORT_PATH(silentwidgetplugin.iby)" \
+ "rom/silentwidgetplugin_resources.iby LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(silentwidgetplugin_resources.iby)"
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/silentwidgetplugin.docml Fri Sep 17 09:20:19 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="8un" type="PREFERRED" width="8un"/>
+ </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/silentwidgetplugin.pri Fri Sep 17 09:20:19 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: Silent widget
+#
+
+HEADERS += ./inc/*.h
+SOURCES += src/silentwidgetplugin.cpp \
+ src/silentwidget.cpp \
+ src/silentmodel.cpp \
+ src/silentobserver.cpp \
+
+symbian : {
+ SOURCES += src/silentmodel_p_symbian.cpp \
+ src/silentobserver_p_symbian.cpp
+}
+
+win32 : {
+ SOURCES += src/silentmodel_p_win.cpp \
+ src/silentobserver_p_win.cpp
+}
\ No newline at end of file
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/silentwidgetplugin.pro Fri Sep 17 09:20:19 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: Silent widget
+#
+
+TEMPLATE = lib
+CONFIG += plugin mobility hb
+MOBILITY = serviceframework
+
+include(../../common.pri)
+include(silentwidgetplugin.pri)
+include (rom/silentwidgetplugin_rom.pri)
+
+INCLUDEPATH += ./inc
+
+RESOURCES += silentwidgetplugin.qrc
+
+TRANSLATIONS = silent_widget.ts
+
+symbian: {
+
+ PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/2002EAD3
+
+ INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+ TARGET.UID3 = 0x2002EAD3
+ TARGET.EPOCALLOWDLLDATA=1
+ TARGET.CAPABILITY = ALL -TCB
+
+ LIBS += -lprofileeng -lxqsettingsmanager
+
+ 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/2002EAD3
+
+ 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/silentwidgetplugin.qrc Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,5 @@
+<RCC>
+ <qresource prefix="/docml" >
+ <file alias="silentdocml">silentwidgetplugin.docml</file>
+ </qresource>
+</RCC>
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/silentmodel.cpp Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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: Silent widget model
+*
+*/
+
+// User includes
+#include "silentmodel.h"
+#include "silentmodel_p.h"
+#include "silentwidgetconsts.h"
+
+/*!
+ \class SilentModel
+ \Silent widget model class
+
+ This class is used to create silent widget model
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ Constructor
+*/
+SilentModel::SilentModel(QObject *parent/*= 0*/)
+ : QObject(parent)
+{
+ QT_TRAP_THROWING(dptr = SilentModelPrivate::NewL());
+}
+
+/*!
+ Destroyer
+*/
+SilentModel::~SilentModel()
+{
+ delete dptr;
+}
+
+/*
+ Get silent status in master volume
+ */
+bool SilentModel::silenceMode() const
+{
+ return dptr->silenceMode();
+}
+
+/*
+ Set silent status in master volume
+ */
+void SilentModel::setSilenceMode(bool isSilence)
+{
+ return dptr->setSilenceMode(isSilence);
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/silentmodel_p_symbian.cpp Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,89 @@
+/*
+* 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: Silent widget model
+*
+*/
+
+// System includes
+#include <e32base.h>
+#include <MProfileEngineExtended2.h>
+
+// User includes
+#include "silentmodel_p.h"
+#include "silentwidgetconsts.h"
+
+/*!
+ \class SilentModelPrivate
+ \silent widget model private class
+
+ This class is used to create silent model
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ NewL
+*/
+SilentModelPrivate *SilentModelPrivate::NewL()
+{
+ SilentModelPrivate *self = new (ELeave) SilentModelPrivate();
+ CleanupStack::PushL(self);
+ self->ConstructL();
+ CleanupStack::Pop(); //self
+ return self;
+}
+
+/*!
+ Constructor
+*/
+SilentModelPrivate::SilentModelPrivate()
+{
+ mEngine = NULL;
+}
+
+/*!
+ ConstructL
+*/
+void SilentModelPrivate::ConstructL()
+{
+ mEngine = CreateProfileEngineExtended2L();
+}
+
+/*!
+ Destroyer
+*/
+SilentModelPrivate::~SilentModelPrivate()
+{
+ if (mEngine!=0) {
+ mEngine->Release();
+ }
+}
+
+/*
+ Get silent status in master volume
+ */
+bool SilentModelPrivate::silenceMode() const
+{
+ bool isSlience = false;
+ TRAP_IGNORE(isSlience = mEngine->SilenceModeL();)
+ return isSlience;
+}
+
+/*
+ Set silent status in master volume
+ */
+void SilentModelPrivate::setSilenceMode(bool isSilence)
+{
+ TRAP_IGNORE(mEngine->SetSilenceModeL(isSilence);)
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/silentmodel_p_win.cpp Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,72 @@
+/*
+* 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: Silent widget model
+*
+*/
+
+// User includes
+#include "silentmodel_p.h"
+
+/*!
+ \class SilentModelPrivate
+ \Silent widget model class
+
+ This class is used to create silent widget model
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ NewL
+*/
+SilentModelPrivate *SilentModelPrivate::NewL()
+{
+}
+
+/*!
+ Constructor
+*/
+SilentModelPrivate::SilentModelPrivate()
+{
+}
+
+/*!
+ ConstructL
+*/
+void SilentModelPrivate::ConstructL()
+{
+}
+
+/*!
+ Destroyer
+*/
+SilentModelPrivate::~SilentModelPrivate()
+{
+
+}
+
+/*
+ Get silent status in master volume
+ */
+bool SilentModelPrivate::silenceMode() const
+{
+ return true;
+}
+
+/*
+ Set silent status in master volume
+ */
+void SilentModelPrivate::setSilenceMode(bool isSilence)
+{
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/silentobserver.cpp Fri Sep 17 09:20:19 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: Silent widget observer
+*
+*/
+
+// User includes
+#include "silentobserver.h"
+#include "silentobserver_p.h"
+
+/*!
+ \class SilentObserver
+ \Silent observer class
+
+ This class is used to create silent widget observer
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ Constructor
+*/
+SilentObserver::SilentObserver(QObject *parent/*= 0*/)
+: QObject(parent)
+{
+ QT_TRAP_THROWING(dptr = SilentObserverPrivate::NewL(parent));
+}
+
+/*!
+ Destroyer
+*/
+SilentObserver::~SilentObserver()
+{
+ delete dptr;
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/silentobserver_p_symbian.cpp Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,83 @@
+/*
+* 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: Silent widget observer
+*
+*/
+
+// System includes
+#include <CProfileChangeNotifyHandler.h>
+
+// User includes
+#include "silentobserver_p.h"
+#include "silentwidget.h"
+
+/*!
+ \class SilentObserverPrivate
+ \Silent observer class
+
+ This class is used to create silent widget observer
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ NewL
+*/
+SilentObserverPrivate *SilentObserverPrivate::NewL(QObject *parent)
+{
+ SilentObserverPrivate *self = new (ELeave)SilentObserverPrivate();
+ CleanupStack::PushL(self);
+ self->ConstructL(parent);
+ CleanupStack::Pop(); //self
+ return self;
+}
+
+/*!
+ Constructor
+*/
+SilentObserverPrivate::SilentObserverPrivate()
+{
+}
+
+/*!
+ ConstructL
+*/
+void SilentObserverPrivate::ConstructL(QObject *parent)
+{
+ iHandler = CProfileChangeNotifyHandler::NewL( this );
+ iParent = parent;
+}
+
+/*!
+ Destroyer
+*/
+SilentObserverPrivate::~SilentObserverPrivate()
+{
+ if (iHandler) {
+ delete iHandler;
+ iHandler = NULL;
+ }
+}
+
+/*!
+ Handle active profile events
+*/
+void SilentObserverPrivate::HandleActiveProfileEventL(
+ TProfileEvent /*aProfileEvent*/,
+ TInt /*aProfileId*/ )
+{
+ // handle event
+ (reinterpret_cast<SilentWidget*>(iParent))->changeIcon();
+
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/silentobserver_p_win.cpp Fri Sep 17 09:20:19 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: Silent widget plugin.
+*
+*/
+
+// User includes
+#include "silentobserver_p.h"
+
+/*!
+ \class SilentObserverPrivate
+ \Silent observer class
+
+ This class is used to create silent widget observer
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ NewL
+*/
+SilentObserverPrivate *SilentObserverPrivate::NewL(QObject *parent)
+{
+}
+
+/*!
+ Constructor
+*/
+SilentObserverPrivate::SilentObserverPrivate()
+{
+}
+
+/*!
+ ConstructL
+*/
+void SilentObserverPrivate::ConstructL(QObject *parent)
+{
+}
+
+/*!
+ Destroyer
+*/
+SilentObserverPrivate::~SilentObserverPrivate()
+{
+}
+
+/*!
+ Handle active profile events
+*/
+void SilentObserverPrivate::HandleActiveProfileEventL(
+ TProfileEvent /*aProfileEvent*/,
+ TInt /*aProfileId*/ )
+{
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/silentwidget.cpp Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,203 @@
+/*
+* 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: Silent widget
+*
+*/
+
+// System includes
+#include <HbPushButton>
+#include <QGraphicsLinearLayout>
+#include <HbStyle>
+#include <HbDocumentLoader>
+#include <HbFrameItem>
+#include <HbFrameDrawer>
+#include <xqsettingsmanager.h>
+#include <ProfileEngineInternalCRKeys.h>
+
+// User includes
+#include "silentwidget.h"
+#include "silentwidgetconsts.h"
+#include "silentmodel.h"
+#include "silentobserver.h"
+
+/*!
+ \class SilentWidget
+ \implementation for silent widget
+
+ This class is used to create silent widget
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ Constructor
+*/
+SilentWidget::SilentWidget(QGraphicsItem* parent, Qt::WindowFlags flags)
+ : HbWidget(parent, flags),
+ mButton(0),
+ mModel(new SilentModel),
+ mObserver(new SilentObserver(this))
+{
+ QGraphicsLinearLayout *mainLayout = new QGraphicsLinearLayout(
+ Qt::Vertical, this);
+
+ // load the widget from .docml
+ HbDocumentLoader loader;
+ bool ok = false;
+ loader.load(":/docml/silentdocml", &ok);
+ if (!ok) {
+ // fail to load .docml file
+ return;
+ }
+ mButton = (HbPushButton *) loader.findWidget("pushButton");
+ if (!mButton) {
+ // fail to find push button
+ return;
+ }
+
+ // set icon and background
+ HbFrameDrawer *background = new HbFrameDrawer("qtg_fr_hsshortcut_normal",
+ HbFrameDrawer::NinePieces);
+ mButton->setFrameBackground(background);
+ HbFrameDrawer *foreground;
+ if (mModel->silenceMode()) {
+ foreground = new HbFrameDrawer("qtg_large_tone_off",
+ HbFrameDrawer::NinePieces);
+ } else {
+ foreground = new HbFrameDrawer("qtg_large_tone",
+ HbFrameDrawer::NinePieces);
+ }
+ HbFrameItem* frameItem = new HbFrameItem(foreground);
+ mButton->setBackgroundItem(frameItem);
+
+ mButton->setCheckable(true);
+ mainLayout->addItem(mButton);
+
+ connect(mButton, SIGNAL(toggled(bool)), this, SLOT(handleClickEvent(bool)));
+ setLayout(mainLayout);
+
+ // create XQSettingsManager, monitor KProEngSilenceMode
+ mSettingManager = new XQSettingsManager();
+ XQCentralRepositorySettingsKey silenceKey(KCRUidProfileEngine.iUid,
+ KProEngSilenceMode);
+ mSettingManager->startMonitoring(silenceKey, XQSettingsManager::TypeInt);
+ connect(mSettingManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)),
+ this, SLOT(settingValueChanged(XQSettingsKey, QVariant)));
+}
+
+/*!
+ Monitor KProEngSilenceMode
+*/
+void SilentWidget::settingValueChanged(const XQSettingsKey &key,
+ const QVariant &value)
+{
+ // change icon according to latest silence mode
+ if (key.uid() == KCRUidProfileEngine.iUid && key.key() == KProEngSilenceMode) {
+ HbFrameDrawer *foreground;
+ if (value.toBool()) {
+ foreground = new HbFrameDrawer("qtg_large_tone_off",
+ HbFrameDrawer::NinePieces);
+ } else {
+ foreground = new HbFrameDrawer("qtg_large_tone",
+ HbFrameDrawer::NinePieces);
+ }
+ HbFrameItem* frameItem = new HbFrameItem(foreground);
+ mButton->setBackgroundItem(frameItem);
+ }
+}
+
+/*!
+ Handle click events
+*/
+void SilentWidget::handleClickEvent(bool /*state*/)
+{
+ // switch icon and activate silece state
+ HbFrameDrawer *foreground;
+ if (!mModel->silenceMode()) {
+ mModel->setSilenceMode(true);
+ foreground = new HbFrameDrawer("qtg_large_tone_off",
+ HbFrameDrawer::NinePieces);
+ } else {
+ mModel->setSilenceMode(false);
+ foreground = new HbFrameDrawer("qtg_large_tone",
+ HbFrameDrawer::NinePieces);
+ }
+ HbFrameItem* frameItem = new HbFrameItem(foreground);
+ mButton->setBackgroundItem(frameItem);
+}
+
+/*!
+ Change icon according to observer event
+*/
+void SilentWidget::changeIcon()
+{
+ HbFrameDrawer *foreground;
+ if (mModel->silenceMode()) {
+ foreground = new HbFrameDrawer("qtg_large_tone_off",
+ HbFrameDrawer::NinePieces);
+ } else {
+ foreground = new HbFrameDrawer("qtg_large_tone",
+ HbFrameDrawer::NinePieces);
+ }
+ HbFrameItem* frameItem = new HbFrameItem(foreground);
+ mButton->setBackgroundItem(frameItem);
+}
+
+/*!
+ Destructor
+*/
+SilentWidget::~SilentWidget()
+{
+ if (mModel) {
+ delete mModel;
+ mModel = NULL;
+ }
+
+ if (mSettingManager) {
+ delete mSettingManager;
+ mSettingManager = NULL;
+ }
+}
+
+/*!
+ Return bounding rect
+*/
+QRectF SilentWidget::boundingRect() const
+{
+ return childrenBoundingRect();
+}
+
+/*!
+ Return shape
+*/
+QPainterPath SilentWidget::shape() const
+{
+ QPainterPath path;
+ path.addRect(boundingRect());
+ return path;
+}
+
+/*!
+ Called when widget is shown in the home screen
+*/
+void SilentWidget::onShow()
+{
+}
+
+/*!
+ Called when widget is hidden from the home screen
+*/
+void SilentWidget::onHide()
+{
+}
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/src/silentwidgetplugin.cpp Fri Sep 17 09:20:19 2010 +0300
@@ -0,0 +1,53 @@
+/*
+* 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: Silent widget plugin
+*
+*/
+
+// System includes
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+// User includes
+#include "silentwidgetplugin.h"
+#include "silentwidget.h"
+
+/*!
+ \class SilentWidgetPlugin
+ \implementation of silent widget plugin.
+*/
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+ Initialize plugin for silent world widget
+*/
+QObject *SilentWidgetPlugin::createInstance(
+ const QServiceInterfaceDescriptor &descriptor,
+ QServiceContext *context,
+ QAbstractSecuritySession *session)
+{
+ Q_UNUSED(context);
+ Q_UNUSED(session);
+
+ if (descriptor.interfaceName() ==
+ QLatin1String("com.nokia.symbian.IHomeScreenWidget")) {
+ return new SilentWidget();
+ } else {
+ return 0;
+ }
+}
+
+Q_EXPORT_PLUGIN2(silentwidgetplugin, SilentWidgetPlugin)
--- /dev/null Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_5_1.dtd Fri Sep 17 09:20:19 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>