Revision: 201027
authorDremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 11:55:49 +0300
changeset 0 db1bf15cefff
child 1 f8e7eccf5f96
Revision: 201027
calendarwidget.pkg
calendarwidget.pro
calendarwidgetinstaller/calendarwidgetinstaller.cpp
calendarwidgetinstaller/calendarwidgetinstaller.pro
calendarwidgetplugin/CalendarWidget.docml
calendarwidgetplugin/calendarwidgetplugin.pro
calendarwidgetplugin/gestures.xml
calendarwidgetplugin/inc/Doxyfile
calendarwidgetplugin/inc/calendarwidget.h
calendarwidgetplugin/inc/calendarwidgetdebug.h
calendarwidgetplugin/inc/calendarwidgetplugin.h
calendarwidgetplugin/inc/contentlayoutgesture.h
calendarwidgetplugin/inc/contentlayouthandler.h
calendarwidgetplugin/inc/dateiconlayouthandler.h
calendarwidgetplugin/inc/datetimeobserver.h
calendarwidgetplugin/inc/datetimeobserver_p.h
calendarwidgetplugin/inc/mainlayouthandler.h
calendarwidgetplugin/inc/saxhandler.h
calendarwidgetplugin/inc/widgetlayouthandler.txt
calendarwidgetplugin/loc/calendarwidget_en.qm
calendarwidgetplugin/loc/calendarwidget_en.ts
calendarwidgetplugin/resource/calendarwidgetplugin.manifest
calendarwidgetplugin/resource/calendarwidgetplugin.png
calendarwidgetplugin/resource/calendarwidgetplugin.s60xml
calendarwidgetplugin/resource/calendarwidgetplugin.xml
calendarwidgetplugin/resource/qtg_large_calendar.png
calendarwidgetplugin/resources.qrc
calendarwidgetplugin/src/calendarwidget.cpp
calendarwidgetplugin/src/calendarwidgetplugin.cpp
calendarwidgetplugin/src/contentlayoutgesture.cpp
calendarwidgetplugin/src/contentlayouthandler.cpp
calendarwidgetplugin/src/dateiconlayouthandler.cpp
calendarwidgetplugin/src/datetimeobserver.cpp
calendarwidgetplugin/src/datetimeobserver_p.cpp
calendarwidgetplugin/src/mainlayouthandler.cpp
calendarwidgetplugin/src/saxhandler.cpp
calendarwidgetplugin/tsrc/matti_testcases/Calendar_widget_tests.rb
calendarwidgetplugin/tsrc/matti_testcases/config/test_execution_profile.sip
calendarwidgetplugin/tsrc/matti_testcases/testdata/calendar_widget_test_script_parameters.xml
layers.sysdef.xml
rom/calendarwidget.iby
rom/calendarwidgetresources.iby
sis/calendarwidget_stub.pkg
sis/calendarwidget_stub_sis.mk
sysdef_1_5_1.dtd
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidget.pkg	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,29 @@
+
+; Language
+&EN
+
+; SIS header: name, uid, version
+#{"calendarwidget"},(0x2002C35A),1,0,0
+
+; Localised Vendor name
+%{"Vendor"}
+
+; Unique Vendor name
+:"Vendor"
+
+; Manual PKG pre-rules from PRO files
+; Default HW/platform dependencies
+[0x101F7961],0,0,0,{"S60ProductID"}
+[0x102032BE],0,0,0,{"S60ProductID"}
+[0x102752AE],0,0,0,{"S60ProductID"}
+[0x1028315F],0,0,0,{"S60ProductID"}
+
+"/epoc32/release/armv5/urel/calendarwidgetplugin.dll"  - "c:/sys/bin/calendarwidgetplugin.dll"
+"/epoc32/data/z/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.qtplugin"  - "c:/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.qtplugin"
+"/epoc32/data/z/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.manifest"  - "c:/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.manifest"
+"/epoc32/data/z/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.png"       - "c:/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.png"
+"/epoc32/data/z/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.xml"       - "c:/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.xml"
+
+"/epoc32/release/armv5/urel/calendarwidgetinstaller.exe"                                  - "c:/sys/bin/calendarwidgetinstaller.exe", FR, RB, RW
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidget.pro	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,36 @@
+#
+# Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+# All rights reserved.
+# This component and the accompanying materials are made available
+# under the terms of "Eclipse Public License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.eclipse.org/legal/epl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Project file for calendar widget homescreen plugin
+#
+
+TEMPLATE = subdirs
+SUBDIRS = calendarwidgetplugin \
+          calendarwidgetinstaller
+
+symbian: {
+    BLD_INF_RULES.prj_exports += \
+      "./rom/calendarwidget.iby             CORE_APP_LAYER_IBY_EXPORT_PATH(calendarwidget.iby)" \
+      "./rom/calendarwidgetresources.iby    LANGUAGE_APP_LAYER_IBY_EXPORT_PATH(calendarwidgetresources.iby)"
+    
+    BLD_INF_RULES.prj_mmpfiles += \
+      " gnumakefile sis/calendarwidget_stub_sis.mk" \
+      
+	
+    BLD_INF_RULES.prj_extensions += \
+      " START EXTENSION app-services/buildstubsis" \
+      " OPTION SRCDIR ./sis" \
+      " OPTION SISNAME calendarwidget_stub" \
+      " END" \
+}
+          
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetinstaller/calendarwidgetinstaller.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,38 @@
+/*
+* 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:  calendar widget installer
+*
+*/
+
+#include <qservicemanager.h>
+#include <QCoreApplication>
+#include <QFile>
+
+QTM_USE_NAMESPACE
+
+const QString xml = "c:/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.xml";
+
+int main(int argc, char *argv[])
+{
+    QCoreApplication app(argc, argv);
+
+    QServiceManager s;
+
+    if (QFile::exists(xml)) {
+        s.removeService("calendarwidgetplugin");
+        s.addService(xml);
+    } else {
+        s.removeService("calendarwidgetplugin");
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetinstaller/calendarwidgetinstaller.pro	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,29 @@
+#
+# 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: Homescreen calendar widget
+#
+
+TEMPLATE = app
+
+QT = core
+CONFIG += no_icon
+
+CONFIG += mobility
+MOBILITY = serviceframework
+
+SOURCES += calendarwidgetinstaller.cpp
+
+symbian {    
+    TARGET.CAPABILITY = ALL -TCB
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/CalendarWidget.docml	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,153 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<hbdocument version="1.1">
+    <widget name="CalendarWidget" type="HbWidget">
+        <widget name="widgetBackground" type="HbLabel">
+            <real name="z" value="0"/>
+            <sizehint height="10un" type="PREFERRED" width="46un"/>
+            <sizehint height="10un" type="MINIMUM" width="46un"/>
+            <sizehint height="10un" type="MAXIMUM" width="46un"/>
+            <string name="plainText"/>
+        </widget>
+        <widget name="iconContainer" type="HbWidget">
+            <widget name="month" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+                <real name="z" value="5"/>
+                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint height="3un" type="FIXED" width="9.5un"/>
+                <sizehint height="3un" type="MINIMUM" width="9.5un"/>
+                <sizehint height="3un" type="MAXIMUM" width="9.5un"/>
+                <string name="plainText" value="Feb"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="expr(var(hb-param-text-height-tiny) )"/>
+            </widget>
+            <widget name="dayNumber" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <enums name="aspectRatioMode" value="IgnoreAspectRatio"/>
+                <real name="z" value="4"/>
+                <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+                <sizehint type="FIXED" width="9.5un"/>
+                <sizehint height="5un" type="MINIMUM" width="9.5un"/>
+                <sizehint height="5un" type="MAXIMUM" width="9.5un"/>
+                <string name="plainText" value="15"/>
+                <fontspec name="fontSpec" role="Primary" textheight="4.5un"/>
+            </widget>
+            <widget name="iconLabel" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <real name="z" value="3"/>
+                <sizehint type="PREFERRED" width="10.5un"/>
+                <sizehint height="10.5un" type="MINIMUM" width="10.5un"/>
+                <sizehint height="10.5un" type="MAXIMUM" width="10.5un"/>
+                <string name="plainText" value="I"/>
+            </widget>
+            <widget name="iconHighlight" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <real name="z" value="0"/>
+                <sizehint height="10un" type="PREFERRED" width="12.2un"/>
+                <sizehint height="10un" type="MINIMUM" width="12.2un"/>
+                <sizehint height="10un" type="MAXIMUM" width="12.2un"/>
+                <string name="plainText" value="I"/>
+            </widget>
+            <real name="z" value="4"/>
+            <sizehint height="15un" type="PREFERRED" width="12un"/>
+            <sizehint height="15un" type="MINIMUM" width="12un"/>
+            <sizehint height="15un" type="MAXIMUM" width="12un"/>
+            <layout type="anchor">
+                <anchoritem dst="iconLabel" dstEdge="LEFT" spacing="0.9un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="iconLabel" dstEdge="TOP" spacing="0un" src="" srcEdge="TOP"/>
+                <anchoritem dst="dayNumber" dstEdge="LEFT" spacing="1.4un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="dayNumber" dstEdge="BOTTOM" spacing="-1.8un" src="iconLabel" srcEdge="BOTTOM"/>
+                <anchoritem dst="month" dstEdge="LEFT" spacing="1.4un" src="" srcEdge="LEFT"/>
+                <anchoritem dst="month" dstEdge="TOP" spacing="0.2un" src="iconLabel" srcEdge="BOTTOM"/>
+                <anchoritem dst="iconHighlight" dstEdge="LEFT" spacing="0" src="" srcEdge="LEFT"/>
+                <anchoritem dst="iconHighlight" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+            </layout>
+        </widget>
+        <widget name="separatorLabel" type="HbLabel">
+            <real name="z" value="5"/>
+            <sizepolicy horizontalPolicy="Fixed" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+            <sizehint height="9.5un" type="FIXED" width="2"/>
+            <sizehint height="9.5un" type="MINIMUM" width="2"/>
+            <contentsmargins bottom="0un" left="0un" right="0un" top="0un"/>
+            <sizehint height="9.5un" type="MAXIMUM" width="2"/>
+            <string name="plainText" value="Label"/>
+        </widget>
+        <widget name="contentContainer" type="HbWidget">
+            <widget name="upperLabelLong" type="HbLabel">
+                <real name="z" value="1"/>
+                <sizehint height="3.7un" type="PREFERRED" width="31.6un"/>
+                <sizehint height="3.7un" type="MINIMUM" width="31.6un"/>
+                <sizehint height="3.7un" type="MAXIMUM" width="31.6un"/>
+                <string name="plainText" value="Upper"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="expr(var(hb-param-text-height-secondary) )"/>
+            </widget>
+            <widget name="lowerLabel" type="HbLabel">
+                <real name="z" value="2"/>
+                <sizehint height="3.7un" type="PREFERRED" width="31.6un"/>
+                <sizehint height="3.7un" type="MINIMUM" width="31.6un"/>
+                <sizehint height="3.7un" type="MAXIMUM" width="31.6un"/>
+                <string name="plainText" value="Lower"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+            </widget>
+            <widget name="reminderLabel" type="HbLabel">
+                <enums name="alignment" value="AlignVCenter|AlignHCenter"/>
+                <real name="z" value="4"/>
+                <sizehint height="3.88un" type="PREFERRED" width="3.88un"/>
+                <sizehint height="3.88un" type="MINIMUM" width="3.88un"/>
+                <sizehint height="3.88un" type="MAXIMUM" width="3.88un"/>
+                <string name="plainText" value="R"/>
+            </widget>
+            <widget name="upperLabelShort" type="HbLabel">
+                <real name="z" value="5"/>
+                <sizehint height="3.7un" type="PREFERRED" width="27.15un"/>
+                <sizehint height="3.7un" type="MINIMUM" width="27.15un"/>
+                <sizehint height="3.7un" type="MAXIMUM" width="27.15un"/>
+                <string name="plainText" value="Upper"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="expr(var(hb-param-text-height-secondary) )"/>
+            </widget>
+            <widget name="middleLabel" type="HbLabel">
+                <enums name="textWrapping" value="TextWordWrap"/>
+                <real name="z" value="4"/>
+                <sizehint height="8.0597un" type="PREFERRED"/>
+                <sizehint height="5un" type="MINIMUM" width="31.6un"/>
+                <sizehint height="10un" type="MAXIMUM" width="31.6un"/>
+                <string name="plainText" value="Middle"/>
+                <fontspec name="fontSpec" role="Secondary" textheight="var(hb-param-text-height-secondary)"/>
+            </widget>
+            <real name="z" value="6"/>
+            <sizehint height="10un" type="PREFERRED" width="33.7un"/>
+            <sizehint height="10un" type="MINIMUM" width="33.4un"/>
+            <sizehint height="10un" type="MAXIMUM" width="33.7un"/>
+            <layout type="anchor">
+                <anchoritem dst="lowerLabel" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-middle-horizontal) )" src="" srcEdge="LEFT"/>
+                <anchoritem dst="lowerLabel" dstEdge="TOP" spacing="expr(var(hb-param-margin-gene-middle-vertical) )" src="upperLabelLong" srcEdge="BOTTOM"/>
+                <anchoritem dst="reminderLabel" dstEdge="TOP" spacing="0.9un" src="" srcEdge="TOP"/>
+                <anchoritem dst="reminderLabel" dstEdge="RIGHT" spacing="-0.9un" src="" srcEdge="RIGHT"/>
+                <anchoritem dst="upperLabelLong" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-middle-horizontal) )" src="" srcEdge="LEFT"/>
+                <anchoritem dst="upperLabelLong" dstEdge="TOP" spacing="1un" src="" srcEdge="TOP"/>
+                <anchoritem dst="upperLabelShort" dstEdge="LEFT" spacing="expr(var(hb-param-margin-gene-middle-horizontal) )" src="" srcEdge="LEFT"/>
+                <anchoritem dst="upperLabelShort" dstEdge="TOP" spacing="1un" src="" srcEdge="TOP"/>
+                <anchoritem dst="middleLabel" dstEdge="LEFT" spacing="0un" src="upperLabelLong" srcEdge="LEFT"/>
+                <anchoritem dst="middleLabel" dstEdge="TOP" spacing="0un" src="upperLabelLong" srcEdge="TOP"/>
+            </layout>
+        </widget>
+        <size height="15.22388un" name="size" width="46un"/>
+        <rect height="102" name="geometry" width="308.19999" x="0" y="0"/>
+        <sizepolicy horizontalPolicy="Maximum" horizontalStretch="0" verticalPolicy="Fixed" verticalStretch="0"/>
+        <sizehint height="102" type="PREFERRED" width="46un"/>
+        <sizehint height="102" type="MINIMUM" width="46un"/>
+        <sizehint height="102" type="MAXIMUM" width="46un"/>
+        <layout type="anchor">
+            <anchoritem dst="widgetBackground" dstEdge="RIGHT" spacing="0un" src="" srcEdge="RIGHT"/>
+            <anchoritem dst="widgetBackground" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+            <anchoritem dst="iconContainer" dstEdge="LEFT" spacing="0un" src="" srcEdge="LEFT"/>
+            <anchoritem dst="iconContainer" dstEdge="BOTTOM" spacing="0un" src="" srcEdge="BOTTOM"/>
+            <anchoritem dst="separatorLabel" dstEdge="LEFT" spacing="0un" src="iconContainer" srcEdge="RIGHT"/>
+            <anchoritem dst="separatorLabel" dstEdge="BOTTOM" spacing="-2" src="widgetBackground" srcEdge="BOTTOM"/>
+            <anchoritem dst="contentContainer" dstEdge="TOP" spacing="0un" src="widgetBackground" srcEdge="TOP"/>
+            <anchoritem dst="contentContainer" dstEdge="RIGHT" spacing="0un" src="widgetBackground" srcEdge="RIGHT"/>
+        </layout>
+    </widget>
+    <metadata activeUIState="Common ui state" display="NHD-3.2-inch_portrait" unit="un">
+        <uistate name="Common ui state" sections="#common"/>
+    </metadata>
+</hbdocument>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/calendarwidgetplugin.pro	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,84 @@
+#
+# 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 the License "Symbian Foundation License v1.0"
+# which accompanies this distribution, and is available
+# at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html".
+#
+# Initial Contributors:
+# Nokia Corporation - initial contribution.
+#
+# Contributors:
+#
+# Description: Project file for calendar widget
+#
+
+TEMPLATE = lib
+CONFIG += plugin hb mobility
+MOBILITY = serviceframework
+
+CONFIG(debug, debug|release) {
+  DESTDIR = debug
+  LIBS += -L../../../../bin/debug
+}
+else {
+  DESTDIR = release
+  LIBS += -L../../../../bin/release
+}
+
+HEADERS += ./inc/*.h
+
+SOURCES += ./src/*.cpp \
+
+RESOURCES += resources.qrc
+
+DEPENDPATH += ./inc \
+              ./src
+
+INCLUDEPATH += ./inc \
+
+TRANSLATIONS = calwidget.ts
+
+QT += xml              
+
+symbian: {
+    //TRANSLATIONS = loc/calendarwidget_en.ts 
+    INCLUDEPATH += $$APP_LAYER_SYSTEMINCLUDE
+
+    LIBS += -lagendainterface
+    LIBS += -lxqservice
+    LIBS += -lxqsettingsmanager
+    LIBS += -lbafl
+
+    # get your own symbian uid    
+    TARGET.UID3 = 0x2002C35A
+    TARGET.EPOCALLOWDLLDATA=1
+    TARGET.CAPABILITY = ALL -TCB
+    
+    # add your symbian uid here
+    PLUGIN_SUBDIR = /private/20022F35/import/widgetregistry/2002C35A
+    
+    pluginstub.sources = $${TARGET}.dll
+    pluginstub.path = $$PLUGIN_SUBDIR
+
+    DEPLOYMENT += pluginstub
+
+    qtplugins.path = $$PLUGIN_SUBDIR
+    qtplugins.sources += qmakepluginstubs/$${TARGET}.qtplugin
+    qtplugins.sources += resource/$${TARGET}.manifest
+    qtplugins.sources += resource/qtg_large_calendar.png
+     
+    for(qtplugin, qtplugins.sources):BLD_INF_RULES.prj_exports += "./$$qtplugin z:$$qtplugins.path/$$basename(qtplugin)"
+    BLD_INF_RULES.prj_exports += "./resource/$${TARGET}.s60xml z:$$PLUGIN_SUBDIR/$${TARGET}.xml"
+
+    XML_LOCATION = z:/resource/
+    BLD_INF_RULES.prj_exports += "./gestures.xml $$XML_LOCATION"
+}
+
+win32 {
+    # add platfrom API for windows
+    TRANSLATIONS = loc/calendarwidget_en.ts 
+    INCLUDEPATH += ../../../../homescreensrv/homescreensrv_plat/hswidgetmodel_api
+    PLUGIN_SUBDIR = /hsresources/import/widgetregistry/2002C35A
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/gestures.xml	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,23 @@
+<gestures>
+<gesture type="onTap" layout="contentContainer" action="launchApplication"> 
+    <parameter service="com.nokia.services"></parameter>
+    <parameter interface="calendar.Launch"></parameter>
+    <parameter method="launchCalendarApp(QDateTime,int)"></parameter>
+    <argument name="date">CURRENTDATE</argument>
+    <argument name="view">1</argument>
+</gesture>
+<gesture type="onSwipe" layout="contentContainer" action="launchApplication">
+    <parameter service="com.nokia.services"></parameter>
+    <parameter interface="calendar.Launch"></parameter>
+    <parameter method="launchCalendarApp(QDateTime,int)"></parameter>
+    <argument name="date">CURRENTDATE</argument>
+    <argument name="view">1</argument>
+</gesture>
+<gesture type="onTap" layout="iconContainer" action="launchApplication">
+    <parameter service="com.nokia.services"></parameter>
+    <parameter interface="calendar.Launch"></parameter>
+    <parameter method="launchCalendarApp(QDateTime,int)"></parameter>
+    <argument name="date">CURRENTDATE</argument>
+    <argument name="view">0</argument>
+</gesture>
+</gestures>
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/Doxyfile	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,1551 @@
+# Doxyfile 1.6.3
+
+# This file describes the settings to be used by the documentation system
+# doxygen (www.doxygen.org) for a project
+#
+# All text after a hash (#) is considered a comment and will be ignored
+# The format is:
+#       TAG = value [value, ...]
+# For lists items can also be appended using:
+#       TAG += value [value, ...]
+# Values that contain spaces should be placed between quotes (" ")
+
+#---------------------------------------------------------------------------
+# Project related configuration options
+#---------------------------------------------------------------------------
+
+# This tag specifies the encoding used for all characters in the config file
+# that follow. The default is UTF-8 which is also the encoding used for all
+# text before the first occurrence of this tag. Doxygen uses libiconv (or the
+# iconv built into libc) for the transcoding. See
+# http://www.gnu.org/software/libiconv for the list of possible encodings.
+
+DOXYFILE_ENCODING      = UTF-8
+
+# The PROJECT_NAME tag is a single word (or a sequence of words surrounded
+# by quotes) that should identify the project.
+
+PROJECT_NAME           =
+
+# The PROJECT_NUMBER tag can be used to enter a project or revision number.
+# This could be handy for archiving the generated documentation or
+# if some version control system is used.
+
+PROJECT_NUMBER         =
+
+# The OUTPUT_DIRECTORY tag is used to specify the (relative or absolute)
+# base path where the generated documentation will be put.
+# If a relative path is entered, it will be relative to the location
+# where doxygen was started. If left blank the current directory will be used.
+
+OUTPUT_DIRECTORY       =
+
+# If the CREATE_SUBDIRS tag is set to YES, then doxygen will create
+# 4096 sub-directories (in 2 levels) under the output directory of each output
+# format and will distribute the generated files over these directories.
+# Enabling this option can be useful when feeding doxygen a huge amount of
+# source files, where putting all generated files in the same directory would
+# otherwise cause performance problems for the file system.
+
+CREATE_SUBDIRS         = NO
+
+# The OUTPUT_LANGUAGE tag is used to specify the language in which all
+# documentation generated by doxygen is written. Doxygen will use this
+# information to generate all constant output in the proper language.
+# The default language is English, other supported languages are:
+# Afrikaans, Arabic, Brazilian, Catalan, Chinese, Chinese-Traditional,
+# Croatian, Czech, Danish, Dutch, Esperanto, Farsi, Finnish, French, German,
+# Greek, Hungarian, Italian, Japanese, Japanese-en (Japanese with English
+# messages), Korean, Korean-en, Lithuanian, Norwegian, Macedonian, Persian,
+# Polish, Portuguese, Romanian, Russian, Serbian, Serbian-Cyrilic, Slovak,
+# Slovene, Spanish, Swedish, Ukrainian, and Vietnamese.
+
+OUTPUT_LANGUAGE        = English
+
+# If the BRIEF_MEMBER_DESC tag is set to YES (the default) Doxygen will
+# include brief member descriptions after the members that are listed in
+# the file and class documentation (similar to JavaDoc).
+# Set to NO to disable this.
+
+BRIEF_MEMBER_DESC      = YES
+
+# If the REPEAT_BRIEF tag is set to YES (the default) Doxygen will prepend
+# the brief description of a member or function before the detailed description.
+# Note: if both HIDE_UNDOC_MEMBERS and BRIEF_MEMBER_DESC are set to NO, the
+# brief descriptions will be completely suppressed.
+
+REPEAT_BRIEF           = YES
+
+# This tag implements a quasi-intelligent brief description abbreviator
+# that is used to form the text in various listings. Each string
+# in this list, if found as the leading text of the brief description, will be
+# stripped from the text and the result after processing the whole list, is
+# used as the annotated text. Otherwise, the brief description is used as-is.
+# If left blank, the following values are used ("$name" is automatically
+# replaced with the name of the entity): "The $name class" "The $name widget"
+# "The $name file" "is" "provides" "specifies" "contains"
+# "represents" "a" "an" "the"
+
+ABBREVIATE_BRIEF       =
+
+# If the ALWAYS_DETAILED_SEC and REPEAT_BRIEF tags are both set to YES then
+# Doxygen will generate a detailed section even if there is only a brief
+# description.
+
+ALWAYS_DETAILED_SEC    = NO
+
+# If the INLINE_INHERITED_MEMB tag is set to YES, doxygen will show all
+# inherited members of a class in the documentation of that class as if those
+# members were ordinary class members. Constructors, destructors and assignment
+# operators of the base classes will not be shown.
+
+INLINE_INHERITED_MEMB  = NO
+
+# If the FULL_PATH_NAMES tag is set to YES then Doxygen will prepend the full
+# path before files name in the file list and in the header files. If set
+# to NO the shortest path that makes the file name unique will be used.
+
+FULL_PATH_NAMES        = YES
+
+# If the FULL_PATH_NAMES tag is set to YES then the STRIP_FROM_PATH tag
+# can be used to strip a user-defined part of the path. Stripping is
+# only done if one of the specified strings matches the left-hand part of
+# the path. The tag can be used to show relative paths in the file list.
+# If left blank the directory from which doxygen is run is used as the
+# path to strip.
+
+STRIP_FROM_PATH        =
+
+# The STRIP_FROM_INC_PATH tag can be used to strip a user-defined part of
+# the path mentioned in the documentation of a class, which tells
+# the reader which header file to include in order to use a class.
+# If left blank only the name of the header file containing the class
+# definition is used. Otherwise one should specify the include paths that
+# are normally passed to the compiler using the -I flag.
+
+STRIP_FROM_INC_PATH    =
+
+# If the SHORT_NAMES tag is set to YES, doxygen will generate much shorter
+# (but less readable) file names. This can be useful is your file systems
+# doesn't support long names like on DOS, Mac, or CD-ROM.
+
+SHORT_NAMES            = NO
+
+# If the JAVADOC_AUTOBRIEF tag is set to YES then Doxygen
+# will interpret the first line (until the first dot) of a JavaDoc-style
+# comment as the brief description. If set to NO, the JavaDoc
+# comments will behave just like regular Qt-style comments
+# (thus requiring an explicit @brief command for a brief description.)
+
+JAVADOC_AUTOBRIEF      = NO
+
+# If the QT_AUTOBRIEF tag is set to YES then Doxygen will
+# interpret the first line (until the first dot) of a Qt-style
+# comment as the brief description. If set to NO, the comments
+# will behave just like regular Qt-style comments (thus requiring
+# an explicit \brief command for a brief description.)
+
+QT_AUTOBRIEF           = NO
+
+# The MULTILINE_CPP_IS_BRIEF tag can be set to YES to make Doxygen
+# treat a multi-line C++ special comment block (i.e. a block of //! or ///
+# comments) as a brief description. This used to be the default behaviour.
+# The new default is to treat a multi-line C++ comment block as a detailed
+# description. Set this tag to YES if you prefer the old behaviour instead.
+
+MULTILINE_CPP_IS_BRIEF = NO
+
+# If the INHERIT_DOCS tag is set to YES (the default) then an undocumented
+# member inherits the documentation from any documented member that it
+# re-implements.
+
+INHERIT_DOCS           = YES
+
+# If the SEPARATE_MEMBER_PAGES tag is set to YES, then doxygen will produce
+# a new page for each member. If set to NO, the documentation of a member will
+# be part of the file/class/namespace that contains it.
+
+SEPARATE_MEMBER_PAGES  = NO
+
+# The TAB_SIZE tag can be used to set the number of spaces in a tab.
+# Doxygen uses this value to replace tabs by spaces in code fragments.
+
+TAB_SIZE               = 8
+
+# This tag can be used to specify a number of aliases that acts
+# as commands in the documentation. An alias has the form "name=value".
+# For example adding "sideeffect=\par Side Effects:\n" will allow you to
+# put the command \sideeffect (or @sideeffect) in the documentation, which
+# will result in a user-defined paragraph with heading "Side Effects:".
+# You can put \n's in the value part of an alias to insert newlines.
+
+ALIASES                =
+
+# Set the OPTIMIZE_OUTPUT_FOR_C tag to YES if your project consists of C
+# sources only. Doxygen will then generate output that is more tailored for C.
+# For instance, some of the names that are used will be different. The list
+# of all members will be omitted, etc.
+
+OPTIMIZE_OUTPUT_FOR_C  = NO
+
+# Set the OPTIMIZE_OUTPUT_JAVA tag to YES if your project consists of Java
+# sources only. Doxygen will then generate output that is more tailored for
+# Java. For instance, namespaces will be presented as packages, qualified
+# scopes will look different, etc.
+
+OPTIMIZE_OUTPUT_JAVA   = NO
+
+# Set the OPTIMIZE_FOR_FORTRAN tag to YES if your project consists of Fortran
+# sources only. Doxygen will then generate output that is more tailored for
+# Fortran.
+
+OPTIMIZE_FOR_FORTRAN   = NO
+
+# Set the OPTIMIZE_OUTPUT_VHDL tag to YES if your project consists of VHDL
+# sources. Doxygen will then generate output that is tailored for
+# VHDL.
+
+OPTIMIZE_OUTPUT_VHDL   = NO
+
+# Doxygen selects the parser to use depending on the extension of the files it parses.
+# With this tag you can assign which parser to use for a given extension.
+# Doxygen has a built-in mapping, but you can override or extend it using this tag.
+# The format is ext=language, where ext is a file extension, and language is one of
+# the parsers supported by doxygen: IDL, Java, Javascript, C#, C, C++, D, PHP,
+# Objective-C, Python, Fortran, VHDL, C, C++. For instance to make doxygen treat
+# .inc files as Fortran files (default is PHP), and .f files as C (default is Fortran),
+# use: inc=Fortran f=C. Note that for custom extensions you also need to set FILE_PATTERNS otherwise the files are not read by doxygen.
+
+EXTENSION_MAPPING      =
+
+# If you use STL classes (i.e. std::string, std::vector, etc.) but do not want
+# to include (a tag file for) the STL sources as input, then you should
+# set this tag to YES in order to let doxygen match functions declarations and
+# definitions whose arguments contain STL classes (e.g. func(std::string); v.s.
+# func(std::string) {}). This also make the inheritance and collaboration
+# diagrams that involve STL classes more complete and accurate.
+
+BUILTIN_STL_SUPPORT    = NO
+
+# If you use Microsoft's C++/CLI language, you should set this option to YES to
+# enable parsing support.
+
+CPP_CLI_SUPPORT        = NO
+
+# Set the SIP_SUPPORT tag to YES if your project consists of sip sources only.
+# Doxygen will parse them like normal C++ but will assume all classes use public
+# instead of private inheritance when no explicit protection keyword is present.
+
+SIP_SUPPORT            = NO
+
+# For Microsoft's IDL there are propget and propput attributes to indicate getter
+# and setter methods for a property. Setting this option to YES (the default)
+# will make doxygen to replace the get and set methods by a property in the
+# documentation. This will only work if the methods are indeed getting or
+# setting a simple type. If this is not the case, or you want to show the
+# methods anyway, you should set this option to NO.
+
+IDL_PROPERTY_SUPPORT   = YES
+
+# If member grouping is used in the documentation and the DISTRIBUTE_GROUP_DOC
+# tag is set to YES, then doxygen will reuse the documentation of the first
+# member in the group (if any) for the other members of the group. By default
+# all members of a group must be documented explicitly.
+
+DISTRIBUTE_GROUP_DOC   = NO
+
+# Set the SUBGROUPING tag to YES (the default) to allow class member groups of
+# the same type (for instance a group of public functions) to be put as a
+# subgroup of that type (e.g. under the Public Functions section). Set it to
+# NO to prevent subgrouping. Alternatively, this can be done per class using
+# the \nosubgrouping command.
+
+SUBGROUPING            = YES
+
+# When TYPEDEF_HIDES_STRUCT is enabled, a typedef of a struct, union, or enum
+# is documented as struct, union, or enum with the name of the typedef. So
+# typedef struct TypeS {} TypeT, will appear in the documentation as a struct
+# with name TypeT. When disabled the typedef will appear as a member of a file,
+# namespace, or class. And the struct will be named TypeS. This can typically
+# be useful for C code in case the coding convention dictates that all compound
+# types are typedef'ed and only the typedef is referenced, never the tag name.
+
+TYPEDEF_HIDES_STRUCT   = NO
+
+# The SYMBOL_CACHE_SIZE determines the size of the internal cache use to
+# determine which symbols to keep in memory and which to flush to disk.
+# When the cache is full, less often used symbols will be written to disk.
+# For small to medium size projects (<1000 input files) the default value is
+# probably good enough. For larger projects a too small cache size can cause
+# doxygen to be busy swapping symbols to and from disk most of the time
+# causing a significant performance penality.
+# If the system has enough physical memory increasing the cache will improve the
+# performance by keeping more symbols in memory. Note that the value works on
+# a logarithmic scale so increasing the size by one will rougly double the
+# memory usage. The cache size is given by this formula:
+# 2^(16+SYMBOL_CACHE_SIZE). The valid range is 0..9, the default is 0,
+# corresponding to a cache size of 2^16 = 65536 symbols
+
+SYMBOL_CACHE_SIZE      = 0
+
+#---------------------------------------------------------------------------
+# Build related configuration options
+#---------------------------------------------------------------------------
+
+# If the EXTRACT_ALL tag is set to YES doxygen will assume all entities in
+# documentation are documented, even if no documentation was available.
+# Private class members and static file members will be hidden unless
+# the EXTRACT_PRIVATE and EXTRACT_STATIC tags are set to YES
+
+EXTRACT_ALL            = YES
+
+# If the EXTRACT_PRIVATE tag is set to YES all private members of a class
+# will be included in the documentation.
+
+EXTRACT_PRIVATE        = YES
+
+# If the EXTRACT_STATIC tag is set to YES all static members of a file
+# will be included in the documentation.
+
+EXTRACT_STATIC         = NO
+
+# If the EXTRACT_LOCAL_CLASSES tag is set to YES classes (and structs)
+# defined locally in source files will be included in the documentation.
+# If set to NO only classes defined in header files are included.
+
+EXTRACT_LOCAL_CLASSES  = YES
+
+# This flag is only useful for Objective-C code. When set to YES local
+# methods, which are defined in the implementation section but not in
+# the interface are included in the documentation.
+# If set to NO (the default) only methods in the interface are included.
+
+EXTRACT_LOCAL_METHODS  = NO
+
+# If this flag is set to YES, the members of anonymous namespaces will be
+# extracted and appear in the documentation as a namespace called
+# 'anonymous_namespace{file}', where file will be replaced with the base
+# name of the file that contains the anonymous namespace. By default
+# anonymous namespace are hidden.
+
+EXTRACT_ANON_NSPACES   = NO
+
+# If the HIDE_UNDOC_MEMBERS tag is set to YES, Doxygen will hide all
+# undocumented members of documented classes, files or namespaces.
+# If set to NO (the default) these members will be included in the
+# various overviews, but no documentation section is generated.
+# This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_MEMBERS     = NO
+
+# If the HIDE_UNDOC_CLASSES tag is set to YES, Doxygen will hide all
+# undocumented classes that are normally visible in the class hierarchy.
+# If set to NO (the default) these classes will be included in the various
+# overviews. This option has no effect if EXTRACT_ALL is enabled.
+
+HIDE_UNDOC_CLASSES     = NO
+
+# If the HIDE_FRIEND_COMPOUNDS tag is set to YES, Doxygen will hide all
+# friend (class|struct|union) declarations.
+# If set to NO (the default) these declarations will be included in the
+# documentation.
+
+HIDE_FRIEND_COMPOUNDS  = NO
+
+# If the HIDE_IN_BODY_DOCS tag is set to YES, Doxygen will hide any
+# documentation blocks found inside the body of a function.
+# If set to NO (the default) these blocks will be appended to the
+# function's detailed documentation block.
+
+HIDE_IN_BODY_DOCS      = NO
+
+# The INTERNAL_DOCS tag determines if documentation
+# that is typed after a \internal command is included. If the tag is set
+# to NO (the default) then the documentation will be excluded.
+# Set it to YES to include the internal documentation.
+
+INTERNAL_DOCS          = NO
+
+# If the CASE_SENSE_NAMES tag is set to NO then Doxygen will only generate
+# file names in lower-case letters. If set to YES upper-case letters are also
+# allowed. This is useful if you have classes or files whose names only differ
+# in case and if your file system supports case sensitive file names. Windows
+# and Mac users are advised to set this option to NO.
+
+CASE_SENSE_NAMES       = NO
+
+# If the HIDE_SCOPE_NAMES tag is set to NO (the default) then Doxygen
+# will show members with their full class and namespace scopes in the
+# documentation. If set to YES the scope will be hidden.
+
+HIDE_SCOPE_NAMES       = NO
+
+# If the SHOW_INCLUDE_FILES tag is set to YES (the default) then Doxygen
+# will put a list of the files that are included by a file in the documentation
+# of that file.
+
+SHOW_INCLUDE_FILES     = YES
+
+# If the FORCE_LOCAL_INCLUDES tag is set to YES then Doxygen
+# will list include files with double quotes in the documentation
+# rather than with sharp brackets.
+
+FORCE_LOCAL_INCLUDES   = NO
+
+# If the INLINE_INFO tag is set to YES (the default) then a tag [inline]
+# is inserted in the documentation for inline members.
+
+INLINE_INFO            = YES
+
+# If the SORT_MEMBER_DOCS tag is set to YES (the default) then doxygen
+# will sort the (detailed) documentation of file and class members
+# alphabetically by member name. If set to NO the members will appear in
+# declaration order.
+
+SORT_MEMBER_DOCS       = YES
+
+# If the SORT_BRIEF_DOCS tag is set to YES then doxygen will sort the
+# brief documentation of file, namespace and class members alphabetically
+# by member name. If set to NO (the default) the members will appear in
+# declaration order.
+
+SORT_BRIEF_DOCS        = NO
+
+# If the SORT_MEMBERS_CTORS_1ST tag is set to YES then doxygen will sort the (brief and detailed) documentation of class members so that constructors and destructors are listed first. If set to NO (the default) the constructors will appear in the respective orders defined by SORT_MEMBER_DOCS and SORT_BRIEF_DOCS. This tag will be ignored for brief docs if SORT_BRIEF_DOCS is set to NO and ignored for detailed docs if SORT_MEMBER_DOCS is set to NO.
+
+SORT_MEMBERS_CTORS_1ST = NO
+
+# If the SORT_GROUP_NAMES tag is set to YES then doxygen will sort the
+# hierarchy of group names into alphabetical order. If set to NO (the default)
+# the group names will appear in their defined order.
+
+SORT_GROUP_NAMES       = NO
+
+# If the SORT_BY_SCOPE_NAME tag is set to YES, the class list will be
+# sorted by fully-qualified names, including namespaces. If set to
+# NO (the default), the class list will be sorted only by class name,
+# not including the namespace part.
+# Note: This option is not very useful if HIDE_SCOPE_NAMES is set to YES.
+# Note: This option applies only to the class list, not to the
+# alphabetical list.
+
+SORT_BY_SCOPE_NAME     = NO
+
+# The GENERATE_TODOLIST tag can be used to enable (YES) or
+# disable (NO) the todo list. This list is created by putting \todo
+# commands in the documentation.
+
+GENERATE_TODOLIST      = YES
+
+# The GENERATE_TESTLIST tag can be used to enable (YES) or
+# disable (NO) the test list. This list is created by putting \test
+# commands in the documentation.
+
+GENERATE_TESTLIST      = YES
+
+# The GENERATE_BUGLIST tag can be used to enable (YES) or
+# disable (NO) the bug list. This list is created by putting \bug
+# commands in the documentation.
+
+GENERATE_BUGLIST       = YES
+
+# The GENERATE_DEPRECATEDLIST tag can be used to enable (YES) or
+# disable (NO) the deprecated list. This list is created by putting
+# \deprecated commands in the documentation.
+
+GENERATE_DEPRECATEDLIST= YES
+
+# The ENABLED_SECTIONS tag can be used to enable conditional
+# documentation sections, marked by \if sectionname ... \endif.
+
+ENABLED_SECTIONS       =
+
+# The MAX_INITIALIZER_LINES tag determines the maximum number of lines
+# the initial value of a variable or define consists of for it to appear in
+# the documentation. If the initializer consists of more lines than specified
+# here it will be hidden. Use a value of 0 to hide initializers completely.
+# The appearance of the initializer of individual variables and defines in the
+# documentation can be controlled using \showinitializer or \hideinitializer
+# command in the documentation regardless of this setting.
+
+MAX_INITIALIZER_LINES  = 30
+
+# Set the SHOW_USED_FILES tag to NO to disable the list of files generated
+# at the bottom of the documentation of classes and structs. If set to YES the
+# list will mention the files that were used to generate the documentation.
+
+SHOW_USED_FILES        = YES
+
+# If the sources in your project are distributed over multiple directories
+# then setting the SHOW_DIRECTORIES tag to YES will show the directory hierarchy
+# in the documentation. The default is NO.
+
+SHOW_DIRECTORIES       = NO
+
+# Set the SHOW_FILES tag to NO to disable the generation of the Files page.
+# This will remove the Files entry from the Quick Index and from the
+# Folder Tree View (if specified). The default is YES.
+
+SHOW_FILES             = YES
+
+# Set the SHOW_NAMESPACES tag to NO to disable the generation of the
+# Namespaces page.
+# This will remove the Namespaces entry from the Quick Index
+# and from the Folder Tree View (if specified). The default is YES.
+
+SHOW_NAMESPACES        = YES
+
+# The FILE_VERSION_FILTER tag can be used to specify a program or script that
+# doxygen should invoke to get the current version for each file (typically from
+# the version control system). Doxygen will invoke the program by executing (via
+# popen()) the command <command> <input-file>, where <command> is the value of
+# the FILE_VERSION_FILTER tag, and <input-file> is the name of an input file
+# provided by doxygen. Whatever the program writes to standard output
+# is used as the file version. See the manual for examples.
+
+FILE_VERSION_FILTER    =
+
+# The LAYOUT_FILE tag can be used to specify a layout file which will be parsed by
+# doxygen. The layout file controls the global structure of the generated output files
+# in an output format independent way. The create the layout file that represents
+# doxygen's defaults, run doxygen with the -l option. You can optionally specify a
+# file name after the option, if omitted DoxygenLayout.xml will be used as the name
+# of the layout file.
+
+LAYOUT_FILE            =
+
+#---------------------------------------------------------------------------
+# configuration options related to warning and progress messages
+#---------------------------------------------------------------------------
+
+# The QUIET tag can be used to turn on/off the messages that are generated
+# by doxygen. Possible values are YES and NO. If left blank NO is used.
+
+QUIET                  = NO
+
+# The WARNINGS tag can be used to turn on/off the warning messages that are
+# generated by doxygen. Possible values are YES and NO. If left blank
+# NO is used.
+
+WARNINGS               = YES
+
+# If WARN_IF_UNDOCUMENTED is set to YES, then doxygen will generate warnings
+# for undocumented members. If EXTRACT_ALL is set to YES then this flag will
+# automatically be disabled.
+
+WARN_IF_UNDOCUMENTED   = YES
+
+# If WARN_IF_DOC_ERROR is set to YES, doxygen will generate warnings for
+# potential errors in the documentation, such as not documenting some
+# parameters in a documented function, or documenting parameters that
+# don't exist or using markup commands wrongly.
+
+WARN_IF_DOC_ERROR      = YES
+
+# This WARN_NO_PARAMDOC option can be abled to get warnings for
+# functions that are documented, but have no documentation for their parameters
+# or return value. If set to NO (the default) doxygen will only warn about
+# wrong or incomplete parameter documentation, but not about the absence of
+# documentation.
+
+WARN_NO_PARAMDOC       = NO
+
+# The WARN_FORMAT tag determines the format of the warning messages that
+# doxygen can produce. The string should contain the $file, $line, and $text
+# tags, which will be replaced by the file and line number from which the
+# warning originated and the warning text. Optionally the format may contain
+# $version, which will be replaced by the version of the file (if it could
+# be obtained via FILE_VERSION_FILTER)
+
+WARN_FORMAT            = "$file:$line: $text"
+
+# The WARN_LOGFILE tag can be used to specify a file to which warning
+# and error messages should be written. If left blank the output is written
+# to stderr.
+
+WARN_LOGFILE           =
+
+#---------------------------------------------------------------------------
+# configuration options related to the input files
+#---------------------------------------------------------------------------
+
+# The INPUT tag can be used to specify the files and/or directories that contain
+# documented source files. You may enter file names like "myfile.cpp" or
+# directories like "/usr/src/myproject". Separate the files or directories
+# with spaces.
+
+INPUT                  =
+
+# This tag can be used to specify the character encoding of the source files
+# that doxygen parses. Internally doxygen uses the UTF-8 encoding, which is
+# also the default input encoding. Doxygen uses libiconv (or the iconv built
+# into libc) for the transcoding. See http://www.gnu.org/software/libiconv for
+# the list of possible encodings.
+
+INPUT_ENCODING         = UTF-8
+
+# If the value of the INPUT tag contains directories, you can use the
+# FILE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank the following patterns are tested:
+# *.c *.cc *.cxx *.cpp *.c++ *.java *.ii *.ixx *.ipp *.i++ *.inl *.h *.hh *.hxx
+# *.hpp *.h++ *.idl *.odl *.cs *.php *.php3 *.inc *.m *.mm *.py *.f90
+
+FILE_PATTERNS          =
+
+# The RECURSIVE tag can be used to turn specify whether or not subdirectories
+# should be searched for input files as well. Possible values are YES and NO.
+# If left blank NO is used.
+
+RECURSIVE              = NO
+
+# The EXCLUDE tag can be used to specify files and/or directories that should
+# excluded from the INPUT source files. This way you can easily exclude a
+# subdirectory from a directory tree whose root is specified with the INPUT tag.
+
+EXCLUDE                =
+
+# The EXCLUDE_SYMLINKS tag can be used select whether or not files or
+# directories that are symbolic links (a Unix filesystem feature) are excluded
+# from the input.
+
+EXCLUDE_SYMLINKS       = NO
+
+# If the value of the INPUT tag contains directories, you can use the
+# EXCLUDE_PATTERNS tag to specify one or more wildcard patterns to exclude
+# certain files from those directories. Note that the wildcards are matched
+# against the file with absolute path, so to exclude all test directories
+# for example use the pattern */test/*
+
+EXCLUDE_PATTERNS       =
+
+# The EXCLUDE_SYMBOLS tag can be used to specify one or more symbol names
+# (namespaces, classes, functions, etc.) that should be excluded from the
+# output. The symbol name can be a fully qualified name, a word, or if the
+# wildcard * is used, a substring. Examples: ANamespace, AClass,
+# AClass::ANamespace, ANamespace::*Test
+
+EXCLUDE_SYMBOLS        =
+
+# The EXAMPLE_PATH tag can be used to specify one or more files or
+# directories that contain example code fragments that are included (see
+# the \include command).
+
+EXAMPLE_PATH           =
+
+# If the value of the EXAMPLE_PATH tag contains directories, you can use the
+# EXAMPLE_PATTERNS tag to specify one or more wildcard pattern (like *.cpp
+# and *.h) to filter out the source-files in the directories. If left
+# blank all files are included.
+
+EXAMPLE_PATTERNS       =
+
+# If the EXAMPLE_RECURSIVE tag is set to YES then subdirectories will be
+# searched for input files to be used with the \include or \dontinclude
+# commands irrespective of the value of the RECURSIVE tag.
+# Possible values are YES and NO. If left blank NO is used.
+
+EXAMPLE_RECURSIVE      = NO
+
+# The IMAGE_PATH tag can be used to specify one or more files or
+# directories that contain image that are included in the documentation (see
+# the \image command).
+
+IMAGE_PATH             =
+
+# The INPUT_FILTER tag can be used to specify a program that doxygen should
+# invoke to filter for each input file. Doxygen will invoke the filter program
+# by executing (via popen()) the command <filter> <input-file>, where <filter>
+# is the value of the INPUT_FILTER tag, and <input-file> is the name of an
+# input file. Doxygen will then use the output that the filter program writes
+# to standard output.
+# If FILTER_PATTERNS is specified, this tag will be
+# ignored.
+
+INPUT_FILTER           =
+
+# The FILTER_PATTERNS tag can be used to specify filters on a per file pattern
+# basis.
+# Doxygen will compare the file name with each pattern and apply the
+# filter if there is a match.
+# The filters are a list of the form:
+# pattern=filter (like *.cpp=my_cpp_filter). See INPUT_FILTER for further
+# info on how filters are used. If FILTER_PATTERNS is empty, INPUT_FILTER
+# is applied to all files.
+
+FILTER_PATTERNS        =
+
+# If the FILTER_SOURCE_FILES tag is set to YES, the input filter (if set using
+# INPUT_FILTER) will be used to filter the input files when producing source
+# files to browse (i.e. when SOURCE_BROWSER is set to YES).
+
+FILTER_SOURCE_FILES    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to source browsing
+#---------------------------------------------------------------------------
+
+# If the SOURCE_BROWSER tag is set to YES then a list of source files will
+# be generated. Documented entities will be cross-referenced with these sources.
+# Note: To get rid of all source code in the generated output, make sure also
+# VERBATIM_HEADERS is set to NO.
+
+SOURCE_BROWSER         = NO
+
+# Setting the INLINE_SOURCES tag to YES will include the body
+# of functions and classes directly in the documentation.
+
+INLINE_SOURCES         = NO
+
+# Setting the STRIP_CODE_COMMENTS tag to YES (the default) will instruct
+# doxygen to hide any special comment blocks from generated source code
+# fragments. Normal C and C++ comments will always remain visible.
+
+STRIP_CODE_COMMENTS    = YES
+
+# If the REFERENCED_BY_RELATION tag is set to YES
+# then for each documented function all documented
+# functions referencing it will be listed.
+
+REFERENCED_BY_RELATION = NO
+
+# If the REFERENCES_RELATION tag is set to YES
+# then for each documented function all documented entities
+# called/used by that function will be listed.
+
+REFERENCES_RELATION    = NO
+
+# If the REFERENCES_LINK_SOURCE tag is set to YES (the default)
+# and SOURCE_BROWSER tag is set to YES, then the hyperlinks from
+# functions in REFERENCES_RELATION and REFERENCED_BY_RELATION lists will
+# link to the source code.
+# Otherwise they will link to the documentation.
+
+REFERENCES_LINK_SOURCE = YES
+
+# If the USE_HTAGS tag is set to YES then the references to source code
+# will point to the HTML generated by the htags(1) tool instead of doxygen
+# built-in source browser. The htags tool is part of GNU's global source
+# tagging system (see http://www.gnu.org/software/global/global.html). You
+# will need version 4.8.6 or higher.
+
+USE_HTAGS              = NO
+
+# If the VERBATIM_HEADERS tag is set to YES (the default) then Doxygen
+# will generate a verbatim copy of the header file for each class for
+# which an include is specified. Set to NO to disable this.
+
+VERBATIM_HEADERS       = YES
+
+#---------------------------------------------------------------------------
+# configuration options related to the alphabetical class index
+#---------------------------------------------------------------------------
+
+# If the ALPHABETICAL_INDEX tag is set to YES, an alphabetical index
+# of all compounds will be generated. Enable this if the project
+# contains a lot of classes, structs, unions or interfaces.
+
+ALPHABETICAL_INDEX     = NO
+
+# If the alphabetical index is enabled (see ALPHABETICAL_INDEX) then
+# the COLS_IN_ALPHA_INDEX tag can be used to specify the number of columns
+# in which this list will be split (can be a number in the range [1..20])
+
+COLS_IN_ALPHA_INDEX    = 5
+
+# In case all classes in a project start with a common prefix, all
+# classes will be put under the same header in the alphabetical index.
+# The IGNORE_PREFIX tag can be used to specify one or more prefixes that
+# should be ignored while generating the index headers.
+
+IGNORE_PREFIX          =
+
+#---------------------------------------------------------------------------
+# configuration options related to the HTML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_HTML tag is set to YES (the default) Doxygen will
+# generate HTML output.
+
+GENERATE_HTML          = YES
+
+# The HTML_OUTPUT tag is used to specify where the HTML docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `html' will be used as the default path.
+
+HTML_OUTPUT            = html
+
+# The HTML_FILE_EXTENSION tag can be used to specify the file extension for
+# each generated HTML page (for example: .htm,.php,.asp). If it is left blank
+# doxygen will generate files with .html extension.
+
+HTML_FILE_EXTENSION    = .html
+
+# The HTML_HEADER tag can be used to specify a personal HTML header for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard header.
+
+HTML_HEADER            =
+
+# The HTML_FOOTER tag can be used to specify a personal HTML footer for
+# each generated HTML page. If it is left blank doxygen will generate a
+# standard footer.
+
+HTML_FOOTER            =
+
+# The HTML_STYLESHEET tag can be used to specify a user-defined cascading
+# style sheet that is used by each HTML page. It can be used to
+# fine-tune the look of the HTML output. If the tag is left blank doxygen
+# will generate a default style sheet. Note that doxygen will try to copy
+# the style sheet file to the HTML output directory, so don't put your own
+# stylesheet in the HTML output directory as well, or it will be erased!
+
+HTML_STYLESHEET        =
+
+# If the HTML_TIMESTAMP tag is set to YES then the footer of each generated HTML
+# page will contain the date and time when the page was generated. Setting
+# this to NO can help when comparing the output of multiple runs.
+
+HTML_TIMESTAMP         = YES
+
+# If the HTML_ALIGN_MEMBERS tag is set to YES, the members of classes,
+# files or namespaces will be aligned in HTML using tables. If set to
+# NO a bullet list will be used.
+
+HTML_ALIGN_MEMBERS     = YES
+
+# If the HTML_DYNAMIC_SECTIONS tag is set to YES then the generated HTML
+# documentation will contain sections that can be hidden and shown after the
+# page has loaded. For this to work a browser that supports
+# JavaScript and DHTML is required (for instance Mozilla 1.0+, Firefox
+# Netscape 6.0+, Internet explorer 5.0+, Konqueror, or Safari).
+
+HTML_DYNAMIC_SECTIONS  = NO
+
+# If the GENERATE_DOCSET tag is set to YES, additional index files
+# will be generated that can be used as input for Apple's Xcode 3
+# integrated development environment, introduced with OSX 10.5 (Leopard).
+# To create a documentation set, doxygen will generate a Makefile in the
+# HTML output directory. Running make will produce the docset in that
+# directory and running "make install" will install the docset in
+# ~/Library/Developer/Shared/Documentation/DocSets so that Xcode will find
+# it at startup.
+# See http://developer.apple.com/tools/creatingdocsetswithdoxygen.html for more information.
+
+GENERATE_DOCSET        = NO
+
+# When GENERATE_DOCSET tag is set to YES, this tag determines the name of the
+# feed. A documentation feed provides an umbrella under which multiple
+# documentation sets from a single provider (such as a company or product suite)
+# can be grouped.
+
+DOCSET_FEEDNAME        = "Doxygen generated docs"
+
+# When GENERATE_DOCSET tag is set to YES, this tag specifies a string that
+# should uniquely identify the documentation set bundle. This should be a
+# reverse domain-name style string, e.g. com.mycompany.MyDocSet. Doxygen
+# will append .docset to the name.
+
+DOCSET_BUNDLE_ID       = org.doxygen.Project
+
+# If the GENERATE_HTMLHELP tag is set to YES, additional index files
+# will be generated that can be used as input for tools like the
+# Microsoft HTML help workshop to generate a compiled HTML help file (.chm)
+# of the generated HTML documentation.
+
+GENERATE_HTMLHELP      = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_FILE tag can
+# be used to specify the file name of the resulting .chm file. You
+# can add a path in front of the file if the result should not be
+# written to the html output directory.
+
+CHM_FILE               =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the HHC_LOCATION tag can
+# be used to specify the location (absolute path including file name) of
+# the HTML help compiler (hhc.exe). If non-empty doxygen will try to run
+# the HTML help compiler on the generated index.hhp.
+
+HHC_LOCATION           =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the GENERATE_CHI flag
+# controls if a separate .chi index file is generated (YES) or that
+# it should be included in the master .chm file (NO).
+
+GENERATE_CHI           = NO
+
+# If the GENERATE_HTMLHELP tag is set to YES, the CHM_INDEX_ENCODING
+# is used to encode HtmlHelp index (hhk), content (hhc) and project file
+# content.
+
+CHM_INDEX_ENCODING     =
+
+# If the GENERATE_HTMLHELP tag is set to YES, the BINARY_TOC flag
+# controls whether a binary table of contents is generated (YES) or a
+# normal table of contents (NO) in the .chm file.
+
+BINARY_TOC             = NO
+
+# The TOC_EXPAND flag can be set to YES to add extra items for group members
+# to the contents of the HTML help documentation and to the tree view.
+
+TOC_EXPAND             = NO
+
+# If the GENERATE_QHP tag is set to YES and both QHP_NAMESPACE and QHP_VIRTUAL_FOLDER
+# are set, an additional index file will be generated that can be used as input for
+# Qt's qhelpgenerator to generate a Qt Compressed Help (.qch) of the generated
+# HTML documentation.
+
+GENERATE_QHP           = NO
+
+# If the QHG_LOCATION tag is specified, the QCH_FILE tag can
+# be used to specify the file name of the resulting .qch file.
+# The path specified is relative to the HTML output folder.
+
+QCH_FILE               =
+
+# The QHP_NAMESPACE tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#namespace
+
+QHP_NAMESPACE          = org.doxygen.Project
+
+# The QHP_VIRTUAL_FOLDER tag specifies the namespace to use when generating
+# Qt Help Project output. For more information please see
+# http://doc.trolltech.com/qthelpproject.html#virtual-folders
+
+QHP_VIRTUAL_FOLDER     = doc
+
+# If QHP_CUST_FILTER_NAME is set, it specifies the name of a custom filter to add.
+# For more information please see
+# http://doc.trolltech.com/qthelpproject.html#custom-filters
+
+QHP_CUST_FILTER_NAME   =
+
+# The QHP_CUST_FILT_ATTRS tag specifies the list of the attributes of the custom filter to add.For more information please see
+# <a href="http://doc.trolltech.com/qthelpproject.html#custom-filters">Qt Help Project / Custom Filters</a>.
+
+QHP_CUST_FILTER_ATTRS  =
+
+# The QHP_SECT_FILTER_ATTRS tag specifies the list of the attributes this project's
+# filter section matches.
+# <a href="http://doc.trolltech.com/qthelpproject.html#filter-attributes">Qt Help Project / Filter Attributes</a>.
+
+QHP_SECT_FILTER_ATTRS  =
+
+# If the GENERATE_QHP tag is set to YES, the QHG_LOCATION tag can
+# be used to specify the location of Qt's qhelpgenerator.
+# If non-empty doxygen will try to run qhelpgenerator on the generated
+# .qhp file.
+
+QHG_LOCATION           =
+
+# If the GENERATE_ECLIPSEHELP tag is set to YES, additional index files
+#  will be generated, which together with the HTML files, form an Eclipse help
+#  plugin. To install this plugin and make it available under the help contents
+# menu in Eclipse, the contents of the directory containing the HTML and XML
+# files needs to be copied into the plugins directory of eclipse. The name of
+# the directory within the plugins directory should be the same as
+# the ECLIPSE_DOC_ID value. After copying Eclipse needs to be restarted before the help appears.
+
+GENERATE_ECLIPSEHELP   = NO
+
+# A unique identifier for the eclipse help plugin. When installing the plugin
+# the directory name containing the HTML and XML files should also have
+# this name.
+
+ECLIPSE_DOC_ID         = org.doxygen.Project
+
+# The DISABLE_INDEX tag can be used to turn on/off the condensed index at
+# top of each HTML page. The value NO (the default) enables the index and
+# the value YES disables it.
+
+DISABLE_INDEX          = NO
+
+# This tag can be used to set the number of enum values (range [1..20])
+# that doxygen will group on one line in the generated HTML documentation.
+
+ENUM_VALUES_PER_LINE   = 4
+
+# The GENERATE_TREEVIEW tag is used to specify whether a tree-like index
+# structure should be generated to display hierarchical information.
+# If the tag value is set to YES, a side panel will be generated
+# containing a tree-like index structure (just like the one that
+# is generated for HTML Help). For this to work a browser that supports
+# JavaScript, DHTML, CSS and frames is required (i.e. any modern browser).
+# Windows users are probably better off using the HTML help feature.
+
+GENERATE_TREEVIEW      = NO
+
+# By enabling USE_INLINE_TREES, doxygen will generate the Groups, Directories,
+# and Class Hierarchy pages using a tree view instead of an ordered list.
+
+USE_INLINE_TREES       = NO
+
+# If the treeview is enabled (see GENERATE_TREEVIEW) then this tag can be
+# used to set the initial width (in pixels) of the frame in which the tree
+# is shown.
+
+TREEVIEW_WIDTH         = 250
+
+# Use this tag to change the font size of Latex formulas included
+# as images in the HTML documentation. The default is 10. Note that
+# when you change the font size after a successful doxygen run you need
+# to manually remove any form_*.png images from the HTML output directory
+# to force them to be regenerated.
+
+FORMULA_FONTSIZE       = 10
+
+# When the SEARCHENGINE tag is enabled doxygen will generate a search box for the HTML output. The underlying search engine uses javascript
+# and DHTML and should work on any modern browser. Note that when using HTML help (GENERATE_HTMLHELP), Qt help (GENERATE_QHP), or docsets (GENERATE_DOCSET) there is already a search function so this one should
+# typically be disabled. For large projects the javascript based search engine
+# can be slow, then enabling SERVER_BASED_SEARCH may provide a better solution.
+
+SEARCHENGINE           = YES
+
+# When the SERVER_BASED_SEARCH tag is enabled the search engine will be implemented using a PHP enabled web server instead of at the web client using Javascript. Doxygen will generate the search PHP script and index
+# file to put on the web server. The advantage of the server based approach is that it scales better to large projects and allows full text search. The disadvances is that it is more difficult to setup
+# and does not have live searching capabilities.
+
+SERVER_BASED_SEARCH    = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the LaTeX output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_LATEX tag is set to YES (the default) Doxygen will
+# generate Latex output.
+
+GENERATE_LATEX         = NO
+
+# The LATEX_OUTPUT tag is used to specify where the LaTeX docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `latex' will be used as the default path.
+
+LATEX_OUTPUT           = latex
+
+# The LATEX_CMD_NAME tag can be used to specify the LaTeX command name to be
+# invoked. If left blank `latex' will be used as the default command name.
+# Note that when enabling USE_PDFLATEX this option is only used for
+# generating bitmaps for formulas in the HTML output, but not in the
+# Makefile that is written to the output directory.
+
+LATEX_CMD_NAME         = latex
+
+# The MAKEINDEX_CMD_NAME tag can be used to specify the command name to
+# generate index for LaTeX. If left blank `makeindex' will be used as the
+# default command name.
+
+MAKEINDEX_CMD_NAME     = makeindex
+
+# If the COMPACT_LATEX tag is set to YES Doxygen generates more compact
+# LaTeX documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_LATEX          = NO
+
+# The PAPER_TYPE tag can be used to set the paper type that is used
+# by the printer. Possible values are: a4, a4wide, letter, legal and
+# executive. If left blank a4wide will be used.
+
+PAPER_TYPE             = a4wide
+
+# The EXTRA_PACKAGES tag can be to specify one or more names of LaTeX
+# packages that should be included in the LaTeX output.
+
+EXTRA_PACKAGES         =
+
+# The LATEX_HEADER tag can be used to specify a personal LaTeX header for
+# the generated latex document. The header should contain everything until
+# the first chapter. If it is left blank doxygen will generate a
+# standard header. Notice: only use this tag if you know what you are doing!
+
+LATEX_HEADER           =
+
+# If the PDF_HYPERLINKS tag is set to YES, the LaTeX that is generated
+# is prepared for conversion to pdf (using ps2pdf). The pdf file will
+# contain links (just like the HTML output) instead of page references
+# This makes the output suitable for online browsing using a pdf viewer.
+
+PDF_HYPERLINKS         = YES
+
+# If the USE_PDFLATEX tag is set to YES, pdflatex will be used instead of
+# plain latex in the generated Makefile. Set this option to YES to get a
+# higher quality PDF documentation.
+
+USE_PDFLATEX           = YES
+
+# If the LATEX_BATCHMODE tag is set to YES, doxygen will add the \\batchmode.
+# command to the generated LaTeX files. This will instruct LaTeX to keep
+# running if errors occur, instead of asking the user for help.
+# This option is also used when generating formulas in HTML.
+
+LATEX_BATCHMODE        = NO
+
+# If LATEX_HIDE_INDICES is set to YES then doxygen will not
+# include the index chapters (such as File Index, Compound Index, etc.)
+# in the output.
+
+LATEX_HIDE_INDICES     = NO
+
+# If LATEX_SOURCE_CODE is set to YES then doxygen will include source code with syntax highlighting in the LaTeX output. Note that which sources are shown also depends on other settings such as SOURCE_BROWSER.
+
+LATEX_SOURCE_CODE      = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the RTF output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_RTF tag is set to YES Doxygen will generate RTF output
+# The RTF output is optimized for Word 97 and may not look very pretty with
+# other RTF readers or editors.
+
+GENERATE_RTF           = NO
+
+# The RTF_OUTPUT tag is used to specify where the RTF docs will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `rtf' will be used as the default path.
+
+RTF_OUTPUT             = rtf
+
+# If the COMPACT_RTF tag is set to YES Doxygen generates more compact
+# RTF documents. This may be useful for small projects and may help to
+# save some trees in general.
+
+COMPACT_RTF            = NO
+
+# If the RTF_HYPERLINKS tag is set to YES, the RTF that is generated
+# will contain hyperlink fields. The RTF file will
+# contain links (just like the HTML output) instead of page references.
+# This makes the output suitable for online browsing using WORD or other
+# programs which support those fields.
+# Note: wordpad (write) and others do not support links.
+
+RTF_HYPERLINKS         = NO
+
+# Load stylesheet definitions from file. Syntax is similar to doxygen's
+# config file, i.e. a series of assignments. You only have to provide
+# replacements, missing definitions are set to their default value.
+
+RTF_STYLESHEET_FILE    =
+
+# Set optional variables used in the generation of an rtf document.
+# Syntax is similar to doxygen's config file.
+
+RTF_EXTENSIONS_FILE    =
+
+#---------------------------------------------------------------------------
+# configuration options related to the man page output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_MAN tag is set to YES (the default) Doxygen will
+# generate man pages
+
+GENERATE_MAN           = NO
+
+# The MAN_OUTPUT tag is used to specify where the man pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `man' will be used as the default path.
+
+MAN_OUTPUT             = man
+
+# The MAN_EXTENSION tag determines the extension that is added to
+# the generated man pages (default is the subroutine's section .3)
+
+MAN_EXTENSION          = .3
+
+# If the MAN_LINKS tag is set to YES and Doxygen generates man output,
+# then it will generate one additional man file for each entity
+# documented in the real man page(s). These additional files
+# only source the real man page, but without them the man command
+# would be unable to find the correct page. The default is NO.
+
+MAN_LINKS              = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the XML output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_XML tag is set to YES Doxygen will
+# generate an XML file that captures the structure of
+# the code including all documentation.
+
+GENERATE_XML           = NO
+
+# The XML_OUTPUT tag is used to specify where the XML pages will be put.
+# If a relative path is entered the value of OUTPUT_DIRECTORY will be
+# put in front of it. If left blank `xml' will be used as the default path.
+
+XML_OUTPUT             = xml
+
+# The XML_SCHEMA tag can be used to specify an XML schema,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_SCHEMA             =
+
+# The XML_DTD tag can be used to specify an XML DTD,
+# which can be used by a validating XML parser to check the
+# syntax of the XML files.
+
+XML_DTD                =
+
+# If the XML_PROGRAMLISTING tag is set to YES Doxygen will
+# dump the program listings (including syntax highlighting
+# and cross-referencing information) to the XML output. Note that
+# enabling this will significantly increase the size of the XML output.
+
+XML_PROGRAMLISTING     = YES
+
+#---------------------------------------------------------------------------
+# configuration options for the AutoGen Definitions output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_AUTOGEN_DEF tag is set to YES Doxygen will
+# generate an AutoGen Definitions (see autogen.sf.net) file
+# that captures the structure of the code including all
+# documentation. Note that this feature is still experimental
+# and incomplete at the moment.
+
+GENERATE_AUTOGEN_DEF   = NO
+
+#---------------------------------------------------------------------------
+# configuration options related to the Perl module output
+#---------------------------------------------------------------------------
+
+# If the GENERATE_PERLMOD tag is set to YES Doxygen will
+# generate a Perl module file that captures the structure of
+# the code including all documentation. Note that this
+# feature is still experimental and incomplete at the
+# moment.
+
+GENERATE_PERLMOD       = NO
+
+# If the PERLMOD_LATEX tag is set to YES Doxygen will generate
+# the necessary Makefile rules, Perl scripts and LaTeX code to be able
+# to generate PDF and DVI output from the Perl module output.
+
+PERLMOD_LATEX          = NO
+
+# If the PERLMOD_PRETTY tag is set to YES the Perl module output will be
+# nicely formatted so it can be parsed by a human reader.
+# This is useful
+# if you want to understand what is going on.
+# On the other hand, if this
+# tag is set to NO the size of the Perl module output will be much smaller
+# and Perl will parse it just the same.
+
+PERLMOD_PRETTY         = YES
+
+# The names of the make variables in the generated doxyrules.make file
+# are prefixed with the string contained in PERLMOD_MAKEVAR_PREFIX.
+# This is useful so different doxyrules.make files included by the same
+# Makefile don't overwrite each other's variables.
+
+PERLMOD_MAKEVAR_PREFIX =
+
+#---------------------------------------------------------------------------
+# Configuration options related to the preprocessor
+#---------------------------------------------------------------------------
+
+# If the ENABLE_PREPROCESSING tag is set to YES (the default) Doxygen will
+# evaluate all C-preprocessor directives found in the sources and include
+# files.
+
+ENABLE_PREPROCESSING   = YES
+
+# If the MACRO_EXPANSION tag is set to YES Doxygen will expand all macro
+# names in the source code. If set to NO (the default) only conditional
+# compilation will be performed. Macro expansion can be done in a controlled
+# way by setting EXPAND_ONLY_PREDEF to YES.
+
+MACRO_EXPANSION        = NO
+
+# If the EXPAND_ONLY_PREDEF and MACRO_EXPANSION tags are both set to YES
+# then the macro expansion is limited to the macros specified with the
+# PREDEFINED and EXPAND_AS_DEFINED tags.
+
+EXPAND_ONLY_PREDEF     = NO
+
+# If the SEARCH_INCLUDES tag is set to YES (the default) the includes files
+# in the INCLUDE_PATH (see below) will be search if a #include is found.
+
+SEARCH_INCLUDES        = YES
+
+# The INCLUDE_PATH tag can be used to specify one or more directories that
+# contain include files that are not input files but should be processed by
+# the preprocessor.
+
+INCLUDE_PATH           =
+
+# You can use the INCLUDE_FILE_PATTERNS tag to specify one or more wildcard
+# patterns (like *.h and *.hpp) to filter out the header-files in the
+# directories. If left blank, the patterns specified with FILE_PATTERNS will
+# be used.
+
+INCLUDE_FILE_PATTERNS  =
+
+# The PREDEFINED tag can be used to specify one or more macro names that
+# are defined before the preprocessor is started (similar to the -D option of
+# gcc). The argument of the tag is a list of macros of the form: name
+# or name=definition (no spaces). If the definition and the = are
+# omitted =1 is assumed. To prevent a macro definition from being
+# undefined via #undef or recursively expanded use the := operator
+# instead of the = operator.
+
+PREDEFINED             =
+
+# If the MACRO_EXPANSION and EXPAND_ONLY_PREDEF tags are set to YES then
+# this tag can be used to specify a list of macro names that should be expanded.
+# The macro definition that is found in the sources will be used.
+# Use the PREDEFINED tag if you want to use a different macro definition.
+
+EXPAND_AS_DEFINED      =
+
+# If the SKIP_FUNCTION_MACROS tag is set to YES (the default) then
+# doxygen's preprocessor will remove all function-like macros that are alone
+# on a line, have an all uppercase name, and do not end with a semicolon. Such
+# function macros are typically used for boiler-plate code, and will confuse
+# the parser if not removed.
+
+SKIP_FUNCTION_MACROS   = YES
+
+#---------------------------------------------------------------------------
+# Configuration::additions related to external references
+#---------------------------------------------------------------------------
+
+# The TAGFILES option can be used to specify one or more tagfiles.
+# Optionally an initial location of the external documentation
+# can be added for each tagfile. The format of a tag file without
+# this location is as follows:
+#
+# TAGFILES = file1 file2 ...
+# Adding location for the tag files is done as follows:
+#
+# TAGFILES = file1=loc1 "file2 = loc2" ...
+# where "loc1" and "loc2" can be relative or absolute paths or
+# URLs. If a location is present for each tag, the installdox tool
+# does not have to be run to correct the links.
+# Note that each tag file must have a unique name
+# (where the name does NOT include the path)
+# If a tag file is not located in the directory in which doxygen
+# is run, you must also specify the path to the tagfile here.
+
+TAGFILES               =
+
+# When a file name is specified after GENERATE_TAGFILE, doxygen will create
+# a tag file that is based on the input files it reads.
+
+GENERATE_TAGFILE       =
+
+# If the ALLEXTERNALS tag is set to YES all external classes will be listed
+# in the class index. If set to NO only the inherited external classes
+# will be listed.
+
+ALLEXTERNALS           = NO
+
+# If the EXTERNAL_GROUPS tag is set to YES all external groups will be listed
+# in the modules index. If set to NO, only the current project's groups will
+# be listed.
+
+EXTERNAL_GROUPS        = YES
+
+# The PERL_PATH should be the absolute path and name of the perl script
+# interpreter (i.e. the result of `which perl').
+
+PERL_PATH              = /usr/bin/perl
+
+#---------------------------------------------------------------------------
+# Configuration options related to the dot tool
+#---------------------------------------------------------------------------
+
+# If the CLASS_DIAGRAMS tag is set to YES (the default) Doxygen will
+# generate a inheritance diagram (in HTML, RTF and LaTeX) for classes with base
+# or super classes. Setting the tag to NO turns the diagrams off. Note that
+# this option is superseded by the HAVE_DOT option below. This is only a
+# fallback. It is recommended to install and use dot, since it yields more
+# powerful graphs.
+
+CLASS_DIAGRAMS         = YES
+
+# You can define message sequence charts within doxygen comments using the \msc
+# command. Doxygen will then run the mscgen tool (see
+# http://www.mcternan.me.uk/mscgen/) to produce the chart and insert it in the
+# documentation. The MSCGEN_PATH tag allows you to specify the directory where
+# the mscgen tool resides. If left empty the tool is assumed to be found in the
+# default search path.
+
+MSCGEN_PATH            =
+
+# If set to YES, the inheritance and collaboration graphs will hide
+# inheritance and usage relations if the target is undocumented
+# or is not a class.
+
+HIDE_UNDOC_RELATIONS   = YES
+
+# If you set the HAVE_DOT tag to YES then doxygen will assume the dot tool is
+# available from the path. This tool is part of Graphviz, a graph visualization
+# toolkit from AT&T and Lucent Bell Labs. The other options in this section
+# have no effect if this option is set to NO (the default)
+
+HAVE_DOT               = YES
+
+# By default doxygen will write a font called FreeSans.ttf to the output
+# directory and reference it in all dot files that doxygen generates. This
+# font does not include all possible unicode characters however, so when you need
+# these (or just want a differently looking font) you can specify the font name
+# using DOT_FONTNAME. You need need to make sure dot is able to find the font,
+# which can be done by putting it in a standard location or by setting the
+# DOTFONTPATH environment variable or by setting DOT_FONTPATH to the directory
+# containing the font.
+
+DOT_FONTNAME           = FreeSans
+
+# The DOT_FONTSIZE tag can be used to set the size of the font of dot graphs.
+# The default size is 10pt.
+
+DOT_FONTSIZE           = 10
+
+# By default doxygen will tell dot to use the output directory to look for the
+# FreeSans.ttf font (which doxygen will put there itself). If you specify a
+# different font using DOT_FONTNAME you can set the path where dot
+# can find it using this tag.
+
+DOT_FONTPATH           =
+
+# If the CLASS_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect inheritance relations. Setting this tag to YES will force the
+# the CLASS_DIAGRAMS tag to NO.
+
+CLASS_GRAPH            = YES
+
+# If the COLLABORATION_GRAPH and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for each documented class showing the direct and
+# indirect implementation dependencies (inheritance, containment, and
+# class references variables) of the class with other documented classes.
+
+COLLABORATION_GRAPH    = YES
+
+# If the GROUP_GRAPHS and HAVE_DOT tags are set to YES then doxygen
+# will generate a graph for groups, showing the direct groups dependencies
+
+GROUP_GRAPHS           = YES
+
+# If the UML_LOOK tag is set to YES doxygen will generate inheritance and
+# collaboration diagrams in a style similar to the OMG's Unified Modeling
+# Language.
+
+UML_LOOK               = NO
+
+# If set to YES, the inheritance and collaboration graphs will show the
+# relations between templates and their instances.
+
+TEMPLATE_RELATIONS     = NO
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDE_GRAPH, and HAVE_DOT
+# tags are set to YES then doxygen will generate a graph for each documented
+# file showing the direct and indirect include dependencies of the file with
+# other documented files.
+
+INCLUDE_GRAPH          = YES
+
+# If the ENABLE_PREPROCESSING, SEARCH_INCLUDES, INCLUDED_BY_GRAPH, and
+# HAVE_DOT tags are set to YES then doxygen will generate a graph for each
+# documented header file showing the documented files that directly or
+# indirectly include this file.
+
+INCLUDED_BY_GRAPH      = YES
+
+# If the CALL_GRAPH and HAVE_DOT options are set to YES then
+# doxygen will generate a call dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable call graphs
+# for selected functions only using the \callgraph command.
+
+CALL_GRAPH             = YES
+
+# If the CALLER_GRAPH and HAVE_DOT tags are set to YES then
+# doxygen will generate a caller dependency graph for every global function
+# or class method. Note that enabling this option will significantly increase
+# the time of a run. So in most cases it will be better to enable caller
+# graphs for selected functions only using the \callergraph command.
+
+CALLER_GRAPH           = YES
+
+# If the GRAPHICAL_HIERARCHY and HAVE_DOT tags are set to YES then doxygen
+# will graphical hierarchy of all classes instead of a textual one.
+
+GRAPHICAL_HIERARCHY    = YES
+
+# If the DIRECTORY_GRAPH, SHOW_DIRECTORIES and HAVE_DOT tags are set to YES
+# then doxygen will show the dependencies a directory has on other directories
+# in a graphical way. The dependency relations are determined by the #include
+# relations between the files in the directories.
+
+DIRECTORY_GRAPH        = YES
+
+# The DOT_IMAGE_FORMAT tag can be used to set the image format of the images
+# generated by dot. Possible values are png, jpg, or gif
+# If left blank png will be used.
+
+DOT_IMAGE_FORMAT       = png
+
+# The tag DOT_PATH can be used to specify the path where the dot tool can be
+# found. If left blank, it is assumed the dot tool can be found in the path.
+
+DOT_PATH               =
+
+# The DOTFILE_DIRS tag can be used to specify one or more directories that
+# contain dot files that are included in the documentation (see the
+# \dotfile command).
+
+DOTFILE_DIRS           =
+
+# The DOT_GRAPH_MAX_NODES tag can be used to set the maximum number of
+# nodes that will be shown in the graph. If the number of nodes in a graph
+# becomes larger than this value, doxygen will truncate the graph, which is
+# visualized by representing a node as a red box. Note that doxygen if the
+# number of direct children of the root node in a graph is already larger than
+# DOT_GRAPH_MAX_NODES then the graph will not be shown at all. Also note
+# that the size of a graph can be further restricted by MAX_DOT_GRAPH_DEPTH.
+
+DOT_GRAPH_MAX_NODES    = 50
+
+# The MAX_DOT_GRAPH_DEPTH tag can be used to set the maximum depth of the
+# graphs generated by dot. A depth value of 3 means that only nodes reachable
+# from the root by following a path via at most 3 edges will be shown. Nodes
+# that lay further from the root node will be omitted. Note that setting this
+# option to 1 or 2 may greatly reduce the computation time needed for large
+# code bases. Also note that the size of a graph can be further restricted by
+# DOT_GRAPH_MAX_NODES. Using a depth of 0 means no depth restriction.
+
+MAX_DOT_GRAPH_DEPTH    = 0
+
+# Set the DOT_TRANSPARENT tag to YES to generate images with a transparent
+# background. This is disabled by default, because dot on Windows does not
+# seem to support this out of the box. Warning: Depending on the platform used,
+# enabling this option may lead to badly anti-aliased labels on the edges of
+# a graph (i.e. they become hard to read).
+
+DOT_TRANSPARENT        = NO
+
+# Set the DOT_MULTI_TARGETS tag to YES allow dot to generate multiple output
+# files in one run (i.e. multiple -o and -T options on the command line). This
+# makes dot run faster, but since only newer versions of dot (>1.8.10)
+# support this, this feature is disabled by default.
+
+DOT_MULTI_TARGETS      = NO
+
+# If the GENERATE_LEGEND tag is set to YES (the default) Doxygen will
+# generate a legend page explaining the meaning of the various boxes and
+# arrows in the dot generated graphs.
+
+GENERATE_LEGEND        = YES
+
+# If the DOT_CLEANUP tag is set to YES (the default) Doxygen will
+# remove the intermediate dot files that are used to generate
+# the various graphs.
+
+DOT_CLEANUP            = YES
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/calendarwidget.h	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,219 @@
+/*
+* 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: Home screen calendar widget
+*
+*/
+
+#ifndef CALENDARWIDGET_H
+#define CALENDARWIDGET_H
+
+// System includes
+#include <hbwidget.h>
+
+// Forward declarations
+class HbLabel;
+class QGraphicsLinearLayout;
+class HbFrameDrawer;
+class HbFrameItem;
+class ContentLayoutHandler;
+class DateIconLayoutHandler;
+class MainLayoutHandler;
+/*!
+    \class HbWidget
+    \brief The super class for homescreen widgets.
+*/
+class HbWidget;
+class XQServiceRequest;
+class HbDocumentLoader;
+class QTranslator;
+
+/*!
+    \class CalendarWidget
+    \brief The CalendarWidget class is the main class for the calendar widget project
+*/
+// Class declaration
+class CalendarWidget : public HbWidget
+{
+    Q_OBJECT
+
+public:
+    /*! 
+        \fn CalendarWidget::CalendarWidget(QGraphicsItem* parent, Qt::WindowFlags flags)
+        
+        Constructor of the CalendarWidget class.
+     */
+    CalendarWidget(QGraphicsItem *parent = 0, Qt::WindowFlags flags = 0);
+    /*!
+        \fn CalendarWidget::~CalendarWidget()
+
+        Destructor of the CalendarWidget class.
+    */
+    ~CalendarWidget();
+    /*!
+        \fn QRectF CalendarWidget::boundingRect() const
+
+        Derived from HbWidget. Returns the bounding rectangle of the widget.
+    */
+    QRectF boundingRect() const;
+    /*!
+        \fn QPainterPath CalendarWidget::shape() const
+
+        Derived from HbWidget. Returns the shape of the widget.
+    */
+    QPainterPath shape() const;
+
+signals:
+    /*!
+        \fn void CalendarWidget::mousePressed(QPointF& point)
+
+        Emitted by the widget when mouse press event is received
+        @param point The position in which the event took place.
+    */
+    void mousePressed(QPointF& point);
+    /*!
+        \fn void CalendarWidget::mouseReleased()
+
+        Emitted by the widget when mouse release event is received.
+    */
+    void mouseReleased();
+    /*!
+        \fn void CalendarWidget::themeChanged()
+
+        Emitted by the framework when a theme change event is received by the widget.
+    */
+    void themeChanged();
+    /*!
+        \fn void CalendarWidget::finished()
+
+        Emitted by the widget if the initialization fails.
+    */
+    void finished();
+        /*!
+        \fn void CalendarWidget::tapGesture(QPointF& point)
+
+        Emitted by the widget when the widget receives a tap gesture.
+        @param point Position of the tap gesture
+    */
+    void tapGesture(QPointF& point);
+
+protected:
+    /*!
+        \fn bool CalendarWidget::event(QEvent *  event)
+
+        Derived from HbWidget. Catches all the events that are directed to the widget.
+        @param event The received event.
+    */
+    bool event(QEvent *  event);
+    /*!
+        \fn bool CalendarWidget::eventFilter(QObject * obj, QEvent * event)
+
+        Reimplemented from QObject. Filters events when CalendarWidget has 
+        been installed as an event filter for a watched object. Used for detecting 
+        mouse press events before they arrive to HomeScreen application.
+        @param obj The watched object.
+        @param event The caught event.
+    */
+    bool eventFilter(QObject *obj, QEvent *event);
+    /*!
+        \fn void CalendarWidget::gestureEvent(QGestureEvent *event)
+
+        Reimplemented from HbWidgetBase. Called by the framework when 
+        a gesture event has been received.
+        @param event The received event
+    */
+    void gestureEvent(QGestureEvent *event);
+
+public slots:
+    /*!
+        \fn void CalendarWidget::onShow()
+
+        Called by the framework each time the widget is shown on the screen.
+    */
+    void onShow();
+    /*!
+        \fn void CalendarWidget::onHide()
+
+        Called by the framework each time the widget is hidden from the screen.
+    */
+    void onHide();
+    /*!
+        \fn void CalendarWidget::onInitialize()
+
+        Called by the framework each time the widget is initialized.
+    */
+    void onInitialize();
+    /*!
+        \fn void CalendarWidget::onUninitialize()
+
+        Called by the framework each time the widget is deleted.
+    */
+    void onUninitialize();
+
+private:
+    /*!
+        \fn bool CalendarWidget::loadWidget()
+
+        Used by CalendarWidget::onInitialize to load the DOCML and create the layout handlers. 
+        Upon success it returns true. If initialization fails it returns false. 
+    */
+    bool loadWidget();
+    /*!
+        \fn void CalendarWidget::mousePressEvent(QGraphicsSceneMouseEvent *aEvent)
+
+        Called by the framework when the mouse is pressed on the top of the widget.
+        Does not currently do anything. Mouse press events are caught using an event filter.
+        @param aEvent The received mouse event
+    */
+    void mousePressEvent(QGraphicsSceneMouseEvent *aEvent);
+    /*!
+        \fn void CalendarWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *aEvent)
+
+        Called by the framework when the mouse is released on the top of the widget.
+        @param aEvent The received mouse event
+    */
+    void mouseReleaseEvent(QGraphicsSceneMouseEvent *aEvent);
+    /*!
+        \fn void CalendarWidget::loadTranslator()
+
+        Loads and installs the localization.
+    */
+    void loadTranslator();
+    /*!
+        \fn void CalendarWidget::connectLayoutHandler(HbWidget *widget, QObject *layoutHandler, HbDocumentLoader& loader)()
+
+        Used by CalendarWidget::loadWidget() to initialize the layouts and to connect the widget's signals with 
+        layout handler's slots.
+        @param widget Main widget
+        @param layoutHandler Layout handler to connect
+        @param loader Document loader needed for getting the relevant objects
+    */
+    void connectLayoutHandler(HbWidget *widget, QObject *layoutHandler, HbDocumentLoader& loader);
+    /*!
+        \fn bool CalendarWidget::parseFile(QString& fileName, HbDocumentLoader& loader)
+
+        Parses an XML file that describes the functionality of the widget.
+        @param fileName Name of the XML file
+        @param loader Document loader that contains the relevant objects
+    */
+    bool parseFile(QString& fileName, HbDocumentLoader& loader);
+
+private: // data
+    Q_DISABLE_COPY(CalendarWidget)
+    QTranslator* mCommonTranslator;
+    
+    //For documentation purpose
+    ContentLayoutHandler* mContent;
+};
+
+#endif // CALENDARWIDGET_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/calendarwidgetdebug.h	Tue Jul 06 11:55:49 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: Home screen calendar widget
+*
+*/
+
+#ifndef CALENDARWIDGETDEBUG_H_
+#define CALENDARWIDGETDEBUG_H_
+
+// System includes
+#include <QDebug>
+
+// MACROS
+// Writing data into log
+// LOGS("My log string");
+
+#ifndef _DEBUG
+    // No logging wanted --> define empty macros
+
+    #define LOGS(A)
+
+#else // qDebug logging
+    #define LOGS(A) { qDebug() << A; }
+#endif
+
+#endif /* CALENDARWIDGETDEBUG_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/calendarwidgetplugin.h	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,63 @@
+/*
+* 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:  Homescreen widget plugin
+*
+*/
+
+#ifndef CALENDARWIDGETPLUGIN_H
+#define CALENDARWIDGETPLUGIN_H
+
+// System includes
+#include <QObject>
+/*!
+    \class QServicePluginInterface
+    \brief The service framework interface implemented by the plugin.  
+    \details The plugin is registered to the service framework. Homescreen loads the widgets through the
+        service framework. The plugin is loaded as a widget only if it implements (which is the case of
+        calendar widget) the interface <b>com.nokia.symbian.IHomeScreenWidget</b>
+*/
+#include <qserviceplugininterface.h>
+
+QTM_USE_NAMESPACE
+
+/*!
+    \class CalendarWidgetPlugin
+    \brief Responsible for loading the whole widget. Called by the service framework.
+*/
+
+// Class declaration
+class CalendarWidgetPlugin : public QObject, public QServicePluginInterface
+{
+    Q_OBJECT
+    Q_INTERFACES(QtMobility::QServicePluginInterface)
+
+public:
+    /*! 
+        \fn QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+                                    QServiceContext *context,
+                                    QAbstractSecuritySession *session);
+
+........Invoked by service framework.
+........@param descriptor contains the interface name. If the interface name contained in the descriptor matches
+               the one implemented createInstance returns and instance of CalendarWidget, otherwise it returns 
+               NULL. 
+        @param context Not used.
+        @param session Not used.
+    */
+    QObject *createInstance(const QServiceInterfaceDescriptor &descriptor,
+                            QServiceContext *context,
+                            QAbstractSecuritySession *session);
+};
+
+#endif // CALENDARWIDGETPLUGIN_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/contentlayoutgesture.h	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,171 @@
+/*
+* 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: Content layout gesture class
+*
+*/
+
+#ifndef CONTENTLAYOUTGESTURE_H_
+#define CONTENTLAYOUTGESTURE_H_
+
+#include <QObject>
+#include <QRectF>
+#include <QVector>
+#include <QDateTime>
+
+class QPointF;
+class HbDocumentLoader;
+class HbWidget;
+class TestContentLayoutHandler;
+
+/*!
+    \class ContentLayoutGesture
+    \brief Handles gestures for content layout.
+*/
+
+// Class declaration
+class ContentLayoutGesture: public QObject
+{
+    Q_OBJECT
+    Q_PROPERTY(int testID READ testId WRITE setTestId)
+
+public:
+    /*!
+        \fn ContentLayoutGesture::ContentLayoutGesture(HbWidget* widget, QList<QString> parameters, QString& layout, QString& gestureType, QString& action, QObject* parent = 0)
+
+        Constructor of the ContentLayoutGesture class.
+        @param widget
+        @param parameters
+        @param layout
+        @param gestureType
+        @param action
+        @param parent
+    */
+    ContentLayoutGesture(HbWidget* widget, QList<QString> parameters, QString& layout, QString& gestureType, QString& action, QObject* parent = 0);
+    /*!
+        \fn ContentLayoutGesture::~ContentLayoutGesture()
+
+        Destructor of the ContentLayoutGesture class.
+    */
+    ~ContentLayoutGesture();
+
+public slots:
+    /*!
+        \fn void ContentLayoutGesture::onTap(QPointF& point)
+
+        @param point
+    */
+    void onTap(QPointF& point);
+    /*!
+        \fn void ContentLayoutGesture::handleOk(const QVariant& var)
+
+        @param var
+    */
+    void handleOk(const QVariant& var);
+    /*!
+        \fn void ContentLayoutGesture::handleError(int err, const QString& str)
+
+        @param err
+        @param str
+    */
+    void handleError(int err, const QString& str);
+    /*!
+        \fn void ContentLayoutGesture::updateDate(QDateTime& date)
+
+        @param date
+    */
+    void updateDate(QDateTime& date);
+    /*!
+        \fn void ContentLayoutGesture::addGesture(QList<QString> parameters, QString& gestureType, QString& action)
+
+        @param parameters
+        @param gestureType
+        @param action
+    */
+    void addGesture(QList<QString> parameters, QString& gestureType, QString& action);
+
+signals:
+    /*!
+        \fn void ContentLayoutGesture::requestError()
+    */
+    void requestError();
+    /*!
+        \fn void ContentLayoutGesture::requestComplete()
+    */
+    void requestComplete();
+    
+private:
+    /*!
+        \fn void ContentLayoutGesture::assignParameters(QList<QString> parameters, QString& gestureType, QString& action)
+
+        @param parameters
+        @param gestureType
+        @param action
+    */
+    void assignParameters(QList<QString> parameters, QString& gestureType, QString& action);
+    /*!
+        \fn void ContentLayoutGesture::launchApplication(QList<QString> parameters)
+
+        @param parameters
+    */
+    void launchApplication(QList<QString> parameters, QList<QString> parametersType);
+	
+    /*!
+        \fn void ContentLayoutGesture::parseParameters( QString& gestureType )
+
+        @param gestureType
+    */
+	void parseParameters( QString& gestureType );
+	
+	//Test property functions
+    /*! 
+        \fn int ContentLayoutHandler::testId()
+        
+        Used to check which test needs to run.
+        @return Test id
+     */
+    int testId();
+    /*! 
+        \fn void ContentLayoutHandler::setTestId(int testID)
+        
+        Used to set which test it needs to run.
+     */
+    void setTestId(int testID);
+
+private:
+    QDateTime mDate;
+    
+    QList<QString> mTapParameters;
+    QList<QString> mSwipeParameters;
+    QList<QString> mPinchParameters;
+    QList<QString> mPanParameters;
+    QList<QString> mHighlightParameters;
+    QList<QString> mTapParametersType;
+    QList<QString> mSwipeParametersType;
+    QList<QString> mPinchParametersType;
+    QList<QString> mPanParametersType;
+    QList<QString> mHighlightParametersType;
+    HbWidget* mLayout;
+    QString mTapAction;
+    QString mSwipeAction;
+    QString mPinchAction;
+    QString mPanAction;
+    QString mHighlightAction;
+    
+    //test variables
+    friend class TestContentLayoutGesture;   
+    int mTestID;
+    int mTestResult;
+};
+
+#endif /* CONTENTLAYOUTGESTURE_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/contentlayouthandler.h	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,470 @@
+/*
+* 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: Homescreen calendar widget's content layout handler.
+*
+*/
+
+#ifndef CONTENTLAYOUTHANDLER_H
+#define CONTENTLAYOUTHANDLER_H
+
+// System includes
+#include <QObject>
+#include <QGraphicsLinearLayout>
+
+/*!
+  \class AgendaUtil
+  \brief Interface to the calendar database.
+  \details It is used by ContentLayoutHandler to retrieve the list of calendar entries in the next seven days.\n\n
+  <b>QList<AgendaEntry> AgendaUtil::fetchEntriesInRange(
+            QDateTime rangeStart, QDateTime rangeEnd,
+            AgendaUtil::FilterFlags filter = AgendaUtil::IncludeAll)</b>
+      
+  is the function used to retrieve the list of calendar entries in range. It returns a list of calendar events.
+  @param rangeStart is the range date start. In calendar widget is always today.
+  @param rangeEnd is the range date end. In calendar widget is always one week after today.
+  @param filter is the type of event we want to include in the list. Calendar widget includes only All-Day and timed events.
+*/
+
+// Forward declarations
+class AgendaEntry;
+class AgendaUtil;
+class HbDocumentLoader;
+class HbFrameDrawer;
+class HbFrameItem;
+class HbLabel;
+class HbWidget;
+class QGraphicsLayout;
+class QPointF;
+class QTimer;
+class XQServiceRequest;
+class XQSettingsManager;
+class XQSettingsKey;
+class TestContentLayoutHandler;
+class QDateTime;
+class QRectF;
+//from DateIconLayoutHandler
+class DateTimeObserver;
+/*!
+  \class ContentLayoutHandler
+  \brief Decorates the content layout.
+*/
+// Class declaration
+class ContentLayoutHandler: public QObject, public QGraphicsLinearLayout
+{
+    Q_OBJECT
+    Q_PROPERTY(int testID READ testId WRITE setTestId)
+    Q_PROPERTY(int testResult READ testResult WRITE setTestResult)
+
+public:
+    /*! 
+        \fn ContentLayoutHandler::ContentLayoutHandler()
+        
+        Constructor of the ContentLayoutHandler class.
+     */
+    ContentLayoutHandler();
+    /*! 
+        \fn ContentLayoutHandler::~ContentLayoutHandler()
+        
+        Destructor of the ContentLayoutHandler class.
+     */
+    ~ContentLayoutHandler();
+
+    //Test property functions
+    /*! 
+        \fn int ContentLayoutHandler::testId()
+        
+        Used to check which test needs to run.
+        @return Test id
+     */
+    int testId();
+    /*! 
+        \fn void ContentLayoutHandler::setTestId(int testID)
+        
+        Used to set which test it needs to run.
+     */
+    void setTestId(int testID);
+    /*! 
+        \fn int ContentLayoutHandler::testResult()
+        
+        Used to check whether the calendar has been launched correctly or not.
+     */
+    int testResult();
+    /*! 
+        \fn void ContentLayoutHandler::setTestResult(int testResult)
+        
+        Used to set the test property.
+     */
+    void setTestResult(int testResult);
+
+signals:
+     /*! 
+        \fn void ContentLayoutHandler::requestComplete()
+        
+        Emitted in case the calendar has been launched correctly.
+     */
+    void requestComplete();
+    /*! 
+        \fn void ContentLayoutHandler::requestError()
+        
+        Emitted in case the calendar launch didn't succeed.
+     */
+    void requestError();
+    /*! 
+        \fn void ContentLayoutHandler::currentDate(QDateTime& date)
+        
+        Emits the current date during layout decoration.
+        @param date Current date
+     */    
+    void currentDate(QDateTime& date);
+    
+    //from DateIconLayoutHandler
+    /*! 
+        \fn void ContentLayoutHandler::dateChanged()
+        
+        Emitted when the date has changed.
+     */        
+    void dateChanged();
+
+public slots:
+    /*! 
+        \fn void ContentLayoutHandler::eventTimerExpired()
+        
+        Connected to the timer signal timeout. The timer is needed in order to calculate the time that divides
+        the current moment from the expiration of the next upcoming event. This slot is called when the timer expires,
+        thus, its purpose is to decorate the layout with the next upcoming event and start the timer again.
+    */
+    void eventTimerExpired();
+    /*! 
+        \fn void ContentLayoutHandler::calendarChanged(const XQSettingsKey& key, const QVariant& value)
+        
+        Calendar P&S listener. Its purpose is to listen to the calendar P&S in order to be notified of any calendar
+        event modifications. Whenever it receives any notifications from the calendar, it will decorate the layout.
+        @param key The key to listen to
+        @param value Key value
+    */
+    void calendarChanged(const XQSettingsKey& key, const QVariant& value);
+    /*! 
+        \fn void ContentLayoutHandler::initializeLayout(const HbDocumentLoader &layoutLoader, QObject *owner)
+        
+        Initializes the layout using the document loader. Connected to CalendarWidget.
+        @param layoutLoader Document loader that contains the DOCML needed to load the layout
+        @param owner Parent
+    */
+    void initializeLayout(const HbDocumentLoader &layoutLoader, QObject *owner);
+    /*! 
+        \fn void ContentLayoutHandler::updateLayout()
+        
+        Decorates the layout content.
+    */
+    void updateLayout();
+    /*! 
+        \fn void ContentLayoutHandler::onThemeChange()
+        
+        Connected to CalendarWidget. Called when a theme change events occurs. Its purpose is to load the new
+        theme graphics into the widget.
+    */
+    void onThemeChange();
+    /*! 
+        \fn void ContentLayoutHandler::handleOk(const QVariant& var)
+        
+        Connected to XQSettingsManager valueChanged signal. Called if the calendar has been launched correctly.
+        @param var operation returning value
+    */
+    void handleOk(const QVariant& var);
+    /*! 
+        \fn void ContentLayoutHandler::handleError(int err, const QString& str)
+        
+        Connected to XQSettingsManager valueChanged signal. Called if the calendar has not been launched correctly.
+        @param err Error code
+        @param str Explanation of the error
+    */
+    void handleError(int err, const QString& str);
+    /*! 
+        \fn void ContentLayoutHandler::highlightOn(QPointF& point)
+        
+        Highlights the layout, if the point is inside the correct area.
+        @param point The (scene) position of the highlighting event
+    */
+    void highlightOn(QPointF &point);
+    /*! 
+        \fn void ContentLayoutHandler::highlightOff()
+        
+        Removes highlighting from the layout. 
+    */
+    void highlightOff();
+
+private:
+    /*! 
+        \fn void ContentLayoutHandler::hideLabels()
+        
+        Called when the widget is initialized to hide all the labels in the layout. 
+    */
+    void hideLabels();
+    /*! 
+        \fn void ContentLayoutHandler::setLabelsColor()
+        
+        Called when the widget is initialized and when a theme change occurs to change the labels text color.
+    */
+    void setLabelsColor();
+    /*! 
+        \fn void ContentLayoutHandler::removePassedEvents()
+        
+        Filters out the already passed events from the list of events that comes from the calendar database.
+    */
+    void removePassedEvents();
+    /*! 
+        \fn void ContentLayoutHandler::createAgendaUtilsInstance()
+        
+        Initializes the agenda utils instance.
+    */
+    void createAgendaUtilsInstance();
+    /*! 
+        \fn void ContentLayoutHandler::removeTodosFrom()
+        
+        Filters out the todo events from the list of events that comes from the calendar database.
+        Also filters out other type of events that should be ignored by the calendar widget.
+    */
+    void removeTodosFrom();
+    /*! 
+        \fn void ContentLayoutHandler::todayHasValidEvents()
+        
+        Returns true if in the list of events there are upcoming events to be shown today.
+        Returns false otherwise.
+    */
+    bool todayHasValidEvents();
+    /*! 
+        \fn void ContentLayoutHandler::sortList()
+        
+        Sorts the list of events according to the starting time.
+    */
+    void sortList();
+    /*! 
+        \fn void ContentLayoutHandler::showNoEventsNextWeek()
+        
+        If there are no events the next seven days, decorates the layout with that information. 
+    */
+    void showNoEventsNextWeek();
+    /*! 
+        \fn void ContentLayoutHandler::showNextEvent()
+        
+        Decorates the layout with the information about today's next upcoming event.
+    */
+    void showNextEvent();
+    /*! 
+        \fn void ContentLayoutHandler::showOverlappingEvents(int when, int numOverlappingEvents, int aEndEventIndex)
+        
+        Decorates the layout with the information about how many upcoming overlapping events there are,
+        starting time and end time.
+        @param when 1 = today, >1 = upcoming day
+        @param numOverlappingEvents Number of overlapping events
+        @param aEndEventIndex The index in the list of events of the last event that overlaps the one
+        with index 0.
+    */
+    void showOverlappingEvents(int when, int numOverlappingEvents, int aEndEventIndex);
+    /*! 
+        \fn void ContentLayoutHandler::showNextDaysEvent()
+        
+        Decorates the layout with the information about the next days first upcoming event.
+    */
+    void showNextDaysEvent();
+    /*! 
+        \fn int ContentLayoutHandler::checkOverlappingEvents(ulong id, int& aEndEventIndex)
+        
+        Calculates the number of events overlapping event with id \em id.
+        @param id The id of the event we want to find overlapping events to
+        @param aEndEventIndex The index of the last event that is overlapping the event id
+        @return Number of overlapping events. 
+    */
+    int checkOverlappingEvents(ulong id, int& aEndEventIndex);
+    /*! 
+        \fn void ContentLayoutHandler::updateList()
+        
+        Asks calendar database to provide an updated list of events in range now, now + 7 days.
+    */
+    void updateList();
+    /*! 
+        \fn void ContentLayoutHandler::decorateContent()
+        
+        Contains the layout decoration logic. Called whenever an update is needed and upon widget initialization.
+    */
+    void decorateContent();
+    /*! 
+        \fn QString ContentLayoutHandler::currentDateFormat()
+        
+        Checks whether the current date format is english, american or 
+        japanese and formats the date string accordingly.
+        @return The date string formatted with the current date format
+    */
+    QString currentDateFormat();
+    /*! 
+        \fn QString ContentLayoutHandler::currentTimeFormat()
+        
+        Checks whether the current time format is 12 hours or 24 hours and formats the date string accordingly.
+        @return The time string formatted with the current time format
+    */
+    QString currentTimeFormat();
+    /*! 
+        \fn int ContentLayoutHandler::timeToNextCheck()
+        
+        Calculates the time that needs to pass before we need to check whether a layout decoration is needed or not.
+        @return Number of milliseconds to the next check
+    */
+    int timeToNextCheck();
+    /*! 
+        \fn int ContentLayoutHandler::initializeTimer()
+        
+        Initializes the timer and calculates the time to the first check.
+    */
+    void initializeTimer();
+    /*! 
+        \fn QString ContentLayoutHandler::calculateEndTime(int& aEndEventIndex)
+        
+        Calculates when the overlapping situation ends by checking the end 
+        time of all the involved events and choose the biggest one.
+        @param aEndEventIndex The index of the last overlapping event in the list of events
+        @return The end time as a string
+    */
+    QString calculateEndTime(int& aEndEventIndex);
+    /*! 
+        \fn int ContentLayoutHandler::firstEntryIndex()
+        
+        Calculates the index of the first timed event in the list of events.
+        @return The index of the first timed event
+    */
+    int firstEntryIndex();
+    /*! 
+        \fn void ContentLayoutHandler::setTimerForNextUpdate()
+        
+        Checks whether there are events in the list and timeToNextCheck is not zero and then sets the timer to 
+        timeToNextCheck values.
+    */
+    void setTimerForNextUpdate();
+    /*! 
+        \fn QDateTime ContentLayoutHandler::currentDateTime()
+        
+        Get current date, either real device date or fake date during testing.
+        @return Date
+    */
+    QDateTime currentDateTime();
+    /*! 
+        \fn void ContentLayoutHandler::setLabelText(HbLabel* label, QString text)
+        
+        Sets the label text. Checks whether the label pointer is valid or not.
+        @param label The label to set the text to
+        @param text The text to be set
+    */
+    void setLabelText(HbLabel* label, QString text);
+    /*! 
+        \fn void ContentLayoutHandler::setLabelVisible(HbLabel* label, bool visible)
+        
+        Sets visible or invisible a specified label. It checks whether the label pointer is valid or not.
+        @param label The label to set the text to
+        @param visible Label visible, true or false
+    */
+    void setLabelVisible(HbLabel* label, bool visible);
+    /*! 
+        \fn bool ContentLayoutHandler::isAllDayEvent(AgendaEntry entry)
+        
+        Checks whether a specific entry is an all day event or not.
+        @param entry Entry to check
+        @return True, if entry is an all day event, otherwise false
+    */
+    bool isAllDayEvent(AgendaEntry entry);
+
+    /*! 
+        \fn bool ContentLayoutHandler::isOneDayAllDayEvent(AgendaEntry entry)
+            
+        Checks whether the entry is an all day event with the duration of one day.
+        @param entry Entry to check
+        @return True, if entry is an one day all day event, otherwise false
+    */
+    bool isOneDayAllDayEvent(AgendaEntry entry);
+    
+    //from DateIconLayoutHandler
+    /*! 
+        \fn void ContentLayoutHandler::setCalendarIconContent()
+        
+        Updates date number label and month label texts.
+    */    
+    void setCalendarIconContent();
+    /*! 
+        \fn void ContentLayoutHandler::setLowerLabelOverlapping(int numberOfEvents)
+        
+        Sets the lower label text to indicate overlapping events.
+        @param numberOfEvents Number of overlapping events to insert in the localized text
+    */
+    void setLowerLabelOverlapping(int numberOfEvents);
+    
+private: // data
+    Q_DISABLE_COPY(ContentLayoutHandler)
+
+    HbWidget* mContainer;
+
+    HbLabel* mReminderLabel;
+    HbLabel* mUpperLabelShort;
+    HbLabel* mUpperLabelLong;
+    HbLabel* mMiddleLabel;
+    HbLabel* mLowerLabel;
+    
+    //From DateIconLayoutHandler
+    // Containers
+    HbWidget* mIconContainer;
+    
+    // Labels (not owned)
+    HbLabel* mIconLabel;
+    HbLabel* mNumberLabel;
+    HbLabel* mMonthLabel;
+    HbLabel* mHighlightLabel;
+        
+    // Background drawer (not owned)
+    HbFrameDrawer* mDateIconFrameDrawer;
+
+    // Owned
+    DateTimeObserver* mDateObserver;
+    //From MainLayoutHandler
+    HbWidget* mWidget;
+
+    // Background label
+    HbLabel* mBgLabel;
+    
+    // Separator
+    HbLabel* mSeparatorLabel;
+
+    //to paint icon and widget background
+    HbFrameItem* mIconLayoutItem;
+    HbFrameItem* mBackgroundLayoutItem;
+    HbFrameItem* mSeparatorLayoutItem;
+    //END
+    // Frame drawer for reminder icon (not owned)
+    HbFrameDrawer* mReminderDrawer;
+    //timer used to know when the current shown event disappears
+    QTimer* mEventTimer;
+
+    //Agenda Utils
+    AgendaUtil* mAgendaUtil;
+    QList<AgendaEntry> mAgendaEntryList;
+    XQSettingsManager* mCalendarKeyManager;
+
+    // State variables
+    bool mDateHighlightActive;
+    bool mContentHighlightActive;
+    
+    //test variables
+    int mTestID;
+    int mTestResult;
+
+    friend class TestContentLayoutHandler;
+};
+
+#endif // CONTENTLAYOUTHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/dateiconlayouthandler.h	Tue Jul 06 11:55:49 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: Calendar widget's date icon layout handler
+*
+*/
+
+#ifndef DATEICONLAYOUTHANDLER_H
+#define DATEICONLAYOUTHANDLER_H
+
+// System includes
+#include <QObject>
+
+// Forward declarations
+class HbLabel;
+class HbFrameDrawer;
+class HbWidget;
+class QTimer;
+class QPointF;
+class XQServiceRequest;
+class DateTimeObserver;
+class TestDateIconLayoutHandler;
+class HbDocumentLoader;
+
+// Class declaration
+class DateIconLayoutHandler: public QObject
+{
+    Q_OBJECT
+    Q_PROPERTY(int testID READ testId WRITE setTestId)
+    Q_PROPERTY(int testResult READ testResult WRITE setTestResult)
+
+public:
+    DateIconLayoutHandler();
+    ~DateIconLayoutHandler();
+
+    //Test property functions
+    int testId();
+    void setTestId(int testID);
+    int testResult();
+    void setTestResult(int testResult);
+
+signals:
+    void dateChanged();
+    void requestComplete();
+    void requestError();
+
+public slots:
+    void initializeLayout(const HbDocumentLoader &layoutLoader, QObject *owner);
+    void updateLayout();
+    void onTap(QPointF &point); //TODO: change this with onGesture at some point
+    void onThemeChange();
+    void handleOk(const QVariant& var);
+    void handleError(int err, const QString& str);
+
+private:
+    void setCalendarIconContent();
+    void launchCalendarMonthView();
+    void setLabelsColor();
+
+private: // data
+    Q_DISABLE_COPY(DateIconLayoutHandler)
+
+    HbWidget* mWidget;
+
+    // Labels (not owned)
+    HbLabel* mNumberLabel;
+    HbLabel* mMonthLabel;
+
+    // Background drawer (not owned)
+    HbFrameDrawer* mFrameDrawer;
+
+    // Owned
+    DateTimeObserver* mDateObserver;
+
+    // Test variables
+    int mTestID;
+    int mTestResult;
+
+    friend class TestDateIconLayoutHandler;
+};
+
+#endif // DATEICONLAYOUTHANDLER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/datetimeobserver.h	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,73 @@
+/*
+* 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: Calendar widget datetime observer
+*
+*/
+
+#ifndef DATETIMEOBSERVER_H
+#define DATETIMEOBSERVER_H
+
+#include <QObject>
+
+/*!
+  \class DateTimeObserver
+  \brief Gets notifications about date changes from the Symbian fw and 
+  forwards those to the widget.
+*/
+
+class DateTimeObserverPrivate;
+
+class DateTimeObserver : public QObject
+{
+    Q_OBJECT
+
+public:
+    /*! 
+        \fn DateTimeObserver::DateTimeObserver(QObject *parent = 0)
+        
+        Constructor of the DateTimeObserver class.
+        @param parent is the parent class.
+     */
+    explicit DateTimeObserver(QObject *parent = 0);
+    /*! 
+        \fn DateTimeObserver::~DateTimeObserver()
+        
+        Destructor of the DateTimeObserver class.
+     */
+    virtual ~DateTimeObserver();
+
+signals:
+     /*! 
+        \fn void DateTimeObserver::completed()
+        
+        emitted when a new notification is received from the private part.
+     */
+    void completed();
+
+protected:
+    /*! 
+        \fn void DateTimeObserver::handleCompletion()
+        
+        called by the private part of DateTimeObserver when the date has changed.
+     */
+    void handleCompletion();
+
+private:
+    Q_DISABLE_COPY(DateTimeObserver)
+    friend class DateTimeObserverPrivate;
+
+    DateTimeObserverPrivate *d_ptr;
+};
+
+#endif // DATETIMEOBSERVER_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/datetimeobserver_p.h	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,78 @@
+/*
+* 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: Calendar widget datetime observer
+*
+*/
+
+#ifndef DATETIMEOBSERVERPRIVATE_H
+#define DATETIMEOBSERVERPRIVATE_H
+
+#include <e32base.h>
+#include <e32property.h>
+#include <qglobal.h>
+#include <bacntf.h>
+
+class DateTimeObserver;
+
+/*!
+  \class DateTimeObserverPrivate
+  \brief Gets notifications about date changes from the Symbian fw and 
+  forwards those to its public class.
+*/
+
+class DateTimeObserverPrivate
+{
+public:
+    /*! 
+        \fn DateTimeObserverPrivate::DateTimeObserverPrivate(DateTimeObserver *q = 0)
+        
+        Constructor of the DateTimeObserverPrivate class.
+        @param q is the public class that will be notified of date changes.
+     */
+    explicit DateTimeObserverPrivate(DateTimeObserver *q = 0);
+    /*! 
+        \fn DateTimeObserverPrivate::~DateTimeObserverPrivate
+        
+        Destructor of the DateTimeObserverPrivate class.
+     */
+    ~DateTimeObserverPrivate();
+
+private:
+    /*! 
+        \fn TInt DateTimeObserverPrivate::HandleLocaleChange()
+        
+        Called by LocaleChangeCallBack to handle the locale change.
+        @return 1, if the locale change was handled, otherwise 0
+     */
+    TInt HandleLocaleChange();
+    /*! 
+        \fn TInt DateTimeObserverPrivate::LocaleChangeCallback(TAny* aThisPtr)
+        
+        Called by the framework when a locale change occurs.
+        @param aThisPtr is the pointer to this object.
+        @return 1, if the locale change was handled, otherwise 0
+     */
+    static TInt LocaleChangeCallback(TAny* aThisPtr);
+
+private:
+    Q_DISABLE_COPY(DateTimeObserverPrivate)
+
+            DateTimeObserver *q_ptr;
+    /*
+     * Owned
+     */
+    CEnvironmentChangeNotifier* iLocaleNotifier;
+};
+
+#endif // DATETIMEOBSERVERPRIVATE_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/mainlayouthandler.h	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,56 @@
+/*
+* 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: Calendar widget's date icon layout handler
+*
+*/
+
+#ifndef MAINLAYOUTHANDLER_H_
+#define MAINLAYOUTHANDLER_H_
+
+// System includes
+#include <QObject>
+#include <QGraphicsLinearLayout>
+
+class HbDocumentLoader;
+class HbLabel;
+class HbWidget;
+class HbFrameItem;
+
+class MainLayoutHandler : public QObject, public QGraphicsLinearLayout
+{
+    Q_OBJECT
+
+public:
+    MainLayoutHandler();
+    ~MainLayoutHandler();
+
+public slots:
+    void initializeLayout(const HbDocumentLoader &layoutLoader, QObject *owner);
+    void updateLayout();
+    void onThemeChange();
+
+private:
+    HbWidget* mWidget;
+
+    //separator
+    HbLabel* mSeparatorLabel;
+
+    //to paint icon and widget background
+    HbFrameItem* mIconLayoutItem;
+    HbFrameItem* mBackgroundLayoutItem;
+    HbFrameItem* mSeparatorLayoutItem;
+
+};
+
+#endif // MAINLAYOUTHANDLER_H_
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/saxhandler.h	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,113 @@
+/*
+* 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: Calendar widget XML reader/parser
+*
+*/
+
+#ifndef SAXHANDLER_H_
+#define SAXHANDLER_H_
+
+#include <qxml.h>
+#include <qobject.h>
+
+class HbDocumentLoader;
+
+/*!
+    \class SaxHandler
+    \brief Reads and parses XML-based configuration for the calendar widget.
+*/
+class SaxHandler: public QXmlDefaultHandler
+{
+public:
+    /*!
+        \fn SaxHandler::SaxHandler(QObject* caller, HbDocumentLoader &loader)
+
+        Constructor of the SaxHandler class.
+        @param caller The calling object
+        @param loader Orbit document loader
+    */
+    SaxHandler(QObject* caller, HbDocumentLoader &loader);
+    /*!
+        \fn SaxHandler::~SaxHandler()
+
+        Destructor of the SaxHandler class.
+    */
+    ~SaxHandler();
+    //From QXmlDefaultHandler
+    /*!
+        \fn bool SaxHandler::startElement(const QString &namespaceURI, const QString &localName, const QString &qName,
+        const QXmlAttributes &attributes)
+
+        @param namespaceURI
+        @param localName
+        @param qName
+        @param attributes
+    */
+    bool startElement(const QString &namespaceURI, const QString &localName, const QString &qName,
+        const QXmlAttributes &attributes);
+    /*!
+        \fn bool SaxHandler::endElement(const QString &namespaceURI, const QString &localName, const QString &qName)
+
+        @param namespaceURI
+        @param localName
+        @param qName
+    */
+    bool endElement(const QString &namespaceURI, const QString &localName, const QString &qName);
+    /*!
+        \fn bool SaxHandler::characters(const QString &str)
+
+        @param str
+    */
+    bool characters(const QString &str);
+    /*!
+        \fn bool SaxHandler::fatalError(const QXmlParseException &exception)
+
+        @param exception
+        @return 
+    */
+    bool fatalError(const QXmlParseException &exception);
+
+private:
+    /*!
+        \fn void SaxHandler::connectObject(QObject* object)
+
+        @param object
+        @return 
+    */    
+    void connectObject(QObject* object);
+    /*!
+        \fn QString SaxHandler::createGestureSignal()
+
+        @return 
+    */    
+    QString createGestureSignal();
+    /*!
+        \fn QString SaxHandler::createGestureSlot()
+
+        @return 
+    */    
+    QString createGestureSlot();
+
+private:
+    QObject* mCaller;
+    QString mGestureType;
+    QString mLayout;
+    QString mAction;
+    QList<QString> mParameters;
+    bool mArgumentValue;
+    HbDocumentLoader& mLoader;
+};
+
+
+#endif /* SAXHANDLER_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/inc/widgetlayouthandler.txt	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,22 @@
+class IWidgetLayoutHandler
+{
+    // OPTIONAL: turns on/off the layout handler
+    Q_PROPERTY(bool enable RW)
+    // OPTIONAL: returns the enabled state of the layout handler
+    Q_PROPERTY(bool isEnabled R)
+public: // public invokable methods
+public signals:
+    // OPTIONAL: emited by the handler when the widget must update its content
+    void updateWidget();
+    // OPTIONAL: update widget
+    void updateLayout(const QString &layoutFile);
+public slots:
+    // MANDATORY: the slot initializes the layout handler internals and connects to the owner
+    void initializeLayout(const HbDocumentLoader &layoutLoader, QObject *owner);
+    // MANDATORY: updates the layout content
+    void updateLayout();
+    //OPTIONAL: reacts on gestures
+    void onTap(QPointF& point);
+    // OPTIONAL: updates the layout upon theme change
+    void onThemeChange();
+};
\ No newline at end of file
Binary file calendarwidgetplugin/loc/calendarwidget_en.qm has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/loc/calendarwidget_en.ts	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,83 @@
+<?xml version="1.0" encoding="utf-8"?>
+<!DOCTYPE TS><TS version="1.1" language="en_GB">
+<defaultcodec></defaultcodec>
+<context>
+    <name></name>
+    <message id="txt_calendar_january">
+        <source>January</source>
+        <translation>January</translation>
+    </message>
+    <message id="txt_calendar_february">
+        <source>February</source>
+        <translation>February</translation>
+    </message>
+    <message id="txt_calendar_march">
+        <source>March</source>
+        <translation>March</translation>
+    </message>
+    <message id="txt_calendar_april">
+        <source>April</source>
+        <translation>April</translation>
+    </message>
+    <message id="txt_calendar_may">
+        <source>May</source>
+        <translation>May</translation>
+    </message>
+    <message id="txt_calendar_june">
+        <source>June</source>
+        <translation>June</translation>
+    </message>
+    <message id="txt_calendar_july">
+        <source>July</source>
+        <translation>July</translation>
+    </message>
+    <message id="txt_calendar_august">
+        <source>August</source>
+        <translation>August</translation>
+    </message>
+    <message id="txt_calendar_september">
+        <source>September</source>
+        <translation>September</translation>
+    </message>
+    <message id="txt_calendar_october">
+        <source>October</source>
+        <translation>October</translation>
+    </message>
+    <message id="txt_calendar_november">
+        <source>November</source>
+        <translation>November</translation>
+    </message>
+    <message id="txt_calendar_december">
+        <source>December</source>
+        <translation>December</translation>
+    </message>
+    <message id="txt_calendar_monday">
+        <source>Monday</source>
+        <translation>Lunedi</translation>
+    </message>
+    <message id="txt_calendar_tuesday">
+        <source>Tuesday</source>
+        <translation>Tuesday</translation>
+    </message>
+    <message id="txt_calendar_wednesday">
+        <source>Wednesday</source>
+        <translation>Wednesday</translation>
+    </message>
+    <message id="txt_calendar_thursday">
+        <source>Thursday</source>
+        <translation>Thursday</translation>
+    </message>
+    <message id="txt_calendar_friday">
+        <source>Friday</source>
+        <translation>Friday</translation>
+    </message>
+    <message id="txt_calendar_saturday">
+        <source>Saturday</source>
+        <translation>Saturday</translation>
+    </message>
+    <message id="txt_calendar_sunday">
+        <source>Sunday</source>
+        <translation>Sunday</translation>
+    </message>
+</context>
+</TS>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/resource/calendarwidgetplugin.manifest	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,8 @@
+<?xml version="1.0" encoding="utf-8"?>
+<widgetprovider>
+    <widget library="calendarwidgetplugin"
+            uri="calendarwidgetplugin"
+            title="CalendarWidget"
+            iconuri="qtg_large_calendar.png"
+            description="Shows calendar events."/>
+</widgetprovider>
Binary file calendarwidgetplugin/resource/calendarwidgetplugin.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/resource/calendarwidgetplugin.s60xml	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>calendarwidgetplugin</name>
+    <filepath>z:/private/20022F35/import/widgetregistry/2002C35A/calendarwidgetplugin.qtplugin</filepath>
+    <description>shows calendar events.</description>
+    <interface>
+        <name>com.nokia.symbian.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description>Calendar widget</description>
+        <capabilities></capabilities>
+        <customproperty key="iconuri">qtg_large_calendar.png</customproperty>
+        <customproperty key="title">CalendarWidget</customproperty>
+    </interface>
+</service>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/resource/calendarwidgetplugin.xml	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,14 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<service>
+    <name>calendarwidgetplugin</name>
+    <filepath>calendarwidgetplugin</filepath>
+    <description>CalendarWidget</description>
+    <interface>
+        <name>com.nokia.symbian.IHomeScreenWidget</name>
+        <version>1.0</version>
+        <description>Calendar widget shows current calendar events/description>
+        <capabilities></capabilities>
+        <customproperty key="iconuri">calendarwidgetplugin.png</customproperty>
+        <customproperty key="title">CalendarWidget</customproperty>
+    </interface>
+</service>
Binary file calendarwidgetplugin/resource/qtg_large_calendar.png has changed
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/resources.qrc	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,6 @@
+<?xml version="1.0" encoding="UTF-8"?>
+<RCC>
+    <qresource>
+        <file alias="CalendarWidget">CalendarWidget.docml</file>
+    </qresource>
+</RCC>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/calendarwidget.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,398 @@
+/*
+* 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: Home screen Calendar widget
+*
+*/
+
+// System includes
+#include <QGraphicsProxyWidget>
+#include <HbDocumentLoader>
+#include <QGraphicsLinearLayout>
+#include <QGraphicsWidget>
+#include <QGraphicsSceneMouseEvent>
+#include <QPainter>
+#include <QDebug>
+#include <QTranslator>
+#include <QDir>
+#include <QDateTime>
+#include <xqservicerequest.h>
+#include <HbFrameDrawer>
+#include <HbFrameItem>
+#include <HbColorScheme>
+#include <HbEvent>
+#include <HbLabel>
+#include <QMetaMethod>
+#include <QCoreApplication>
+#include <QGesture>
+#include <qxml.h>
+
+// User includes
+#include "calendarwidget.h"
+#include "contentlayouthandler.h"
+#include "contentlayoutgesture.h"
+#include "calendarwidgetdebug.h"
+#include "saxhandler.h"
+
+//Local constants
+const char DOCML[] = ":/CalendarWidget";
+
+#define CALWIDGET_HIGHLIGHT_ACTIVE
+
+// ======== MEMBER FUNCTIONS ========
+
+/*
+ * CalendarWidget::CalendarWidget()
+ */
+CalendarWidget::CalendarWidget(QGraphicsItem* parent, Qt::WindowFlags flags)
+    : HbWidget(parent, flags)
+{
+    LOGS("CalendarWidget::CalendarWidget");
+    grabGesture(Qt::TapGesture);
+    grabGesture(Qt::PanGesture);
+    grabGesture(Qt::PinchGesture);
+    grabGesture(Qt::SwipeGesture);
+}
+
+/*
+ * CalendarWidget::~CalendarWidget()
+ */
+CalendarWidget::~CalendarWidget()
+{
+    LOGS("CalendarWidget::~CalendarWidget");
+}
+
+/*
+ * CalendarWidget::boundingRect()
+ */
+QRectF CalendarWidget::boundingRect() const
+{
+    LOGS("CalendarWidget::boundingRect");
+    return childrenBoundingRect();
+}
+
+/*
+ * CalendarWidget::shape()
+ */
+QPainterPath CalendarWidget::shape() const
+{
+    LOGS("CalendarWidget::shape");
+
+    QPainterPath path;
+    path.addRect(boundingRect());
+    return path;
+}
+
+/*
+ * CalendarWidget::loadWidget()
+ */
+bool CalendarWidget::loadWidget()
+{
+    LOGS("CalendarWidget::loadWidget");
+
+    // Use document loader to load the contents
+    HbDocumentLoader loader;
+    bool loaded = true;
+    bool ok = false;
+    loader.load(DOCML, &ok);
+
+    if (ok) {
+        QObject* contentLayoutHandler = new ContentLayoutHandler();
+        connectLayoutHandler(this, contentLayoutHandler, loader);
+        
+		QString fileName( "C:/private/20022F35/gestures.xml" );
+		QFile xmlConfiguration(fileName);
+		bool fileExists = xmlConfiguration.open( QIODevice::ReadOnly );
+		if (fileExists) {
+            xmlConfiguration.close();
+        }
+        else {
+            QFile sourceFile("Z:/resource/gestures.xml");
+            fileExists = sourceFile.open(QFile::ReadOnly);
+            fileExists = xmlConfiguration.open(QFile::WriteOnly | QFile::Truncate);
+            fileExists = xmlConfiguration.write(sourceFile.readAll()) >= 0;
+            sourceFile.close();
+            xmlConfiguration.close();
+        }
+		
+		if (fileExists) {
+            parseFile(fileName, loader);
+        }
+
+        if (dynamic_cast<QGraphicsLinearLayout*> (contentLayoutHandler)) {
+            setPreferredSize(
+                dynamic_cast<QGraphicsLinearLayout*>(contentLayoutHandler)->preferredSize());
+            parentWidget()->resize(preferredSize()); // workaround for layouting
+            setLayout(dynamic_cast<QGraphicsLinearLayout*>(contentLayoutHandler));
+        }
+        else {
+            loaded = false;
+        }    
+    }
+    else {
+        loaded = false;
+    }
+    
+    return loaded;
+}
+
+/*
+ * CalendarWidget::connectLayoutHandler()
+ */
+void CalendarWidget::connectLayoutHandler(HbWidget *widget, QObject *layoutHandler, HbDocumentLoader& loader)
+{
+    LOGS("CalendarWidget::connectLayoutHandler");
+    if (!widget || !layoutHandler) {
+        return;
+    }
+    int methodIndex = layoutHandler->metaObject()->
+        indexOfSlot("initializeLayout(HbDocumentLoader,QObject*)");
+    if (methodIndex >= 0) {
+        layoutHandler->metaObject()->method(methodIndex).invoke(layoutHandler,
+            Q_ARG(const HbDocumentLoader, loader), Q_ARG(QObject*, this));
+    }
+    else {
+        return;
+    }
+
+    methodIndex = layoutHandler->metaObject()->indexOfSlot("onThemeChange()");
+    if (methodIndex >= 0) {
+        connect(this, SIGNAL(themeChanged()), layoutHandler, SLOT(onThemeChange()));
+    }
+
+    methodIndex = layoutHandler->metaObject()->indexOfSlot("highlightOn(QPointF&)");
+    if (methodIndex >= 0) {
+        connect(this, SIGNAL(mousePressed(QPointF&)),
+            layoutHandler, SLOT(highlightOn(QPointF&)));
+    }
+    
+    methodIndex = layoutHandler->metaObject()->indexOfSlot("highlightOff()");
+    if (methodIndex >= 0) {
+        connect(this, SIGNAL(mouseReleased()),
+            layoutHandler, SLOT(highlightOff()));
+    }
+
+}
+
+/*
+ * CalendarWidget::loadTranslator
+ */
+void CalendarWidget::loadTranslator()
+{
+    LOGS("CalendarWidget::loadTranslator");
+    QLocale::setDefault(QLocale::English);
+    QString locale = QLocale::system().languageToString(QLocale::system().language());
+    qDebug() << "locale: " << locale;
+    QString lang = QLocale::system().name();
+    mCommonTranslator = new QTranslator();
+    QString path = "Z:/resource/qt/translations/";
+    QString filename = "calwidget_" + lang + ".qm";
+    qDebug() << "path: " << path;
+    qDebug() << "filename: " << filename;
+    bool loaded = mCommonTranslator->load(filename,path);
+    qDebug() << "loaded = " << loaded;
+    QCoreApplication::installTranslator(mCommonTranslator);
+}
+
+/*
+ * CalendarWidget::event()
+ */
+bool CalendarWidget::event(QEvent * event)
+{
+    LOGS("CalendarWidget::event");
+    bool consumed = false;
+    QEvent::Type eventType = event->type();
+
+    if (eventType == HbEvent::ThemeChanged) {
+        consumed = true;
+        emit themeChanged();
+    }
+    
+    if (eventType == QEvent::Gesture) {
+        QGestureEvent* gesture = static_cast<QGestureEvent*>(event);
+        QList<QGesture*> gestureList = gesture->gestures();
+        for (int i = 0; i < gestureList.count(); i++) {
+            int type = gestureList.at(i)->gestureType();
+            qDebug() << "type = " << type;
+        }
+        gestureEvent(static_cast<QGestureEvent*>(event));
+        consumed = true;
+    }
+
+    return consumed;
+}
+
+/*
+ * CalendarWidget::onInitialize()
+ */
+void CalendarWidget::onInitialize()
+{
+    LOGS("CalendarWidget::onInitialize");
+    loadTranslator();
+
+    if (loadWidget()) {
+#ifdef CALWIDGET_HIGHLIGHT_ACTIVE
+        // Register event filter for highlighting
+        QCoreApplication* coreApp = QCoreApplication::instance();
+        if (coreApp) {
+            coreApp->installEventFilter(this);
+        }
+#endif
+    }
+    else {
+        //loading failed
+        emit finished();
+    }
+}
+
+/*
+ * CalendarWidget::onShow()
+ */
+void CalendarWidget::onShow()
+{
+    LOGS("CalendarWidget::onShow");
+    emit mouseReleased();
+}
+
+/*
+* CalendarWidget::onHide()
+*/
+void CalendarWidget::onHide()
+{
+    LOGS("CalendarWidget::onHide");
+}
+
+/*
+ * CalendarWidget::onUninitialize()
+ */
+void CalendarWidget::onUninitialize()
+{
+    LOGS("CalendarWidget::onUninitialize");
+#ifdef CALWIDGET_HIGHLIGHT_ACTIVE
+    // Uninstall event filter
+    QCoreApplication* coreApp = QCoreApplication::instance();
+    if (coreApp) {
+        coreApp->removeEventFilter(this);
+    }
+#endif
+}
+
+/*
+ * CalendarWidget::eventFilter()
+ */
+bool CalendarWidget::eventFilter(QObject *obj, QEvent *event)
+{
+    Q_UNUSED(obj);
+    if (event->type() == QEvent::GraphicsSceneMousePress) {
+        QGraphicsSceneMouseEvent* mouseEvent = (QGraphicsSceneMouseEvent*)event;
+        QPointF pos = mouseEvent->scenePos();
+//        emit mousePressed(pos);
+    }
+    else if (event->type() == QEvent::GraphicsSceneMouseRelease) {
+//        emit mouseReleased();
+    }
+    return false;
+}
+
+/*
+ * CalendarWidget::gestureEvent()
+ */
+void CalendarWidget::gestureEvent(QGestureEvent *event)
+{
+    LOGS("CalendarWidget::gestureEvent");
+    if (QTapGesture *tap = (QTapGesture*)event->gesture(Qt::TapGesture)) {
+        //QPointF pos = mapFromScene(event->mapToGraphicsScene(tap->position()));
+        QPointF pos = tap->position();
+        switch(tap->state()) {
+            case Qt::GestureStarted:
+                emit mousePressed(pos);
+                LOGS("CalendarWidget::gestureEvent => gestureStarted");
+                break;
+            case Qt::GestureUpdated:
+                LOGS("CalendarWidget::gestureEvent => gestureUpdated");
+                break;
+            case Qt::GestureFinished:
+                emit tapGesture(pos);
+                emit mouseReleased();
+                LOGS("CalendarWidget::gestureEvent => gestureFinished");
+                break;
+            case Qt::GestureCanceled:
+                LOGS("CalendarWidget::gestureEvent => gestureCanceled");
+                break;
+            default:
+                break;
+        }
+    }
+    
+    if(QPanGesture *pan = (QPanGesture*)event->gesture(Qt::PanGesture)) {
+        switch (pan->state()) {
+            case Qt::GestureFinished:
+                emit mouseReleased();
+                break;
+            default:
+                break;
+        }
+    }
+        
+    if (QSwipeGesture *pan = (QSwipeGesture*)event->gesture(Qt::SwipeGesture)) {
+        switch (pan->state()) {
+            case Qt::GestureFinished:
+                emit mouseReleased();
+                break;
+            default:
+                break;
+        }
+    }
+
+    if (QPinchGesture *pan = (QPinchGesture*)event->gesture(Qt::PinchGesture)) {
+        switch (pan->state()) {
+            case Qt::GestureFinished:
+                emit mouseReleased();
+                break;
+            default:
+                break;
+        }
+    }
+}
+
+/*
+ *  CalendarWidget::mousePressEvent()
+ */
+void CalendarWidget::mousePressEvent(QGraphicsSceneMouseEvent *event)
+{
+    Q_UNUSED(event);
+    LOGS("CalendarWidget::mousePressEvent");
+}
+
+/*
+ *  CalendarWidget::mouseReleaseEvent()
+ */
+void CalendarWidget::mouseReleaseEvent(QGraphicsSceneMouseEvent *event)
+{
+    Q_UNUSED(event);
+    LOGS("CalendarWidget::mouseReleaseEvent");
+}
+
+bool CalendarWidget::parseFile(QString& fileName, HbDocumentLoader& loader)
+{
+    LOGS("CalendarWidget::ParseFile");
+    QFile file(fileName);
+    QXmlInputSource inputSource(&file);
+    QXmlSimpleReader reader;
+    SaxHandler xmlParser(this, loader);
+    reader.setContentHandler(&xmlParser);
+    reader.setErrorHandler(&xmlParser);
+    return reader.parse(inputSource);
+}
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/calendarwidgetplugin.cpp	Tue Jul 06 11:55:49 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:  Homescreen widget plugin
+*
+*/
+
+// System includes
+#include <qserviceinterfacedescriptor.h>
+#include <qabstractsecuritysession.h>
+#include <qservicecontext.h>
+
+// User includes
+#include "calendarwidgetplugin.h"
+#include "calendarwidget.h"
+
+// ======== MEMBER FUNCTIONS ========
+
+/*!
+    ?Qt_style_documentation
+*/
+QObject *CalendarWidgetPlugin::createInstance(const QServiceInterfaceDescriptor &descriptor,
+                                               QServiceContext *context,
+                                               QAbstractSecuritySession *session)
+{
+    Q_UNUSED(context);
+    Q_UNUSED(session);
+
+    if (descriptor.interfaceName() == QLatin1String("com.nokia.symbian.IHomeScreenWidget")) {
+        return new CalendarWidget();
+    } else {
+        return 0;
+    }
+}
+
+Q_EXPORT_PLUGIN2(calendarwidgetplugin, CalendarWidgetPlugin)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/contentlayoutgesture.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,248 @@
+/*
+* 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:  Homescreen widget plugin
+*
+*/
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#include <QPointF>
+#include <HbDocumentLoader>
+#include <HbWidget>
+#include <QStringList>
+
+#include "contentlayoutgesture.h"
+#include "calendarwidgetdebug.h"
+
+const int KMethodIndex = 2;
+
+/*
+ * ContentLayoutGesture::ContentLayoutGesture
+ */
+ContentLayoutGesture::ContentLayoutGesture(HbWidget* widget, QList<QString> parameters, QString& layout, QString& gestureType, QString& action, QObject* parent) : QObject(parent)
+{
+    LOGS("ContentLayoutGesture::ContentLayoutGesture");
+    this->setObjectName(layout);
+    assignParameters(parameters, gestureType, action);
+    mLayout = widget;
+    mTestID = 0;
+}
+
+/*
+ * ContentLayoutGesture::~ContentLayoutGesture
+ */
+ContentLayoutGesture::~ContentLayoutGesture()
+{
+    LOGS("ContentLayoutGesture::~ContentLayoutGesture");
+}
+
+/*
+ * ContentLayoutGesture::assignParameter
+ */
+void ContentLayoutGesture::assignParameters(QList<QString> parameters, QString& gestureType, QString& action)
+{
+    LOGS("ContentLayoutGesture::assignParameter");
+    if (gestureType == "onTap") {
+        mTapParameters = parameters;
+        mTapAction = action;
+        if (mTapAction == "launchApplication") {
+            //Parse the method and extract parameters type 
+            parseParameters(gestureType);
+        }
+    }
+    
+    if (gestureType == "onSwipe") {
+        mSwipeParameters = parameters;
+        mSwipeAction = action;
+    }
+    
+    if (gestureType == "onHighlight") {
+        mHighlightParameters = parameters;
+        mHighlightAction = action;
+    }
+    
+    if (gestureType == "onPinch") {
+        mPinchParameters = parameters;
+        mPinchAction = action;
+    }
+    
+    if (gestureType == "onPan") {
+        mPanParameters = parameters;
+        mPanAction = action;
+        }
+}
+
+/*
+ * ContentLayoutGesture::parseParameters()
+ */
+void ContentLayoutGesture::parseParameters( QString& gestureType )
+{
+	LOGS( "ContentLayoutGesture::parseParameters" );
+	if (gestureType == "onTap") {
+        int parameterStartIndex = 0;
+        int parameterEndIndex = 0;
+        bool parameterFound = false;
+        int i = 0;
+        while ((mTapParameters.at(KMethodIndex).at(i) != '(') && (i < mTapParameters.at(
+            KMethodIndex).length())) {
+            i++;
+        }
+        parameterStartIndex = i + 1;
+        for (;i < mTapParameters.at(KMethodIndex).length(); i++) {
+            if (mTapParameters.at(KMethodIndex).at(i) == ',' || mTapParameters.at(KMethodIndex).at(
+                i) == ')') {
+                parameterEndIndex = i;
+                parameterFound = true;
+            }
+
+            if (parameterFound) {
+                QString parameterType = mTapParameters.at(KMethodIndex).mid(parameterStartIndex,
+                    parameterEndIndex - parameterStartIndex);
+                mTapParametersType.append(parameterType);
+                //check the next parameter type from the next cycle
+                parameterStartIndex = i + 1;
+                parameterFound = false;
+            }
+        }
+    }
+}
+
+/*
+ * ContentLayoutGesture::addGesture()
+ */
+void ContentLayoutGesture::addGesture(QList<QString> parameters, QString& gestureType, QString& action)
+{
+    LOGS("ContentLayoutGesture::addGesture");
+    assignParameters(parameters, gestureType, action);
+}
+
+/*
+ * ContentLayoutGesture::onTap
+ */
+void ContentLayoutGesture::onTap(QPointF& point)
+{
+    LOGS("ContentLayoutGesture::launchApplication");
+	if (mLayout->sceneBoundingRect().contains(point)) {
+        if (mTapAction == "launchApplication") {
+            launchApplication(mTapParameters, mTapParametersType);
+            mTestID = 1;
+        }
+    }
+}
+
+/*
+ * ContentLayoutGesture::launchApplication
+ */
+void ContentLayoutGesture::launchApplication( QList<QString> parameters, QList<QString> parametersType )
+{
+    LOGS("ContentLayoutGesture::launchApplication");
+    
+    QString service = parameters.at(0);
+    QString interface = parameters.at(1);
+    QString method = parameters.at(2);
+
+    XQApplicationManager aiwMgr;
+    //XQAiwRequest request = aiwMgr.create(url);
+    XQAiwRequest* request = aiwMgr.create(service, interface, method, false);
+    if (request == NULL) {
+        return;
+    }
+
+    // Connect result handling signal
+    connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+    // Connect error handling signal or apply lastError function instead.
+    connect(request, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&)));
+
+    QList<QVariant> args;
+    
+	for (int i = 3; i < parameters.count(); i++) {
+        if (parameters.at(i) == "CURRENTDATE") {
+            args << mDate;
+        }
+        else {
+            if (parametersType.at(i - KMethodIndex - 1) == "int") {
+                int par = parameters.at(i).toInt();
+                args << par;
+            }
+        }
+    }
+
+    // Set function parameters
+    request->setArguments(args);
+
+    // Send the request
+    bool res = request->send();
+    if (!res) {
+        // Request failed.
+        int error = request->lastError();
+
+        // Handle error
+    }
+
+    // All done.
+    delete request;
+}
+
+/*
+ * ContentLayoutGesture::handleOk()
+ */
+void ContentLayoutGesture::handleOk(const QVariant& var)
+{
+    Q_UNUSED(var);
+    LOGS("DateIconGesture::handleOk");
+    mTestID = 0;
+    emit requestComplete();
+}
+
+/*
+ * ContentLayoutGesture::handleError()
+ */
+void ContentLayoutGesture::handleError(int err, const QString& str)
+{
+    Q_UNUSED(str);
+    Q_UNUSED(err);
+    LOGS("DateIconGesture::handleError");
+    mTestID = err;
+    emit requestError();
+}
+
+
+/*
+ * ContentLayoutGesture::updateDate()
+ */
+void ContentLayoutGesture::updateDate(QDateTime& date)
+{
+    LOGS("ContentLayoutGesture::updateDate");
+    mDate = date;
+}
+
+//TEST FUNCTIONS
+
+/*
+ * ContentLayoutHandler::testId()
+ */
+int ContentLayoutGesture::testId()
+{
+    return mTestID;
+}
+
+/*
+ * ContentLayoutHandler::setTestId()
+ */
+void ContentLayoutGesture::setTestId(int testID)
+{
+    mTestID = testID;
+}
+
+//END OF FILE
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/contentlayouthandler.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,1207 @@
+/*
+* 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: Homescreen calendar widget's content layout handler.
+*
+*/
+
+// System includes
+#include <HbColorScheme>
+#include <QDateTime>
+#include <HbLabel>
+#include <HbDocumentLoader>
+#include <HbCore>
+#include <HbFrameDrawer>
+#include <HbFrameItem>
+#include <QTimer>
+#ifndef TEST
+#include <agendautil.h>
+#else
+#include "mockagendautil.h"
+#endif
+#include <agendaentry.h>
+#include <xqsettingsmanager.h>
+#include <xqsettingskey.h>
+#include <calnotification.h>
+#include <QGraphicsLayout>
+#include <QPointF>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+#include <QCoreApplication>
+
+// User includes
+#include "contentlayouthandler.h"
+#include "calendarwidgetdebug.h"
+#include "datetimeobserver.h"
+
+// Local constants
+namespace {
+    const HbFrameDrawer::FrameType REMINDER_FRAME_TYPE = HbFrameDrawer::OnePiece;
+    const char *CONTENT_CONTAINER = "contentContainer";
+    const char *UPPER_LABEL_SHORT = "upperLabelShort";
+    const char *UPPER_LABEL_LONG = "upperLabelLong";
+    const char *MIDDLE_LABEL = "middleLabel";
+    const char *LOWER_LABEL = "lowerLabel";
+    const char *REMINDER_ICON_LABEL = "reminderLabel";
+    const char *REMINDER_IMAGE_NAME = "qtg_small_reminder";
+    const char *HIGHLIGHT_IMAGE_NAME = "qtg_fr_hsitems_pressed";
+    //same color applies to upper and middle labels
+    const char *UPPER_LABEL_COLOR = "qtc_hs_list_item_title_normal";
+    const char *LOWER_LABEL_COLOR = "qtc_hs_list_item_content_normal";
+    const char *HIGHLIGHT_LABEL_COLOR = "qtc_hs_list_item_pressed";
+    // time constants
+    const int KHalfHour = 30;
+    const int KSecondInMillisec = 1000;
+    const int KSecondsInMinute = 60;
+    const int KToday = 1;
+    const int KComingDays = 0;
+    const int KDaysInWeek = 7;
+    const int KHourMinuteSeparatorIndex = 1;
+    const int KPassedEventTimeoutSecs = 1800; // Half hour
+    
+    //from DateIconLayoutHandler
+    const HbFrameDrawer::FrameType DATE_ICON_BACKGROUND_FRAME_TYPE = HbFrameDrawer::OnePiece;
+    const char *ICON_CONTAINER = "iconContainer";
+    const char *DATE_ICON_LABEL = "iconLabel";
+    const char *DATE_ICON_DAYNUMBER = "dayNumber";
+    const char *DATE_ICON_MONTHLABEL = "month";
+    const char *DATE_ICON_HIGHLIGHTLABEL = "iconHighlight";
+    const char *NUMBER_LABEL_COLOR = "qtc_hs_cal";
+    const char *MONTH_LABEL_COLOR = "qtc_hs_list_item_title_normal";
+    //const char *HIGHLIGHT_LABEL_COLOR = "qtc_hs_list_item_pressed";
+    const char *DATE_BACKGROUND = "qtg_large_calendar_dynamic";
+    //const char *HIGHLIGHT_IMAGE_NAME = "qtg_fr_hsitems_pressed";
+    
+    //From MainLayoutHandler
+    const char WIDGET[] = "CalendarWidget";
+    const char *BACKGROUND_LABEL = "widgetBackground";
+    const char *SEPARATOR_LABEL = "separatorLabel";
+    const char *SEPARATOR_IMAGE_NAME = "qtg_graf_divider_v_thin";
+    const char *BACKGROUND_IMAGE_NAME = "qtg_fr_hswidget_normal";
+    const HbFrameDrawer::FrameType BACKGROUND_FRAME_TYPE = HbFrameDrawer::NinePieces;
+    const HbFrameDrawer::FrameType SEPARATOR_FRAME_TYPE = HbFrameDrawer::OnePiece;
+}
+
+// ======== MEMBER FUNCTIONS ========
+
+/*
+ * ContentLayoutHandler::ContentLayoutHandler()
+ */
+ContentLayoutHandler::ContentLayoutHandler()
+        : mContainer(0),
+          mReminderLabel(0),
+          mUpperLabelShort(0),
+          mUpperLabelLong(0),
+          mMiddleLabel(0),
+          mLowerLabel(0),
+          mIconContainer(0),
+          mIconLabel(0),
+          mNumberLabel(0),
+          mMonthLabel(0),
+          mHighlightLabel(0),
+          mDateIconFrameDrawer(0),
+          mReminderDrawer(0),
+          mEventTimer(0),
+          mAgendaUtil(0),
+          mCalendarKeyManager(0),
+          mDateHighlightActive(0),
+          mContentHighlightActive(0)
+{
+    LOGS("ContentLayoutHandler::ContentLayoutHandler");
+
+    mCalendarKeyManager = new XQSettingsManager();
+    unsigned long int key = (unsigned long int)ECalPubSubEventNotification;
+    XQSettingsKey calendarKey(XQSettingsKey::TargetPublishAndSubscribe,
+        KCalPubSubCategory.iUid, key);
+    mCalendarKeyManager->startMonitoring(calendarKey);
+    connect(mCalendarKeyManager, SIGNAL(valueChanged(XQSettingsKey, QVariant)),
+        this, SLOT(calendarChanged(XQSettingsKey, QVariant)));
+}
+
+/*
+ * ContentLayoutHandler::~ContentLayoutHandler()
+ */
+ContentLayoutHandler::~ContentLayoutHandler()
+{
+    LOGS("ContentLayoutHandler::~ContentLayoutHandler");
+    unsigned long int key = (unsigned long int)ECalPubSubEventNotification;
+    XQSettingsKey calendarKey(XQSettingsKey::TargetPublishAndSubscribe,
+        KCalPubSubCategory.iUid, key);
+    mCalendarKeyManager->stopMonitoring(calendarKey);
+    delete mCalendarKeyManager;
+}
+
+/*
+ * ContentLayoutHandler::initializeLayout()
+ */
+void ContentLayoutHandler::initializeLayout(const HbDocumentLoader &layoutLoader,
+    QObject *owner)
+{
+    this->setParent(owner);
+    this->setObjectName("contentlayouthandler");
+    
+    //From MainLayoutHandler
+    mWidget = (HbWidget*)layoutLoader.findWidget(WIDGET);
+    mBgLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(BACKGROUND_LABEL));
+    mSeparatorLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(QString(SEPARATOR_LABEL)));
+
+    // Discontinue initialization of the main widget is missing
+    if (!mWidget) {
+        return;
+    }
+
+    addItem(mWidget);
+    mWidget->setVisible(true);
+
+    // Create main background drawer
+    if (mBgLabel) {
+        HbFrameDrawer* backgroundFrameDrawer = new HbFrameDrawer(BACKGROUND_IMAGE_NAME,
+            BACKGROUND_FRAME_TYPE);
+        mBackgroundLayoutItem = new HbFrameItem(backgroundFrameDrawer);
+        mBgLabel->setBackgroundItem(mBackgroundLayoutItem);
+    }
+    
+    // Create separator graphics drawer
+    HbFrameDrawer* separatorFrameDrawer = new HbFrameDrawer(SEPARATOR_IMAGE_NAME,
+        SEPARATOR_FRAME_TYPE);
+    mSeparatorLayoutItem = new HbFrameItem(separatorFrameDrawer);
+    mSeparatorLabel->setBackgroundItem(mSeparatorLayoutItem);
+
+    setPreferredSize(mWidget->preferredSize());
+    //END
+    
+    //From DateIconLayoutHandler
+    mIconContainer = qobject_cast<HbWidget*>(layoutLoader.findWidget(QString(ICON_CONTAINER)));
+    mIconLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(QString(DATE_ICON_LABEL)));
+    mNumberLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(QString(DATE_ICON_DAYNUMBER)));
+    mMonthLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(QString(DATE_ICON_MONTHLABEL)));
+    mHighlightLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(QString(DATE_ICON_HIGHLIGHTLABEL)));
+
+    // Create background drawer only if day container loading succeeded
+    if (mIconLabel) {
+        mDateIconFrameDrawer = new HbFrameDrawer(DATE_BACKGROUND, DATE_ICON_BACKGROUND_FRAME_TYPE);
+        HbFrameItem* dateIconFrameItem = new HbFrameItem(mDateIconFrameDrawer);
+        mIconLabel->setBackgroundItem(dateIconFrameItem);
+    }
+
+    setCalendarIconContent();
+    setLabelsColor();
+
+    // The icon label should never show text
+    if (mIconLabel) {
+        mIconLabel->clear();
+    }
+    if (mHighlightLabel) {
+        mHighlightLabel->clear();
+    }
+
+    
+    mDateObserver = new DateTimeObserver();
+    connect(mDateObserver, SIGNAL(completed()), this, SIGNAL(dateChanged()));
+    connect(this, SIGNAL(dateChanged()), this, SLOT(updateLayout()));
+    //END
+    
+    // Get widget handles
+    mContainer = qobject_cast<HbWidget*>(
+        layoutLoader.findWidget(QString(CONTENT_CONTAINER)));
+    mUpperLabelShort = qobject_cast<HbLabel*>(
+        layoutLoader.findWidget(QString(UPPER_LABEL_SHORT)));
+    mUpperLabelLong = qobject_cast<HbLabel*>(
+        layoutLoader.findWidget(QString(UPPER_LABEL_LONG)));
+    mMiddleLabel = qobject_cast<HbLabel*>(
+        layoutLoader.findWidget(QString(MIDDLE_LABEL)));
+    mLowerLabel = qobject_cast<HbLabel*>(
+        layoutLoader.findWidget(QString(LOWER_LABEL)));
+    mReminderLabel = qobject_cast<HbLabel*>(
+        layoutLoader.findWidget(QString(REMINDER_ICON_LABEL)));
+
+    // Create reminder icon drawer only if reminder label loading succeeded.
+    if (mReminderLabel) {
+        // Make sure there's no text in reminder icon label
+        mReminderLabel->clear();
+        // Create drawer for reminder icon
+        mReminderDrawer = new HbFrameDrawer(REMINDER_IMAGE_NAME,
+            REMINDER_FRAME_TYPE);
+        //ownership transferred
+        HbFrameItem* reminderFrameItem = new HbFrameItem(mReminderDrawer);
+        //ownership transferred
+        mReminderLabel->setBackgroundItem(reminderFrameItem);
+    }
+
+    setLabelsColor();
+    hideLabels();
+    createAgendaUtilsInstance();
+    initializeTimer();
+}
+
+/*
+ * ContentLayoutHandler::calendarChanged()
+ */
+void ContentLayoutHandler::calendarChanged(const XQSettingsKey& key,
+    const QVariant& value)
+{
+    LOGS("ContentLayoutHandler::calendarChanged");
+    Q_UNUSED(key);
+    Q_UNUSED(value);
+    updateLayout();
+}
+
+/*
+ * ContentLayoutHandler::updateLayout()
+ */
+void ContentLayoutHandler::updateLayout()
+{
+    LOGS("ContentLayoutHandler::updateLayout");
+    decorateContent();
+    setTimerForNextUpdate();
+    //From DateIconLayoutHandler
+    setCalendarIconContent();
+}
+
+/*
+ * ContentLayoutHandler::onThemeChange()
+ */
+void ContentLayoutHandler::onThemeChange()
+{
+    LOGS("ContentLayoutHandler::onThemeChange");
+    if (mReminderDrawer) {
+        mReminderDrawer->themeChanged();
+    }
+    
+    if (mDateIconFrameDrawer) {
+        mDateIconFrameDrawer->themeChanged();
+    }
+    
+    if (mBackgroundLayoutItem) {
+        mBackgroundLayoutItem->frameDrawer().themeChanged();
+    }
+    if (mSeparatorLayoutItem) {
+        mSeparatorLayoutItem->frameDrawer().themeChanged();
+    }
+    
+    setLabelsColor();
+}
+
+/*
+ * ContentLayoutHandler::createAgendaUtilsInstance()
+ */
+void ContentLayoutHandler::createAgendaUtilsInstance()
+{
+    LOGS("ContentLayoutHandler::createAgendaUtilsInstance");
+    mAgendaUtil = new AgendaUtil(this);
+    connect(mAgendaUtil, SIGNAL(entryViewCreationCompleted(int)),
+        this, SLOT(updateLayout()));
+}
+
+/*
+ * ContentLayoutHandler::initializeTimer()
+ */
+void ContentLayoutHandler::initializeTimer()
+{
+    LOGS("ContentLayoutHandler::initializeTimer");
+    mEventTimer = new QTimer();
+    mEventTimer->setSingleShot(true);
+    connect(mEventTimer, SIGNAL(timeout()), this, SLOT(eventTimerExpired()));
+    setTimerForNextUpdate();
+}
+
+/*
+ * ContentLayoutHandler::hideLabels()
+ */
+void ContentLayoutHandler::hideLabels()
+{
+    LOGS("ContentLayoutHandler::hideLabels");
+    setLabelVisible(mMiddleLabel, false);
+    setLabelVisible(mUpperLabelShort, false);
+    setLabelVisible(mUpperLabelLong, false);
+    setLabelVisible(mLowerLabel, false);
+    setLabelVisible(mReminderLabel, false);
+}
+
+/*
+ * ContentLayoutHandler::setLabelsColor()
+ */
+void ContentLayoutHandler::setLabelsColor()
+{
+    LOGS("ContentLayoutHandler::setLabelsColor");
+    
+    // --- Content layout ---
+    
+    // Choose text colors according to highlight state
+    QString upperLabelColorAttribute;
+    QString lowerLabelColorAttribute;
+    if (mContentHighlightActive) {
+        upperLabelColorAttribute = HIGHLIGHT_LABEL_COLOR;
+        lowerLabelColorAttribute = HIGHLIGHT_LABEL_COLOR;
+    }
+    else {
+        upperLabelColorAttribute = UPPER_LABEL_COLOR;
+        lowerLabelColorAttribute = LOWER_LABEL_COLOR;
+    }
+    QColor upperLabelTextColor(HbColorScheme::color(upperLabelColorAttribute));
+    QColor lowerLabelTextColor(HbColorScheme::color(lowerLabelColorAttribute));
+    
+    // Set upper and middle label text color
+    if (upperLabelTextColor.isValid()) {
+        if (mUpperLabelShort) {
+            mUpperLabelShort->setTextColor(upperLabelTextColor);
+        }
+        if (mUpperLabelLong) {
+            mUpperLabelLong->setTextColor(upperLabelTextColor);
+        }
+        if (mMiddleLabel) {
+            mMiddleLabel->setTextColor(upperLabelTextColor);
+        }
+    }
+
+    // Set lower label text color
+    if (lowerLabelTextColor.isValid()) {
+        if (mLowerLabel) {
+            mLowerLabel->setTextColor(lowerLabelTextColor);
+        }
+    }
+    
+    // --- DateIconLayoutHandler ---
+    QString numberLabelColorAttribute;
+    QString monthLabelColorAttribute;
+    if (mDateHighlightActive) {
+        numberLabelColorAttribute = NUMBER_LABEL_COLOR;
+        monthLabelColorAttribute = HIGHLIGHT_LABEL_COLOR;
+    }
+    else {
+        numberLabelColorAttribute = NUMBER_LABEL_COLOR;
+        monthLabelColorAttribute = MONTH_LABEL_COLOR;
+    }
+    QColor numberLabelTextColor(HbColorScheme::color(numberLabelColorAttribute));
+    QColor monthLabelTextColor(HbColorScheme::color(monthLabelColorAttribute));
+    
+    // Set day number label text color
+    if (numberLabelTextColor.isValid()) {
+        if (mNumberLabel) {
+            mNumberLabel->setTextColor(numberLabelTextColor);
+        }
+    }
+    // Set month label text color
+    if (monthLabelTextColor.isValid()) {
+        if (mMonthLabel) {
+            mMonthLabel->setTextColor(monthLabelTextColor);
+        }
+    }
+}
+
+/*
+ * ContentLayoutHandler::eventTimerExpired
+ */
+void ContentLayoutHandler::eventTimerExpired()
+{
+    LOGS("ContentLayoutHandler::eventTimerExpired");
+    decorateContent();
+    setTimerForNextUpdate();
+}
+
+/*
+ * ContentLayoutHandler::timeToNextCheck()
+ */
+int ContentLayoutHandler::timeToNextCheck()
+{
+    LOGS("ContentLayoutHandler::timeToNextCheck");
+    QDateTime now = currentDateTime();
+    int secondsToNextCheck = 0;
+    int currentSeconds = 0;
+    currentSeconds = now.toTime_t();
+    int entryStartTimeSeconds = 0;
+    int entryEndTimeSeconds = 0;
+    int indexEntryToCheck = firstEntryIndex();
+
+    QDateTime startTime = mAgendaEntryList.at(indexEntryToCheck).startTime();
+    QDateTime endTime = mAgendaEntryList.at(indexEntryToCheck).endTime();
+    entryStartTimeSeconds = startTime.toTime_t();
+    entryEndTimeSeconds = endTime.toTime_t();
+
+    //check if the event is bigger than half hour
+    if ((entryEndTimeSeconds - entryStartTimeSeconds) < (KHalfHour * KSecondsInMinute)) {
+        secondsToNextCheck = entryEndTimeSeconds - currentSeconds;
+    }
+    else {
+        //check that it's not an all time event.
+        //if it's an all day event there's no need to set the timer because there is already a date check and the widget content
+        //will be updated anyway.
+        if (!isAllDayEvent(mAgendaEntryList.at(indexEntryToCheck))) {
+            secondsToNextCheck = entryStartTimeSeconds + KHalfHour * KSecondsInMinute
+                - currentSeconds;
+        }
+    }
+
+    int mSecsToNextCheck = 0;
+    if (secondsToNextCheck > INT_MAX / KSecondInMillisec) {
+        mSecsToNextCheck = INT_MAX;
+    }
+    else {
+        //seconds to milliseconds
+        mSecsToNextCheck = secondsToNextCheck * KSecondInMillisec;
+    }
+
+    return mSecsToNextCheck;
+}
+
+/*
+ * ContentLayoutHandler::firstEntryIndex()
+ */
+int ContentLayoutHandler::firstEntryIndex()
+{
+    int indexEntryToCheck = 0;
+    LOGS("ContentLayoutHandler::firstEntryIndex()");
+
+    //let's find the first non all day event in the list
+    while (isAllDayEvent(mAgendaEntryList.at(indexEntryToCheck))
+        && (indexEntryToCheck < mAgendaEntryList.count() - 1)) {
+        indexEntryToCheck++;
+    }
+
+    //if we found the first valid non all day event as last in the array then we have to keep that index
+    if ((indexEntryToCheck == mAgendaEntryList.count() - 1)
+        && isAllDayEvent(mAgendaEntryList.at(indexEntryToCheck))) {
+        indexEntryToCheck = 0;
+    }
+
+    return indexEntryToCheck;
+}
+
+/*
+ * ContentLayoutHandler::decorateContent()
+ */
+void ContentLayoutHandler::decorateContent()
+{
+    LOGS("ContentLayoutHandler::decorateContent");
+    updateList();
+
+    if (mAgendaEntryList.count()) {
+        removeTodosFrom();
+        //it removes the events that are shorter than 30 minutes and are already passed
+        removePassedEvents();
+    }
+
+    //there might be only ToDos. Let's check again.
+    if (mAgendaEntryList.count()) {
+        int endEventIndex = 0;
+        if (todayHasValidEvents()) {
+            int numOverlappingEvents = checkOverlappingEvents(0, endEventIndex);
+            if (!numOverlappingEvents) {
+                showNextEvent();
+            }
+            else {
+                showOverlappingEvents(KToday, numOverlappingEvents, endEventIndex);
+            }
+        }
+        else {
+            int numOverlappingEvents = checkOverlappingEvents(0, endEventIndex);
+            if (!numOverlappingEvents) {
+                showNextDaysEvent();
+            }
+            else {
+                showOverlappingEvents(KComingDays, numOverlappingEvents, endEventIndex);
+            }
+        }
+    }
+    else {
+        showNoEventsNextWeek();
+    }
+    
+    QDateTime date;
+    if (mAgendaEntryList.count()) {
+        date = mAgendaEntryList.at(0).startTime();
+    }
+    else {
+        date = QDateTime::currentDateTime();
+    }
+    
+    emit currentDate(date);
+}
+
+/*
+ * ContentLayoutHandler::updateList()
+ */
+void ContentLayoutHandler::updateList()
+{
+    LOGS("ContentLayoutHandler::updateList");
+    
+    // Calculate start of event fetching range
+    QDateTime previousMidnight(currentDateTime().date(), QTime(0, 0));
+    QDateTime passedEventStart(currentDateTime().addSecs(-KPassedEventTimeoutSecs));
+    QDateTime rangeStart;
+    if (previousMidnight < passedEventStart) {
+        rangeStart = previousMidnight;
+    }
+    else {
+        rangeStart = passedEventStart;
+    }
+
+    // Calculate end of event fetching range
+    QDateTime rangeEnd(previousMidnight.addDays(KDaysInWeek+1));
+    
+    // Fetch events
+    mAgendaEntryList = mAgendaUtil->fetchEntriesInRange(rangeStart, rangeEnd);
+    
+    QString agenda_count = "count: "
+        + QString::number(mAgendaEntryList.count(), 10);
+    LOGS(agenda_count);
+    sortList();
+}
+
+/*
+ * ContentLayoutHandler::removePassedEvents()
+ */
+void ContentLayoutHandler::removePassedEvents()
+{
+    LOGS("ContentLayoutHandler::removePassedEvents");
+    for (int i = 0; i < mAgendaEntryList.count(); i++) {
+        //add half hour
+        QDateTime entryStartTime =
+            mAgendaEntryList.at(i).startTime().addSecs(KHalfHour * KSecondsInMinute);
+        LOGS(entryStartTime.toString());
+        LOGS(currentDateTime());
+        //if the entry start time plus half hour is less than current time or it is not but the entry duration is less than half hour (endtime < currenttime)
+        //and the entry is not an all day event then remove it because it is passed.
+        if (((entryStartTime < currentDateTime())
+            || (mAgendaEntryList.at(i).endTime() < currentDateTime()))
+            && !isAllDayEvent(mAgendaEntryList.at(i))) {
+            mAgendaEntryList.removeAt(i);
+            i--;
+        }
+    }
+}
+
+/*
+ * ContentLayoutHandler::currentDateFormat()
+ */
+QString ContentLayoutHandler::currentDateFormat()
+{
+    LOGS("ContentLayoutHandler::currentDateFormat");
+    QString format;
+    HbExtendedLocale locale;
+    switch (locale.dateStyle()) {
+        case HbExtendedLocale::American:
+        case HbExtendedLocale::Japanese:
+            format = QString("MMM dd");
+            break;
+        case HbExtendedLocale::European:
+            format = QString("dd MMM");
+            break;
+        default:
+            format = QString("dd:MM");
+            break;
+    }        
+    return format;
+}
+
+/*
+ * ContentLayoutHandler::currentTimeFormat()
+ */
+QString ContentLayoutHandler::currentTimeFormat()
+{
+    LOGS("ContentLayoutHandler::currentTimeFormat");
+    QString format;
+    HbExtendedLocale locale;
+    QChar separator = locale.timeSeparator(KHourMinuteSeparatorIndex);
+    format = QString("hh") + separator + QString("mm");
+    if (locale.timeStyle() == HbExtendedLocale::Time12) {
+        if (locale.amPmSymbolPosition() == HbExtendedLocale::Before) {
+            if (locale.amPmSpace()) {
+                format.prepend(' ');
+            }
+            format.prepend("ap");
+        }
+        else {
+            if (locale.amPmSpace()) {
+                format.append(' ');
+            }
+            format.append("ap");
+        }    
+    }
+    return format;
+}
+
+/*
+ * ContentLayoutHandler::showNextDaysEvent()
+ */
+void ContentLayoutHandler::showNextDaysEvent()
+{
+    LOGS("ContentLayoutHandler::showNextDaysEvent");
+    setLabelVisible(mMiddleLabel, false);
+    setLabelVisible(mUpperLabelShort, true);
+    setLabelVisible(mLowerLabel, true);
+    QString day = mAgendaEntryList.at(0).startTime().date().toString(currentDateFormat());
+    QString startTime = mAgendaEntryList.at(0).startTime().time().toString(currentTimeFormat());
+    QString endTime = mAgendaEntryList.at(0).endTime().time().toString(currentTimeFormat());
+    QString description = mAgendaEntryList.at(0).summary();
+    if (!isAllDayEvent(mAgendaEntryList.at(0))) {
+        //if not all day event show the start time
+        if (mAgendaEntryList.at(0).startTime().date() == mAgendaEntryList.at(0).endTime().date()) {
+            setLabelText(mUpperLabelShort, day + " " + startTime + " " + description);
+            setLabelText(mLowerLabel, hbTrId("txt_calendar_widget_v_dblist_val_no_events_tod"));
+        }
+        else {
+            //if the end date is different from the starting date show that information
+            setLabelText(mUpperLabelShort, day + " " + startTime + "-"
+                + mAgendaEntryList.at(0).endTime().date().toString(currentDateFormat()) + " "
+                + description);
+            setLabelText(mLowerLabel, hbTrId("txt_calendar_widget_v_dblist_val_no_events_tod"));
+        }
+    }
+    else {
+        // It's an all day event
+        if (isOneDayAllDayEvent(mAgendaEntryList.at(0))) {
+            // It's a one day all day event
+            setLabelText(mUpperLabelShort, day + " " + description);
+            setLabelText(mLowerLabel, hbTrId("txt_calendar_widget_v_dblist_val_no_events_tod"));
+        }
+        else {
+            // It's a multiple day all day event
+            setLabelText(mUpperLabelShort, day + " - "
+                + mAgendaEntryList.at(0).endTime().date().addDays(-1).toString(currentDateFormat()) + " "
+                + description);
+            setLabelText(mLowerLabel, hbTrId("txt_calendar_widget_v_dblist_val_no_events_tod"));
+        }
+    }
+
+    int timeoffset = mAgendaEntryList.at(0).alarm().timeOffset();
+    if (mAgendaEntryList.at(0).alarm().timeOffset()
+        && mAgendaEntryList.at(0).alarm().timeOffset() != -1) {
+        setLabelVisible(mReminderLabel, true);
+    }
+    else {
+        setLabelVisible(mReminderLabel, false);
+    }
+}
+
+/*
+ * ContentLayoutHandler::showOverlappingEvents()
+ */
+void ContentLayoutHandler::showOverlappingEvents(int when, int numOverlappingEvents,
+    int aEndEventIndex)
+{
+    LOGS("ContentLayoutHandler::showOverlappingEvents");
+    if (when == KToday) {
+        setLabelVisible(mMiddleLabel, false);
+        setLabelVisible(mUpperLabelShort, true);
+        setLabelVisible(mLowerLabel, true);
+        QString startTime = mAgendaEntryList.at(0).startTime().time().toString(currentTimeFormat());
+        QString endTime = calculateEndTime(aEndEventIndex);
+        QString day = mAgendaEntryList.at(0).startTime().date().toString(currentDateFormat());
+        if (!isAllDayEvent(mAgendaEntryList.at(0))) {
+            if (mAgendaEntryList.at(0).startTime().date()
+                == mAgendaEntryList.at(aEndEventIndex).endTime().date()) {
+                //if not all day event show the start time and end time
+                setLabelText(mUpperLabelShort, startTime + "-" + endTime);
+                setLowerLabelOverlapping(numOverlappingEvents);
+            }
+            else {
+                setLabelText(mUpperLabelShort, startTime + "-"
+                    + mAgendaEntryList.at(aEndEventIndex).endTime().date().toString(
+                        currentDateFormat()) + " "
+                    + mAgendaEntryList.at(aEndEventIndex).endTime().time().toString(
+                        currentTimeFormat()));
+                setLowerLabelOverlapping(numOverlappingEvents);
+            }
+        }
+        else {
+            // It's an all day event
+            if (isOneDayAllDayEvent(mAgendaEntryList.at(0))) {
+                // It's a one day all day event
+                setLabelText(mUpperLabelShort, day);
+                setLowerLabelOverlapping(numOverlappingEvents);
+            }
+            else {
+                // It's a multiple day all day event
+                setLabelText(mUpperLabelShort, day + " - "
+                    + mAgendaEntryList.at(0).endTime().date().addDays(-1).toString(currentDateFormat()));
+                setLowerLabelOverlapping(numOverlappingEvents);
+            }
+        }
+    }
+    else {
+        setLabelVisible(mMiddleLabel, false);
+        setLabelVisible(mUpperLabelShort, true);
+        setLabelVisible(mLowerLabel, true);
+        QString day = mAgendaEntryList.at(0).startTime().date().toString(currentDateFormat());
+        QString startTime = mAgendaEntryList.at(0).startTime().time().toString(currentTimeFormat());
+        QString endTime = calculateEndTime(aEndEventIndex);
+        if (!isAllDayEvent(mAgendaEntryList.at(0))) {
+            if (mAgendaEntryList.at(0).startTime().date()
+                == mAgendaEntryList.at(aEndEventIndex).endTime().date()) {
+                //if not all day event show the start time and end time
+                setLabelText(mUpperLabelShort, day + " " + startTime + "-" + endTime);
+                setLowerLabelOverlapping(numOverlappingEvents);
+            }
+            else {
+                setLabelText(mUpperLabelShort, day + " " + startTime + "-"
+                    + mAgendaEntryList.at(0).endTime().date().toString(currentDateFormat()));
+                setLowerLabelOverlapping(numOverlappingEvents);
+            }
+        }
+        else {
+            // It's an all day event
+            if (isOneDayAllDayEvent(mAgendaEntryList.at(0))) {
+                // It's a one day all day event
+                setLabelText(mUpperLabelShort, day);
+                setLowerLabelOverlapping(numOverlappingEvents);
+            }
+            else {
+                // It's a multiple day all day event
+                setLabelText(mUpperLabelShort, day + " - "
+                    + mAgendaEntryList.at(0).endTime().date().addDays(-1).toString(currentDateFormat()));
+                setLowerLabelOverlapping(numOverlappingEvents);
+            }
+        }
+    }
+
+    // Never show reminder icon for overlapping events
+    setLabelVisible(mReminderLabel, false);
+}
+
+/*
+ * ContentLayoutHandler::calculateEndTime()
+ */
+QString ContentLayoutHandler::calculateEndTime(int& aEndEventIndex)
+{
+    LOGS("ContentLayoutHandler::calculateEndTime");
+    QDateTime current = mAgendaEntryList.at(0).endTime();
+    int endTimeIndex = 0;
+    for (int i = 0; i < aEndEventIndex + 1; i++) {
+        if (mAgendaEntryList.at(i).endTime() > current) {
+            current = mAgendaEntryList.at(i).endTime();
+            endTimeIndex = i;
+        }
+    }
+
+    aEndEventIndex = endTimeIndex;
+    return current.time().toString(currentTimeFormat());
+}
+
+/*
+ * ContentLayoutHandler::showNextEvent()
+ */
+void ContentLayoutHandler::showNextEvent()
+{
+    LOGS("ContentLayoutHandler::showNextEvent");
+    setLabelVisible(mMiddleLabel, false);
+    setLabelVisible(mUpperLabelShort, true);
+    setLabelVisible(mLowerLabel, true);
+    QString startTime = mAgendaEntryList.at(0).startTime().time().toString(currentTimeFormat());
+    QString endTime = mAgendaEntryList.at(0).endTime().time().toString(currentTimeFormat());
+    QString description = mAgendaEntryList.at(0).summary();
+    if (!isAllDayEvent(mAgendaEntryList.at(0))) {
+        //if not all day event show the start time and end time
+        if (mAgendaEntryList.at(0).startTime().date() == mAgendaEntryList.at(0).endTime().date()) {
+            setLabelText(mUpperLabelShort, startTime + "-" + endTime);
+            setLabelText(mLowerLabel, description);
+        }
+        else {
+            //if the end date is different from the starting date show that information
+            setLabelText(mUpperLabelShort, startTime + "-"
+                + mAgendaEntryList.at(0).endTime().date().toString(currentDateFormat()) + " "
+                + endTime);
+            setLabelText(mLowerLabel, description);
+        }
+    }
+    else {
+        // It's an all day event
+        if (isOneDayAllDayEvent(mAgendaEntryList.at(0))) {
+            // It's a one day all day event
+            setLabelText(mUpperLabelShort,
+                mAgendaEntryList.at(0).startTime().date().toString(currentDateFormat()));
+            setLabelText(mLowerLabel, description);
+        }
+        else {
+            // It's a multiple day all day event
+            setLabelText(mUpperLabelShort,
+                mAgendaEntryList.at(0).startTime().date().toString(currentDateFormat())
+                + " - " + mAgendaEntryList.at(0).endTime().date().addDays(-1).toString(
+                currentDateFormat()));
+            setLabelText(mLowerLabel, description);
+        }
+    }
+
+    //check if reminder is set
+    if (mAgendaEntryList.at(0).alarm().timeOffset()
+        && mAgendaEntryList.at(0).alarm().timeOffset() != -1) {
+        setLabelVisible(mReminderLabel, true);
+    }
+    else {
+        setLabelVisible(mReminderLabel, false);
+    }
+}
+
+/*
+ * ContentLayoutHandler::showNoEventsNextWeek()
+ */
+void ContentLayoutHandler::showNoEventsNextWeek()
+{
+    LOGS("ContentLayoutHandler::showNoEventsNextWeek");
+    setLabelText(mMiddleLabel, hbTrId("txt_calendar_widget_v_dblist_val_no_events_ox"));
+    setLabelVisible(mMiddleLabel, true);
+    setLabelVisible(mUpperLabelShort, false);
+    setLabelVisible(mLowerLabel, false);
+    setLabelVisible(mReminderLabel, false);
+}
+
+/*
+ * ContentLayoutHandler::checkOverlappingEvents()
+ */
+int ContentLayoutHandler::checkOverlappingEvents(ulong id, int& aEndEventIndex)
+{
+    LOGS("ContentLayoutHandler::checkOverlappingEvents");
+    int overlappingEvents = 0;
+    AgendaEntry entry = mAgendaEntryList.at(id);
+    for (int i = id + 1; i < mAgendaEntryList.count(); i++) {
+        if ((entry.startTime() <= mAgendaEntryList.at(i).startTime())
+            && (entry.endTime() >= mAgendaEntryList.at(i).startTime())
+            && entry.startTime().date() == mAgendaEntryList.at(i).startTime().date()) {
+            aEndEventIndex = i;
+            overlappingEvents++;
+        }
+    }
+    if (overlappingEvents) {
+        //if there are overlapping events we have to count one more
+        //because the minumum is two.
+        overlappingEvents++;
+    }
+
+    return overlappingEvents;
+}
+
+/*
+ * ContentLayoutHandler::sortList()
+ */
+void ContentLayoutHandler::sortList()
+{
+    LOGS("ContentLayoutHandler::sortList");
+    for (int i = 0; i < mAgendaEntryList.count() - 1; i++) {
+        for (int j = i + 1; j < mAgendaEntryList.count(); j++) {
+            if (mAgendaEntryList.at(i).startTime() > mAgendaEntryList.at(j).startTime()) {
+                //TODO: Maintain an array of integer ?
+                mAgendaEntryList.swap(i, j);
+            }
+        }
+    }
+}
+
+/*
+ * ContentLayoutHandler::todayHasValidEvents()
+ */
+bool ContentLayoutHandler::todayHasValidEvents()
+{
+    LOGS("ContentLayoutHandler::todayHasValidEvents");
+    QDateTime currentTime = currentDateTime();
+    bool hasValidEvents = false;
+    for (int i = 0; i < mAgendaEntryList.count(); i++) {
+        if ((mAgendaEntryList.at(i).endTime() >= currentTime)
+            && (mAgendaEntryList.at(i).startTime().date() == currentTime.date())) {
+            hasValidEvents = true;
+        }
+    }
+
+    return hasValidEvents;
+}
+
+/*
+ * ContentLayoutHandler::removeTodosFrom()
+ */
+void ContentLayoutHandler::removeTodosFrom()
+{
+    LOGS("ContentLayoutHandler::removeTodosFrom");
+    for (int i = 0; i < mAgendaEntryList.count();) {
+        if ((mAgendaEntryList.at(i).type() == AgendaEntry::TypeTodo)
+            || (mAgendaEntryList.at(i).type() == AgendaEntry::TypeNote)
+            || (mAgendaEntryList.at(i).type() == AgendaEntry::TypeUnknown)) {
+            mAgendaEntryList.removeAt(i);
+        }
+        else {
+            //nothing has been removed. Increment the counter.
+            i++;
+        }
+    }
+}
+
+void ContentLayoutHandler::handleOk(const QVariant& var)
+{
+    Q_UNUSED(var);
+
+    LOGS("ContentLayoutHandler::handleOk");
+    mTestResult = 0;
+    emit requestComplete();
+}
+
+void ContentLayoutHandler::handleError(int err, const QString& str)
+{
+    Q_UNUSED(str);
+
+    LOGS("ContentLayoutHandler::handleError");
+    mTestResult = err;
+    emit requestError();
+}
+
+void ContentLayoutHandler::highlightOn(QPointF &point)
+{
+    // --- Content layout ---
+    
+    if (mContainer) {
+        if (mContainer->sceneBoundingRect().contains(point)) {
+            LOGS("[[[Highlight signal in Content area]]]");
+            if (!mContentHighlightActive) {
+                HbFrameDrawer* highlightDrawer = new HbFrameDrawer(HIGHLIGHT_IMAGE_NAME,
+                    HbFrameDrawer::NinePieces);
+                HbFrameItem* highlightItem = new HbFrameItem(highlightDrawer);
+                mContainer->setBackgroundItem(highlightItem);
+                mContentHighlightActive = true; // must be done before setLabelsColor
+                setLabelsColor();
+                mContainer->update();
+            }
+        }
+    }
+    
+    // --- Date layout ---
+    
+    // TODO Don't highlight if already highlighted
+   
+    if (mIconContainer) {
+        if (mIconContainer->sceneBoundingRect().contains(point)) {
+            LOGS("[[[Highlight signal in dateicon area]]]");
+            if (!mDateHighlightActive) {
+                HbFrameDrawer* highlightDrawer = new HbFrameDrawer(HIGHLIGHT_IMAGE_NAME,
+                    HbFrameDrawer::NinePieces);
+                HbFrameItem* highlightItem = new HbFrameItem(highlightDrawer);
+                if (mHighlightLabel) {
+                    mHighlightLabel->setBackgroundItem(highlightItem);
+                }
+                mDateHighlightActive = true; // must be done before setLabelsColor
+                setLabelsColor();
+                if (mHighlightLabel) {
+                    mHighlightLabel->update();
+                }
+            }
+        }
+    }
+}
+
+void ContentLayoutHandler::highlightOff()
+{
+    // --- Content layout ---
+    
+    if (mContentHighlightActive) {
+        QGraphicsItem* background1 = mContainer->backgroundItem();
+        if (background1) {
+            background1->hide();
+        }
+        mContentHighlightActive = false; // must be done before setLabelsColor
+        setLabelsColor();
+        mContainer->update();
+    }
+    
+    // --- Date layout ---
+    
+    if (mDateIconFrameDrawer) {
+        QGraphicsItem* background2 = mHighlightLabel->backgroundItem();
+        if (background2) {
+            background2->hide();
+        }
+        mDateHighlightActive = false; // must be done before setLabelsColor
+        setLabelsColor();
+        mHighlightLabel->update();
+    }
+}
+
+//TEST FUNCTIONS
+
+/*
+ * ContentLayoutHandler::testId()
+ */
+int ContentLayoutHandler::testId()
+{
+    return mTestID;
+}
+
+/*
+ * ContentLayoutHandler::setTestId()
+ */
+void ContentLayoutHandler::setTestId(int testID)
+{
+    mTestID = testID;
+}
+
+/*
+ * ContentLayoutHandler::testResult()
+ */
+int ContentLayoutHandler::testResult()
+{
+    return mTestResult;
+}
+
+/*
+ * ContentLayoutHandler::setTestResult
+ */
+void ContentLayoutHandler::setTestResult(int testResult)
+{
+    mTestResult = testResult;
+}
+
+/*
+ * ContentLayoutHandler::setTimerForNextUpdate()
+ */
+void ContentLayoutHandler::setTimerForNextUpdate()
+{
+    if (mAgendaEntryList.count()) {
+        int msecsToNextEvent = timeToNextCheck();
+        if (msecsToNextEvent > 0) {
+            mEventTimer->start(msecsToNextEvent);
+        }
+    }
+}
+
+QDateTime ContentLayoutHandler::currentDateTime()
+{
+#ifdef TEST
+    return QDateTime(QDate(2010, 1, 1), QTime(9, 0, 0));
+#else
+    return QDateTime::currentDateTime();
+#endif
+}
+
+void ContentLayoutHandler::setLabelText(HbLabel* label, QString text)
+{
+    if (label) {
+        label->setPlainText(text);
+
+        if (label == mUpperLabelShort) {
+            if (mUpperLabelLong) {
+                mUpperLabelLong->setPlainText(text);
+            }
+        }
+    }
+}
+
+void ContentLayoutHandler::setLabelVisible(HbLabel* label, bool visible)
+{
+    // State transition table
+    //  R = reminder label, L = long upper label, S = short upper label
+    //  rows = current state (label visibility), columns = action
+    //          [hide R]  [show R]  [hide S]  [show S]
+    // 0 (slr)   0 (slr)   1 (slR)   0 (slr)   2 (sLr)
+    // 1 (slR)   0 (slr)   1 (slR)   1 (slR)   5 (SlR)
+    // 2 (sLr)   2 (sLr)   5 (SlR)   0 (slr)   2 (sLr)
+    // 3 (sLR)   2 (sLr)   5 (SlR)   1 (slR)   5 (SlR)
+    // 4 (Slr)   2 (sLr)   5 (SlR)   0 (slr)   2 (sLr)
+    // 5 (SlR)   2 (sLr)   5 (SlR)   1 (slR)   5 (SlR)
+    // 6 (SLr)   2 (sLr)   5 (SlR)   0 (slr)   2 (sLr)
+    // 7 (SLR)   2 (sLr)   5 (SlR)   1 (slR)   5 (SlR)
+    const int stateTransition[] =
+        {0,1,0,2,
+         0,1,1,5,
+         2,5,0,2,
+         2,5,1,5,
+         2,5,0,2, 
+         2,5,1,5,
+         2,5,0,2,
+         2,5,1,5};
+    
+    // Logic for showing correct upper label
+    if (label == mUpperLabelShort || label == mReminderLabel) {
+        // Make sure all three labels exists
+        if (mUpperLabelShort && mUpperLabelLong && mReminderLabel) {
+            int currentState = 0;
+            currentState += (mReminderLabel->isVisible() ? 1 : 0);
+            currentState += (mUpperLabelLong->isVisible()  ? 2 : 0);
+            currentState += (mUpperLabelShort->isVisible() ? 4 : 0);
+
+            int action = -1;
+            if (label == mReminderLabel) {
+                if (visible) {
+                    action = 1;
+                }
+                else {
+                    action = 0;
+                }
+            }
+            else if (label == mUpperLabelShort) {
+                if (visible) {
+                    action = 3;
+                }
+                else {
+                    action = 2;
+                }
+            }
+            
+            int newState = stateTransition[currentState * 4 + action];
+            
+            if (newState != currentState) {
+                mReminderLabel->setVisible(newState & 1);
+                mUpperLabelLong->setVisible(newState & 2);
+                mUpperLabelShort->setVisible(newState & 4);
+            }
+        }
+    }
+    else { // Other labels
+        if (label) {
+            label->setVisible(visible);
+        }
+    }
+}
+
+bool ContentLayoutHandler::isAllDayEvent(AgendaEntry entry)
+{
+    if (entry.startTime().time() == QTime(0, 0)
+        && entry.endTime().time() == QTime(0, 0)
+        && entry.startTime().date() < entry.endTime().date()) {
+        return true;
+    }
+    else {
+        return false;
+    }
+}
+
+bool ContentLayoutHandler::isOneDayAllDayEvent(AgendaEntry entry)
+{
+    if (isAllDayEvent(entry)
+        && entry.startTime().date().addDays(1) == entry.endTime().date()) {
+        return true;
+    }
+    else {
+        return false;
+    }
+}
+
+void ContentLayoutHandler::setLowerLabelOverlapping(int numberOfEvents)
+{
+    QString trString(hbTrId("txt_calendar_widget_v_dblist_val_l1_events"));
+    // TODO: Remove the replacing of the parameter, once localized
+    //       string is corrected.
+    setLabelText(mLowerLabel, trString.replace("%Ln", "%L1").arg(numberOfEvents));
+}
+
+//from DateIconLayoutHandler
+/*
+ * ContentLayoutHandler::setCalendarIconContent()
+ */
+void ContentLayoutHandler::setCalendarIconContent()
+{
+    LOGS("ContentLayoutHandler::setCalendarIconContent");
+    if (mNumberLabel) {
+        mNumberLabel->setPlainText(QString::number(QDateTime::currentDateTime().date().day(), 10));
+    }
+    if (mMonthLabel) {
+        mMonthLabel->setPlainText(QLocale::system().monthName(
+            QDateTime::currentDateTime().date().month()));
+    }
+}
+
+//End of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/dateiconlayouthandler.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,263 @@
+/*
+* 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: Calendar widget's date icon layout handler
+*
+*/
+
+// System includes
+#include <QObject>
+#include <HbLabel>
+#include <HbColorScheme>
+#include <HbFrameDrawer>
+#include <HbFrameItem>
+#include <HbDocumentLoader>
+#include <QDateTime>
+#include <QTimer>
+#include <QPointF>
+#include <QGraphicsLayout>
+#include <xqaiwrequest.h>
+#include <xqappmgr.h>
+
+// User includes
+#include "dateiconlayouthandler.h"
+#include "calendarwidgetdebug.h"
+#include "datetimeobserver.h"
+
+// Local constants
+namespace
+{
+    const HbFrameDrawer::FrameType BACKGROUND_FRAME_TYPE = HbFrameDrawer::OnePiece;
+    const char *DAY_CONTAINER = "dayContainer";
+    const char *DATE_ICON_DAYNUMBER = "dayNumber";
+    const char *DATE_ICON_MONTHLABEL = "month";
+    const char *NUMBER_LABEL_COLOR = "qtc_hs_cal";
+    const char *MONTH_LABEL_COLOR = "qtc_hs_list_item_title_normal";
+    const char *DATE_BACKGROUND = "qtg_large_calendar_dynamic";
+} // namespace 
+
+// ======== MEMBER FUNCTIONS ========
+
+/*
+ * DateIconLayoutHandler::DateIconLayoutHandler()
+ */
+DateIconLayoutHandler::DateIconLayoutHandler()
+        : mWidget(0),
+          mNumberLabel(0),
+          mMonthLabel(0),
+          mFrameDrawer(0),
+          mDateObserver(0)
+{
+    LOGS("DateIconLayoutHandler::DateIconLayoutHandler");
+}
+
+/*
+ * DateIconLayoutHandler::~DateIconLayoutHandler()
+ */
+DateIconLayoutHandler::~DateIconLayoutHandler()
+{
+    LOGS("DateIconLayoutHandler::~DateIconLayoutHandler()");
+    delete mDateObserver;
+}
+
+/*
+ * DateIconLayoutHandler::initializeLayout()
+ */
+void DateIconLayoutHandler::initializeLayout(const HbDocumentLoader &layoutLoader, QObject *owner)
+{
+    this->setParent(owner);
+    mWidget = qobject_cast<HbWidget*>(layoutLoader.findWidget(QString(DAY_CONTAINER)));
+    mNumberLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(QString(DATE_ICON_DAYNUMBER)));
+    mMonthLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(QString(DATE_ICON_MONTHLABEL)));
+
+    // Create background drawer only if day container loading succeeded
+    if (mWidget) {
+        mFrameDrawer = new HbFrameDrawer(DATE_BACKGROUND, BACKGROUND_FRAME_TYPE);
+        HbFrameItem* frameItem = new HbFrameItem(mFrameDrawer);
+        mWidget->setBackgroundItem(frameItem);
+    }
+
+    setCalendarIconContent();
+    setLabelsColor();
+
+    mDateObserver = new DateTimeObserver();
+    connect(mDateObserver, SIGNAL(completed()), this, SIGNAL(dateChanged()));
+    connect(this, SIGNAL( dateChanged() ), owner, SIGNAL( updateLayout() ));
+}
+
+/*
+ * DateIconLayoutHandler::updateLayout()
+ */
+void DateIconLayoutHandler::updateLayout()
+{
+    LOGS("DateIconLayoutHandler::updateLayout");
+    setCalendarIconContent();
+}
+
+/*
+ * DateIconLayoutHandler::onTap()
+ */
+void DateIconLayoutHandler::onTap(QPointF &point)
+{
+    if (mWidget) {
+        if (mWidget->sceneBoundingRect().contains(point)) {
+            LOGS("[[[onTap in DateIcon area]]]");
+            launchCalendarMonthView();
+        }
+    }
+}
+
+/*
+ * DateIconLayoutHandler::onThemeChange()
+ */
+void DateIconLayoutHandler::onThemeChange()
+{
+    LOGS("DateIconLayoutHandler::onThemeChange");
+    if (mFrameDrawer) {
+        mFrameDrawer->themeChanged();
+    }
+    setLabelsColor();
+}
+
+void DateIconLayoutHandler::setLabelsColor()
+{
+    LOGS("CalendarWidget::CalendarWidget");
+    
+    const QString dayLabelColorAttribute(NUMBER_LABEL_COLOR);
+    QColor numberLabelColor(HbColorScheme::color(dayLabelColorAttribute));
+    if (numberLabelColor.isValid() && mNumberLabel) {
+        mNumberLabel->setTextColor(numberLabelColor);
+    }
+    
+    const QString monthLabelColorAttribute(MONTH_LABEL_COLOR);
+    QColor monthLabelColor(HbColorScheme::color(monthLabelColorAttribute));
+    if (monthLabelColor.isValid() && mMonthLabel) {
+        mMonthLabel->setTextColor(monthLabelColor);
+    }
+}
+
+/*
+ * DateIconLayoutHandler::setCalendarIconContent()
+ */
+void DateIconLayoutHandler::setCalendarIconContent()
+{
+    LOGS("DateIconLayoutHandler::setCalendarIconContent");
+    if (mNumberLabel) {
+        mNumberLabel->setPlainText(QString::number(QDateTime::currentDateTime().date().day(), 10));
+    }
+    if (mMonthLabel) {
+        mMonthLabel->setPlainText(QLocale::system().monthName(
+            QDateTime::currentDateTime().date().month()));
+    }
+}
+
+/*
+ * DateIconLayoutHandler::launchCalendarMonthView()
+ */
+void DateIconLayoutHandler::launchCalendarMonthView()
+{
+    LOGS("DateIconLayoutHandler::launchCalendarMonthView");
+
+    QString interface("calendar.Launch");
+    QString service("com.nokia.services");
+    QString method("launchCalendarApp(QDateTime,int)");
+
+    XQApplicationManager aiwMgr;
+    XQAiwRequest* request = aiwMgr.create(service, interface, method, false);
+    if (request == NULL)
+        {
+        return;
+        }
+
+    // Connect result handling signal
+    connect(request, SIGNAL(requestOk(const QVariant&)), this, SLOT(handleOk(const QVariant&)));
+    // Connect error handling signal or apply lastError function instead.
+    connect(request, SIGNAL(requestError(int,const QString&)), this, SLOT(handleError(int,const QString&)));
+
+    QList<QVariant> args;
+    //if there are no elements in the calendar open the current day view
+    QDateTime currentDate = QDateTime::currentDateTime();
+    args << currentDate;
+
+    int viewId = 0;
+    args << viewId;
+
+    // Set function parameters
+    request->setArguments(args);
+
+    // Send the request
+    bool res = request->send();
+    if (!res) {
+        // Request failed.
+        int error = request->lastError();
+        // Handle error
+    }
+
+    // All done.
+    delete request;
+}
+
+/*
+ * DateIconLayoutHandler::handleOk()
+ */
+void DateIconLayoutHandler::handleOk(const QVariant& var)
+{
+    Q_UNUSED(var);
+    LOGS("DateIconLayoutHandler::handleOk");
+    mTestResult = 0;
+    emit requestComplete();
+}
+
+/*
+ * DateIconLayoutHandler::handleError()
+ */
+void DateIconLayoutHandler::handleError(int err, const QString& str)
+{
+    Q_UNUSED(str);
+    LOGS("ContentLayoutHandler::handleError");
+    mTestResult = err;
+    emit requestError();
+}
+
+/*
+ * TEST Functions
+ */
+
+/*
+ * DateIconLayoutHandler::testId()
+ */
+int DateIconLayoutHandler::testId()
+{
+    return mTestID;
+}
+
+/*
+ * DateIconLayoutHandler::setTestId()
+ */
+void DateIconLayoutHandler::setTestId(int testID)
+{
+    mTestID = testID;
+}
+
+int DateIconLayoutHandler::testResult()
+{
+    return mTestResult;
+}
+
+void DateIconLayoutHandler::setTestResult(int testResult)
+{
+    mTestResult = testResult;
+}
+
+//End of file
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/datetimeobserver.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,40 @@
+/*
+* Copyright (c) 2010 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description: Calendar widget datetime observer
+*
+*/
+
+#include "datetimeobserver.h"
+#include "datetimeobserver_p.h"
+#include "calendarwidgetdebug.h"
+
+DateTimeObserver::DateTimeObserver(QObject *parent) :
+    QObject(parent),
+    d_ptr(0)
+{
+    LOGS("DateTimeObserver::DateTimeObserver");
+    d_ptr = new DateTimeObserverPrivate(this);
+}
+
+DateTimeObserver::~DateTimeObserver()
+{
+    LOGS("DateTimeObserver::~DateTimeObserver");
+    delete d_ptr;
+}
+
+void DateTimeObserver::handleCompletion()
+{
+    LOGS("DateTimeObserver::handleCompletion");
+    emit completed();
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/datetimeobserver_p.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,54 @@
+/*
+* 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: Calendar widget datetime observer
+*
+*/
+
+#include "datetimeobserver.h"
+#include "datetimeobserver_p.h"
+#include "calendarwidgetdebug.h"
+
+DateTimeObserverPrivate::DateTimeObserverPrivate(DateTimeObserver *q) :
+    q_ptr(q)
+{
+    LOGS("DateTimeObserverPrivate::DateTimeObserverPrivate");
+    TCallBack callback(LocaleChangeCallback, this);
+    iLocaleNotifier = CEnvironmentChangeNotifier::NewL(CActive::EPriorityStandard, callback);
+    iLocaleNotifier->Start();
+}
+
+DateTimeObserverPrivate::~DateTimeObserverPrivate()
+{
+    LOGS("DateTimeObserverPrivate::~DateTimeObserverPrivate");
+    delete iLocaleNotifier;
+}
+
+TInt DateTimeObserverPrivate::HandleLocaleChange()
+{
+    LOGS("DateTimeObserverPrivate::HandleLocaleChange");
+    TInt handled = 0;
+    if (iLocaleNotifier->Change() & (EChangesSystemTime | EChangesLocale | EChangesMidnightCrossover)) {
+        q_ptr->handleCompletion();
+        handled = 1;
+    }
+
+    return handled;
+}
+
+TInt DateTimeObserverPrivate::LocaleChangeCallback(TAny* aThisPtr)
+{
+    LOGS("DateTimeObserverPrivate::LocaleChangeCallback");
+    TInt ret = static_cast<DateTimeObserverPrivate*>(aThisPtr)->HandleLocaleChange();
+    return ret;
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/mainlayouthandler.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,99 @@
+/*
+* 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: Calendar widget's date icon layout handler
+*
+*/
+
+// System includes
+#include <HbDocumentLoader>
+#include <HbFrameDrawer>
+#include <HbLabel>
+#include <HbWidget>
+#include <HbFrameItem>
+
+// User includes
+#include "mainlayouthandler.h"
+#include "calendarwidgetdebug.h"
+
+// Local constants
+namespace
+	{
+    const char WIDGET[] = "CalendarWidget";
+    const char *SEPARATOR_LABEL = "separatorLabel";
+    const char *SEPARATOR_IMAGE_NAME = "qtg_graf_divider_v_thin";
+    const char *BACKGROUND_IMAGE_NAME = "qtg_fr_hswidget_normal";
+    const HbFrameDrawer::FrameType BACKGROUND_FRAME_TYPE = HbFrameDrawer::NinePieces;
+    const HbFrameDrawer::FrameType SEPARATOR_FRAME_TYPE = HbFrameDrawer::OnePiece;
+	} // namespace 
+
+// ======== MEMBER FUNCTIONS ========
+
+MainLayoutHandler::MainLayoutHandler()
+        : mWidget(0),
+          mSeparatorLabel(0),
+          mIconLayoutItem(0),
+          mBackgroundLayoutItem(0),
+          mSeparatorLayoutItem(0)
+{
+    LOGS("MainLayoutHandler::MainLayoutHandler");
+}
+
+MainLayoutHandler::~MainLayoutHandler()
+{
+    LOGS("MainLayoutHandler::~MainLayoutHandler");
+}
+
+void MainLayoutHandler::initializeLayout(const HbDocumentLoader &layoutLoader, QObject *owner)
+{
+    LOGS("MainLayoutHandler::initializeLayout");
+    setParent(owner);
+
+    mWidget = (HbWidget*)layoutLoader.findWidget(WIDGET);
+    mSeparatorLabel = qobject_cast<HbLabel*>(layoutLoader.findWidget(QString(SEPARATOR_LABEL)));
+
+    // The rest of the initializion is pointless if loading of the main widget fails.
+    if (!mWidget) {
+        return;
+    }
+
+    addItem(mWidget);
+    mWidget->setVisible(true);
+
+    HbFrameDrawer* backgroundFrameDrawer = new HbFrameDrawer(BACKGROUND_IMAGE_NAME,
+        BACKGROUND_FRAME_TYPE);
+    mBackgroundLayoutItem = new HbFrameItem(backgroundFrameDrawer);
+    mWidget->setBackgroundItem(mBackgroundLayoutItem);
+    HbFrameDrawer* separatorFrameDrawer = new HbFrameDrawer(SEPARATOR_IMAGE_NAME,
+        SEPARATOR_FRAME_TYPE);
+    mSeparatorLayoutItem = new HbFrameItem(separatorFrameDrawer);
+    mSeparatorLabel->setBackgroundItem(mSeparatorLayoutItem);
+
+    setPreferredSize(mWidget->preferredSize());
+}
+
+void MainLayoutHandler::updateLayout()
+{
+    LOGS("MainLayoutHandler::updateLayout");
+}
+
+void MainLayoutHandler::onThemeChange()
+{
+    LOGS("MainLayoutHandler::onThemeChange");
+    if (mBackgroundLayoutItem) {
+        mBackgroundLayoutItem->frameDrawer().themeChanged();
+    }
+    if (mSeparatorLayoutItem) {
+        mSeparatorLayoutItem->frameDrawer().themeChanged();
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/src/saxhandler.cpp	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,148 @@
+/*
+* 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: Calendar widget XML reader/parser
+*
+*/
+#include <QObject>
+#include <QMetaMethod>
+#include <HbDocumentLoader>
+#include <HbWidget>
+
+#include "saxhandler.h"
+#include "calendarwidgetdebug.h"
+#include "contentlayoutgesture.h"
+
+SaxHandler::SaxHandler(QObject* caller, HbDocumentLoader &loader) : mLoader(loader)
+{
+    LOGS("SaxHandler::SaxHandler");
+    mCaller = caller;
+    mArgumentValue = false;
+}
+
+SaxHandler::~SaxHandler()
+{
+    LOGS("SaxHandler::~SaxHandler");
+}
+
+bool SaxHandler::startElement(const QString &namespaceURI,
+    const QString &localName,
+    const QString &qName,
+    const QXmlAttributes &attributes)
+{
+    LOGS("SaxHandler::startElement");
+    qDebug() << "namespaceURI: " << namespaceURI << " localName: " << localName << " qName: "
+        << qName;
+    
+    for (int i = 0; i < attributes.length(); i++) {
+        qDebug() << "attribute type: " << attributes.type(i) << " attribute qname: "
+            << attributes.qName(i) << "attribute localname: " << attributes.localName(i)
+            << " attribute value: " << attributes.value(i);
+        
+        if (attributes.qName(i) == "type") {
+            mGestureType = attributes.value(i);
+            mArgumentValue = false;
+        }
+        
+        if (attributes.qName(i) == "layout") {
+            mLayout = attributes.value(i);
+            mArgumentValue = false;
+        }
+        
+        if (attributes.qName(i) == "action") {
+            mAction = attributes.value(i);
+        }
+        
+        if (localName == "argument") {
+            mArgumentValue = true;
+        }
+        
+        if (localName == "parameter") {
+            mParameters.append(attributes.value(i));
+            mArgumentValue = false;
+        }
+    }
+    
+    return true;
+}
+    
+bool SaxHandler::endElement(const QString &namespaceURI,
+    const QString &localName,
+    const QString &qName)
+{
+    LOGS("HsSaxHandler::endElement");
+    qDebug() << "namespaceURI: " << namespaceURI << " localName: " << localName << " qName: "
+        << qName;
+    if (localName == "gesture") {
+        QObject* gesture = mCaller->findChild<QObject*>(mLayout);
+        if (!gesture) {
+            HbWidget* layout = qobject_cast<HbWidget*> (mLoader.findWidget(mLayout));
+            gesture = new ContentLayoutGesture(layout, mParameters, mLayout, mGestureType, mAction,
+                mCaller);
+        }
+        else {
+            int methodIndex = gesture->metaObject()-> indexOfSlot(
+                "addGesture(QList<QString>,QString&,QString&)");
+            if (methodIndex >= 0) {
+                gesture->metaObject()->method(methodIndex).invoke(gesture,
+                    Q_ARG(QList<QString>, mParameters), Q_ARG(QString, mGestureType),
+                    Q_ARG(QString, mAction));
+            }
+        }
+
+        connectObject(gesture);
+        
+        //remove parameters
+        mParameters.clear();
+    }
+    return true;
+}
+    
+bool SaxHandler::characters(const QString &str)
+{
+    LOGS("HsSaxHandler::characters");
+    qDebug() << "characters: " << str;
+    if (mArgumentValue) {
+        mParameters.append(str);
+        mArgumentValue = false;
+        // set mGestureAction
+    }
+    return true;
+}
+    
+bool SaxHandler::fatalError(const QXmlParseException &exception)
+{
+    Q_UNUSED(exception);
+    LOGS("HsSaxHandler::fatalError");
+    return true;
+}
+
+void SaxHandler::connectObject(QObject* object)
+{
+    LOGS("SaxHandler::connectObject");
+    if (mGestureType == "onTap") {
+        QObject::connect(mCaller, SIGNAL(tapGesture(QPointF&)), object, SLOT(onTap(QPointF&)));
+        //connect contentlayouthandler to this gesture object to update the current date
+        QObject* contentLayoutHandler = mCaller->findChild<QObject*> ("contentlayouthandler");
+        if (contentLayoutHandler) {
+            QObject::connect(contentLayoutHandler, SIGNAL(currentDate(QDateTime&)), object,
+                SLOT(updateDate(QDateTime&)));
+        }
+    }
+    
+    if (mGestureType == "onSwipe") {
+        //connect(mCaller, SIGNAL(swipeGesture()), object, SLOT(onSwipe));
+    }
+    
+    //complete with all supported gestures
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/tsrc/matti_testcases/Calendar_widget_tests.rb	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,1193 @@
+#/*
+#* 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: Calendar widget MATTI test cases
+#*
+#*/
+
+# require needed Ruby, MATTI and Orbit files
+require 'test/unit'
+require 'matti'
+require 'date'
+#require 'parsedate'
+#require 'OrbitBehaviours'
+include MobyBase 
+include MobyUtil
+include MattiVerify 
+@@z_index = ""
+
+Parameter.instance.load_parameters_xml(File.expand_path(File.dirname(__FILE__)) + '/testdata/calendar_widget_test_script_parameters.xml') 
+    
+class TestClassCalendarWidget < Test::Unit::TestCase
+    
+
+##  def initialize (args)
+##	super(args)
+##	@sut = MATTI.sut(:Id => 'sut_s60_qt')
+##	#@sut = MATTI.sut(:Id => 's60')
+##	begin		
+##		#check_phone_date
+##		#check_phone_time
+##		#if @sut.application.test_object_exists?("HbTextItem", {:text => 'Continue', :__timeout => 2})
+##		#	@sut.application( :name => 'ftulanguage' ).HbTextItem(:text => 'Continue').tap
+##		#end
+##		#@sut.press_key(:kEnd)
+##		@sut.application( :name => 'qttasserver' ).press_key(:kApp)
+##	rescue Exception => ex
+##		puts "INITIALIZE FAILED. ERROR:"
+##		puts ex.message
+##		puts "*************************"
+##	end
+##  end
+  def initialize (args)
+	super(args)
+	# MANDATORY DEFINITION: Define device "suts" which are used in testing, remember defined [ut] name in matti_parameters.xml
+	@sut = MATTI.sut(:Id => 'sut_s60_qt')
+	#to see if there is some widgets on the screen
+	retry_count = 0
+	begin
+		if @sut.application.test_object_exists?("HbTextItem", {:text => 'Continue', :__timeout => 2})
+			@sut.application( :name => 'ftulanguage' ).HbTextItem(:text => 'Continue').tap
+		end
+		if @@z_index == ""
+			@@z_index = -1
+			begin
+				if @sut.application(:name => 'hsapplication').test_object_exists?("HsDialerWidget", {:__timeout => 2})
+				@@z_index += 1
+				end
+				if @sut.application(:name => 'hsapplication').test_object_exists?("HsClockWidget", {:__timeout => 2})
+				@@z_index += 1
+				end
+				if @sut.application(:name => 'hsapplication').test_object_exists?("FtuHSWidget", {:__timeout => 2})
+				@@z_index += 1
+				end
+			rescue
+				retry
+			end
+		end
+    rescue Exception => ex
+		puts "INITIALIZE FAIL. Lets try again..."
+		if retry_count <= 10
+			retry_count = retry_count +1
+			retry
+		else
+			puts "INITIALIZE FAILED. ERROR:"
+			puts ex.message
+			puts "*************************"
+		end
+	end
+  #@real_phone_number = "02722990"
+  #@widget_name = "Contact widget."
+  #@@contact_array = Array.new() 
+  end 
+  
+  def teardown
+	puts "teardown actions"
+	begin
+		app = @sut.application.executable_name
+		app_name = app.split(".exe")[0].to_s
+		app_name = (app_name == 'tsapplication') ? 'hsapplication' : app_name
+		if @sut.application(:name => app_name).test_object_exists?("HbIconItem", {:iconName => 'qtg_mono_applications_all', :__timeout => 2})
+			navigate_to_first_homescreen
+			if @sut.application(:name => app_name).test_object_exists?("HbWidget",{:name => 'CalendarWidget'}) then
+				remove_calendar_widget_from_homescreen(0)
+			end
+			delete_calendar_events(@sut.application(:name => app_name))
+		else
+			app = @sut.application.executable_name
+			app_name = app.split(".exe")[0].to_s
+			app_name = (app_name == 'tsapplication') ? 'hsapplication' : app_name
+			if @sut.application(:name => app_name).test_object_exists?("HbIconItem", {:iconName => 'qtg_mono_back', :__timeout => 2})
+				@sut.application(:name => app_name).HbIconItem(:iconName => 'qtg_mono_back').tap
+				sleep 2
+			end
+			app = @sut.application.executable_name
+			app_name = app.split(".exe")[0].to_s
+			app_name = (app_name == 'tsapplication') ? 'hsapplication' : app_name
+			if @sut.application(:name => app_name).test_object_exists?("HbTextItem", {:text => 'Close', :__timeout => 2})
+				@sut.application(:name => app_name).HbTextItem(:text => 'Close').tap
+				sleep 1
+			end
+			app = @sut.application.executable_name
+			app_name = app.split(".exe")[0].to_s
+			app_name = (app_name == 'tsapplication') ? 'hsapplication' : app_name
+			if @sut.application(:name => app_name).test_object_exists?("HbIconItem", {:iconName => 'qtg_mono_back', :__timeout => 2})
+				@sut.application(:name => app_name).HbIconItem(:iconName => 'qtg_mono_back').tap
+				sleep 2
+			end
+			app = @sut.application.executable_name
+			app_name = app.split(".exe")[0].to_s
+			app_name = (app_name == 'tsapplication') ? 'hsapplication' : app_name
+			navigate_to_first_homescreen
+			if @sut.application(:name => app_name).test_object_exists?("HbWidget",{:name => 'CalendarWidget'}) then
+				remove_calendar_widget_from_homescreen(0)
+			end
+			delete_calendar_events(@sut.application(:name => app_name))
+		end
+	rescue Exception => ex
+		puts "TEARDOWN FAILED. ERROR:"
+		puts ex.message
+		puts "*************************"
+		begin
+			#did MATTI found wrong application
+			app = @sut.application.executable_name
+			app_name = app.split(".exe")[0].to_s
+			if app_name == 'tsapplication'
+				puts "MATTI get wrong application in UI (" + app_name +"). Start rebooting...!!!!"
+				@sut.reset
+				puts "Reboot is done!!"
+				app_name = @sut.application.executable_name.split(".exe")[0].to_s
+				puts "Application on the screen is " + app_name
+				#lets see that there is not any calendar widget on the homescreen
+				navigate_to_first_homescreen
+				if @sut.application(:name => app_name).test_object_exists?("HbWidget",{:name => 'CalendarWidget'}) then
+					remove_calendar_widget_from_homescreen(0)
+				end
+				delete_calendar_events(@sut.application(:name => app_name))
+			end
+		rescue Exception => e
+			puts "TEARDOWN BEGIN-RESCUE FAILED. ERROR:"
+			puts e.message
+			puts "*************************"
+		end
+	end		
+	#begin
+	#	navigate_to_first_homescreen
+	#	if @sut.application(:name => 'hsapplication').test_object_exists?("HbWidget",{:name => 'CalendarWidget'}) then
+	#		remove_calendar_widget_from_homescreen
+	#	end
+	#rescue
+	#end 
+	#delete_calendar_events(@sut.application(:name => 'hsapplication'))
+  end # teardown
+  
+  def add_calendar_widget_to_homescreen(app, browse_to_list)
+	#selects calendar widget from applications-menu and adds it to home screen
+	#Lets calculate, how many application list items there is seen
+
+	identificator = TestObjectIdentificator.new(:type => :HsListViewItem)
+	xml =  app.HbListView( :name => 'allAppsListView' ).xml_data 
+	element_set = xml.xpath( xpath = identificator.get_xpath_to_identify( xml ) ) 
+	item_count = element_set.size
+	#puts "item_count = ",item_count
+	item_index = 4
+	#lets check if calendar widget is visible on display. If not, we flick until we get it visible
+	while item_index < item_count
+		if app.test_object_exists?("HbTextItem",{:text => 'CalendarWidget',:visibleOnScreen => 'true'}) then
+			#app.HbTextItem(:__index => item_index-1).tap_down
+			#app.HbTextItem(:__index => item_index-1).flick(:Up)
+			#app.HbListViewItem(:text => 'Bedrock').gesture(:Up,1,450,:Left,true)
+			if browse_to_list == 'longpressHS' then
+				app.HbTextItem(:text => 'CalendarWidget').tap
+			else
+				app.HbTextItem(:text => 'CalendarWidget').tap
+				app.HbTextItem( :text => 'Add to Home screen' ).tap
+				app.HbIconItem(:iconName => 'qtg_mono_back').tap
+			end
+			break
+		else
+			#app.HbTextItem(:__index => item_index-1).tap_down
+			#app.HbListViewItem(:__index => item_index-1).flick(:Up)
+			app.HsListViewItem(:__index => item_index-1).gesture(:Up,1,550,{:Left,true})
+		end
+		item_index +=2
+		if item_index >= item_count then
+			identificator = TestObjectIdentificator.new(:type => :HsListViewItem) 
+			xml =  app.HbListView(:__index => 0).xml_data 
+			element_set = xml.xpath( xpath = identificator.get_xpath_to_identify( xml ) ) 
+			item_count = element_set.size
+			#puts "item_count = ",item_count
+			item_index = 4
+		end
+	end
+
+	if browse_to_list != 'longpressHS' then
+		app.HbIconItem(:iconName => 'qtg_mono_back').tap
+	end
+	#verify, that there exists calendar widget in homescreen
+	#verify(){app.HbWidget( :name => 'CalendarWidget' )}
+  end
+  
+    ########################################################################################################################################
+	#
+	#	remove_calendar_widget_from_homescreen
+	#
+	#	description:
+	#		This function emoves calendar widget from homescreen
+	#
+	#	preconditions: 
+	#		-Phone is in homescreen and there is calendar widget in HS
+	#	parameters:
+	#		hs_pagenumber:	Number of the homescreen page (0, 1 or 2)
+	#
+	#	created: Jarno Mäkelä
+	#	creation date: 17-May-2010
+	#
+	########################################################################################################################################
+	
+  def remove_calendar_widget_from_homescreen(hs_pagenumber)
+	app = @sut.application(:name => 'hsapplication')
+	#verify(){@sut.application.HbIconItem(:iconName => 'hs_applib_button.png')}
+	#verify(){app.HbWidget( :name => 'CalendarWidget' )}
+	#find correct widget host object
+	calendar_widget_object = app.HsPage(:__index => hs_pagenumber).find(:name => 'CalendarWidget')
+	#app.HsPage(:__index => hs_pagenumber).HsWidgetHost.HsCalendarWidget.HbWidget( :name => 'CalendarWidget' ).tap_down
+	calendar_widget_object.tap_down
+	#app.HbWidget( :name => 'controlLayer' ).HsWidgetHost.HbWidget( :name => 'CalendarWidget' ).tap_down
+	#app.HbWidget( :name => 'controlLayer' ).HsWidgetHost.HbWidget( :name => 'CalendarWidget' ).drag_to_object(app.HsTrashBinWidget( :name => 'trashBin' ))
+	calendar_widget_object = app.HbWidget( :name => 'controlLayer' ).find(:name => 'CalendarWidget')
+	calendar_widget_object.drag_to_object(app.HsTrashBinWidget( :name => 'trashBin' ))
+  end
+  
+    ########################################################################################################################################
+	#
+	#	create_calendar_event
+	#
+	#	description:
+	#		This function creates calendar event via fixture  
+	#
+	#	preconditions: 
+	#
+	#	parameters:
+	#		-subject:			subject of the meeting
+	#		-start_day:	    	start day of the meeting
+	#		-start_month:		start month of the meeting
+	#		-start_year:		start year of the meeting
+	#		-start_hour:		start hour of the meeting
+	#		-start_minute:		start minute of the meeting
+	#		-duration_days: 	duration of the days, that meeting is lasting
+	#		-duration_hours:	duration of the hours, that meeting is lasting
+	#		-duration_minutes:	duration of the minutes, that meeting is lasting
+	#
+	#	return value:
+	#		-time_to_verify:	time, that is supposed to be in the calendar widget (Format: hh:mm-hh:mm or hh:mm (am/pm)-hh:mm (am/pm))
+	#
+	#	created: Jarno Mäkelä
+	#	creation date: 17-May-2010
+	#
+	########################################################################################################################################
+	
+  def create_calendar_event(app, subject,start_day, start_month, start_year, start_hour, start_minute, duration_days, duration_hours, duration_minutes)
+	#Creates calendar event
+	#let's calculate the real values of start date. In parameters, eg. the day value can exceed 31, so we need to change month and set day
+	#to 1. Same calculation needed for other parameter values
+	start_date = calculate_date(start_day, start_month, start_year, start_hour, start_minute)
+	puts "start_date:",start_date.to_s
+	start_time_split = (start_date.to_s).split
+	start_time = start_time_split[1]
+	start_time_to_verify = start_time[0..4]
+	puts "start_time_to_verify:",start_time_to_verify
+	end_date = calculate_date(start_day+duration_days, start_month, start_year, start_hour+duration_hours, start_minute+duration_minutes)
+	puts "end_date:",end_date.to_s
+	end_time_split = (end_date.to_s).split
+	end_time = end_time_split[1]
+	end_time_to_verify = end_time[0..4]
+	puts "end_time_to_verify:",end_time_to_verify
+	if @hourformat_12 == true then
+		#12 hour time used
+		time_to_verify = convert_time_to_12hour_format(start_time_to_verify)+'-'+convert_time_to_12hour_format(end_time_to_verify)
+	else
+		#24 hour time used
+		time_to_verify = start_time_to_verify+'-'+end_time_to_verify
+	end
+	tmp_id = app.id
+	tmp = @sut.execution_order
+	@sut.execution_order = ['S60']
+	app.apply_behaviour!( :name => 'S60Fixture' )
+	app.set_application_id(app.attribute('applicationUid'));
+	response = app.fixture('tapi_calendar_fixture', 'add_meeting', {:description =>  subject, :start_date => start_date, :end_date => end_date})
+	@sut.execution_order = tmp
+	app.apply_behaviour!( :name => 'QtFixture' ) 
+	app.set_application_id(tmp_id)
+	response
+	#let's put date if event is in other future day than today
+	if start_day > @day.to_i then
+	   start_date = start_time_split[0]
+	   month_text = case start_date[3..4]
+			when "01" then "Jan"
+			when "02" then "Feb"
+			when "03" then "Mar"
+			when "04" then "Apr"
+			when "05" then "May"
+			when "06" then "Jun"
+			when "07" then "Jul"
+			when "08" then "Aug"
+			when "09" then "Sep"
+			when "10" then "Oct"
+			when "11" then "Nov"
+			when "12" then "Dec"
+		end
+		puts "time_to_verify:", start_date[0..1]+' '+month_text+' '+time_to_verify
+		return start_date[0..1]+' '+month_text+' '+time_to_verify
+	else
+		puts "time_to_verify:", time_to_verify
+		return time_to_verify
+	end
+	#sut = MATTI.sut(:Id => 's60')
+	#app = sut.run(:name => "HtiAdmin.exe")
+	#app.fixture('tapi_calendar_fixture', 'add_meeting', {:description =>  subject, :start_date => '17-05-2010 15:00:00', :end_date => '17-05-2010 16:00:00'})
+	#app.fixture('tapi_calendar_fixture', 'add_meeting', {:description =>  subject, :start_date => start_date, :end_date => end_date})
+	#app.close()
+  end
+  
+    ########################################################################################################################################
+	#
+	#	convert_time_to_12hour_format
+	#
+	#	description:
+	#		This function converts 24 hour time to 12 hour time format
+	#
+	#	preconditions: 
+	#
+	#	parameters:
+	#		-conv_timestr:				time string that is needed to convert
+	#
+	#	return value:
+	#		correctly converted time string
+	#
+	#	created: Jarno Mäkelä
+	#	creation date: 25-May-2010
+	#
+	########################################################################################################################################
+	
+  def convert_time_to_12hour_format(conv_timestr)
+	#let's first check the hour
+	hour = conv_timestr[0..1].to_i
+	#puts "hour:", hour
+	if hour >= 12 then
+		if hour == 12 then
+			return hour.to_s+':'+conv_timestr[3..4]+' pm'
+		else
+			hour = hour -12
+			if hour < 10 then
+				return '0'+hour.to_s+':'+conv_timestr[3..4]+' pm'
+			else
+				return hour.to_s+':'+conv_timestr[3..4]+' pm'
+			end
+		end
+	else
+		if hour == 0 then
+			hour = 12
+			return hour.to_s+':'+conv_timestr[3..4]+' am'
+		elsif hour < 10 then
+			return '0'+hour.to_s+':'+conv_timestr[3..4]+' am'
+		else
+			return hour.to_s+':'+conv_timestr[3..4]+' am'
+		end
+	end
+  end
+  
+    ########################################################################################################################################
+	#
+	#	delete_calendar_events
+	#
+	#	description:
+	#		This function deletes all calendar events via fixture  
+	#
+	#	preconditions: 
+	#
+	#	parameters:
+	#		-app:				application needed
+	#
+	#	created: Jarno Mäkelä
+	#	creation date: 19-May-2010
+	#
+	########################################################################################################################################
+	
+  def delete_calendar_events(app)
+	tmp_id = app.id
+	tmp = @sut.execution_order
+	@sut.execution_order = ['S60']
+	app.apply_behaviour!( :name => 'S60Fixture' )
+	app.set_application_id(app.attribute('applicationUid'));
+	response = app.fixture('tapi_calendar_fixture', 'delete_all', {})
+	@sut.execution_order = tmp
+	app.apply_behaviour!( :name => 'QtFixture' ) 
+	app.set_application_id(tmp_id)
+	response
+  end
+  
+  def create_calendar_event_via_calendar(subject)
+	#Creates calendar event
+	cal_app = @sut.run(:name => "calendar.exe")
+	cal_app.HbIconItem(:iconName => 'qtg_mono_options_menu').tap
+	cal_app.HbTextItem(:text => 'New event')
+	#Add the subject
+	cal_app.HbDataFormViewItem(:__index =>0).HbWidget.tap
+	cal_app.HbDataFormViewItem(:__index =>0).HbWidget.type_text(subject)
+	cal_app.HbTextItem(:text => 'Subject').tap
+	#Add start time
+	cal_app.CalenEditorCustomItem(:__index=>0).HbWidget.HbPushButton(:__index=>0).tap
+	
+  end
+  
+    ########################################################################################################################################
+	#
+	#	check_phone_date
+	#
+	#	description:
+	#		This function checks the date of phone 
+	#
+	#	preconditions: 
+	#
+	#	parameters:
+	#		
+	#
+	#	created: Jarno Mäkelä
+	#	creation date: 18-May-2010
+	#
+	########################################################################################################################################
+	
+  def check_phone_date
+	#Temporarily lets assume, that phone date is same as current real time, since clock application crashes in phone
+	clock_app = @sut.run(:name => "clock.exe")
+	date = clock_app.HbLabel( :name => 'dateLabel' ).HbTextItem.attribute("text")
+	#date = Time.now
+	puts "date is: ",date
+	#parse day,month and year
+	@day = date[4..5]
+	#@day = (date.day).to_s
+	#if @day.to_i < 10 then
+		#@day = '0'+ (date.day).to_s
+	#end
+	puts "day:", @day
+	@month = date[7..8]
+	#@month = (date.month).to_s
+	#if @month.to_i < 10 then
+	#	@month = '0'+ (date.month).to_s
+	#end
+	puts "month:", @month
+	@year = date[10..13]
+	#@year = (date.year).to_s
+	puts "year:",@year
+	clock_app.close
+  end
+  
+    ########################################################################################################################################
+	#
+	#	check_phone_time
+	#
+	#	description:
+	#		This function checks the time of phone 
+	#
+	#	preconditions: 
+	#
+	#	parameters:
+	#		
+	#
+	#	created: Jarno Mäkelä
+	#	creation date: 18-May-2010
+	#
+	########################################################################################################################################
+	
+  def check_phone_time
+	app = @sut.application(:name => 'hsapplication')
+	time = app.HbStatusBar.HbTextItem.attribute("text")
+	puts "time is: ",time
+	#parse hour and minute
+	@hour = time[0..1]
+	temp_hour = @hour.to_i
+	if time.index('pm') != nil
+		if temp_hour != 12 then
+			temp_hour = temp_hour +12
+		end
+	end
+	if time.index('am') != nil || time.index('pm') != nil then
+		@hourformat_12 = true
+	else
+		@hourformat_12 = false
+	end
+	@hour = temp_hour.to_s
+	puts "hour:", @hour
+	@minute = time[3..4]
+	puts "minute:", @minute
+  end
+  
+    ########################################################################################################################################
+	#
+	#	calculate_date
+	#
+	#	description:
+	#		This function calculates the correct date from unchecked date values
+	#
+	#	preconditions: 
+	#
+	#	parameters:
+	#		-day: 		unhandled day value
+	#		-month:		unhandled month value
+	#		-year: 		unhandled year value
+	#		-hour: 		unhandled hour value
+	#		-minute: 	unhandled minute value
+	#
+	#	return value:
+	#		handled date string in fixture needed format (dd-mm-yyyy hh:mm:00)
+	#
+	#	created: Jarno Mäkelä
+	#	creation date: 18-May-2010
+	#
+	########################################################################################################################################
+	
+  def calculate_date(day, month, year, hour, minute)
+	#let's check the minute
+	if(minute >=60) then
+		minute = minute - 60
+		hour= hour +1
+	end
+	if(hour >=24) then
+		hour = hour - 24
+		day = day +1
+	end
+	if(day > 31) then
+		if(month == 1)||(month == 3)||(month == 5)||(month == 7)||(month == 8)||(month == 10)||(month == 12) then
+			month = month +1
+			day = day - 31
+		elsif(month == 4)||(month == 6)||(month == 9)||(month == 11) then
+			month = month +1
+			day = day - 30
+		elsif(month == 2) then
+			if ( year % 100 != 0 && year % 4 == 0 || year % 400 == 0 ) then
+				month = month +1
+				day = day -29
+			else
+				month = month +1
+				day = day - 28
+			end
+		end
+	end
+	if(month > 12) then
+		month = month - 12
+		year = year +1
+	end
+	if(day <10) then
+		returnday = '0'+day.to_s
+	else
+		returnday = day.to_s
+	end
+	if(month < 10) then
+		returnmonth = '0' + month.to_s
+	else
+		returnmonth = month.to_s
+	end
+	if(minute < 10) then
+		returnminute = '0'+minute.to_s
+	else
+		returnminute = minute.to_s
+	end
+	if(hour < 10) then
+		returnhour = '0'+hour.to_s
+	else
+		returnhour = hour.to_s
+	end
+	
+	return returnday,'-',returnmonth,'-',year.to_s,' ',returnhour,':',returnminute,':00'
+	
+  end
+  
+    ########################################################################################################################################
+	#
+	#	navigate_to_first_homescreen
+	#
+	#	description:
+	#		This function goes to first homescreen page from anywhere of homescreen pages
+	#
+	#	preconditions: 
+	#		-Phone is in homescreen
+	#	parameters:
+	#		None
+	#
+	#	created: Jarno Mäkelä
+	#	creation date: 02-Jun-2010
+	#
+	########################################################################################################################################
+	
+  def navigate_to_first_homescreen
+	app = @sut.application(:name => 'hsapplication')
+	if app.HsPageIndicatorItem(:__index =>0).test_object_exists?("HbIconItem",{:iconName => 'qtg_graf_hspage_highlight'}) then
+		page = 1
+	elsif app.HsPageIndicatorItem(:__index =>1).test_object_exists?("HbIconItem",{:iconName => 'qtg_graf_hspage_highlight'}) then
+		page = 2
+		app.HsPageIndicatorItem(:__index =>1).gesture(:Right,1,170)
+		if app.HsPageIndicatorItem(:__index =>0).test_object_exists?("HbIconItem",{:iconName => 'qtg_graf_hspage_highlight'}) then
+			page = 1
+		else
+			raise VerificationError ,"ERROR: Cannot go to first home screen", caller
+		end
+	else
+		page = 3
+		app.HsPageIndicatorItem(:__index =>1).gesture(:Right,1,170)
+		sleep 1
+		app.HsPageIndicatorItem(:__index =>1).gesture(:Right,1,170)
+		if app.HsPageIndicatorItem(:__index =>0).test_object_exists?("HbIconItem",{:iconName => 'qtg_graf_hspage_highlight'}) then
+			page = 1
+		else
+			raise VerificationError ,"ERROR: Cannot go to first home screen", caller
+		end
+	end
+  end
+################################################################################################################################################
+###
+###						BAT cases start
+###
+################################################################################################################################################
+  
+  ##############################################################################################################################################
+  # Calendar widget - Load-Unload widget in HomeScreen 
+  ##############################################################################################################################################
+  #
+  # Purpose of the test is to check, that calendar widget can be load to Homescreen and unload from Homescreen
+  #
+  #	Created at: 17.05.2010
+  #	Created by: Jarno Mäkelä
+  #	Reviewed by: 
+  #
+  #	===	preconditions
+  #	- Device is in Home Screen
+  # - Some events in Calendar.
+  #
+  #	===	params
+  #	none
+  #
+  ############################################################################################################################################
+  
+  def _test_calendar_widget_load_unload_widget_in_HomeScreen
+	#running_round = 1
+	#max_running_rounds = 2
+	#begin
+		#Preconditions:
+		#Device is in Homescreen
+		app = @sut.application(:name => 'hsapplication')
+		navigate_to_first_homescreen
+		verify(){app.HbIconItem(:iconName => 'qtg_mono_applications_all')}
+		#Some events in calendar
+		check_phone_date
+		check_phone_time
+		create_calendar_event(app, 'Meeting 1',@day.to_i+1,@month.to_i,@year.to_i,@hour.to_i+1,@minute.to_i,0,1,0)
+		create_calendar_event(app, 'Meeting 2',@day.to_i+2,@month.to_i,@year.to_i,@hour.to_i-2,@minute.to_i,0,1,0)
+		#Step 1:Tap application list button in the upper right corner of Home Screen
+		app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+		#step 2: Select 'add to homescreen' by longpressing 'Calendar Widget' in the catalog list
+		add_calendar_widget_to_homescreen(app,'AppListButton')
+		#step 2 expected: Calendar widget is added to Home Screen.
+		day_to_verify = @day.to_i
+		#puts "day_to_verify =", day_to_verify
+		verify(){app.HbTextItem(:text => day_to_verify)}
+		#Calendar widget content contains "No event for next 7 days"
+		#verify(){app.HbTextItem(:text => 'No events for next 7 days')}
+		#Verify, that reminder icon in widget is not shown
+		#if not(app.test_object_exists?("HbIconItem",{:iconName => 'images/bell.PNG'})) then
+		#	raise VerificationError ,"ERROR: There is not reminder icon in calendar widget, when it should be there", caller
+		#end
+		#Step 3 and Step4:Remove calendar widget from display
+		remove_calendar_widget_from_homescreen(0)
+		delete_calendar_events(app)
+	#rescue
+	#	if (running_round < max_running_rounds) then
+    #       running_round = running_round + 1
+    #        puts "Some error came during run. Lets try again"
+    #        teardown
+	#		retry
+    #    else
+    #        puts "Test failed"
+    #        raise
+    #    end
+	#end #rescue	
+  end
+  
+  ##############################################################################################################################################
+  # Calendar widget - One all day event and one other timed event overlapping 
+  ##############################################################################################################################################
+  #
+  # Purpose of this test case ist to verify that "overlapping events" information will be shown on widget, when there is one all day event and 
+  # one timed event overlapping. Also when removing timed event, only all dau event is shown in calendar widget
+  #
+  #	Created at: 17.05.2010
+  #	Created by: Jarno Mäkelä
+  #	Reviewed by: 
+  #
+  #	===	preconditions
+  #	- Device is in Home Screen.
+  # - Calendar widget is added to Home Screen.
+  # - One all day event and one timed event happens few hours after current phone time at today in Calendar.
+  #
+  #	===	params
+  #	none
+  #
+  ############################################################################################################################################
+  
+  def _test_calendar_widget_one_all_day_event_and_one_other_timed_event_overlapping
+	
+  end
+  
+  ##############################################################################################################################################
+  # Calendar widget - one event today, one event tomorrow 
+  ##############################################################################################################################################
+  #
+  # Purpose of the test is to check, that when there is one event today and one event tomorrow, calendar widget shows only the today's event.
+  #
+  #	Created at: 17.05.2010
+  #	Created by: Jarno Mäkelä
+  #	Reviewed by: 
+  #
+  #	===	preconditions
+  #	- Device is in Home Screen.
+  # - Calendar widget is added to Home Screen.
+  # - One event happens few hours after current phone time at today and one event at tomorrow in Calendar.
+  #
+  #	===	params
+  #	none
+  #
+  ############################################################################################################################################
+  
+  def _test_calendar_widget_one_event_today_one_event_tomorrow
+	#running_round = 1
+	#max_running_rounds = 2
+	#begin
+		#Preconditions:
+		#Device is in Homescreen
+		app = @sut.application(:name => 'hsapplication')
+		verify(){app.HbIconItem(:iconName => 'qtg_mono_applications_all')}
+		navigate_to_first_homescreen
+		#- One event happens few hours after current phone time at today and one event at tomorrow in Calendar.
+		check_phone_date
+		check_phone_time
+		today_time_for_verification = create_calendar_event(app, 'Today meeting',@day.to_i,@month.to_i,@year.to_i,@hour.to_i+3,@minute.to_i,0,1,0)
+		tomorrow_time_for_verification = create_calendar_event(app, 'Tomorrow meeting',@day.to_i+1,@month.to_i,@year.to_i,@hour.to_i,@minute.to_i,0,1,0)
+		#-Calendar widget is added to Home Screen.
+		#Not adding calendar widget, if it already exists there
+		if not(app.test_object_exists?("HbWidget",{:name => 'CalendarWidget'})) then
+			#add calendar widget to home screen
+			app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+			add_calendar_widget_to_homescreen(app,'AppListButton')
+		end
+		#Step 1:Check Calendar widget.
+		#app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+		#step 1 Expected: - All icons (widget icon and reminder icon) are shown correctly.
+		#- Only today event is shown in widget as two rows: first row shows the event time and second row shows the event title.
+		day_to_verify = @day.to_i
+		verify(){app.HbTextItem(:text => day_to_verify)}
+		verify(){app.HbLabel( :name => 'upperLabel' ).HbTextItem( :text => today_time_for_verification )}
+		verify(){app.HbLabel( :name => 'lowerLabel' ).HbTextItem( :text => 'Today meeting' )}
+		#Verify, that reminder icon in widget is shown
+		#cannot verify yet, since with calendar fixture only events, that has no reminder, are possible to create
+		#if not(app.test_object_exists?("HbIconItem",{:iconName => 'images/bell.PNG'})) then
+		#	raise VerificationError ,"ERROR: There is not reminder icon in calendar widget, when it should be there", caller
+		#end
+		
+		remove_calendar_widget_from_homescreen(0)
+		delete_calendar_events(app)
+	#rescue
+	#	if (running_round < max_running_rounds) then
+    #       running_round = running_round + 1
+    #       puts "Some error came during run. Lets try again"
+    #       teardown
+	#       retry
+    #    else
+    #       puts "Test failed"
+    #       raise
+    #    end
+	#end #rescue	
+  end
+  
+  ##############################################################################################################################################
+  # Calendar widget - Overlapping events
+  ##############################################################################################################################################
+  #
+  # Purpose of the test is to check, that when there are overlapping events, there comes information about that in calendar widget and 
+  # when tapping the events, phone goes to calendar agenda view.
+  #
+  #	Created at: 17.05.2010
+  #	Created by: Jarno Mäkelä
+  #	Reviewed by: 
+  #
+  #	===	preconditions
+  #	- Device is in Home Screen.
+  # - Calendar widget is added to Home Screen.
+  # - One event happens few hours after current phone time at today in Calendar.
+  #
+  #	===	params
+  #	none
+  #
+  ############################################################################################################################################
+  
+  def _test_calendar_widget_overlapping_events
+	running_round = 1
+	max_running_rounds = 2
+	begin
+		#Preconditions:
+		#Device is in Homescreen
+		app = @sut.application(:name => 'hsapplication')
+		verify(){app.HbIconItem(:iconName => 'qtg_mono_applications_all')}
+		navigate_to_first_homescreen
+		#- One event happens few hours after current phone time at today in Calendar.
+		check_phone_date
+		check_phone_time
+		today_time_for_verification = create_calendar_event(app, 'Today meeting',@day.to_i,@month.to_i,@year.to_i,@hour.to_i+3,@minute.to_i,0,1,0)
+		#-Calendar widget is added to Home Screen.
+		#Not adding calendar widget, if it already exists there
+		if not(app.test_object_exists?("HbWidget",{:name => 'CalendarWidget'})) then
+			#add calendar widget to home screen
+			app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+			add_calendar_widget_to_homescreen(app,'AppListButton')
+		end
+		#Step 1:Check Calendar widget.
+		#step 1 Expected: - All icons (widget icon and reminder icon) are shown correctly.
+		#- Calendar widget shows the event as two rows: first row show the event time and second row shows the event title.
+		day_to_verify = @day.to_i
+		verify(){app.HbTextItem(:text => day_to_verify)}
+		verify(){app.HbLabel( :name => 'upperLabel' ).HbTextItem( :text => today_time_for_verification )}
+		verify(){app.HbLabel( :name => 'lowerLabel' ).HbTextItem( :text => 'Today meeting' )}
+		#Verify, that reminder icon in widget is shown
+		#if not(app.test_object_exists?("HbIconItem",{:iconName => 'images/bell.PNG'})) then
+		#	raise VerificationError ,"ERROR: There is not reminder icon in calendar widget, when it should be there", caller
+		#end
+		
+		#Step 2:Create another event overlapping the first event in Calendar.
+		another_time_for_verification = create_calendar_event(app, 'Another today meeting',@day.to_i,@month.to_i,@year.to_i,@hour.to_i+3,@minute.to_i+15,0,1,0)
+		#Step 3:Return to Home Screen and check Calendar widget.
+		#Step 3 Expected: - All icons (widget icon and reminder icon) are shown correctly.
+		#- Calendar widget shows the overlapping information as two rows: first row shows overlapping time and second row shows  text 
+		#'2 events overlapping'.
+		if @hourformat_12 == true then
+			overlapping_time_for_verification = today_time_for_verification[0..7]+'-'+another_time_for_verification[9..16]
+		else
+			overlapping_time_for_verification = today_time_for_verification[0..4]+'-'+another_time_for_verification[6..10]
+		end
+		puts "overlapping_time_for_verification: ",overlapping_time_for_verification
+		verify(){app.HbLabel( :name => 'upperLabel' ).HbTextItem( :text => overlapping_time_for_verification )}
+		verify(){app.HbLabel( :name => 'lowerLabel' ).HbTextItem( :text => '2 events overlapping' )}
+		#Step 4: Tap the overlapping events part in calendar view
+		app.HbLabel( :name => 'lowerLabel' ).HbTextItem( :text => '2 events overlapping' ).tap
+		#Step 4 Expected: - Phone goes to calendar agenda view with  all events visible.
+		#ToDo
+		# - The date is same as the event date.
+		#ToDo
+		remove_calendar_widget_from_homescreen(0)
+		delete_calendar_events(app)
+	rescue
+		if (running_round < max_running_rounds) then
+           running_round = running_round + 1
+           puts "Some error came during run. Lets try again"
+           teardown
+	       retry
+        else
+           puts "Test failed"
+           raise
+        end
+	end #rescue	
+  end
+  
+  ##############################################################################################################################################
+  # Calendar widget - Tapping upcoming event
+  ##############################################################################################################################################
+  #
+  # Purpose of the test is to check, that when tapping upcoming event in calendar widget, calendar agenda view is opened in calendar.
+  #
+  #	Created at: 17.05.2010
+  #	Created by: Jarno Mäkelä
+  #	Reviewed by: 
+  #
+  #	===	preconditions
+  #	- Device is in Home Screen.
+  # - Some events are created in Calendar.
+  # - Calendar widget is added to Home Screen.
+  #
+  #	===	params
+  #	none
+  #
+  ############################################################################################################################################
+  
+  def _test_calendar_widget_tapping_upcoming_event
+	
+  end
+  
+  ##############################################################################################################################################
+  # Calendar widget - no events
+  ##############################################################################################################################################
+  #
+  # Purpose of the test is to check, that when there are not any events in calendar, calendar widget shows text 'No event for next 7 days'
+  #
+  #	Created at: 10.03.2010
+  #	Created by: Jarno Mäkelä
+  #	Reviewed by: 
+  #
+  #	===	preconditions
+  #	- Device is in Home Screen.
+  # - Calendar widget is added to Home Screen.
+  # - No any events in Calendar.
+  #
+  #	===	params
+  #	none
+  #
+  ############################################################################################################################################
+  
+  def test_calendar_widget_no_events
+	#running_round = 1
+	#max_running_rounds = 2
+	#begin
+		#preconditions:
+		#-Device is in Home Screen
+		app = @sut.application(:name => 'hsapplication')
+		#verify(){@sut.application(:name => 'hsapplication').HbIconItem(:iconName => 'qtg_mono_applications_all')}
+		verify(){app.HbIconItem(:iconName => 'qtg_mono_applications_all')}
+		navigate_to_first_homescreen
+		#-Calendar widget is added to Home Screen.
+		#Not adding calendar widget, if it already exists there
+		if not(app.test_object_exists?("HbWidget",{:name => 'CalendarWidget'})) then
+			#add calendar widget to home screen
+			app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+			add_calendar_widget_to_homescreen(app,'AppListButton')
+		end
+		#ToDo:Checking, that there are no events in calendar
+	
+		#step 1: Check Calendar widget
+		#Verify, that calendar widget shows current date
+		check_phone_date
+		month_in_view = case @month
+			when "01" then "January"
+			when "02" then "February"
+			when "03" then "March"
+			when "04" then "April"
+			when "05" then "May"
+			when "06" then "June"
+			when "07" then "July"
+			when "08" then "August"
+			when "09" then "September"
+			when "10" then "October"
+			when "11" then "November"
+			when "12" then "December"
+		end
+		day_to_verify = @day.to_i
+		verify(){app.HbTextItem(:text => day_to_verify)}
+		verify(){app.HbTextItem(:text => month_in_view)}
+		#Calendar widget content contains "No event for next 7 days"
+		verify(){app.HbTextItem(:text => 'No calendar entries today or next 7 days')}
+	
+		#Verify, that reminder icon in widget is not shown
+		if (app.test_object_exists?("HbIconItem",{:iconName => 'images/bell.PNG'})) then
+			raise VerificationError ,"ERROR: There is reminder icon in calendar widget, when it should not be there", caller
+		end
+		#Remove calendar widget from display
+		remove_calendar_widget_from_homescreen(0)
+	#rescue
+	#	if (running_round < max_running_rounds) then
+    #       running_round = running_round + 1
+    #       puts "Some error came during run. Lets try again"
+    #       teardown
+	#       retry
+    #    else
+    #       puts "Test failed"
+    #       raise
+    #    end
+	#end #rescue			
+  end #test_calendar_widget_no_events
+
+  def _test_create_meeting
+	create_calendar_event_via_calendar('Meeting 1')
+  end
+
+################################################################################################################################################
+###
+###						BAT cases end. User story related FuTe cases start
+###
+################################################################################################################################################
+
+  ##############################################################################################################################################
+  # test_calendar_widget_One_upcoming_event_in_7_day_away_and_one_in_8_day_away
+  ##############################################################################################################################################
+  #
+  # Purpose of the test is to check, that event, that is in 7 day away, can be seen in calendar widget, but event, that is 8 days away 
+  # cannot be seen in calendar widget.
+  #
+  #	Created at: 04.06.2010
+  #	Created by: Jarno Mäkelä
+  #	Reviewed by: 
+  #
+  #	===	preconditions
+  #	- Device is in Home Screen.
+  # - Calendar widget is added to Home Screen.
+  # - One event at 7 days away and one event at 8 days away in Calendar.
+  #
+  #	===	params
+  #	none
+  #
+  ############################################################################################################################################
+  
+  def _test_calendar_widget_One_upcoming_event_in_7_day_away_and_one_in_8_day_away
+	#running_round = 1
+	#max_running_rounds = 2
+	#begin
+		#preconditions:
+		#-Device is in Home Screen
+		app = @sut.application(:name => 'hsapplication')
+		verify(){app.HbIconItem(:iconName => 'qtg_mono_applications_all')}
+		navigate_to_first_homescreen
+		#-One event at 7 days away and one event at 8 days away in Calendar
+		check_phone_date
+		check_phone_time
+		seventh_day_time_for_verification = create_calendar_event(app, '7th day meeting',@day.to_i+7,@month.to_i,@year.to_i,@hour.to_i,@minute.to_i,0,1,0)
+		eight_day_time_for_verification = create_calendar_event(app, '8th day meeting',@day.to_i+8,@month.to_i,@year.to_i,@hour.to_i,@minute.to_i,0,1,0)
+		#-Calendar widget is added to Home Screen.
+		#Not adding calendar widget, if it already exists there
+		if not(app.test_object_exists?("HbWidget",{:name => 'CalendarWidget'})) then
+			#add calendar widget to home screen
+			app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+			add_calendar_widget_to_homescreen(app,'AppListButton')
+		end
+		#step 1: Check Calendar widget
+		#step 1 expected:
+		#- All icons (widget icon and reminder icon) are shown correctly.
+		#Verify, that reminder icon in widget is not shown. Cannot be verified currently, since fixture creating calendar event does not 
+		#have reminders
+		#if not(app.test_object_exists?("HbIconItem",{:iconName => 'images/bell.PNG'})) then
+		#	raise VerificationError ,"ERROR: There is not reminder icon in calendar widget, when it should not be there", caller
+		#end
+		#- Only event at 7 days away is shown in widget as two rows: first row shows the event date and title, second row shows the text 'No calendar entries today'.
+		#Verify, that calendar widget shows current date
+		month_in_view = case @month
+			when 1 then "January"
+			when 2 then "February"
+			when 3 then "March"
+			when 4 then "April"
+			when 5 then "May"
+			when 6 then "June"
+			when 7 then "July"
+			when 8 then "August"
+			when 9 then "September"
+			when 10 then "October"
+			when 11 then "November"
+			when 12 then "December"
+		end
+		day_to_verify = @day.to_i
+		verify(){app.HbTextItem(:text => day_to_verify)}
+		verify(){app.HbTextItem(:text => month_in_view)}
+		#- Only event at 7 days away is shown in widget as two rows: first row shows the event date and title, second row shows the text 'No calendar entries today'.
+		seventh_date_for_verification = verify(){app.HbLabel( :name => 'upperLabel' ).HbTextItem( :text => seventh_day_time_for_verification+' 7th day meeting' )}
+		#Remove calendar widget from display
+		#remove_calendar_widget_from_homescreen(0)
+	#rescue
+	#	if (running_round < max_running_rounds) then
+    #       running_round = running_round + 1
+    #       puts "Some error came during run. Lets try again"
+    #       teardown
+	#       retry
+    #    else
+    #       puts "Test failed"
+    #       raise
+    #    end
+	#end #rescue			
+  end #test_calendar_widget_One_upcoming_event_in_7_day_away_and_one_in_8_day_away
+
+################################################################################################################################################
+###
+###						User story related FuTe cases cases end. NFT cases start
+###
+################################################################################################################################################
+
+  ##############################################################################################################################################
+  # Calendar widget - NFT - Switch between HS and application library 50 times
+  ##############################################################################################################################################
+  #
+  # The purpose of this test is to verify that calendar widget is shown properly under stress. Calendar widget set on every HS, switch between 
+  # application library and HS 50 times. After this verify that calendar widget is functioning properly.
+  #
+  #	Created at: 28.05.2010
+  #	Created by: Jarno Mäkelä
+  #	Reviewed by: 
+  #
+  #	===	preconditions
+  #	- Device is in Home Screen.
+  # - Some events in Calendar.
+  # - Calendar widget is added to every Home screen.
+  #
+  #	===	params
+  #	none
+  #
+  ############################################################################################################################################
+  
+  def _test_Calendar_widget_NFT_Switch_between_HS_and_application_library_50_times
+	#running_round = 1
+	#max_running_rounds = 2
+	#begin
+		#preconditions:
+		#-Device is in Home Screen
+		app = @sut.application(:name => 'hsapplication')
+		#- Some events in Calendar.
+		check_phone_date
+		check_phone_time
+		today_time_for_verification = create_calendar_event(app, 'Today meeting',@day.to_i,@month.to_i,@year.to_i,@hour.to_i+3,@minute.to_i,0,1,0)
+		tomorrow_time_for_verification = create_calendar_event(app, 'Tomorrow meeting',@day.to_i+1,@month.to_i,@year.to_i,@hour.to_i,@minute.to_i,0,1,0)
+		day_after_tomorrow_time_for_verification = create_calendar_event(app, 'Day after tomorrow meeting',@day.to_i+2,@month.to_i,@year.to_i,@hour.to_i+2,@minute.to_i,0,2,0)
+		# - Calendar widget is added to every Home screen.
+		#let's first navigate to first home screen
+		navigate_to_first_homescreen
+		#add calendar widget to first home screen
+		app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+		add_calendar_widget_to_homescreen(app,'AppListButton')
+		#verify the calendar widget
+		day_to_verify = @day.to_i
+		verify(){app.HsPage(:__index => 0).HsWidgetHost.HsCalendarWidget.HbWidget( :name => 'CalendarWidget' ).HbTextItem(:text => day_to_verify)}
+		#go to second homescreen
+		app.HsPageIndicatorItem(:__index =>1).gesture(:Left,1,170)
+		#add calendar widget to second home screen
+		app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+		add_calendar_widget_to_homescreen(app,'AppListButton')
+		#verify the calendar widget
+		day_to_verify = @day.to_i
+		verify(){app.HsPage(:__index => 1).HsWidgetHost.HsCalendarWidget.HbWidget( :name => 'CalendarWidget' ).HbTextItem(:text => day_to_verify)}
+		#go to third homescreen
+		app.HsPageIndicatorItem(:__index =>1).gesture(:Left,1,170)
+		#add calendar widget to third home screen
+		app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+		add_calendar_widget_to_homescreen(app,'AppListButton')
+		#verify the calendar widget
+		day_to_verify = @day.to_i
+		verify(){app.HsPage(:__index => 2).HsWidgetHost.HsCalendarWidget.HbWidget( :name => 'CalendarWidget' ).HbTextItem(:text => day_to_verify)}
+		#do 50 times
+		50.times do
+			#step 1: Go to application library
+			app.HbIconItem(:iconName => 'qtg_mono_applications_all').tap
+			#step 1 Expected: Phone goes to application library view
+			verify(){app.HbMarqueeItem(:text => 'Applications')}
+			#Step 2: Switch to Home Screen and check Calendar widget.
+			app.HbIconItem(:iconName => 'qtg_mono_back').tap
+			#Step 2 expected: 
+			# - Phone goes to Home Screen.
+			# - Calendar widget shows the correct information.
+		end
+		verify(){app.HsPage(:__index => 0).HsWidgetHost.HsCalendarWidget.HbWidget( :name => 'CalendarWidget' ).HbTextItem(:text => day_to_verify)}
+		verify(){app.HsPage(:__index => 1).HsWidgetHost.HsCalendarWidget.HbWidget( :name => 'CalendarWidget' ).HbTextItem(:text => day_to_verify)}
+		verify(){app.HsPage(:__index => 2).HsWidgetHost.HsCalendarWidget.HbWidget( :name => 'CalendarWidget' ).HbTextItem(:text => day_to_verify)}
+		#verify(){app.HbLabel( :name => 'upperLabel' ).HbTextItem( :text => today_time_for_verification )}
+		#verify(){app.HbLabel( :name => 'lowerLabel' ).HbTextItem( :text => 'Today meeting' )}
+		remove_calendar_widget_from_homescreen(2)
+		#Go to second homescreen and remove calendar widget
+		app.HsPageIndicatorItem(:__index =>1).gesture(:Right,1,170)
+		remove_calendar_widget_from_homescreen(1)
+		#Go to first HS and remove calendar widget
+		app.HsPageIndicatorItem(:__index =>1).gesture(:Right,1,170)
+		remove_calendar_widget_from_homescreen(0)
+		delete_calendar_events(app)
+	#rescue
+	#	if (running_round < max_running_rounds) then
+    #       running_round = running_round + 1
+    #       puts "Some error came during run. Lets try again"
+    #       teardown
+	#       retry
+    #    else
+    #       puts "Test failed"
+    #       raise
+    #    end
+	#end #rescue			
+  end #test_editor_view_new
+
+end # test class
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/tsrc/matti_testcases/config/test_execution_profile.sip	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,7 @@
+
+TestClassCalendarWidget=1
+test_calendar_widget_no_events(TestClassCalendarWidget)=1
+test_calendar_widget_load_unload_widget_in_HomeScreen(TestClassCalendarWidget)=0
+test_calendar_widget_one_event_today_one_event_tomorrow(TestClassCalendarWidget)=0
+test_Calendar_widget_NFT_Switch_between_HS_and_application_library_50_times(TestClassCalendarWidget)=0
+test_calendar_widget_One_upcoming_event_in_7_day_away_and_one_in_8_day_away(TestClassCalendarWidget)=0
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/calendarwidgetplugin/tsrc/matti_testcases/testdata/calendar_widget_test_script_parameters.xml	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,4 @@
+<?xml version="1.0"?>
+<dsw>
+  <test_calendar_widget_no_events execute="true"/>
+</dsw>
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/layers.sysdef.xml	Tue Jul 06 11:55:49 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/calendarwidget" >
+]>
+
+<SystemDefinition name="calendarwidget" schema="1.5.1">
+  <systemModel>
+    <layer name="app_layer">
+      <module name="calendarwidget">
+        <unit unitID="calendarwidget_qt" mrp="" bldFile="&layer_real_source_path;" name="calendarwidget_qt" proFile="calendarwidget.pro" qmakeArgs="-r" filter="dfs_build" />
+      </module>
+      <module name="t_calendarwidget">
+        <unit unitID="t_calendarwidget_qt" mrp="" bldFile="&layer_real_source_path;/calendarwidgetplugin/tsrc" name="t_calendarwidget_qt" proFile="tsrc.pro" qmakeArgs="-r" filter="dfs_build" />
+      </module>
+    </layer>
+  </systemModel>
+</SystemDefinition>
+
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/rom/calendarwidget.iby	Tue Jul 06 11:55:49 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:
+ * The iby file for calendarplugin component
+ *
+ */
+
+#ifndef CALENDARPLUGIN_IBY
+#define CALENDARPLUGIN_IBY
+
+//#ifdef FF_CALENDAR_WIDGET
+
+file=ABI_DIR\BUILD_DIR\calendarwidgetplugin.dll    SHARED_LIB_DIR\calendarwidgetplugin.dll
+
+data=ZPRIVATE\20022F35\import\widgetregistry\2002C35A\calendarwidgetplugin.qtplugin   private\20022f35\import\widgetregistry\2002C35A\calendarwidgetplugin.qtplugin
+data=ZPRIVATE\20022F35\import\widgetregistry\2002C35A\calendarwidgetplugin.manifest   private\20022f35\import\widgetregistry\2002C35A\calendarwidgetplugin.manifest
+data=ZPRIVATE\20022F35\import\widgetregistry\2002C35A\qtg_large_calendar.png          private\20022f35\import\widgetregistry\2002C35A\qtg_large_calendar.png
+data=ZPRIVATE\20022F35\import\widgetregistry\2002C35A\calendarwidgetplugin.xml        private\20022f35\import\widgetregistry\2002C35A\calendarwidgetplugin.xml
+
+data=DATAZ_\resource\gestures.xml    \resource\gestures.xml
+data=ZSYSTEM\Install\calendarwidget_stub.sis               \system\install\calendarwidget_stub.sis
+
+//#endif //FF_CALENDAR_WIDGET
+
+#endif // CALENDARPLUGIN_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/calendarwidgetresources.iby	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,24 @@
+/*
+ * 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:
+ * The iby file for calendarplugin resources
+ *
+ */
+ 
+#ifndef CALENDARWIDGETRESOURCES_IBY
+#define CALENDARWIDGETRESOURCES_IBY
+
+data=DATAZ_\QT_TRANSLATIONS_DIR\calwidget.qm     QT_TRANSLATIONS_DIR\calwidget.qm
+
+#endif //CALENDARWIDGETRESOURCES_IBY
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/calendarwidget_stub.pkg	Tue Jul 06 11:55:49 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:
+;
+
+
+; Language - standard language definitions
+&EN
+
+; Standard SIS file header
+#{"calendarwidget"},(0x2002C35A),1,0,0
+
+; Non-localised vendor name
+:"Nokia Corporation"
+
+; Localised vendor names
+%{"Nokia Corporation"}
+
+; normal stuff:
+""-"z:\sys\bin\calendarwidgetplugin.dll"
+""-"z:\resource\qt\translations\calwidget.qm"
+""-"z:\private\20022f35\import\widgetregistry\2002C35A\calendarwidgetplugin.qtplugin"
+""-"z:\private\20022f35\import\widgetregistry\2002C35A\calendarwidgetplugin.manifest"
+""-"z:\private\20022f35\import\widgetregistry\2002C35A\qtg_large_calendar.png"
+""-"z:\private\20022f35\import\widgetregistry\2002C35A\calendarwidgetplugin.xml"
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sis/calendarwidget_stub_sis.mk	Tue Jul 06 11:55:49 2010 +0300
@@ -0,0 +1,56 @@
+#
+# 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:  
+#
+
+
+TARGETDIR=$(EPOCROOT)EPOC32\Data\Z\System\Install
+
+SISNAME=calendarwidget_stub
+PKGNAME=calendarwidget_stub
+
+$(TARGETDIR) :
+	@perl -S emkdir.pl "$(TARGETDIR)"
+
+do_nothing :
+	rem do_nothing
+
+SISFILE=$(TARGETDIR)\$(SISNAME).sis
+
+$(SISFILE) : ..\sis\$(PKGNAME).pkg
+	makesis -s $? $@ 
+
+
+
+MAKMAKE : do_nothing
+
+RESOURCE : do_nothing
+
+SAVESPACE : do_nothing
+
+BLD : do_nothing
+
+FREEZE : do_nothing
+
+LIB : do_nothing
+
+CLEANLIB : do_nothing
+
+FINAL : $(TARGETDIR) $(SISFILE)
+
+CLEAN : 
+	@if exist $(SISFILE) erase $(SISFILE)
+
+RELEASABLES : 
+	@echo $(SISFILE)
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/sysdef_1_5_1.dtd	Tue Jul 06 11:55:49 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>