# HG changeset patch # User jake # Date 1275474125 -10800 # Node ID b856a9924bbc7845f4e495d430f7502cfc9437fd initial contribution diff -r 000000000000 -r b856a9924bbc WidgetGen.pro --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WidgetGen.pro Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,27 @@ +#------------------------------------------------- +# +# Project created by QtCreator 2010-05-05T13:56:52 +# +#------------------------------------------------- + +QT += core gui + +TARGET = WidgetGen +TEMPLATE = app + + +SOURCES += main.cpp\ + mainwindow.cpp \ + renderercreator.cpp \ + widgetcreator.cpp \ + publishercreator.cpp + +HEADERS += mainwindow.h \ + renderercreator.h \ + widgetcreator.h \ + publishercreator.h + +FORMS += mainwindow.ui + +RESOURCES += \ + widgetgen.qrc diff -r 000000000000 -r b856a9924bbc WidgetGen.pro.user --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/WidgetGen.pro.user Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,113 @@ + + + + ProjectExplorer.Project.ActiveTarget + 0 + + + ProjectExplorer.Project.EditorSettings + + System + + + + ProjectExplorer.Project.Target.0 + + Qt Simulator + Qt4ProjectManager.Target.QtSimulatorTarget + 0 + 0 + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Debug + Qt4ProjectManager.Qt4BuildConfiguration + 2 + F:/QT/tryouts/WidgetGen/WidgetGen-build-simulator + 3 + 2 + true + + + + qmake + QtProjectManager.QMakeBuildStep + + + + Make + Qt4ProjectManager.MakeStep + false + + + + 2 + + Make + Qt4ProjectManager.MakeStep + true + + clean + + + + 1 + false + + Release + Qt4ProjectManager.Qt4BuildConfiguration + 0 + F:/QT/tryouts/WidgetGen/WidgetGen-build-simulator + 3 + 2 + true + + 2 + + WidgetGen + Qt4ProjectManager.Qt4RunConfiguration + 2 + + WidgetGen.pro + false + false + + false + false + + + 1 + + + + ProjectExplorer.Project.TargetCount + 1 + + + ProjectExplorer.Project.Updater.FileVersion + 4 + + diff -r 000000000000 -r b856a9924bbc data/feed/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/feed/group/bld.inf Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/widgetconfiguration.xml +../xuikon/00/#replace#_#replaceuid#.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#_#replaceuid#.dat +../xuikon/00/#replace#.css /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.css +../xuikon/00/#replace#.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.xml +//../xuikon/00/#replace#.dtd /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.dtd + + +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME #replace#_#replaceuid# +OPTION DTD_TYPE widget +END +// End of File diff -r 000000000000 -r b856a9924bbc data/feed/hsps/00/empty.dat diff -r 000000000000 -r b856a9924bbc data/feed/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/feed/hsps/00/manifest.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,21 @@ + + + qhd_tch + widget + + 0x2001f48a + 0x101fb657 + #replaceuid# + + #replace# + #replace# + 1.0 + + unlimited + + widgetconfiguration.xml + + + #replace#.o0000 + + diff -r 000000000000 -r b856a9924bbc data/feed/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/feed/hsps/00/widgetconfiguration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r b856a9924bbc data/feed/sis/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/feed/sis/backup_registration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r b856a9924bbc data/feed/sis/replace.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/feed/sis/replace.pkg Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,19 @@ +;Language +&EN +; Header +#{#replace#}, (#replaceuid#), 1,0,0 +;Localized Vendor Name +%{"Company"} +;Unique Vendor name +:"Vendor" +;Files to install +; HSPS - general (extracting files to C drive, other drives are not searched) +"..\hsps\00\widgetconfiguration.xml" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\widgetconfiguration.xml" +"..\hsps\00\manifest.dat" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\manifest.dat" +; HSPS - Resources for locale 0 +"..\xuikon\00\locale.dtd" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\locale.dtd" +"\epoc32\data\z\private\200159c0\install\#replace#\xuikon\00\#replace#.o0000" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\#replace#.o0000" +; HSPS - Backup +"backup_registration.xml" - "c:\private\10202D56\import\packages\#replaceuid#\backup_registration.xml" +; HSPS - trigger for post installations by the HSPS server +"..\hsps\00\empty.dat" - "c:\private\200159c0\import\plugin_2001f48a_101fb657_#replaceuid#_1.0.dat" diff -r 000000000000 -r b856a9924bbc data/feed/xuikon/00/replace.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/feed/xuikon/00/replace.css Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,50 @@ +widget +{ + direction: ltr; + block-progression:lr; +} + +box#container +{ + direction: ltr; + block-progression: tb; + padding-top:3px; + padding-bottom:4px; + padding-left:5px; + padding-right:8px; + nav-index: appearance; +} +image +{ + height: 70px; + width: 70px; + padding-top:6px; + padding-bottom:6px; + padding-left:6px; + padding-right:5px; + nav-index: appearance; +} + +text +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + color: "SKIN(268458534 13056 74)"; +} + +newsticker +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + color: "SKIN(268458534 13056 74)"; + text-align: left; + _s60-scroll-behaviour: scroll-alternate; + /** Alternate display time */ + _s60-display-time: 5000; + /** Scroll start delay */ + _s60-start-delay: 2000; + /** Restart loop after title is updated */ + _s60-restart-after-update: true; + /** Don't loop titles */ + _s60-scroll-loop: false; +} diff -r 000000000000 -r b856a9924bbc data/feed/xuikon/00/replace.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/feed/xuikon/00/replace.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,12 @@ + + + + 2001CB4F + 101FB657 + 11001241 + Anything + #replace# + 1.0 + #replace#.xml + #replace#.css + diff -r 000000000000 -r b856a9924bbc data/feed/xuikon/00/replace.dtd diff -r 000000000000 -r b856a9924bbc data/feed/xuikon/00/replace.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/feed/xuikon/00/replace.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,75 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + My first widget! + + + + + + + + + + + + <property class="#replace#/title1"/> + <configuration name="content_type" value="cnt2"/> + + + <property class="#replace#/title2"/> + <configuration name="content_type" value="cnt2"/> + + + <property class="#replace#/title3"/> + <configuration name="content_type" value="cnt2"/> + + + + + + + + + + + <property class="#replace#/title4"/> + <configuration name="content_type" value="cnt2"/> + + + <property class="#replace#/title5"/> + <configuration name="content_type" value="cnt2"/> + + + <property class="#replace#/title6"/> + <configuration name="content_type" value="cnt2"/> + + + + + diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphiciconstext/group/bld.inf Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/widgetconfiguration.xml +../xuikon/00/#replace#_#replaceuid#.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#_#replaceuid#.dat +../xuikon/00/#replace#.css /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.css +../xuikon/00/#replace#.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.xml +//../xuikon/00/#replace#.dtd /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.dtd + + +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME #replace#_#replaceuid# +OPTION DTD_TYPE widget +END +// End of File diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/hsps/00/empty.dat diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphiciconstext/hsps/00/manifest.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,21 @@ + + + qhd_tch + widget + + 0x2001f48a + 0x101fb657 + #replaceuid# + + #replace# + #replace# + 1.0 + + unlimited + + widgetconfiguration.xml + + + #replace#.o0000 + + diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphiciconstext/hsps/00/widgetconfiguration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/sis/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphiciconstext/sis/backup_registration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/sis/replace.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphiciconstext/sis/replace.pkg Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,19 @@ +;Language +&EN +; Header +#{#replace#}, (#replaceuid#), 1,0,0 +;Localized Vendor Name +%{"Company"} +;Unique Vendor name +:"Vendor" +;Files to install +; HSPS - general (extracting files to C drive, other drives are not searched) +"..\hsps\00\widgetconfiguration.xml" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\widgetconfiguration.xml" +"..\hsps\00\manifest.dat" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\manifest.dat" +; HSPS - Resources for locale 0 +"..\xuikon\00\locale.dtd" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\locale.dtd" +"\epoc32\data\z\private\200159c0\install\#replace#\xuikon\00\#replace#.o0000" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\#replace#.o0000" +; HSPS - Backup +"backup_registration.xml" - "c:\private\10202D56\import\packages\#replaceuid#\backup_registration.xml" +; HSPS - trigger for post installations by the HSPS server +"..\hsps\00\empty.dat" - "c:\private\200159c0\import\plugin_2001f48a_101fb657_#replaceuid#_1.0.dat" diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/xuikon/00/replace.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphiciconstext/xuikon/00/replace.css Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,69 @@ +widget +{ + block-progression:rl; + +} + +image#img4 +{ + height: 70px; + width: 70px; + padding-top:6px; + padding-bottom:6px; + padding-left:6px; + padding-right:5px; + nav-index:appearance; +} + +box#focus +{ + padding-top:3px; + padding-bottom:4px; + padding-left:5px; + padding-right:8px; + nav-index:appearance; +} +box#container +{ + height:adaptive; + direction: ltr; + block-progression: tb; + margin-top: auto; + margin-bottom: auto; +} + +box#row1 +{ + direction: ltr; + block-progression:lr; + padding:0px; + margin:0px; + height:25px; +} + +box.hidden +{ + display:none; + direction: ltr; + block-progression:lr; + padding:0px; + margin:0px; + height:25px; +} + +image.icon +{ + height: 24px; + width: 24px; + margin-top:1px; +} + +text +{ + height:25px; + margin-left:10px; + font-size:3.5u; + _s60-text-valign: top; + font-family: EAknLogicalFontSecondaryFont; + color: "SKIN(268458534 13056 74)"; +} \ No newline at end of file diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/xuikon/00/replace.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphiciconstext/xuikon/00/replace.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,12 @@ + + + + 2001CB4F + 101FB657 + 11001241 + Anything + #replace# + 1.0 + #replace#.xml + #replace#.css + diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/xuikon/00/replace.dtd diff -r 000000000000 -r b856a9924bbc data/graphiciconstext/xuikon/00/replace.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphiciconstext/xuikon/00/replace.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,67 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r b856a9924bbc data/graphictext/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphictext/group/bld.inf Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/widgetconfiguration.xml +../xuikon/00/#replace#_#replaceuid#.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#_#replaceuid#.dat +../xuikon/00/#replace#.css /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.css +../xuikon/00/#replace#.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.xml +//../xuikon/00/#replace#.dtd /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.dtd + + +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME #replace#_#replaceuid# +OPTION DTD_TYPE widget +END +// End of File diff -r 000000000000 -r b856a9924bbc data/graphictext/hsps/00/empty.dat diff -r 000000000000 -r b856a9924bbc data/graphictext/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphictext/hsps/00/manifest.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,21 @@ + + + qhd_tch + widget + + 0x2001f48a + 0x101fb657 + #replaceuid# + + #replace# + #replace# + 1.0 + + unlimited + + widgetconfiguration.xml + + + #replace#.o0000 + + diff -r 000000000000 -r b856a9924bbc data/graphictext/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphictext/hsps/00/widgetconfiguration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r b856a9924bbc data/graphictext/sis/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphictext/sis/backup_registration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r b856a9924bbc data/graphictext/sis/replace.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphictext/sis/replace.pkg Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,19 @@ +;Language +&EN +; Header +#{#replace#}, (#replaceuid#), 1,0,0 +;Localized Vendor Name +%{"Company"} +;Unique Vendor name +:"Vendor" +;Files to install +; HSPS - general (extracting files to C drive, other drives are not searched) +"..\hsps\00\widgetconfiguration.xml" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\widgetconfiguration.xml" +"..\hsps\00\manifest.dat" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\manifest.dat" +; HSPS - Resources for locale 0 +"..\xuikon\00\locale.dtd" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\locale.dtd" +"\epoc32\data\z\private\200159c0\install\#replace#\xuikon\00\#replace#.o0000" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\#replace#.o0000" +; HSPS - Backup +"backup_registration.xml" - "c:\private\10202D56\import\packages\#replaceuid#\backup_registration.xml" +; HSPS - trigger for post installations by the HSPS server +"..\hsps\00\empty.dat" - "c:\private\200159c0\import\plugin_2001f48a_101fb657_#replaceuid#_1.0.dat" diff -r 000000000000 -r b856a9924bbc data/graphictext/xuikon/00/replace.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphictext/xuikon/00/replace.css Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,48 @@ +widget +{ + block-progression:rl; + +} + +image +{ + height: 70px; + width: 70px; + padding-top:6px; + padding-bottom:6px; + padding-left:6px; + padding-right:5px; + nav-index:appearance; +} + +box#focus +{ + padding-top:3px; + padding-bottom:4px; + padding-left:5px; + padding-right:8px; + nav-index:appearance; +} + +box#container +{ + height: adaptive; + direction: ltr; + block-progression: tb; + margin-top: auto; + margin-bottom: auto; +} + +text +{ + height:25px; + font-size:3.5u; + _s60-text-valign: top; + font-family: EAknLogicalFontSecondaryFont; + color: "SKIN(268458534 13056 74)"; +} + +text.hidden +{ + display:none; +} diff -r 000000000000 -r b856a9924bbc data/graphictext/xuikon/00/replace.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphictext/xuikon/00/replace.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,12 @@ + + + + 2001CB4F + 101FB657 + 11001241 + Anything + #replace# + 1.0 + #replace#.xml + #replace#.css + diff -r 000000000000 -r b856a9924bbc data/graphictext/xuikon/00/replace.dtd diff -r 000000000000 -r b856a9924bbc data/graphictext/xuikon/00/replace.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/graphictext/xuikon/00/replace.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,49 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r b856a9924bbc data/iconstext/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/iconstext/group/bld.inf Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/widgetconfiguration.xml +../xuikon/00/#replace#_#replaceuid#.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#_#replaceuid#.dat +../xuikon/00/#replace#.css /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.css +../xuikon/00/#replace#.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.xml +//../xuikon/00/#replace#.dtd /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.dtd + + +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME #replace#_#replaceuid# +OPTION DTD_TYPE widget +END +// End of File diff -r 000000000000 -r b856a9924bbc data/iconstext/hsps/00/empty.dat diff -r 000000000000 -r b856a9924bbc data/iconstext/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/iconstext/hsps/00/manifest.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,21 @@ + + + qhd_tch + widget + + 0x2001f48a + 0x101fb657 + #replaceuid# + + #replace# + #replace# + 1.0 + + unlimited + + widgetconfiguration.xml + + + #replace#.o0000 + + diff -r 000000000000 -r b856a9924bbc data/iconstext/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/iconstext/hsps/00/widgetconfiguration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r b856a9924bbc data/iconstext/sis/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/iconstext/sis/backup_registration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r b856a9924bbc data/iconstext/sis/replace.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/iconstext/sis/replace.pkg Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,19 @@ +;Language +&EN +; Header +#{#replace#}, (#replaceuid#), 1,0,0 +;Localized Vendor Name +%{"Company"} +;Unique Vendor name +:"Vendor" +;Files to install +; HSPS - general (extracting files to C drive, other drives are not searched) +"..\hsps\00\widgetconfiguration.xml" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\widgetconfiguration.xml" +"..\hsps\00\manifest.dat" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\manifest.dat" +; HSPS - Resources for locale 0 +"..\xuikon\00\locale.dtd" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\locale.dtd" +"\epoc32\data\z\private\200159c0\install\#replace#\xuikon\00\#replace#.o0000" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\#replace#.o0000" +; HSPS - Backup +"backup_registration.xml" - "c:\private\10202D56\import\packages\#replaceuid#\backup_registration.xml" +; HSPS - trigger for post installations by the HSPS server +"..\hsps\00\empty.dat" - "c:\private\200159c0\import\plugin_2001f48a_101fb657_#replaceuid#_1.0.dat" diff -r 000000000000 -r b856a9924bbc data/iconstext/xuikon/00/replace.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/iconstext/xuikon/00/replace.css Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,51 @@ +widget +{ + padding-top:3px; + padding-bottom:4px; + padding-left:5px; + padding-right:8px; +} + + +box#container +{ + height:adaptive; + margin-top: auto; + margin-bottom: auto; +} + +box#row1 +{ + direction: ltr; + block-progression:lr; + padding:0px; + margin:0px; + height:25px; +} + +box.hidden +{ + display:none; + direction: ltr; + block-progression:lr; + padding:0px; + margin:0px; + height:25px; +} + +image +{ + height: 24px; + width: 24px; + margin-top:1px; +} + +text +{ + height:25px; + margin-left:10px; + font-size:3.5u; + _s60-text-valign: top; + font-family: EAknLogicalFontSecondaryFont; + color: "SKIN(268458534 13056 74)"; +} \ No newline at end of file diff -r 000000000000 -r b856a9924bbc data/iconstext/xuikon/00/replace.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/iconstext/xuikon/00/replace.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,12 @@ + + + + 2001CB4F + 101FB657 + 11001241 + Anything + #replace# + 1.0 + #replace#.xml + #replace#.css + diff -r 000000000000 -r b856a9924bbc data/iconstext/xuikon/00/replace.dtd diff -r 000000000000 -r b856a9924bbc data/iconstext/xuikon/00/replace.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/iconstext/xuikon/00/replace.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,54 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r b856a9924bbc data/publisherif/inc/hspublisher.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/publisherif/inc/hspublisher.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,206 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + + +#ifndef __HSPUBLISHER_H__ +#define __HSPUBLISHER_H__ + +// System includes +#include +#include + +// User includes + +// Forward declarations +class CHsPublisherImpl; +class MHsWidgetObserver; + +// Constants + +// Class Definitions +NONSHARABLE_CLASS( CHsPublisher ) : public CBase + { +public: + // constructors and destructor + + /** + * Constructor + * + * @param aObserver Widget observer interface + * @param aEnablePersist ETrue if publisher wants to save published data to SQL database for later usage. + * This option should be used with caution as it taxes runtime performance and resources. + */ + static CHsPublisher* NewL( + MHsWidgetObserver& aObserver, + TBool aEnablePersist = EFalse ); + + /** + * Constructor + * + * @param aObserver Widget observer interface + * @param aEnablePersist ETrue if publisher wants to save published data to SQL database for later usage. + * This option should be used with caution as it taxes runtime performance and resources. + */ + static CHsPublisher* NewLC( + MHsWidgetObserver& aObserver, + TBool aEnablePersist = EFalse ); + + /** + * Destructor + */ + ~CHsPublisher(); + +public: + // new functions + + /** + * Publishes text to a element in widget + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the text element in the widget. + * @param aText Text to set. + * @return System wide error code. + */ + TInt PublishText( + const TDesC& aWidgetId, + const TDesC8& aElementId, + const TDesC& aText ); + + /** + * Publishes image to an element in widget + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the iamge element in the widget. + * @param aImage Image to set. + * @param aMask Mask to set. + * @return System wide error code. + */ + TInt PublishImage( + const TDesC& aWidgetId, + const TDesC8& aElementId, + const CFbsBitmap* aImage, + const CFbsBitmap* aMask ); + + /** + * Publishes image to an element in widget + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the image element in the widget. + * @param aImageHandle Image handle. + * @param aMaskHandle Mask handle. + * @return System wide error code. + */ + TInt PublishImage( + const TDesC& aWidgetId, + const TDesC8& aElementId, + TInt aImageHandle, + TInt aMaskHandle ); + + /** + * Publishes image to an element in the widget. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the image element in the widget. + * @param aSource Source for the image. Supported source formats are: + * - Filesystem path, i.e. _LIT( KMyImagePath, "c:\\data\\Installs\\MyWidget\\image.jpg"); + * - skin( ), i.e. _LIT( KMySkinImage, "skin(270501603 8586)" ); + * - mif( ), i.e. _LIT( KMyMifImage, "mif(c:\\data\\Installs\\MyWidget\\mymwidget.mif 16384 16385" ); + */ + TInt PublishImage( + const TDesC& aWidgetId, + const TDesC8& aElementId, + const TDesC& aSource ); + + /** + * Publishes stream to a element in widget + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the data element in the widget. + * @param aStream The stream as descriptor. + * @return System wide error code. + */ + TInt PublishStream( + const TDesC& aWidgetId, + const TDesC8& aElementId, + const TDesC8& aStream ); + + /** + * Cleans published text from a element. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the data element in the widget. + * @return System wide error code. + */ + TInt CleanText( const TDesC& aWidgetId, + const TDesC8& aElementId ); + + /** + * Cleans published image from an element. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the data element in the widget. + * @return System wide error code. + */ + TInt CleanImage( const TDesC& aWidgetId, + const TDesC8& aElementId ); + + /** + * Starts a publish transaction. Transaction must be committed + * with CommitTransaction method. + * + * @param aWidget Widget Id identifying the transaction for widget instance. + * @return System wide error code. + */ + TInt StartTransaction( + const TDesC& aWidgetId ); + + /** + * Commits the publish transaction and flushes changes to Homescreen. + * + * @param aWidget Widget Id identifying the transaction for the widget instance. + * @return System wide error code. + */ + TInt CommitTransaction( + const TDesC& aWidgetId ); + +private: + // private constructors + + /** + * C++ default constructor + */ + CHsPublisher(); + + /** + * 2nd phase constructor + */ + void ConstructL( + MHsWidgetObserver& aObserver, + TBool aEnablePersist ); + +private: + // data + + /** HS publisher implementation, owned */ + CHsPublisherImpl* iImpl; + }; + +#endif // __HSPUBLISHER_H__ + +// End of file diff -r 000000000000 -r b856a9924bbc data/publisherif/inc/hspublisherimpl.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/publisherif/inc/hspublisherimpl.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,267 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + + +#ifndef __HSPUBLISHERIMPL_H__ +#define __HSPUBLISHERIMPL_H__ + +// System includes +#include +#include + +// User includes + +// Forward declarations +class MHsWidgetObserver; +class CLiwServiceHandler; +class CLiwCriteriaItem; +class CLiwGenericParamList; +class MLiwInterface; +class CFbsBitmap; +class CTransaction; + +// Constants + +// Class declaration +NONSHARABLE_CLASS( CHsPublisherImpl ) : public CBase, + public MLiwNotifyCallback + { +public: + // constructors and destructor + + /** + * Constructor + * + * @param aObserver Widget observer interface. + * @param aEnablePersist ETrue if publisher wants to save published data to SQL database for later usage. + * This option should be used with caution as it taxes runtime performance and resources. + */ + static CHsPublisherImpl* NewL( + MHsWidgetObserver& aObserver, + TBool aEnablePersist ); + + /** + * Constructor + * + * @param aObserver Widget observer interface. + * @param aEnablePersist ETrue if publisher wants to save published data to SQL database for later usage. + * This option should be used with caution as it taxes runtime performance and resources. + */ + static CHsPublisherImpl* NewLC( + MHsWidgetObserver& aObserver, + TBool aEnablePersist ); + + /** + * Destructor + */ + ~CHsPublisherImpl(); + +private: + // from MLiwNotifyCallback + + /** + * Handles notifications caused by an asynchronous Execute*CmdL call + * or an event. + * + * @param aCmdId The service command associated to the event. + * @param aEventId Occured event, see LiwCommon.hrh. + * @param aEventParamList Event parameters, if any, as defined per + * each event. + * @param aInParamList Input parameters, if any, given in the + * related HandleCommmandL. + * @return Error code for the callback. + */ + TInt HandleNotifyL( TInt aCmdId, TInt aEventId, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& aInParamList ); + +public: + // new functions + + /** + * Publishes text to a element in the widget. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the text element in the widget. + * @param aText Text to set. + */ + void PublishTextL( + const TDesC& aWidgetId, + const TDesC8& aElementId, + const TDesC& aText ); + + /** + * Publishes image to an element in the widget. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the image element in the widget. + * @param aImage Image to set. + * @param aMask Mask to set. + */ + void PublishImageL( + const TDesC& aWidgetId, + const TDesC8& aElementId, + const CFbsBitmap* aImage, + const CFbsBitmap* aMask ); + + /** + * Publishes image to an element in the widget. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the image element in the widget. + * @param aImageHandle Handle to Image to set. + * @param aMaskHandle Handle to mask to set. + */ + void PublishImageL( + const TDesC& aWidgetId, + const TDesC8& aElementId, + TInt aImageHandle, + TInt aMaskHandle ); + + /** + * Publishes image to an element in the widget. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the image element in the widget. + * @param aSource Source for the image. Supported source formats are: + * - Filesystem path, i.e. _LIT( KMyImagePath, "c:\\data\\Installs\\MyWidget\\image.jpg"); + * - skin( ), i.e. _LIT( KMySkinImage, "skin(270501603 8586)" ); + * - mif( ), i.e. _LIT( KMyMifImage, "mif(c:\\data\\Installs\\MyWidget\\mymwidget.mif 16384 16385" ); + */ + void PublishImageL( + const TDesC& aWidgetId, + const TDesC8& aElementId, + const TDesC& aSource ); + + /** + * Publishes stream to a element in widget. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the data element in the widget. + * @param aStream The stream as descriptor. + */ + void PublishStreamL( + const TDesC& aWidgetId, + const TDesC8& aElementId, + const TDesC8& aStream ); + + /** + * Cleans published text from a element. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the data element in the widget. + */ + void CleanTextL( const TDesC& aWidgetId, + const TDesC8& aElementId ); + + /** + * Cleans published image from an element. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aElementId Element id identifying the data element in the widget. + */ + void CleanImageL( const TDesC& aWidgetId, + const TDesC8& aElementId ); + + /** + * Starts a publish transaction. Transaction must be committed + * with CommitTransaction method. + * + * @param aWidget Widget Id identifying the transaction for widget instance. + * @return System wide error code. + */ + void StartTransactionL( + const TDesC& aWidgetId ); + + /** + * Commits the publish transaction and flushes changes to Homescreen. + * + * @param aWidget Widget Id identifying the transaction for the widget instance. + */ + void CommitTransactionL( + const TDesC& aWidgetId ); + +private: + // new functions + + /** + * Attaches to CPS service. + */ + void AttachL(); + + /** + * Detaches from CPS servive. + */ + void DetachL(); + + /** + * Process CPS notification and delegates it to MHsWidgetObserver. + * + * @param aWidgetId The widget instance from the event was initiated. + * @param aEvent Event which maps to Content Model. + */ + void ProcessEvent( + const TDesC& aWidgetId, + const TDesC8& aEvent ) const; + + /** + * Gets transaction for aWidgetId. + * + * @param aWidgetId The widget instance to use in transaction look-up. + * @return Transaction, NULL if not found. + */ + CTransaction* Transaction( const TDesC& aWidgetId ) const; + +private: + // private constructors + + /** + * C++ constructor + */ + CHsPublisherImpl( + MHsWidgetObserver& aObserver, + TBool aEnablePersist ); + + /** + * 2nd phase constructor + */ + void ConstructL(); + +private: + // data + + /** HS Widget observer, not owned */ + MHsWidgetObserver& iObserver; + /** SAPI service handler, owned */ + CLiwServiceHandler* iServiceHandler; + /** CPS SAPI service, owned */ + CLiwCriteriaItem* iCpsService; + /** Cps interface, owned */ + MLiwInterface* iCpsInterface; + /** Publish transactions, owned */ + RPointerArray< CTransaction > iTransactions; + /** Attached succesfully to CPS service */ + TBool iCpServiceAvailable; + /** Flag Enable persist */ + TBool iEnablePersist; + }; + +#endif // __HSPUBLISHERIMPL_H__ + +// End of file diff -r 000000000000 -r b856a9924bbc data/publisherif/inc/hswidgetobserver.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/publisherif/inc/hswidgetobserver.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,147 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + + +#ifndef __HSWIDGETOBSERVER_H__ +#define __HSWIDGETOBSERVER_H__ + +// System includes +#include + +// User includes + +// Forward declarations + +// Constants + +// Class Definitions +class MHsWidgetObserver + { +public: + enum EState + { + /** + * Widget instance should enter to suspended state. + * This means that Homescreen is not visible anymore. + */ + ESuspend = 0, + /** + * Widget instance should enter to alive state. + * This means that Homescreen visible. Resource consumption and publishing is allowed. + */ + EAlive, + /** + * Widget instance may enter to online state. + * This means that it may consume network resources. + */ + EOnline, + /** + * Widget instance must enter to offline state. + * This means that it is not allowed to consume network resources. + */ + EOffline + }; + + enum EStartReason + { + /** + * Widget was started because system starts-up. + */ + ESystemStart = 1, + /** + * Widget was started because of Homescreen page change. + */ + EPageStart, + /** + * Widget was started because of it was added to Homescreen. + */ + EWidgetStart + }; + + enum EStopReason + { + /** + * Widget was stopped because system shutsdown. + */ + ESystemStop = 1, + /** + * Widget was stopped because of Homescreen page change. + */ + EPageStop, + /** + * Widget was stopped because it was removed from Homescreen. + */ + EWidgetStop + }; + + /** + * Requests this publisher's identity. + * + * @return Publisher identity in format. + * The identity must map to xml element, i.e.: + * + */ + virtual const TDesC& Identity() = 0; + + /** + * Notifies that Homescreen has started widget. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aReason Reason why Homescreen started the widget instance. + */ + virtual void NotifyWidgetStarted( + const TDesC& aWidgetId, + EStartReason aReason ) = 0; + + /** + * Notifies that Homescreen has stopped widget. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aReason Reason why Homescreen stopped the widget instance. + */ + virtual void NotifyWidgetStopped( + const TDesC& aWidgetId, + EStopReason aReason ) = 0; + + /** + * Notifies that Homescreen has changed widget state. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aState New state for the widget instance. + */ + virtual void NotifyWidgetState( + const TDesC& aWidgetId, + EState aState ) = 0; + + /** + * Notifies a widget specific event. + * + * @param aWidgetId Widget Id identifying the widget instance. + * @param aEvent Event from the widget instance. + * @param aParam Event parameter from the widget instance. + */ + virtual void NotifyWidgetEvent( + const TDesC& aWidgetId, + const TDesC& aEvent, + const TDesC& aParam ) = 0; + }; + +#endif // __HSWIDGETOBSERVER_H__ + +// End of file diff -r 000000000000 -r b856a9924bbc data/publisherif/inc/transaction.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/publisherif/inc/transaction.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,286 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + + +#ifndef __TRANSACTION_H__ +#define __TRANSACTION_H__ + +// System includes +#include + +// User includes + +// Forward declarations + +// Constants + +// CTransactionItem Class declaration +NONSHARABLE_CLASS( CTransactionItem ) : public CBase + { +public: + // constrcutor and destructor + + /** + * C++ constructor + */ + CTransactionItem( const TDesC8& aElementId ); + + /** + * Destructor + */ + ~CTransactionItem(); + +public: + // new functions + + /** + * Returns this transaction's element id. + * + * @return Transaction element id. + */ + const TDesC8& ElementId() const; + + /** + * Returns this transaction's content type. + * To be overriden by sub-classes. + * + * @return Transaction element type. + */ + virtual const TDesC8& Type() const = 0; + +protected: + // data + + /** Transaction's element id, owned */ + HBufC8* iElementId; + }; + +// CImageTransactionItem Class declaration +NONSHARABLE_CLASS( CImageTransactionItem ) : public CTransactionItem + { +public: + // constructors and destructor + + /** + * C++ constructor + */ + CImageTransactionItem( + const TDesC8& aElementId, + TInt aImageHandle, + TInt aMaskHandle ); + + /** + * C++ constructor + */ + CImageTransactionItem( + const TDesC8& aElementId, + const TDesC& aPath ); + + /** + * Destructor + */ + ~CImageTransactionItem(); + +public: + // from CTransactionItem + + /** + * @see CTransactionItem + */ + const TDesC8& Type() const; + +public: + // new functions + + /** + * Gets transaction's image handle. + * Notice that path and handles are mutually exclusice in one transaction. + * + * @return Image handle + */ + TInt ImageHandle() const; + + /** + * Gets transaction's mask handle. + * Notice that path and handles are mutually exclusice in one transaction. + * + * @return Mask handle + */ + TInt MaskHandle() const; + + /** + * Gets transaction's path. + * Notice that path and handles are mutually exclusice in one transaction. + * + * @return Path + */ + const TDesC& Path() const; + +private: + // data + + /** Transaction's data, caller must maintain the bitmap alive */ + TInt iImageHandle; + /** Transaction's data, caller must maintain the bitmap alive */ + TInt iMaskHandle; + /** Transaction's data, owned */ + HBufC* iPath; + }; + +// CTextTransactionItem Class declaration +NONSHARABLE_CLASS( CTextTransactionItem ) : public CTransactionItem + { +public: + // constructors and destructor + + /** + * C++ constructor + */ + CTextTransactionItem( + const TDesC8& aElementId, + const TDesC& aText ); + + /** + * Destructor + */ + ~CTextTransactionItem(); + +public: + // from CTransactionItem + + /** + * @see CTransactionItem + */ + const TDesC8& Type() const; + +public: + // new functions + + /** + * Gets transaction's text + * + * @return Text + */ + const TDesC& Text() const; + +private: + // data + + /** Transaction's data, owned */ + HBufC* iText; + }; + +// CDataTransactionItem Class declaration +NONSHARABLE_CLASS( CDataTransactionItem ) : public CTransactionItem + { +public: + // constructors and destructor + + /** + * C++ constructor + */ + CDataTransactionItem( + const TDesC8& aElementId, + const TDesC8& aData ); + + /** + * Destructor + */ + ~CDataTransactionItem(); + +public: + // from CTransactionItem + + /** + * @see CTransactionItem + */ + const TDesC8& Type() const; + +public: + // new functions + + /** + * Gets transaction's data + * + * @return Data + */ + const TDesC8& Data() const; + +private: + // data + + /** Transaction's data, owned */ + HBufC8* iData; + }; + + +// CTransaction Class declaration +NONSHARABLE_CLASS( CTransaction ) : public CBase + { +public: + // constructors and destructor + + /** + * C++ constructor + */ + CTransaction( + const TDesC& aWidgetId ); + + /** + * Destructor + */ + ~CTransaction(); + +public: + // new functions + + /** + * Equals operator + * + * @param aWidgetId Widget id to use in comparision + * @return ETrue if this transaction matches to aWidgetId, EFalse otherwise + */ + TBool operator== ( const TDesC& aWidgetId ) const; + + /** + * Appends transaction item to transaction items array. + * + * @param aItem Transaction item. This transaction takes item's ownership. + */ + void AppendL( CTransactionItem* aItem ); + + /** + * Gets transaction items from this transaction. + * + * @return Transaction items. + */ + const RPointerArray< CTransactionItem >& Items() const; + +private: + // data + + /** Transaction items, owned */ + mutable RPointerArray< CTransactionItem > iItems; + /** Transaction's id, same as widget id */ + const TDesC& iWidgetId; + }; + +#endif // __TRANSACTION_H__ + +// End of file diff -r 000000000000 -r b856a9924bbc data/publisherif/src/hspublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/publisherif/src/hspublisher.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,205 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +// System includes + +// User includes +#include "hspublisherimpl.h" +#include "hspublisher.h" + +// Constants + + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CHsPublisher::NewLC() +// Two-phased constructor +// ----------------------------------------------------------------------------- +// +CHsPublisher* CHsPublisher::NewLC( MHsWidgetObserver& aObserver, + TBool aEnablePersist ) + { + CHsPublisher* self = new ( ELeave ) CHsPublisher(); + CleanupStack::PushL( self ); + self->ConstructL( aObserver, aEnablePersist ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::NewL() +// Two-phased constructor +// ----------------------------------------------------------------------------- +// +CHsPublisher* CHsPublisher::NewL( MHsWidgetObserver& aObserver, + TBool aEnablePersist ) + { + CHsPublisher* self = CHsPublisher::NewLC( aObserver, aEnablePersist ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::CHsPublisher() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CHsPublisher::CHsPublisher() + { + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CHsPublisher::ConstructL( MHsWidgetObserver& aObserver, + TBool aEnablePersist ) + { + iImpl = CHsPublisherImpl::NewL( aObserver, aEnablePersist ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::~CHsPublisher() +// Destructor +// ----------------------------------------------------------------------------- +// +CHsPublisher::~CHsPublisher() + { + delete iImpl; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::PublishText() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::PublishText( const TDesC& aWidgetId, + const TDesC8& aElementId, const TDesC& aText ) + { + TRAPD( err, iImpl->PublishTextL( aWidgetId, aElementId, aText ) ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::PublishImage() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::PublishImage( const TDesC& aWidgetId, + const TDesC8& aElementId, const CFbsBitmap* aImage, const CFbsBitmap* aMask ) + { + TRAPD( err, iImpl->PublishImageL( aWidgetId, aElementId, aImage, aMask ) ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::PublishImage() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::PublishImage( const TDesC& aWidgetId, + const TDesC8& aElementId, TInt aImageHandle, TInt aMaskHandle ) + { + TRAPD( err, iImpl->PublishImageL( + aWidgetId, aElementId, aImageHandle, aMaskHandle ) ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::PublishImage() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::PublishImage( const TDesC& aWidgetId, + const TDesC8& aElementId, const TDesC& aSource ) + { + TRAPD( err, iImpl->PublishImageL( aWidgetId, aElementId, aSource ) ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::PublishStream() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::PublishStream( const TDesC& aWidgetId, + const TDesC8& aElementId, const TDesC8& aStream ) + { + TRAPD( err, iImpl->PublishStreamL( aWidgetId, aElementId, aStream ) ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::CleanText() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::CleanText( const TDesC& aWidgetId, + const TDesC8& aElementId ) + { + TRAPD( err, iImpl->CleanTextL( aWidgetId, aElementId ) ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::CleanImage() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::CleanImage( const TDesC& aWidgetId, + const TDesC8& aElementId ) + { + TRAPD( err, iImpl->CleanImageL( aWidgetId, aElementId ) ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::StartTransaction() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::StartTransaction( const TDesC& aWidgetId ) + { + TRAPD( err, iImpl->StartTransactionL( aWidgetId ) ); + + return err; + } + +// ----------------------------------------------------------------------------- +// CHsPublisher::CommitTransaction() +// +// ----------------------------------------------------------------------------- +// +TInt CHsPublisher::CommitTransaction( const TDesC& aWidgetId ) + { + TRAPD( err, iImpl->CommitTransactionL( aWidgetId ) ); + + return err; + } + +// End of file diff -r 000000000000 -r b856a9924bbc data/publisherif/src/hspublisherimpl.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/publisherif/src/hspublisherimpl.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,856 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +// System includes +#include +#include +#include +#include + +// User includes +#include "transaction.h" +#include "hswidgetobserver.h" +#include "hspublisherimpl.h" + +// Constants +_LIT8( KCPSConfigurationIf, "IContentPublishing" ); +_LIT8( KCPS, "Service.ContentPublishing" ); + +_LIT( KCpData, "cp_data" ); + +_LIT( KHsWidget, "hswidget" ); +_LIT( KPublisher, "publisher" ); +_LIT( KAll, "all" ); + +_LIT( KDataAndPublisher, "cp_data:publisher" ); + +_LIT8( KAdd, "add" ); +_LIT8( KType, "type" ); +_LIT8( KFilter, "filter" ); +_LIT8( KFlag, "flag" ); +_LIT8( KErrorCode, "ErrorCode" ); +_LIT8( KDataMap, "data_map" ); +_LIT8( KItem, "item" ); +_LIT8( KDelete, "Delete" ); +_LIT8( KPublisherId, "publisher" ); +_LIT8( KContentType, "content_type" ); +_LIT8( KContentId, "content_id" ); +_LIT8( KOperation, "operation" ); +_LIT8( KExecute, "execute" ); + +_LIT8( KRequestNotification, "RequestNotification" ); +_LIT8( KChangeInfo, "change_info" ); +_LIT8( KActionTrigger, "action_trigger" ); + +_LIT8( KActionMap, "action_map" ); +_LIT8( KActive, "active" ); + +_LIT8( KSuspend, "suspend" ); +_LIT8( KResume, "resume" ); +_LIT8( KOnline, "online" ); +_LIT8( KOffline, "offline" ); + +_LIT8( KSystemStartup, "systemstartup" ); +_LIT8( KPageStartup, "pagestartup" ); +_LIT8( KWidgetStartup, "pluginstartup" ); + +_LIT8( KSystemShutdown, "systemshutdown" ); +_LIT8( KPageShutdown, "pageshutdown" ); +_LIT8( KWidgetShutdown, "pluginshutdown" ); + +const TUint KDisablePersist( 0x1000 ); + +// Type definitions +typedef TBuf< 256 > TVariantBuf; +typedef TBuf8< 256 > TVariantBuf8; + + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::NewLC() +// Two-phased constructor +// ----------------------------------------------------------------------------- +// +CHsPublisherImpl* CHsPublisherImpl::NewLC( MHsWidgetObserver& aObserver, + TBool aEnablePersist ) + { + CHsPublisherImpl* self = new ( ELeave ) + CHsPublisherImpl( aObserver, aEnablePersist ); + + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::NewL() +// Two-phased constructor +// ----------------------------------------------------------------------------- +// +CHsPublisherImpl* CHsPublisherImpl::NewL( MHsWidgetObserver& aObserver, + TBool aEnablePersist ) + { + CHsPublisherImpl* self = + CHsPublisherImpl::NewLC( aObserver, aEnablePersist ); + CleanupStack::Pop( self ); + return self; + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::CHsPublisherImpl() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CHsPublisherImpl::CHsPublisherImpl( MHsWidgetObserver& aObserver, + TBool aEnablePersist ) + : iObserver( aObserver ), + iEnablePersist( aEnablePersist ) + { + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::ConstructL() +// 2nd phase constructor +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::ConstructL() + { + AttachL(); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::~CHsPublisherImpl() +// Destructor +// ----------------------------------------------------------------------------- +// +CHsPublisherImpl::~CHsPublisherImpl() + { + iTransactions.ResetAndDestroy(); + + TRAP_IGNORE( DetachL() ); + } + +// --------------------------------------------------------------------------- +// CHsPublisherImpl::AttachL +// +// --------------------------------------------------------------------------- +// +void CHsPublisherImpl::AttachL() + { + // Attach to CPS service + RCriteriaArray interestList; + CleanupClosePushL( interestList ); + + iServiceHandler = CLiwServiceHandler::NewL(); + + iCpsService = CLiwCriteriaItem::NewL( 1, KCPSConfigurationIf, KCPS ); + + iCpsService->SetServiceClass( TUid::Uid( KLiwClassBase ) ); + + interestList.AppendL( iCpsService ); + iServiceHandler->AttachL( interestList ); + + CLiwGenericParamList& inParamList( iServiceHandler->InParamListL() ); + CLiwGenericParamList& outParamList( iServiceHandler->OutParamListL() ); + + iServiceHandler->ExecuteServiceCmdL( + *iCpsService, + inParamList, + outParamList ); + + TInt pos( 0 ); + + outParamList.FindFirst( pos, KCPSConfigurationIf ); + + if ( pos != KErrNotFound ) + { + iCpsInterface = outParamList[pos].Value().AsInterface(); + } + + inParamList.Reset(); + outParamList.Reset(); + + if ( !iCpsInterface ) + { + User::Leave( KErrNotFound ); + } + + const TDesC& publisherId( iObserver.Identity() ); + + // Register Observer + CLiwDefaultMap* reqmap = CLiwDefaultMap::NewLC(); + + reqmap->InsertL( KPublisherId, TLiwVariant( publisherId ) ); + reqmap->InsertL( KContentType, TLiwVariant( KAll ) ); + reqmap->InsertL( KContentId, TLiwVariant( KAll ) ); + reqmap->InsertL( KOperation, TLiwVariant( KExecute ) ); + + inParamList.AppendL( TLiwGenericParam( + KType, TLiwVariant( KDataAndPublisher ) ) ); + + inParamList.AppendL( TLiwGenericParam( + KFilter, TLiwVariant( reqmap ) ) ); + + iCpsInterface->ExecuteCmdL( + KRequestNotification, inParamList, outParamList, 0, this ); + + const TLiwGenericParam* outparam( NULL ); + + pos = 0; + + outparam = outParamList.FindFirst( pos, KErrorCode ); + + TInt err( KErrNone ); + + if ( outparam ) + { + if ( outparam->Value().AsTInt32() ) + { + err = KErrGeneral; + } + } + + inParamList.Reset(); + outParamList.Reset(); + + User::LeaveIfError( err ); + + CleanupStack::PopAndDestroy( reqmap ); + + // Register Publisher + CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); + CLiwDefaultMap* actionmap = CLiwDefaultMap::NewLC(); + + datamap->InsertL( KPublisherId, TLiwVariant( publisherId ) ); + datamap->InsertL( KContentType, TLiwVariant( KAll ) ); + datamap->InsertL( KContentId, TLiwVariant( KAll ) ); + + actionmap->InsertL( KActive, TLiwVariant() ); + + datamap->InsertL( KActionMap, TLiwVariant( actionmap ) ); + + inParamList.AppendL( TLiwGenericParam( + KType, TLiwVariant( KPublisher ) ) ); + + inParamList.AppendL( TLiwGenericParam( + KItem, TLiwVariant( datamap ) ) ); + + iCpsInterface->ExecuteCmdL( KAdd, inParamList, outParamList ); + + outparam = NULL; + + pos = 0; + + outparam = outParamList.FindFirst( pos, KErrorCode ); + + err = KErrNone; + + if ( outparam ) + { + if ( outparam->Value().AsTInt32() ) + { + err = KErrGeneral; + } + } + + inParamList.Reset(); + outParamList.Reset(); + + User::LeaveIfError( err ); + + CleanupStack::PopAndDestroy( 2, datamap ); // actionmap + + CleanupStack::PopAndDestroy( &interestList ); + + iCpServiceAvailable = ETrue; + } + +// --------------------------------------------------------------------------- +// CHsPublisherImpl::DetachL +// +// --------------------------------------------------------------------------- +// +void CHsPublisherImpl::DetachL() + { + if ( iServiceHandler && iCpsInterface ) + { + CLiwGenericParamList& inParamList( iServiceHandler->InParamListL() ); + CLiwGenericParamList& outParamList( iServiceHandler->OutParamListL() ); + + // Remove widget data + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + + const TDesC& publisherId( iObserver.Identity() ); + + cpdatamap->InsertL( KPublisherId, TLiwVariant( publisherId ) ); + cpdatamap->InsertL( KContentType, TLiwVariant( KAll ) ); + cpdatamap->InsertL( KContentId, TLiwVariant( KAll ) ); + + inParamList.AppendL( TLiwGenericParam( + KType, TLiwVariant( KCpData ) ) ); + + inParamList.AppendL( TLiwGenericParam( + KItem, TLiwVariant( cpdatamap ) ) ); + + TRAP_IGNORE( iCpsInterface->ExecuteCmdL( + KDelete, inParamList, outParamList ) ); + + inParamList.Reset(); + outParamList.Reset(); + + CleanupStack::PopAndDestroy( cpdatamap ); + + // Unregister Observer + TRAP_IGNORE( iCpsInterface->ExecuteCmdL( + KRequestNotification, + inParamList, + outParamList, + KLiwOptCancel, + this ) ); + + // Detach from CPS service + if ( iCpsInterface ) + { + // Close interface + iCpsInterface->Close(); + } + + iCpsInterface = NULL; + + if ( iServiceHandler && iCpsService ) + { + // Detach services from the handler + RCriteriaArray list; + + list.Append( iCpsService ); + + TRAP_IGNORE( iServiceHandler->DetachL( list ) ); + + list.Reset(); + } + } + + delete iCpsService; + iCpsService = NULL; + + delete iServiceHandler; + iServiceHandler = NULL; + + iCpServiceAvailable = EFalse; + } + +// --------------------------------------------------------------------------- +// CHsPublisherImpl::HandleNotifyL +// +// --------------------------------------------------------------------------- +// +TInt CHsPublisherImpl::HandleNotifyL( TInt /*aCmdId*/, TInt /*aEventId*/, + CLiwGenericParamList& aEventParamList, + const CLiwGenericParamList& /*aInParamList*/ ) + { + TInt pos( 0 ); + + aEventParamList.FindFirst( pos, KChangeInfo ); + + if ( pos == KErrNotFound ) + { + return pos; + } + + const TDesC& publisherId( iObserver.Identity() ); + + // Get list of maps + TLiwVariant listvariant( aEventParamList[pos].Value() ); + listvariant.PushL(); + + const CLiwList* list( listvariant.AsList() ); + + // Iterate through list + for ( TInt i = 0; i < list->Count(); i++ ) + { + TVariantBuf publisher; + TVariantBuf contenttype; + TVariantBuf widgetid; + + TVariantBuf8 operation; + TVariantBuf8 trigger; + + TLiwVariant variant; + variant.PushL(); + + if ( list->AtL( i, variant ) ) + { + const CLiwMap* map( variant.AsMap() ); + + if( map->FindL( KPublisherId, variant ) ) + { + variant.Get( publisher ); + } + + if ( publisher != publisherId ) + { + // Not targeted to this publisher + continue; + } + + // Check what triggered a notification + if ( map->FindL( KOperation, variant ) ) + { + variant.Get( operation ); + } + + if ( operation == KExecute() ) + { + if ( map->FindL( KActionTrigger, variant ) ) + { + variant.Get( trigger ); + } + + if ( map->FindL( KContentId, variant ) ) + { + variant.Get( widgetid ); + } + + if ( map->FindL( KContentType, variant ) ) + { + variant.Get( contenttype ); + } + + if ( contenttype == KHsWidget() ) + { + // HS specific notification + ProcessEvent( widgetid, trigger ); + } + else + { + // Widget specific notification + HBufC* param = HBufC::NewLC( trigger.Length() ); + param->Des().Copy( trigger ); + + iObserver.NotifyWidgetEvent( + widgetid, contenttype, *param ); + + CleanupStack::PopAndDestroy( param ); + } + } + + CleanupStack::PopAndDestroy(); // variant + } + } + + CleanupStack::PopAndDestroy(); // listvariant + + return KErrNone; + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::ProcessEvent() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::ProcessEvent( const TDesC& aWidgetId, + const TDesC8& aEvent ) const + { + if ( aEvent == KResume() ) + { + iObserver.NotifyWidgetState( + aWidgetId, MHsWidgetObserver::EAlive ); + } + else if ( aEvent == KSuspend() ) + { + iObserver.NotifyWidgetState( + aWidgetId, MHsWidgetObserver::ESuspend ); + } + else if ( aEvent == KOnline() ) + { + iObserver.NotifyWidgetState( + aWidgetId, MHsWidgetObserver::EOnline ); + } + else if ( aEvent == KOffline() ) + { + iObserver.NotifyWidgetState( + aWidgetId, MHsWidgetObserver::EOffline ); + } + else if ( aEvent == KSystemStartup() ) + { + iObserver.NotifyWidgetStarted( + aWidgetId, MHsWidgetObserver::ESystemStart ); + } + else if ( aEvent == KPageStartup() ) + { + iObserver.NotifyWidgetStarted( + aWidgetId, MHsWidgetObserver::EPageStart ); + } + else if ( aEvent == KWidgetStartup() ) + { + iObserver.NotifyWidgetStarted( + aWidgetId, MHsWidgetObserver::EWidgetStart ); + } + else if ( aEvent == KSystemShutdown() ) + { + iObserver.NotifyWidgetStopped( + aWidgetId, MHsWidgetObserver::ESystemStop ); + } + else if ( aEvent == KPageShutdown() ) + { + iObserver.NotifyWidgetStopped( + aWidgetId, MHsWidgetObserver::EPageStop ); + } + else if ( aEvent == KWidgetShutdown() ) + { + iObserver.NotifyWidgetStopped( + aWidgetId, MHsWidgetObserver::EWidgetStop ); + } + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::PublishTextL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::PublishTextL( const TDesC& aWidgetId, + const TDesC8& aElementId, const TDesC& aText ) + { + __ASSERT_ALWAYS( iCpServiceAvailable, User::Invariant() ); + + CTransaction* tr( Transaction( aWidgetId ) ); + + if ( !tr ) + { + // Transaction not started + User::Leave( KErrNotReady ); + } + + CTextTransactionItem* item = + new ( ELeave ) CTextTransactionItem( aElementId, aText ); + + CleanupStack::PushL( item ); + + tr->AppendL( item ); + CleanupStack::Pop( item ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::PublishImageL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::PublishImageL( const TDesC& aWidgetId, + const TDesC8& aElementId, const CFbsBitmap* aImage, const CFbsBitmap* aMask ) + { + __ASSERT_ALWAYS( iCpServiceAvailable, User::Invariant() ); + + TInt imageHandle( KErrBadHandle ); + TInt maskHandle( KErrBadHandle ); + + if ( aImage ) + { + imageHandle = aImage->Handle(); + } + + if ( aMask ) + { + maskHandle = aMask->Handle(); + } + + PublishImageL( aWidgetId, aElementId, imageHandle, maskHandle ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::PublishImageL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::PublishImageL( const TDesC& aWidgetId, + const TDesC8& aElementId, TInt aImageHandle, TInt aMaskHandle ) + { + __ASSERT_ALWAYS( iCpServiceAvailable, User::Invariant() ); + + CTransaction* tr( Transaction( aWidgetId ) ); + + if ( !tr ) + { + // Transaction not started + User::Leave( KErrNotReady ); + } + + CImageTransactionItem* item = + new ( ELeave ) CImageTransactionItem( + aElementId, aImageHandle, aMaskHandle ); + + CleanupStack::PushL( item ); + + tr->AppendL( item ); + CleanupStack::Pop( item ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::PublishImageL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::PublishImageL( const TDesC& aWidgetId, + const TDesC8& aElementId, const TDesC& aSource ) + { + __ASSERT_ALWAYS( iCpServiceAvailable, User::Invariant() ); + + CTransaction* tr( Transaction( aWidgetId ) ); + + if ( !tr ) + { + // Transaction not started + User::Leave( KErrNotReady ); + } + + CImageTransactionItem* item = + new ( ELeave ) CImageTransactionItem( aElementId, aSource ); + CleanupStack::PushL( item ); + + tr->AppendL( item ); + CleanupStack::Pop( item ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::PublishStreamL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::PublishStreamL( const TDesC& aWidgetId, + const TDesC8& aElementId, const TDesC8& aStream ) + { + CTransaction* tr( Transaction( aWidgetId ) ); + + if ( !tr ) + { + // Transaction not started + User::Leave( KErrNotReady ); + } + + CDataTransactionItem* item = + new ( ELeave ) CDataTransactionItem( aElementId, aStream ); + CleanupStack::PushL( item ); + + tr->AppendL( item ); + CleanupStack::Pop( item ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::CleanTextL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::CleanTextL( const TDesC& aWidgetId, + const TDesC8& aElementId ) + { + CTransaction* tr( Transaction( aWidgetId ) ); + + if ( !tr ) + { + // Transaction not started + User::Leave( KErrNotReady ); + } + + CTextTransactionItem* item = + new ( ELeave ) CTextTransactionItem( aElementId, KNullDesC() ); + CleanupStack::PushL( item ); + + tr->AppendL( item ); + CleanupStack::Pop( item ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::CleanImageL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::CleanImageL( const TDesC& aWidgetId, + const TDesC8& aElementId ) + { + CTransaction* tr( Transaction( aWidgetId ) ); + + if ( !tr ) + { + // Transaction not started + User::Leave( KErrNotReady ); + } + + CImageTransactionItem* item = + new ( ELeave ) CImageTransactionItem( + aElementId, KErrBadHandle, KErrBadHandle ); + CleanupStack::PushL( item ); + + tr->AppendL( item ); + CleanupStack::Pop( item ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::StartTransactionL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::StartTransactionL( const TDesC& aWidgetId ) + { + __ASSERT_ALWAYS( iCpServiceAvailable, User::Invariant() ); + + CTransaction* tr( Transaction( aWidgetId ) ); + + if ( tr ) + { + // Transaction already started + User::Leave( KErrAlreadyExists ); + } + + // Create new transaction for this widget instance + tr = new ( ELeave ) CTransaction( aWidgetId ); + CleanupStack::PushL( tr ); + + iTransactions.AppendL( tr ); + CleanupStack::Pop( tr ); + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::CommitTransactionL() +// +// ----------------------------------------------------------------------------- +// +void CHsPublisherImpl::CommitTransactionL( const TDesC& aWidgetId ) + { + __ASSERT_ALWAYS( iCpServiceAvailable, User::Invariant() ); + + CTransaction* tr( Transaction( aWidgetId ) ); + + if ( !tr ) + { + // Transaction not started + User::Leave( KErrNotReady ); + } + + // Remove transaction + iTransactions.Remove( iTransactions.Find( tr ) ); + + // Transaction will be destroyed + CleanupStack::PushL( tr ); + + const RPointerArray< CTransactionItem >& items( tr->Items() ); + + if ( items.Count() == 0 ) + { + // Nothing to publish + CleanupStack::PopAndDestroy( tr ); + return; + } + + CLiwGenericParamList& inParamList( iServiceHandler->InParamListL() ); + CLiwGenericParamList& outParamList( iServiceHandler->OutParamListL() ); + + inParamList.AppendL( TLiwGenericParam( + KType, TLiwVariant( KCpData ) ) ); + + CLiwDefaultMap* cpdatamap = CLiwDefaultMap::NewLC(); + + const TDesC& publisherId( iObserver.Identity() ); + + cpdatamap->InsertL( KPublisherId, TLiwVariant( publisherId ) ); + cpdatamap->InsertL( KContentType, TLiwVariant( KAll ) ); + cpdatamap->InsertL( KContentId, TLiwVariant( aWidgetId ) ); + + CLiwDefaultMap* datamap = CLiwDefaultMap::NewLC(); + + for ( TInt i = 0; i < items.Count(); i++ ) + { + CTransactionItem* item( items[i] ); + + CImageTransactionItem* image = + dynamic_cast< CImageTransactionItem* >( item ); + + CTextTransactionItem* text = + dynamic_cast< CTextTransactionItem* >( item ); + + CDataTransactionItem* data = + dynamic_cast< CDataTransactionItem* >( item ); + + if ( image ) + { + const TDesC& source( image->Path() ); + + if ( source != KNullDesC ) + { + datamap->InsertL( image->ElementId(), + TLiwVariant( source ) ); + } + else + { + datamap->InsertL( image->ElementId(), + TLiwVariant( TInt32( image->ImageHandle() ) ) ); + + datamap->InsertL( image->ElementId(), + TLiwVariant( TInt32( image->MaskHandle() ) ) ); + } + } + else if ( text ) + { + datamap->InsertL( text->ElementId(), + TLiwVariant( text->Text() ) ); + } + else if ( data ) + { + datamap->InsertL( data->ElementId(), + TLiwVariant( data->Data() ) ); + } + } + + cpdatamap->InsertL( KDataMap, TLiwVariant( datamap ) ); + + inParamList.AppendL( TLiwGenericParam( + KItem, TLiwVariant( cpdatamap ) ) ); + + iCpsInterface->ExecuteCmdL( KAdd, inParamList, outParamList, + iEnablePersist ? 0 : KDisablePersist ); + + inParamList.Reset(); + outParamList.Reset(); + + CleanupStack::PopAndDestroy( 3, tr ); // cpdatamap, datamap + } + +// ----------------------------------------------------------------------------- +// CHsPublisherImpl::Transaction() +// +// ----------------------------------------------------------------------------- +// +CTransaction* CHsPublisherImpl::Transaction( + const TDesC& aWidgetId ) const + { + CTransaction* tr( NULL ); + + for ( TInt i = 0; i < iTransactions.Count(); i++ ) + { + if ( *iTransactions[i] == aWidgetId ) + { + tr = iTransactions[i]; + break; + } + } + + return tr; + } + +// End of file diff -r 000000000000 -r b856a9924bbc data/publisherif/src/transaction.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/publisherif/src/transaction.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,284 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ +// System includes + +// User includes +#include "transaction.h" + +// Constants + +// ============================= LOCAL FUNCTIONS =============================== + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTransactionItem::CTransactionItem() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CTransactionItem::CTransactionItem( const TDesC8& aElementId ) + : iElementId( aElementId.Alloc() ) + { + } + +// ----------------------------------------------------------------------------- +// CTransactionItem::~CTransactionItem() +// Destructor +// ----------------------------------------------------------------------------- +// +CTransactionItem::~CTransactionItem() + { + delete iElementId; + } + +// ----------------------------------------------------------------------------- +// CTransactionItem::ElementId() +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CTransactionItem::ElementId() const + { + return iElementId ? *iElementId : KNullDesC8(); + } + +// ----------------------------------------------------------------------------- +// CImageTransactionItem::CImageTransactionItem +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CImageTransactionItem::CImageTransactionItem( const TDesC8& aElementId, + TInt aImageHandle, TInt aMaskHandle ) + : CTransactionItem( aElementId ), + iImageHandle( aImageHandle ), + iMaskHandle( aMaskHandle ), + iPath( NULL ) + { + } + +// ----------------------------------------------------------------------------- +// CImageTransactionItem::CImageTransactionItem +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CImageTransactionItem::CImageTransactionItem( const TDesC8& aElementId, + const TDesC& aPath ) + : CTransactionItem( aElementId ), + iImageHandle( KErrBadHandle ), + iMaskHandle( KErrBadHandle ), + iPath( aPath.Alloc() ) + { + } + +// ----------------------------------------------------------------------------- +// CImageTransactionItem::~CImageTransactionItem() +// Destructor +// ----------------------------------------------------------------------------- +// +CImageTransactionItem::~CImageTransactionItem() + { + delete iPath; + } + +// ----------------------------------------------------------------------------- +// CImageTransactionItem::Type() +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CImageTransactionItem::Type() const + { + _LIT8( KImage, "image" ); + + return KImage(); + } + +// ----------------------------------------------------------------------------- +// CImageTransactionItem::ImageHandle() +// +// ----------------------------------------------------------------------------- +// +TInt CImageTransactionItem::ImageHandle() const + { + return iImageHandle; + } + +// ----------------------------------------------------------------------------- +// CImageTransactionItem::MaskHandle() +// +// ----------------------------------------------------------------------------- +// +TInt CImageTransactionItem::MaskHandle() const + { + return iMaskHandle; + } + +// ----------------------------------------------------------------------------- +// CImageTransactionItem::Path() +// +// ----------------------------------------------------------------------------- +// +const TDesC& CImageTransactionItem::Path() const + { + return iPath ? *iPath : KNullDesC(); + } + +// ----------------------------------------------------------------------------- +// CTextTransactionItem::CTextTransactionItem() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CTextTransactionItem::CTextTransactionItem( const TDesC8& aElementId, + const TDesC& aText ) + : CTransactionItem( aElementId ), + iText( aText.Alloc() ) + { + } + +// ----------------------------------------------------------------------------- +// CTextTransactionItem::~CTextTransactionItem() +// Destructor +// ----------------------------------------------------------------------------- +// +CTextTransactionItem::~CTextTransactionItem() + { + delete iText; + } + +// ----------------------------------------------------------------------------- +// CTextTransactionItem::Type() +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CTextTransactionItem::Type() const + { + _LIT8( KText, "text" ); + + return KText(); + } + +// ----------------------------------------------------------------------------- +// CTextTransactionItem::Text() +// +// ----------------------------------------------------------------------------- +// +const TDesC& CTextTransactionItem::Text() const + { + return iText ? *iText : KNullDesC(); + } + + +// ----------------------------------------------------------------------------- +// CDataTransactionItem::CDataTransactionItem() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CDataTransactionItem::CDataTransactionItem( const TDesC8& aElementId, + const TDesC8& aData ) + : CTransactionItem( aElementId ), + iData( aData.Alloc() ) + { + } + +// ----------------------------------------------------------------------------- +// CDataTransactionItem::~CDataTransactionItem() +// Destructor +// ----------------------------------------------------------------------------- +// +CDataTransactionItem::~CDataTransactionItem() + { + delete iData; + } + +// ----------------------------------------------------------------------------- +// CDataTransactionItem::Type() +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CDataTransactionItem::Type() const + { + _LIT8( KData, "data" ); + + return KData(); + } + +// ----------------------------------------------------------------------------- +// CDataTransactionItem::Data() +// +// ----------------------------------------------------------------------------- +// +const TDesC8& CDataTransactionItem::Data() const + { + return iData ? *iData : KNullDesC8(); + } + +// ----------------------------------------------------------------------------- +// CTransaction::CTransaction() +// C++ default constructor +// ----------------------------------------------------------------------------- +// +CTransaction::CTransaction( const TDesC& aWidgetId ) + : iWidgetId( aWidgetId ) + { + } + +// ----------------------------------------------------------------------------- +// CTransaction::~CTransaction() +// Destructor +// ----------------------------------------------------------------------------- +// +CTransaction::~CTransaction() + { + iItems.ResetAndDestroy(); + } + +// ----------------------------------------------------------------------------- +// CTransaction::operator==() +// +// ----------------------------------------------------------------------------- +// +TBool CTransaction::operator== ( const TDesC& aWidgetId ) const + { + if ( iWidgetId == KNullDesC ) + { + return EFalse; + } + + return aWidgetId == iWidgetId; + } + +// ----------------------------------------------------------------------------- +// CTransaction::AppendL() +// +// ----------------------------------------------------------------------------- +// +void CTransaction::AppendL( CTransactionItem* aItem ) + { + User::LeaveIfError( iItems.InsertInAddressOrder( aItem ) ); + } + +// ----------------------------------------------------------------------------- +// CTransaction::Items() +// +// ----------------------------------------------------------------------------- +// +const RPointerArray< CTransactionItem >& CTransaction::Items() const + { + return iItems; + } + +// End of file diff -r 000000000000 -r b856a9924bbc data/renderingplugin/data/renderer.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/renderingplugin/data/renderer.rss Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,43 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include + +RESOURCE REGISTRY_INFO theInfo +{ +dll_uid = 0x22334454;// Apply your own uid! +interfaces = +{ + INTERFACE_INFO + { + interface_uid = 0x200286DF;//Don't change! + implementations = + { + IMPLEMENTATION_INFO + { + implementation_uid = 0x22334455;// Apply your own uid! + version_no = 1; + display_name = "#replace#renderer"; + default_data = "#replace#renderer"; + opaque_data = ""; + } + }; + } + }; +} diff -r 000000000000 -r b856a9924bbc data/renderingplugin/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/renderingplugin/group/bld.inf Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,24 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +PRJ_PLATFORMS +DEFAULT + +PRJ_MMPFILES +#replace#renderer.mmp diff -r 000000000000 -r b856a9924bbc data/renderingplugin/group/renderer.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/renderingplugin/group/renderer.mmp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,45 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include +#include + +TARGET #replace#renderer.dll +TARGETTYPE PLUGIN +UID 0x10009d8d 0x22334454 + +CAPABILITY CAP_ECOM_PLUGIN + +SOURCEPATH ../src +SOURCE #replace#renderer.cpp + +USERINCLUDE ../inc + +MW_LAYER_SYSTEMINCLUDE +APP_LAYER_SYSTEMINCLUDE + +SOURCEPATH ../data +START RESOURCE #replace#renderer.rss +HEADER +TARGETPATH ECOM_RESOURCE_DIR +END + +LIBRARY euser.lib +LIBRARY extrenderingplugin.lib +LIBRARY cone.lib diff -r 000000000000 -r b856a9924bbc data/renderingplugin/inc/renderer.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/renderingplugin/inc/renderer.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,138 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#ifndef MYRENDERINGPLUGIN_H +#define MYRENDERINGPLUGIN_H + +#include + +// FORWARD DECLARATIONS + +class #replace#Renderer : public CXnExtRenderingPluginAdapter + { +public: + + /** + * Two-phased constructor. + * @return Pointer to created object. + */ + static #replace#Renderer* NewL(); + + /** + * Two-phased constructor. + * @return Pointer to created object. + */ + static #replace#Renderer* NewLC(); + + /** + * Destructor. + */ + virtual ~#replace#Renderer(); + +public: // from base classes + + /** + * From CCoeControl Handles key events. + * @since Series 60 3.1 + * @param aKeyEvent Key event. + * @param aType Event type. + * @return Key response + */ + TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ); + + /** + * From CCoeControl + */ + void SetContainerWindowL( const CCoeControl &aContainer ); + + /** + * See CCoeControl documentation + */ + void HandlePointerEventL( const TPointerEvent& aPointerEvent ); + + /** + * From CCoeControl, CountComponentControls + * @return Number of component controls + */ + TInt CountComponentControls() const; + + /** + * From CCoeControl, ComponentControl + * @param aIndex index of component control + * @return pointer to the specified control + */ + CCoeControl* ComponentControl( TInt aIndex ) const; + + /** + * Skin change notification. + * See CXnControlAdapter documentation + * @since Series 60 3.1 + */ + void SkinChanged(); + + /** + * See CXnControlAdapter documentation + */ + void EnterPowerSaveModeL(); + + /** + * See CXnControlAdapter documentation + */ + void ExitPowerSaveModeL(); + + protected: // from base classes + + /** + * From CCoeControl + * Called if focus changes + */ + void FocusChanged( TDrawNow aDrawNow ); + + /** + * From CCoeControl + * Called if position or size changes + */ + void SizeChanged(); + +private: // from base classes + + /** + * From CCoeControl, Draw + * See CCoeControl documentation + */ + void Draw( const TRect& aRect ) const; + + private: + + /** + * C++ default constructor. + */ + #replace#Renderer(); + + /** + * By default Symbian 2nd phase constructor is private. + */ + void ConstructL(); + +private: // Member data + + }; + +#endif // MYRENDERINGPLUGIN_H diff -r 000000000000 -r b856a9924bbc data/renderingplugin/src/renderer.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/renderingplugin/src/renderer.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,189 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include +#include "#replace#Renderer.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +#replace#Renderer* #replace#Renderer::NewL() + { + #replace#Renderer* self = #replace#Renderer::NewLC(); + CleanupStack::Pop( self ); + return self; + } +// ----------------------------------------------------------------------------- +// Symbian static 1st phase constructor +// ----------------------------------------------------------------------------- +// +#replace#Renderer* #replace#Renderer::NewLC() + { + #replace#Renderer* self = new( ELeave ) #replace#Renderer(); + CleanupStack::PushL( self ); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// C++ destructor +// ----------------------------------------------------------------------------- +// +#replace#Renderer::~#replace#Renderer() + { + } + +// ----------------------------------------------------------------------------- +// Handles key events. +// ----------------------------------------------------------------------------- +// +TKeyResponse #replace#Renderer::OfferKeyEventL( const TKeyEvent& aKeyEvent, + TEventCode aType ) + { + } + +// ----------------------------------------------------------------------------- +// Set window for this control +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::SetContainerWindowL( const CCoeControl &aContainer ) + { + CCoeControl::SetContainerWindowL( aContainer ); + } + +// ----------------------------------------------------------------------------- +// (other items were commented in a header). +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::HandlePointerEventL( const TPointerEvent& aPointerEvent ) + { + CCoeControl::HandlePointerEventL( aPointerEvent ); + } + +// ----------------------------------------------------------------------------- +// Returns the number of component controls +// ----------------------------------------------------------------------------- +// +TInt #replace#Renderer::CountComponentControls() const + { + return 0; + } + +// ----------------------------------------------------------------------------- +// Returns the specified control +// ----------------------------------------------------------------------------- +// +CCoeControl* #replace#Renderer::ComponentControl( TInt aIndex ) const + { + return NULL; + } + +// ----------------------------------------------------------------------------- +// Skin change notification. +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::SkinChanged() + { + } + +// ----------------------------------------------------------------------------- +// EnterPowerSaveModeL +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::EnterPowerSaveModeL() + { + } + +// ----------------------------------------------------------------------------- +// ExitPowerSaveModeL +// +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::ExitPowerSaveModeL() + { + } + +// ----------------------------------------------------------------------------- +// Called if focus changes +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::FocusChanged( TDrawNow /*aDrawNow*/ ) + { + } + +// ----------------------------------------------------------------------------- +// Called if position or size changes +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::SizeChanged() + { + } + +// ----------------------------------------------------------------------------- +// Draws the carousel component +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::Draw( const TRect& aRect ) const + { + CWindowGc& gc( SystemGc() ); + gc.DrawEllipse( aRect ); + } + +// ----------------------------------------------------------------------------- +// C++ default constructor +// ----------------------------------------------------------------------------- +// +#replace#Renderer::#replace#Renderer() + { + // Do nothing + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void #replace#Renderer::ConstructL() + { + } + +// ============================ PUBLIC FUNCTIONS =============================== + +const TImplementationProxy KImplementationTable[] = + { +#ifdef __EABI__ + IMPLEMENTATION_PROXY_ENTRY( 0x22334455, #replace#Renderer::NewL ) +#else + { { 0x22334455 }, #replace#Renderer::NewL } +#endif + }; + +// ----------------------------------------------------------------------------- +// Returns the list of implementations provided by the plugin +// ----------------------------------------------------------------------------- +// +EXPORT_C const TImplementationProxy* ImplementationGroupProxy( + TInt& aTableCount ) + { + aTableCount = sizeof( KImplementationTable ) / sizeof( TImplementationProxy ); + return KImplementationTable; + } + diff -r 000000000000 -r b856a9924bbc data/testpublisher/.cproject --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/.cproject Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,33 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r b856a9924bbc data/testpublisher/.project --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/.project Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,20 @@ + + + TestPublisher + + + + + + com.nokia.carbide.cdt.builder.carbideCPPBuilder + + + + + + org.eclipse.cdt.core.cnature + org.eclipse.cdt.core.ccnature + com.nokia.carbide.cdt.builder.carbideCPPBuilderNature + com.nokia.carbide.cdt.builder.carbideSBSv2BuilderNature + + diff -r 000000000000 -r b856a9924bbc data/testpublisher/data/testpublisher.rls --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/data/testpublisher.rls Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,47 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +// LOCALISATION STRINGS + +// Caption string for app. +#define qtn_caption_string "TestPublisher" + +// First item in "Options" menu pane +#define qtn_command1 "Message" + +// Second item in "Options" menu pane +#define qtn_command2 "Message from file" + +#define qtn_help "Help" + +#define qtn_about "About" + +// Third item in "Options" menu pane +#define qtn_exit "Exit" + +// When user requests ECommand1 event, text below is shown. +#define qtn_command1_text "Test publisher!" + +#define qtn_loc_resource_file_1 "\\resource\\apps\\TestPublisher_0xE5555555" + +#define qtn_about_dialog_title "About" + +#define qtn_about_dialog_text "TestPublisher Version 1.0.0\n\nAuthor: \n\nSupport: \n\n(c) " + +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/data/testpublisher.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/data/testpublisher.rss Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,183 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +// RESOURCE IDENTIFIER +NAME TEST // 4 letter ID + + +// INCLUDES +#include +#include +#include +#include +#include "TestPublisher.hrh" +#include "TestPublisher.rls" + +// RESOURCE DEFINITIONS +// ----------------------------------------------------------------------------- +// +// Define the resource file signature +// This resource should be empty. +// +// ----------------------------------------------------------------------------- +// +RESOURCE RSS_SIGNATURE + { + } + +// ----------------------------------------------------------------------------- +// +// Default Document Name +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF r_default_document_name + { + buf="TEST"; + } + +// ----------------------------------------------------------------------------- +// +// Define default menu and CBA key. +// +// ----------------------------------------------------------------------------- +// +RESOURCE EIK_APP_INFO + { + menubar = r_menubar; + cba = R_AVKON_SOFTKEYS_OPTIONS_EXIT; + } + + +// ----------------------------------------------------------------------------- +// +// r_menubar +// Main menubar +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_BAR r_menubar + { + titles = + { + MENU_TITLE { menu_pane = r_menu; } + }; + } + + +// ----------------------------------------------------------------------------- +// +// r_menu +// Menu for "Options" +// +// ----------------------------------------------------------------------------- +// +RESOURCE MENU_PANE r_menu + { + items = + { + // added the new Options menu command here + MENU_ITEM + { + command = ECommand1; + txt = qtn_command1; + }, + MENU_ITEM + { + command = ECommand2; + txt = qtn_command2; + }, + MENU_ITEM + { + command = EAbout; + txt = qtn_about; + }, + MENU_ITEM + { + command = EAknSoftkeyExit; + txt = qtn_exit; + } + }; + } + +// ----------------------------------------------------------------------------- +// +// About dialog resource. +// +// ----------------------------------------------------------------------------- +// +RESOURCE DIALOG r_about_query_dialog + { + flags = EGeneralQueryFlags | EEikDialogFlagNoBorder | EEikDialogFlagNoShadow; + buttons = R_AVKON_SOFTKEYS_OK_EMPTY; + items= + { + DLG_LINE + { + type = EAknCtPopupHeadingPane; + id = EAknMessageQueryHeaderId; + itemflags = EEikDlgItemNonFocusing; + control = AVKON_HEADING + { + }; + }, + DLG_LINE + { + type = EAknCtMessageQuery; + id = EAknMessageQueryContentId; + control = AVKON_MESSAGE_QUERY + { + }; + } + }; + } + + +// ----------------------------------------------------------------------------- +// +// Resources for messages. +// +// ----------------------------------------------------------------------------- +// +RESOURCE TBUF32 r_caption_string { buf=qtn_caption_string; } +RESOURCE TBUF32 r_about_dialog_title { buf=qtn_about_dialog_title; } +RESOURCE TBUF r_about_dialog_text { buf=qtn_about_dialog_text; } +RESOURCE TBUF r_command1_text { buf=qtn_command1_text; } + + +// ---------------------------------------------------------------------------- +// +// r_localisable_app_info +// +// ---------------------------------------------------------------------------- +// +RESOURCE LOCALISABLE_APP_INFO r_localisable_app_info + { + short_caption = qtn_caption_string; + caption_and_icon = + CAPTION_AND_ICON_INFO + { + caption = qtn_caption_string; + + number_of_icons = 1; + icon_file = "\\resource\\apps\\TestPublisher_0xE5555555.mif"; + }; + } + +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/data/testpublisher_reg.rss --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/data/testpublisher_reg.rss Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,37 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include "TestPublisher.hrh" +#include "TestPublisher.rls" +#include +#include + +UID2 KUidAppRegistrationResourceFile +UID3 _UID3 + +RESOURCE APP_REGISTRATION_INFO + { + app_file="TestPublisher_0xE5555555"; + localisable_resource_file = qtn_loc_resource_file_1; + localisable_resource_id = R_LOCALISABLE_APP_INFO; + + embeddability=KAppNotEmbeddable; + newfile=KAppDoesNotSupportNewFile; + } + diff -r 000000000000 -r b856a9924bbc data/testpublisher/gfx/cricket.png Binary file data/testpublisher/gfx/cricket.png has changed diff -r 000000000000 -r b856a9924bbc data/testpublisher/gfx/f1.png Binary file data/testpublisher/gfx/f1.png has changed diff -r 000000000000 -r b856a9924bbc data/testpublisher/gfx/qgn_menu_TestPublisher.svg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/gfx/qgn_menu_TestPublisher.svg Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,56 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r b856a9924bbc data/testpublisher/gfx/tennis.png Binary file data/testpublisher/gfx/tennis.png has changed diff -r 000000000000 -r b856a9924bbc data/testpublisher/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/group/bld.inf Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +PRJ_EXPORTS +../gfx/f1.png /epoc32/winscw/c/data/installs/f1.png +../gfx/cricket.png /epoc32/winscw/c/data/installs/cricket.png +../gfx/tennis.png /epoc32/winscw/c/data/installs/tennis.png + +PRJ_PLATFORMS +WINSCW ARMV5 GCCE + +PRJ_MMPFILES + +gnumakefile icons_scalable_dc.mk + +TestPublisher.mmp + diff -r 000000000000 -r b856a9924bbc data/testpublisher/group/icons_scalable_dc.mk --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/group/icons_scalable_dc.mk Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,48 @@ + +ifeq (WINS,$(findstring WINS, $(PLATFORM))) +ZDIR=$(EPOCROOT)epoc32\release\$(PLATFORM)\$(CFG)\Z +else +ZDIR=$(EPOCROOT)epoc32\data\z +endif + +TARGETDIR=$(ZDIR)\resource\apps +ICONTARGETFILENAME=$(TARGETDIR)\TestPublisher_0xE5555555.mif + +ICONDIR=..\gfx + +do_nothing : + @rem do_nothing + +MAKMAKE : do_nothing + +BLD : do_nothing + +CLEAN : + @echo ...Deleting $(ICONTARGETFILENAME) + del /q /f $(ICONTARGETFILENAME) + +LIB : do_nothing + +CLEANLIB : do_nothing + +# ---------------------------------------------------------------------------- +# NOTE: if you have JUSTINTIME enabled for your S60 3rd FP1 or newer SDK +# and this command crashes, consider adding "/X" to the command line. +# See +# ---------------------------------------------------------------------------- + +RESOURCE : $(ICONTARGETFILENAME) + +$(ICONTARGETFILENAME) : $(ICONDIR)\qgn_menu_TestPublisher.svg + mifconv $(ICONTARGETFILENAME) \ + /c32 $(ICONDIR)\qgn_menu_TestPublisher.svg + +FREEZE : do_nothing + +SAVESPACE : do_nothing + +RELEASABLES : + @echo $(ICONTARGETFILENAME) + +FINAL : do_nothing + diff -r 000000000000 -r b856a9924bbc data/testpublisher/group/testpublisher.mmp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/group/testpublisher.mmp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,80 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include +#include +APP_LAYER_SYSTEMINCLUDE + +TARGET TestPublisher_0xE5555555.exe +TARGETTYPE exe +UID 0x100039CE 0xE5555555 + +SOURCEPATH ..\src +SOURCE testpublisher.cpp +SOURCE testpublisherapplication.cpp +SOURCE testpublisherappview.cpp +SOURCE testpublisherappui.cpp +SOURCE testpublisherdocument.cpp + +SOURCEPATH ..\..\publisherif\src +SOURCE hspublisher.cpp +SOURCE hspublisherimpl.cpp +SOURCE transaction.cpp + +SOURCEPATH ..\data + +START RESOURCE testpublisher.rss +HEADER +TARGET TestPublisher_0xE5555555 +TARGETPATH resource\apps +END //RESOURCE + +START RESOURCE testpublisher_reg.rss +TARGET testpublisher_0xE5555555_reg +TARGETPATH \private\10003a3f\apps +END //RESOURCE + + + +USERINCLUDE ..\inc +USERINCLUDE ..\..\publisherif\inc + +SYSTEMINCLUDE \epoc32\include + +LIBRARY euser.lib +LIBRARY apparc.lib +LIBRARY cone.lib +LIBRARY bafl.lib +LIBRARY eikcore.lib +LIBRARY avkon.lib +LIBRARY commonengine.lib +LIBRARY aknnotify.lib +LIBRARY liwServiceHandler.lib + + +LANG SC + +VENDORID 0 +SECUREID 0xE5555555 +CAPABILITY ReadUserData + +#ifdef ENABLE_ABIV2_MODE + DEBUGGABLE_UDEBONLY +#endif +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/inc/testpublisher.hrh --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/inc/testpublisher.hrh Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#ifndef __TESTPUBLISHER_HRH__ +#define __TESTPUBLISHER_HRH__ + +#define _UID3 0xE5555555 + +// TestPublisher enumerate command codes +enum TTestPublisherIds + { + ECommand1 = 0x6001, // start value must not be 0 + ECommand2, + EAbout + }; + +#endif // __TESTPUBLISHER_HRH__ diff -r 000000000000 -r b856a9924bbc data/testpublisher/inc/testpublisher.pan --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/inc/testpublisher.pan Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,36 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#ifndef __TESTPUBLISHER_PAN__ +#define __TESTPUBLISHER_PAN__ + +/** TestPublisher application panic codes */ +enum TTestPublisherPanics + { + ETestPublisherUi = 1 + // add further panics here + }; + +inline void Panic(TTestPublisherPanics aReason) + { + _LIT(applicationName, "TestPublisher"); + User::Panic(applicationName, aReason); + } + +#endif // __TESTPUBLISHER_PAN__ diff -r 000000000000 -r b856a9924bbc data/testpublisher/inc/testpublisherappUi.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/inc/testpublisherappUi.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,87 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ +#ifndef __TESTPUBLISHERAPPUI_h__ +#define __TESTPUBLISHERAPPUI_h__ + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CTestPublisherAppView; + +// CLASS DECLARATION +/** + * CTestPublisherAppUi application UI class. + * Interacts with the user through the UI and request message processing + * from the handler class + */ +class CTestPublisherAppUi : public CAknAppUi + { +public: + // Constructors and destructor + + /** + * ConstructL. + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * CTestPublisherAppUi. + * C++ default constructor. This needs to be public due to + * the way the framework constructs the AppUi + */ + CTestPublisherAppUi(); + + /** + * ~CTestPublisherAppUi. + * Virtual Destructor. + */ + virtual ~CTestPublisherAppUi(); + +private: + // Functions from base classes + + /** + * From CEikAppUi, HandleCommandL. + * Takes care of command handling. + * @param aCommand Command to be handled. + */ + void HandleCommandL(TInt aCommand); + + /** + * HandleStatusPaneSizeChange. + * Called by the framework when the application status pane + * size is changed. + */ + void HandleStatusPaneSizeChange(); + +private: + // Data + + /** + * The application view + * Owned by CTestPublisherAppUi + */ + CTestPublisherAppView* iAppView; + + }; + +#endif // __TESTPUBLISHERAPPUI_h__ +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/inc/testpublisherapplication.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/inc/testpublisherapplication.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,66 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#ifndef __TESTPUBLISHERAPPLICATION_H__ +#define __TESTPUBLISHERAPPLICATION_H__ + +// INCLUDES +#include +#include "TestPublisher.hrh" + +// UID for the application; +// this should correspond to the uid defined in the mmp file +const TUid KUidTestPublisherApp = + { + _UID3 + }; + +// CLASS DECLARATION + +/** + * CTestPublisherApplication application class. + * Provides factory to create concrete document object. + * An instance of CTestPublisherApplication is the application part of the + * AVKON application framework for the TestPublisher example application. + */ +class CTestPublisherApplication : public CAknApplication + { +public: + // Functions from base classes + + /** + * From CApaApplication, AppDllUid. + * @return Application's UID (KUidTestPublisherApp). + */ + TUid AppDllUid() const; + +protected: + // Functions from base classes + + /** + * From CApaApplication, CreateDocumentL. + * Creates CTestPublisherDocument document object. The returned + * pointer in not owned by the CTestPublisherApplication object. + * @return A pointer to the created document object. + */ + CApaDocument* CreateDocumentL(); + }; + +#endif // __TESTPUBLISHERAPPLICATION_H__ +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/inc/testpublisherappview.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/inc/testpublisherappview.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,158 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#ifndef __TESTPUBLISHERAPPVIEW_h__ +#define __TESTPUBLISHERAPPVIEW_h__ + +// INCLUDES +#include +#include +#include + +#include "hswidgetobserver.h" + +class CHsPublisher; + +// CLASS DECLARATION +class CTestPublisherAppView : public CCoeControl, public MHsWidgetObserver + { +public: + // New methods + + /** + * NewL. + * Two-phased constructor. + * Create a CTestPublisherAppView object, which will draw itself to aRect. + * @param aRect The rectangle this view will be drawn to. + * @return a pointer to the created instance of CTestPublisherAppView. + */ + static CTestPublisherAppView* NewL(const TRect& aRect); + + /** + * NewLC. + * Two-phased constructor. + * Create a CTestPublisherAppView object, which will draw itself + * to aRect. + * @param aRect Rectangle this view will be drawn to. + * @return A pointer to the created instance of CTestPublisherAppView. + */ + static CTestPublisherAppView* NewLC(const TRect& aRect); + + /** + * ~CTestPublisherAppView + * Virtual Destructor. + */ + virtual ~CTestPublisherAppView(); + +public: + // Functions from base classes + + /** + * From CCoeControl, Draw + * Draw this CTestPublisherAppView to the screen. + * @param aRect the rectangle of this view that needs updating + */ + void Draw(const TRect& aRect) const; + + /** + * From CoeControl, SizeChanged. + * Called by framework when the view size is changed. + */ + virtual void SizeChanged(); + + /** + * From CoeControl, HandlePointerEventL. + * Called by framework when a pointer touch event occurs. + * Note: although this method is compatible with earlier SDKs, + * it will not be called in SDKs without Touch support. + * @param aPointerEvent the information about this event + */ + virtual void HandlePointerEventL(const TPointerEvent& aPointerEvent); + +private: + // from MHsWidgetObserver + + /** + * @see MHsWidgetObserver + */ + const TDesC& Identity(); + + /** + * @see MHsWidgetObserver + */ + void NotifyWidgetStarted( + const TDesC& aWidgetId, + MHsWidgetObserver::EStartReason aReason ); + + /** + * @see MHsWidgetObserver + */ + void NotifyWidgetStopped( + const TDesC& aWidgetId, + MHsWidgetObserver::EStopReason aReason ); + + /** + * @see MHsWidgetObserver + */ + void NotifyWidgetState( + const TDesC& aWidgetId, + MHsWidgetObserver::EState aState ); + + /** + * @see MHsWidgetObserver + */ + void NotifyWidgetEvent( + const TDesC& aWidgetId, + const TDesC& aEvent, + const TDesC& aParam ); + +private: + // Constructors + + /** + * ConstructL + * 2nd phase constructor. + * Perform the second phase construction of a + * CTestPublisherAppView object. + * @param aRect The rectangle this view will be drawn to. + */ + void ConstructL(const TRect& aRect); + + /** + * CTestPublisherAppView. + * C++ default constructor. + */ + CTestPublisherAppView(); + + void PublishL( const TDesC& aWidgetId ); +private: + // data + + /** Publisher, owned */ + CHsPublisher* iPublisher; + /** Id of active widget instance, owned */ + CDesCArrayFlat* iWidgetIds; + /** Flags */ + TBitFlags iFlags; + /** Helper to alternate published image */ + TBool iFeedCnt; + }; + +#endif // __TESTPUBLISHERAPPVIEW_h__ +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/inc/testpublisherdocument.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/inc/testpublisherdocument.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,101 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#ifndef __TESTPUBLISHERDOCUMENT_h__ +#define __TESTPUBLISHERDOCUMENT_h__ + +// INCLUDES +#include + +// FORWARD DECLARATIONS +class CTestPublisherAppUi; +class CEikApplication; + +// CLASS DECLARATION + +/** + * CTestPublisherDocument application class. + * An instance of class CTestPublisherDocument is the Document part of the + * AVKON application framework for the TestPublisher example application. + */ +class CTestPublisherDocument : public CAknDocument + { +public: + // Constructors and destructor + + /** + * NewL. + * Two-phased constructor. + * Construct a CTestPublisherDocument for the AVKON application aApp + * using two phase construction, and return a pointer + * to the created object. + * @param aApp Application creating this document. + * @return A pointer to the created instance of CTestPublisherDocument. + */ + static CTestPublisherDocument* NewL(CEikApplication& aApp); + + /** + * NewLC. + * Two-phased constructor. + * Construct a CTestPublisherDocument for the AVKON application aApp + * using two phase construction, and return a pointer + * to the created object. + * @param aApp Application creating this document. + * @return A pointer to the created instance of CTestPublisherDocument. + */ + static CTestPublisherDocument* NewLC(CEikApplication& aApp); + + /** + * ~CTestPublisherDocument + * Virtual Destructor. + */ + virtual ~CTestPublisherDocument(); + +public: + // Functions from base classes + + /** + * CreateAppUiL + * From CEikDocument, CreateAppUiL. + * Create a CTestPublisherAppUi object and return a pointer to it. + * The object returned is owned by the Uikon framework. + * @return Pointer to created instance of AppUi. + */ + CEikAppUi* CreateAppUiL(); + +private: + // Constructors + + /** + * ConstructL + * 2nd phase constructor. + */ + void ConstructL(); + + /** + * CTestPublisherDocument. + * C++ default constructor. + * @param aApp Application creating this document. + */ + CTestPublisherDocument(CEikApplication& aApp); + + }; + +#endif // __TESTPUBLISHERDOCUMENT_h__ +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/sis/TestPublisher_S60_3_X_v_1_0_0.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/sis/TestPublisher_S60_3_X_v_1_0_0.pkg Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,37 @@ +; Installation file for TestPublisher application +; +; This is an auto-generated PKG file by Carbide. +; This file uses variables specific to Carbide builds that will not work +; on command-line builds. If you want to use this generated PKG file from the +; command-line tools you will need to modify the variables with the appropriate +; values: $(EPOCROOT), $(PLATFORM), $(TARGET) +; +;Language - standard language definitions +&EN + +; standard SIS file header +#{"TestPublisher"},(0xE5555555),1,0,0 + +;Localised Vendor name +%{"Vendor-EN"} + +;Unique Vendor name +:"Vendor" + +;Supports Series 60 v 3.0 +[0x101F7961], 0, 0, 0, {"Series60ProductID"} + +;Files to install +;You should change the source paths to match that of your environment +; +"$(EPOCROOT)Epoc32\release\$(PLATFORM)\$(TARGET)\TestPublisher_0xE5555555.exe" -"!:\sys\bin\TestPublisher_0xE5555555.exe" +"$(EPOCROOT)Epoc32\data\z\resource\apps\TestPublisher_0xE5555555.rsc" -"!:\resource\apps\TestPublisher_0xE5555555.rsc" +"$(EPOCROOT)Epoc32\data\z\private\10003a3f\apps\TestPublisher_0xE5555555_reg.rsc" -"!:\private\10003a3f\import\apps\TestPublisher_0xE5555555_reg.rsc" +"$(EPOCROOT)Epoc32\data\z\resource\apps\TestPublisher_0xE5555555.mif" -"!:\resource\apps\TestPublisher_0xE5555555.mif" +"..\help\TestPublisher_0xE5555555.hlp" -"!:\resource\help\TestPublisher_0xE5555555.hlp" + +; Add any installation notes if applicable +;"TestPublisher.txt" -"!:\private\E5555555\TestPublisher.txt" + +;required for application to be covered by backup/restore facility +"..\sis\backup_registration.xml" -"!:\private\E5555555\backup_registration.xml" diff -r 000000000000 -r b856a9924bbc data/testpublisher/sis/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/sis/backup_registration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r b856a9924bbc data/testpublisher/src/testpublisher.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/src/testpublisher.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,33 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +// INCLUDE FILES +#include +#include "TestPublisherApplication.h" + +LOCAL_C CApaApplication* NewApplication() + { + return new CTestPublisherApplication; + } + +GLDEF_C TInt E32Main() + { + return EikStart::RunApplication(NewApplication); + } + diff -r 000000000000 -r b856a9924bbc data/testpublisher/src/testpublisherappUi.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/src/testpublisherappUi.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,145 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +// INCLUDE FILES +#include +#include +#include +#include + +#include + +#include "TestPublisher.hrh" +#include "TestPublisher.pan" +#include "TestPublisherApplication.h" +#include "TestPublisherAppUi.h" +#include "TestPublisherAppView.h" + +_LIT( KText, "Test publisher!"); + +// ============================ MEMBER FUNCTIONS =============================== + + +// ----------------------------------------------------------------------------- +// CTestPublisherAppUi::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppUi::ConstructL() + { + // Initialise app UI with standard value. + BaseConstructL(CAknAppUi::EAknEnableSkin); + + // Create view object + iAppView = CTestPublisherAppView::NewL(ClientRect()); + } +// ----------------------------------------------------------------------------- +// CTestPublisherAppUi::CTestPublisherAppUi() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CTestPublisherAppUi::CTestPublisherAppUi() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CTestPublisherAppUi::~CTestPublisherAppUi() +// Destructor. +// ----------------------------------------------------------------------------- +// +CTestPublisherAppUi::~CTestPublisherAppUi() + { + if (iAppView) + { + delete iAppView; + iAppView = NULL; + } + + } + +// ----------------------------------------------------------------------------- +// CTestPublisherAppUi::HandleCommandL() +// Takes care of command handling. +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppUi::HandleCommandL(TInt aCommand) + { + switch (aCommand) + { + case EEikCmdExit: + case EAknSoftkeyExit: + Exit(); + break; + + case ECommand1: + { + + // Load a string from the resource file and display it + HBufC* textResource = StringLoader::LoadLC(R_COMMAND1_TEXT); + CAknInformationNote* informationNote; + + informationNote = new (ELeave) CAknInformationNote; + + // Show the information Note with + // textResource loaded with StringLoader. + informationNote->ExecuteLD(*textResource); + + // Pop HBuf from CleanUpStack and Destroy it. + CleanupStack::PopAndDestroy(textResource); + } + break; + case ECommand2: + { + + } + break; + case EAbout: + { + + CAknMessageQueryDialog* dlg = + new (ELeave) CAknMessageQueryDialog(); + dlg->PrepareLC(R_ABOUT_QUERY_DIALOG); + HBufC* title = iEikonEnv->AllocReadResourceLC( + R_ABOUT_DIALOG_TITLE); + dlg->QueryHeading()->SetTextL(*title); + CleanupStack::PopAndDestroy(); //title + HBufC* msg = iEikonEnv->AllocReadResourceLC(R_ABOUT_DIALOG_TEXT); + dlg->SetMessageTextL(*msg); + CleanupStack::PopAndDestroy(); //msg + dlg->RunLD(); + } + break; + default: + Panic( ETestPublisherUi); + break; + } + } +// ----------------------------------------------------------------------------- +// Called by the framework when the application status pane +// size is changed. Passes the new client rectangle to the +// AppView +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppUi::HandleStatusPaneSizeChange() + { + iAppView->SetRect(ClientRect()); + } + +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/src/testpublisherapplication.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/src/testpublisherapplication.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,49 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +// INCLUDE FILES +#include "TestPublisher.hrh" +#include "TestPublisherDocument.h" +#include "TestPublisherApplication.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTestPublisherApplication::CreateDocumentL() +// Creates CApaDocument object +// ----------------------------------------------------------------------------- +// +CApaDocument* CTestPublisherApplication::CreateDocumentL() + { + // Create an TestPublisher document, and return a pointer to it + return CTestPublisherDocument::NewL(*this); + } + +// ----------------------------------------------------------------------------- +// CTestPublisherApplication::AppDllUid() +// Returns application UID +// ----------------------------------------------------------------------------- +// +TUid CTestPublisherApplication::AppDllUid() const + { + // Return the UID for the TestPublisher application + return KUidTestPublisherApp; + } + +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/src/testpublisherappview.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/src/testpublisherappview.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,359 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + + +// INCLUDE FILES +#include +#include +#include +#include "TestPublisherAppView.h" +#include "hspublisher.h" + +_LIT( KId, "#replaceuid#:#replace#" ); + +// Type definitions +enum TFlags + { + ERequirePublish =1, + EPublishAllowed + }; + + +_LIT( KGNews1, "World news!"); +_LIT( KGFeed1, "Bangkok tense as thousands remain on streets." ); +_LIT( KGFeed2, "France frees killer of former Iran PM." ); +_LIT( KGFeed3, "Lingering ash cloud spurs new rules." ); + +_LIT( KSNews1, "Sport news!"); +_LIT( KSFeed1, "Motorsport: Webber dampens title talk." ); +_LIT( KSFeed2, "Cricket: IPL boss seeks reinstatement." ); +_LIT( KSFeed3, "Tennis: Nadal too strong for Federer." ); + + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTestPublisherAppView* CTestPublisherAppView::NewL(const TRect& aRect) + { + CTestPublisherAppView* self = CTestPublisherAppView::NewLC(aRect); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTestPublisherAppView* CTestPublisherAppView::NewLC(const TRect& aRect) + { + CTestPublisherAppView* self = new (ELeave) CTestPublisherAppView; + CleanupStack::PushL(self); + self->ConstructL(aRect); + return self; + } + +// ----------------------------------------------------------------------------- +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppView::ConstructL(const TRect& aRect) + { + // Create a window for this application view + CreateWindowL(); + + // Set the windows size + SetRect(aRect); + + iWidgetIds = new (ELeave) CDesCArrayFlat(5); + //Create the publihser interface + iPublisher = CHsPublisher::NewL( *this ); + // Activate the window, which makes it ready to be drawn + ActivateL(); + } + +// ----------------------------------------------------------------------------- +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CTestPublisherAppView::CTestPublisherAppView() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// Destructor. +// ----------------------------------------------------------------------------- +// +CTestPublisherAppView::~CTestPublisherAppView() + { + delete iPublisher; + delete iWidgetIds; + } + +// ----------------------------------------------------------------------------- +// Draws the display. +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppView::Draw(const TRect& /*aRect*/) const + { + // Get the standard graphics context + CWindowGc& gc = SystemGc(); + + // Gets the control's extent + TRect drawRect(Rect()); + + // Clears the screen + gc.Clear(drawRect); + + } + +// ----------------------------------------------------------------------------- +// Called by framework when the view size is changed. +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppView::SizeChanged() + { + DrawNow(); + } + +// ----------------------------------------------------------------------------- +// Called by framework to handle pointer touch events. +// Note: although this method is compatible with earlier SDKs, +// it will not be called in SDKs without Touch support. +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppView::HandlePointerEventL( + const TPointerEvent& aPointerEvent) + { + + // Call base class HandlePointerEventL() + CCoeControl::HandlePointerEventL(aPointerEvent); + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +const TDesC& CTestPublisherAppView::Identity() + { + return KId(); + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppView::NotifyWidgetStarted( const TDesC& aWidgetId, + MHsWidgetObserver::EStartReason /*aReason*/ ) + { + TInt pos( KErrNotFound ); + if( iWidgetIds->Find( aWidgetId, pos ) != 0) + { + iWidgetIds->AppendL( aWidgetId ); + } + + // Publish after widget is alive, lazy. + iFlags.Set( ERequirePublish ); + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +void CTestPublisherAppView::NotifyWidgetStopped( const TDesC& aWidgetId, + MHsWidgetObserver::EStopReason /*aReason*/ ) + { + TInt pos( KErrNotFound ); + if( iWidgetIds->Find( aWidgetId, pos ) == 0 ) + { + // widget removed from homescreen or in invisible page + iWidgetIds->Delete( pos ); + } + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppView::NotifyWidgetState( const TDesC& aWidgetId, + MHsWidgetObserver::EState aState ) + { + if ( aState == MHsWidgetObserver::EAlive ) + { + iFlags.Set( EPublishAllowed ); + + // PublishL will determine if it is necessary to update widget data + TRAP_IGNORE( PublishL( aWidgetId ) ); + } + else if ( aState == MHsWidgetObserver::ESuspend ) + { + iFlags.Clear( EPublishAllowed ); + } + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppView::NotifyWidgetEvent( const TDesC& aWidgetId, + const TDesC& aEvent, const TDesC& /*aParam*/ ) + { + if ( aEvent == _L("imageclicked")) + { + CAknGlobalNote* globalNote = CAknGlobalNote::NewLC(); + TInt noteId = globalNote->ShowNoteL( EAknGlobalInformationNote, _L("Image clicked")); + User::After( 2000 ); // waiting for 3 seconds + // discard note + globalNote->CancelNoteL( noteId ); + CleanupStack::PopAndDestroy(); + iPublisher->StartTransaction( aWidgetId ); + iPublisher->PublishText( + aWidgetId, _L8("text2"), KGFeed3 ); + iPublisher->CommitTransaction( aWidgetId ); + } + else if ( aEvent == _L("textclicked") ) + { + CAknGlobalNote* globalNote = CAknGlobalNote::NewLC(); + TInt noteId = globalNote->ShowNoteL( EAknGlobalInformationNote, _L("Text clicked") ); + User::After( 2000 ); // waiting for 3 seconds + // discard note + globalNote->CancelNoteL( noteId ); + CleanupStack::PopAndDestroy(); + iPublisher->StartTransaction( aWidgetId ); + iPublisher->PublishText( + aWidgetId, _L8("text3"), KGFeed2 ); + iPublisher->CommitTransaction( aWidgetId ); + } + else if ( aEvent == _L("widgetclicked") ) + { + CAknGlobalNote* globalNote = CAknGlobalNote::NewLC(); + TInt noteId = globalNote->ShowNoteL( EAknGlobalInformationNote, _L("Widget clicked") ); + User::After( 3000 ); // waiting for 3 seconds + // discard note + globalNote->CancelNoteL( noteId ); + CleanupStack::PopAndDestroy(); + iPublisher->StartTransaction( aWidgetId ); + if( !iFeedCnt ) + { + iPublisher->PublishText( + aWidgetId, _L8("text2"), KGFeed3 ); + iFeedCnt = ETrue; + } + else + {iPublisher->PublishText( + aWidgetId, _L8("text3"), KGFeed2 ); + iFeedCnt = EFalse; + } + + iPublisher->CommitTransaction( aWidgetId ); + } + else if( aEvent == _L("OnTitleScrolled")) + { + TInt pos( KErrNotFound ); + if( iWidgetIds->Find( aWidgetId, pos ) == 0 && pos % 2 == 1 ) + { + iPublisher->StartTransaction( aWidgetId ); + if( iFeedCnt == 0 ) + { + iPublisher->PublishImage(aWidgetId, + _L8("image1"), _L("c:\\data\\Installs\\cricket.png")); + iFeedCnt++; + } + else if( iFeedCnt == 1 ) + { + iPublisher->PublishImage(aWidgetId, + _L8("image1"), _L("c:\\data\\Installs\\tennis.png")); + iFeedCnt++; + } + else if( iFeedCnt == 2) + { + iPublisher->PublishImage(aWidgetId, + _L8("image1"), _L("c:\\data\\Installs\\f1.png")); + iFeedCnt = 0; + } + iPublisher->CommitTransaction( aWidgetId ); + } + } + + } + +// ----------------------------------------------------------------------------- +// +// +// ----------------------------------------------------------------------------- +// +void CTestPublisherAppView::PublishL( const TDesC& aWidgetId ) + { + if ( iFlags.IsClear( ERequirePublish ) ) + { + // Can't publish without widget instance id or no reason to publish + return; + } + if ( iFlags.IsSet( EPublishAllowed ) ) + { + iPublisher->StartTransaction( aWidgetId ); + + iPublisher->PublishImage(aWidgetId, + _L8("graphic"), _L("c:\\data\\Installs\\rss.png")); + + iPublisher->PublishText( aWidgetId, _L8("text1"), KGFeed1 ); + /* + iPublisher->PublishText( + aWidgetId, _L8("text2"), KGFeed2 ); + iPublisher->PublishText( + aWidgetId, _L8("text3"), KGFeed3 ); + iPublisher->PublishText( + aWidgetId, _L8("text4"), KSFeed1 ); + */ + iPublisher->PublishText( + aWidgetId, _L8("title1"), KGFeed1 ); + iPublisher->PublishText( + aWidgetId, _L8("title2"), KGFeed2 ); + iPublisher->PublishText( + aWidgetId, _L8("title4"), KGFeed3 ); + + iPublisher->PublishText( + aWidgetId, _L8("title3"), KSFeed1 ); + iPublisher->PublishText( + aWidgetId, _L8("title5"), KSFeed2 ); + iPublisher->PublishText( + aWidgetId, _L8("title6"), KSFeed3 ); + + + iPublisher->PublishImage(aWidgetId, + _L8("image1"), _L("c:\\data\\Installs\\rss_small.png")); + iPublisher->PublishImage(aWidgetId, + _L8("image2"), _L("c:\\data\\Installs\\rss_small.png")); + iPublisher->PublishImage(aWidgetId, + _L8("image3"), _L("c:\\data\\Installs\\rss_small.png")); + + iPublisher->CommitTransaction( aWidgetId ); + + iFlags.Clear( ERequirePublish ); + } + } + +// End of File diff -r 000000000000 -r b856a9924bbc data/testpublisher/src/testpublisherdocument.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/testpublisher/src/testpublisherdocument.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,95 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +// INCLUDE FILES +#include "TestPublisherAppUi.h" +#include "TestPublisherDocument.h" + +// ============================ MEMBER FUNCTIONS =============================== + +// ----------------------------------------------------------------------------- +// CTestPublisherDocument::NewL() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTestPublisherDocument* CTestPublisherDocument::NewL(CEikApplication& aApp) + { + CTestPublisherDocument* self = NewLC(aApp); + CleanupStack::Pop(self); + return self; + } + +// ----------------------------------------------------------------------------- +// CTestPublisherDocument::NewLC() +// Two-phased constructor. +// ----------------------------------------------------------------------------- +// +CTestPublisherDocument* CTestPublisherDocument::NewLC(CEikApplication& aApp) + { + CTestPublisherDocument* self = new (ELeave) CTestPublisherDocument(aApp); + + CleanupStack::PushL(self); + self->ConstructL(); + return self; + } + +// ----------------------------------------------------------------------------- +// CTestPublisherDocument::ConstructL() +// Symbian 2nd phase constructor can leave. +// ----------------------------------------------------------------------------- +// +void CTestPublisherDocument::ConstructL() + { + // No implementation required + } + +// ----------------------------------------------------------------------------- +// CTestPublisherDocument::CTestPublisherDocument() +// C++ default constructor can NOT contain any code, that might leave. +// ----------------------------------------------------------------------------- +// +CTestPublisherDocument::CTestPublisherDocument(CEikApplication& aApp) : + CAknDocument(aApp) + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// CTestPublisherDocument::~CTestPublisherDocument() +// Destructor. +// --------------------------------------------------------------------------- +// +CTestPublisherDocument::~CTestPublisherDocument() + { + // No implementation required + } + +// --------------------------------------------------------------------------- +// CTestPublisherDocument::CreateAppUiL() +// Constructs CreateAppUi. +// --------------------------------------------------------------------------- +// +CEikAppUi* CTestPublisherDocument::CreateAppUiL() + { + // Create the application user interface, and return a pointer to it; + // the framework takes ownership of this object + return new (ELeave) CTestPublisherAppUi; + } + +// End of File diff -r 000000000000 -r b856a9924bbc data/text/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/text/group/bld.inf Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/widgetconfiguration.xml +../xuikon/00/#replace#_#replaceuid#.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#_#replaceuid#.dat +../xuikon/00/#replace#.css /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.css +../xuikon/00/#replace#.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.xml +//../xuikon/00/#replace#.dtd /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.dtd + + +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME #replace#_#replaceuid# +OPTION DTD_TYPE widget +END +// End of File diff -r 000000000000 -r b856a9924bbc data/text/hsps/00/empty.dat diff -r 000000000000 -r b856a9924bbc data/text/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/text/hsps/00/manifest.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,21 @@ + + + qhd_tch + widget + + 0x2001f48a + 0x101fb657 + #replaceuid# + + #replace# + #replace# + 1.0 + + unlimited + + widgetconfiguration.xml + + + #replace#.o0000 + + diff -r 000000000000 -r b856a9924bbc data/text/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/text/hsps/00/widgetconfiguration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r b856a9924bbc data/text/sis/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/text/sis/backup_registration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r b856a9924bbc data/text/sis/replace.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/text/sis/replace.pkg Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,19 @@ +;Language +&EN +; Header +#{#replace#}, (#replaceuid#), 1,0,0 +;Localized Vendor Name +%{"Company"} +;Unique Vendor name +:"Vendor" +;Files to install +; HSPS - general (extracting files to C drive, other drives are not searched) +"..\hsps\00\widgetconfiguration.xml" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\widgetconfiguration.xml" +"..\hsps\00\manifest.dat" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\manifest.dat" +; HSPS - Resources for locale 0 +"..\xuikon\00\locale.dtd" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\locale.dtd" +"\epoc32\data\z\private\200159c0\install\#replace#\xuikon\00\#replace#.o0000" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\#replace#.o0000" +; HSPS - Backup +"backup_registration.xml" - "c:\private\10202D56\import\packages\#replaceuid#\backup_registration.xml" +; HSPS - trigger for post installations by the HSPS server +"..\hsps\00\empty.dat" - "c:\private\200159c0\import\plugin_2001f48a_101fb657_#replaceuid#_1.0.dat" diff -r 000000000000 -r b856a9924bbc data/text/xuikon/00/replace.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/text/xuikon/00/replace.css Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,27 @@ +widget +{ + padding-top:3px; + padding-bottom:4px; + padding-left:10px; + padding-right:8px; +} + +box#container +{ + height:adaptive; + margin-top: auto; + margin-bottom: auto; +} + +text +{ + height:25px; + font-size:3.5u; + _s60-text-valign: top; + font-family: EAknLogicalFontSecondaryFont; + color: "SKIN(268458534 13056 74)"; +} + +text.hidden +{ + display:none; \ No newline at end of file diff -r 000000000000 -r b856a9924bbc data/text/xuikon/00/replace.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/text/xuikon/00/replace.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,12 @@ + + + + 2001CB4F + 101FB657 + 11001241 + Anything + #replace# + 1.0 + #replace#.xml + #replace#.css + diff -r 000000000000 -r b856a9924bbc data/text/xuikon/00/replace.dtd diff -r 000000000000 -r b856a9924bbc data/text/xuikon/00/replace.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/text/xuikon/00/replace.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,36 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + diff -r 000000000000 -r b856a9924bbc data/widget/group/bld.inf --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/group/bld.inf Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,40 @@ +/* +* Copyright (c) {Year(s)} {Copyright owner}. +* All rights reserved. +* This component and the accompanying materials are made available +* under the terms of the "Eclipse Public License v1.0" +* which accompanies this distribution, and is available +* at the URL "http://www.symbianfoundation.org/legal/sfl-v10.html". +* +* Initial Contributors: +* {Name} {Company} ? Initial contribution +* +* Contributors: +* {Name} {Company} ? {{Description of contribution}} +* +* Description: +* {{Description of the file}} +* +*/ + +#include + +PRJ_PLATFORMS +DEFAULT + +PRJ_EXPORTS +// Support for productization and Carbide.Ui customization +../hsps/00/manifest.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/manifest.dat +../hsps/00/widgetconfiguration.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/hsps/widgetconfiguration.xml +../xuikon/00/#replace#_#replaceuid#.dat /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#_#replaceuid#.dat +../xuikon/00/#replace#.css /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.css +../xuikon/00/#replace#.xml /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.xml +//../xuikon/00/#replace#.dtd /epoc32/data/Z/resource/homescreen/#replace#_#replaceuid#/xuikon/#replace#.dtd + + +PRJ_EXTENSIONS +START EXTENSION tools/dtd +OPTION SWITCH_LOC_FILE_NAME #replace#_#replaceuid# +OPTION DTD_TYPE widget +END +// End of File diff -r 000000000000 -r b856a9924bbc data/widget/hsps/00/empty.dat diff -r 000000000000 -r b856a9924bbc data/widget/hsps/00/manifest.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/hsps/00/manifest.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,21 @@ + + + qhd_tch + widget + + 0x2001f48a + 0x101fb657 + #replaceuid# + + #replace# + #replace# + 1.0 + + unlimited + + widgetconfiguration.xml + + + #replace#.o0000 + + diff -r 000000000000 -r b856a9924bbc data/widget/hsps/00/widgetconfiguration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/hsps/00/widgetconfiguration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,6 @@ + + + + + + diff -r 000000000000 -r b856a9924bbc data/widget/sis/backup_registration.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/sis/backup_registration.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,5 @@ + + + + + diff -r 000000000000 -r b856a9924bbc data/widget/sis/replace.pkg --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/sis/replace.pkg Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,19 @@ +;Language +&EN +; Header +#{#replace#}, (#replaceuid#), 1,0,0 +;Localized Vendor Name +%{"Company"} +;Unique Vendor name +:"Vendor" +;Files to install +; HSPS - general (extracting files to C drive, other drives are not searched) +"..\hsps\00\widgetconfiguration.xml" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\widgetconfiguration.xml" +"..\hsps\00\manifest.dat" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\manifest.dat" +; HSPS - Resources for locale 0 +"..\xuikon\00\locale.dtd" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\locale.dtd" +"\epoc32\data\z\private\200159c0\install\#replace#\xuikon\00\#replace#.o0000" - "c:\private\200159c0\import\2001f48a\101fb657\#replaceuid#\1.0\0\#replace#.o0000" +; HSPS - Backup +"backup_registration.xml" - "c:\private\10202D56\import\packages\#replaceuid#\backup_registration.xml" +; HSPS - trigger for post installations by the HSPS server +"..\hsps\00\empty.dat" - "c:\private\200159c0\import\plugin_2001f48a_101fb657_#replaceuid#_1.0.dat" diff -r 000000000000 -r b856a9924bbc data/widget/xuikon/00/replace.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/xuikon/00/replace.css Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,56 @@ +widget +{ + direction: ltr; + block-progression:lr; +} + +box#ntbox +{ + direction: ltr; + block-progression: tb; + margin-left: 5px; + margin-right: 3px; +} +image +{ + height: 70px; + width: 70px; + margin-left: 3px; + margin-top: 2px; + margin-bottom: 2px; + padding-top: 4px; + padding-bottom: 4px; + padding-left: 2px; + padding-right: 2px; + + nav-index: appearance; +} + +text +{ + text-align: center; + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + color: "SKIN(268458534 13056 74)"; + + nav-index: appearance; +} + +newsticker +{ + font-family: EAknLogicalFontSecondaryFont; + font-size: 3.5u; + color: "SKIN(268458534 13056 74)"; + text-align: left; + _s60-scroll-behaviour: scroll-alternate; + /** Alternate display time */ + _s60-display-time: 5000; + /** Scroll start delay */ + _s60-start-delay: 2000; + /** Restart loop after title is updated */ + _s60-restart-after-update: true; + /** Don't loop titles */ + _s60-scroll-loop: false; + + nav-index: appearance; +} diff -r 000000000000 -r b856a9924bbc data/widget/xuikon/00/replace.dat --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/xuikon/00/replace.dat Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,12 @@ + + + + 2001CB4F + 101FB657 + 11001241 + Anything + #replace# + 1.0 + #replace#.xml + #replace#.css + diff -r 000000000000 -r b856a9924bbc data/widget/xuikon/00/replace.dtd diff -r 000000000000 -r b856a9924bbc data/widget/xuikon/00/replace.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/xuikon/00/replace.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,55 @@ + + + + + + + + + + + + + + + + + + + + + + + + + + + + + My first widget! + + + + + + + + + + + + <property class="#replace#/title1"/> + <configuration name="content_type" value="cnt2"/> + + + <property class="#replace#/title2"/> + <configuration name="content_type" value="cnt2"/> + + + <property class="#replace#/title3"/> + <configuration name="content_type" value="cnt2"/> + + + + + diff -r 000000000000 -r b856a9924bbc data/widget/xuikon/00/replacerenderer.css --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/xuikon/00/replacerenderer.css Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,7 @@ +widget +{ +} + +text +{ +} diff -r 000000000000 -r b856a9924bbc data/widget/xuikon/00/replacerenderer.xml --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/data/widget/xuikon/00/replacerenderer.xml Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,17 @@ + + + + + + + + + + + <#replace#renderer> + + + + + + diff -r 000000000000 -r b856a9924bbc images/feeds_layout.jpg Binary file images/feeds_layout.jpg has changed diff -r 000000000000 -r b856a9924bbc images/graphictext_layout_1.jpg Binary file images/graphictext_layout_1.jpg has changed diff -r 000000000000 -r b856a9924bbc images/graphictext_layout_2.jpg Binary file images/graphictext_layout_2.jpg has changed diff -r 000000000000 -r b856a9924bbc images/graphictext_layout_3.jpg Binary file images/graphictext_layout_3.jpg has changed diff -r 000000000000 -r b856a9924bbc images/iconstext_layout_1.jpg Binary file images/iconstext_layout_1.jpg has changed diff -r 000000000000 -r b856a9924bbc images/iconstext_layout_2.jpg Binary file images/iconstext_layout_2.jpg has changed diff -r 000000000000 -r b856a9924bbc images/iconstext_layout_3.jpg Binary file images/iconstext_layout_3.jpg has changed diff -r 000000000000 -r b856a9924bbc images/text_layout_1.jpg Binary file images/text_layout_1.jpg has changed diff -r 000000000000 -r b856a9924bbc images/text_layout_2.jpg Binary file images/text_layout_2.jpg has changed diff -r 000000000000 -r b856a9924bbc images/text_layout_3.jpg Binary file images/text_layout_3.jpg has changed diff -r 000000000000 -r b856a9924bbc main.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/main.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,14 @@ +#include +#include "mainwindow.h" + +int main(int argc, char *argv[]) +{ + QApplication a(argc, argv); + MainWindow w; +#if defined(Q_WS_S60) + w.showMaximized(); +#else + w.show(); +#endif + return a.exec(); +} diff -r 000000000000 -r b856a9924bbc mainwindow.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mainwindow.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,339 @@ +#include "mainwindow.h" +#include "ui_mainwindow.h" + +#include "widgetcreator.h" +#include "renderercreator.h" +#include "publishercreator.h" + +#include +#include +#include +#include + + +MainWindow::MainWindow(QWidget *parent) : + QMainWindow(parent), ui(new Ui::MainWindow), iLayoutIndex( 0 ), iLayoutCount( -1 ) +{ + ui->setupUi(this); + iTimer = new QTimer(this); + connect(iTimer, SIGNAL(timeout()), this, SLOT(updateLayout())); +} + +MainWindow::~MainWindow() +{ + delete ui; +} + +void MainWindow::changeEvent(QEvent *e) +{ + QMainWindow::changeEvent(e); + switch (e->type()) { + case QEvent::LanguageChange: + ui->retranslateUi(this); + break; + default: + break; + } +} + +QString MainWindow::widgetName() +{ + return ui->widgetName->text().toLower(); +} + +QString MainWindow::widgetUid() +{ + return ui->widgetUid->text().toLower(); +} + +QCheckBox& MainWindow::rendererCheckBox() +{ + return *ui->renderingCheckBox; +} + +QString MainWindow::rendererName() +{ + return ui->rendererName->text(); +} + +QString MainWindow::rendererUid() +{ + return ui->rendererUid->text(); +} + +void MainWindow::on_pushButton_clicked() +{ + if( widgetName().isEmpty() || widgetUid().isEmpty() ) + { + QMessageBox msgBox; + msgBox.setText("Widget name and UID must be given."); + msgBox.exec(); + return; + } + + bool ok; + uint uidVal = widgetUid().toUInt(&ok, 16 ); + if( widgetUid().length() != 10 || !widgetUid().startsWith( "0x",Qt::CaseInsensitive ) || !ok ) + { + QMessageBox msgBox; + msgBox.setText("UID must be in 4 byte hexadecimal format\n 0x11223344."); + msgBox.exec(); + return; + } + + if( uidVal >= 2147483648 ) //0x80000000 + { + QMessageBox msgBox; + msgBox.setText("UID must be less than\n 0x80000000."); + msgBox.exec(); + return; + } + + generateMainBuildFile(); + + PublisherCreator* publisherCreator = new PublisherCreator(*this); + delete publisherCreator; + + WidgetCreator* widgetCreator = new WidgetCreator(*this); + delete widgetCreator; + + if( ui->renderingCheckBox->isChecked() ) + { + if( rendererName().isEmpty() || rendererUid().isEmpty() ) + { + QMessageBox msgBox; + msgBox.setText("Renderer name and UID must be given."); + msgBox.exec(); + return; + } + if( rendererUid().length() != 10 || !rendererUid().startsWith( "0x",Qt::CaseInsensitive )) + { + QMessageBox msgBox; + msgBox.setText("UID must be in hexadecimal format\n 0x11223344."); + msgBox.exec(); + return; + } + RendererCreator * renderer = new RendererCreator(*this); + delete renderer; + } +/* + QMessageBox msgBox; + msgBox.setText("Widget created."); + msgBox.exec(); + return;*/ +} + +void MainWindow::generateMainBuildFile() +{ + QDir dir; + dir.mkpath( widgetName() + "/group"); + dir.setPath( widgetName() + "/group"); + QFile file( dir.filePath("bld.inf")); + if (!file.open(QIODevice::WriteOnly | QIODevice::Text)) + return; + + QTextStream out(&file); + generateLicense( out ); + + //out << "#include \"../publisherif/group/bld.inf\"\n"; + out << "#include \"../testpublisher/group/bld.inf\"\n"; + out << "#include \"../widget/group/bld.inf\"\n"; + if( ui->renderingCheckBox->isChecked() ) + { + out << "#include \"../renderingplugin/group/bld.inf\"\n\n"; + } + out << "// End of File\n"; +} + +void MainWindow::generateLicense( QTextStream& aStream ) +{ + aStream << "/*\n"; + aStream << "* Copyright (c) {Year(s)} {Copyright owner}.\n"; + aStream << "* All rights reserved.\n"; + aStream << "* This component and the accompanying materials are made available\n"; + aStream << "* under the terms of the \"Eclipse Public License v1.0\"\n"; + aStream << "* which accompanies this distribution, and is available\n"; + aStream << "* at the URL \"http://www.symbianfoundation.org/legal/sfl-v10.html\".\n"; + aStream << "*\n"; + aStream << "* Initial Contributors:\n"; + aStream << "* {Name} {Company} – Initial contribution\n"; + aStream << "*\n"; + aStream << "* Contributors:\n"; + aStream << "* {Name} {Company} – {{Description of contribution}}\n"; + aStream << "*\n"; + aStream << "* Description:\n"; + aStream << "* {{Description of the file}}\n"; + aStream << "*\n"; + aStream << "*/\n\n"; +} + +QString MainWindow::widgetUidNoHex() +{ + QString uid( widgetUid() ); + if( uid.startsWith( "0x",Qt::CaseInsensitive )) + { + return uid.right(8); + } + else + { + return uid; + } + +} + +void MainWindow::replaceData( QString sourceFile, QString destFile, bool noHexUid ) +{ + QString path = QDir::currentPath(); + QFile infile(sourceFile); + if (!infile.open(QIODevice::ReadWrite | QIODevice::Text)) + return; + + QTextStream in(&infile); + + QFile outfile(destFile); + if (!outfile.open(QIODevice::ReadWrite | QIODevice::Text)) + return; + + QTextStream out(&outfile); + + while (!in.atEnd()) + { + QString line = in.readLine(); + line.replace(QString("#replace#"), widgetName()); + if( noHexUid ) + { + line.replace(QString("#replaceuid#"), widgetUidNoHex()); + } + else + { + line.replace(QString("#replaceuid#"), widgetUid()); + } + out << line << "\n"; + } +} + +void MainWindow::on_renderingCheckBox_stateChanged(int state ) +{ + if( state == Qt::Unchecked ) + { + ui->rendererName->setEnabled( false ); + ui->rendererUid->setEnabled( false ); + } + else if ( state == Qt::Checked) + { + ui->rendererName->setEnabled( true ); + ui->rendererUid->setEnabled( true); + } + +} + +QString MainWindow::widgetLayout() +{ + switch (iLayoutIndex) + { + case 0: + { + return QString( "feed" ); + } + break; + case 1: + { + return QString( "text" ); + } + break; + case 2: + { + return QString( "iconstext" ); + } + break; + case 3: + { + return QString( "graphictext" ); + } + break; + }; +} + +void MainWindow::on_comboBox_currentIndexChanged(int index) +{ + iLayoutIndex = index; + iLayoutCount = 3; + updateLayout(); + + +} + +void MainWindow::updateLayout() +{ + switch (iLayoutIndex) + { + case 0: + { + iTimer->stop(); + showFeedsLayout(); + } + break; + case 1: + { + showTextLayout(); + iTimer->start(2000); + } + break; + case 2: + { + showIconsTextLayout(); + iTimer->start(2000); + } + break; + case 3: + { + showGraphicTextLayout(); + iTimer->start(2000); + } + break; + }; + + if( iLayoutCount > 1) + { + iLayoutCount--; + } + else + { + iLayoutCount = 3; + } +} + +void MainWindow::showFeedsLayout() +{ + ui->layoutGraphics->setPixmap(QPixmap(QString::fromUtf8(":/widgets/images/feeds_layout.jpg"))); +} + +void MainWindow::showTextLayout() +{ + QString imagePath(":/widgets/images/text_layout_"); + QString cnt; + cnt.setNum( iLayoutCount ); + imagePath.append( cnt ); + imagePath.append( ".jpg" ); + ui->layoutGraphics->setPixmap(QPixmap(imagePath)); +} + +void MainWindow::showIconsTextLayout() +{ + QString imagePath(":/widgets/images/iconstext_layout_"); + QString cnt; + cnt.setNum( iLayoutCount ); + imagePath.append( cnt ); + imagePath.append( ".jpg" ); + ui->layoutGraphics->setPixmap(QPixmap(imagePath)); +} + +void MainWindow::showGraphicTextLayout() +{ + QString imagePath(":/widgets/images/graphictext_layout_"); + QString cnt; + cnt.setNum( iLayoutCount ); + imagePath.append( cnt ); + imagePath.append( ".jpg" ); + ui->layoutGraphics->setPixmap(QPixmap(imagePath)); +} diff -r 000000000000 -r b856a9924bbc mainwindow.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mainwindow.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,56 @@ +#ifndef MAINWINDOW_H +#define MAINWINDOW_H + +#include + +class QTextStream; +class QCheckBox; +class QTimer; + +namespace Ui { + class MainWindow; +} + +class MainWindow : public QMainWindow +{ + Q_OBJECT + +public: + explicit MainWindow(QWidget *parent = 0); + ~MainWindow(); + + QString widgetName(); + QString widgetUid(); + QString widgetUidNoHex(); + QString rendererName(); + QString rendererUid(); + void generateLicense( QTextStream& aStream ); + QCheckBox& rendererCheckBox(); + QString widgetLayout(); + + void replaceData( QString sourceFile, QString destFile, bool noHexUid = 0 ); + +protected: + void changeEvent(QEvent *e); + +private: + void generateMainBuildFile(); + void showFeedsLayout(); + void showTextLayout(); + void showIconsTextLayout(); + void showGraphicTextLayout(); + +private: + Ui::MainWindow *ui; + int iLayoutIndex; + int iLayoutCount; + QTimer *iTimer; + +private slots: + void on_comboBox_currentIndexChanged(int index); + void on_renderingCheckBox_stateChanged(int ); + void on_pushButton_clicked(); + void updateLayout(); +}; + +#endif // MAINWINDOW_H diff -r 000000000000 -r b856a9924bbc mainwindow.ui --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/mainwindow.ui Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,300 @@ + + + MainWindow + + + + 0 + 0 + 332 + 324 + + + + Amazing Widget Builder + + + + + + + + + + + + + + 12 + + + + Widget Name + + + widgetName + + + + + + + + 12 + + + + Widget UID + + + widgetUid + + + + + + + + 12 + + + + Widget Layout + + + widgetUid + + + + + + + + + + + + 12 + + + + + + + + + 12 + + + + + + + + + 12 + + + + + Feeds layout + + + + + Text layout + + + + + Icons&Text layout + + + + + Graphic&Text layout + + + + + + + + + + + + + 312 + 82 + + + + + + + :/widgets/images/feeds_layout.jpg + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 12 + + + + Custom Rendering Plug-in + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + 12 + + + + Renderer Name + + + rendererName + + + + + + + false + + + + + + + + + + + + 12 + + + + Renderer UID + + + rendererUid + + + + + + + false + + + + + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + 150 + 16777215 + + + + + 12 + + + + Generate + + + + + + + Qt::Horizontal + + + + 40 + 20 + + + + + + + + + + + + + + widgetName + widgetUid + renderingCheckBox + rendererName + rendererUid + pushButton + + + + + + diff -r 000000000000 -r b856a9924bbc publishercreator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/publishercreator.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,97 @@ +#include +#include + +#include "publishercreator.h" + +PublisherCreator::PublisherCreator(MainWindow& aUi) : iUi( aUi ) +{ + copyFiles(); +} + +void PublisherCreator::copyFiles() +{ + QDir dir; + + // Copy publisher interface as is + dir.mkpath( iUi.widgetName() + "/publisherif/inc"); + QFile::copy ( "data/publisherif/inc/hspublisher.h", + iUi.widgetName() + "/publisherif/inc/hspublisher.h"); + QFile::copy ( "data/publisherif/inc/hspublisherimpl.h", + iUi.widgetName() + "/publisherif/inc/hspublisherimpl.h"); + QFile::copy ( "data/publisherif/inc/hswidgetobserver.h", + iUi.widgetName() + "/publisherif/inc/hswidgetobserver.h"); + QFile::copy ( "data/publisherif/inc/transaction.h", + iUi.widgetName() + "/publisherif/inc/transaction.h"); + + + dir.mkpath( iUi.widgetName() + "/publisherif/src"); + QFile::copy ( "data/publisherif/src/hspublisher.cpp", + iUi.widgetName() + "/publisherif/src/hspublisher.cpp"); + QFile::copy ( "data/publisherif/src/hspublisherimpl.cpp", + iUi.widgetName() + "/publisherif/src/hspublisherimpl.cpp"); + QFile::copy ( "data/publisherif/src/transaction.cpp", + iUi.widgetName() + "/publisherif/src/transaction.cpp"); + + // Copy test publisher + dir.mkpath( iUi.widgetName() + "/testpublisher/data"); + QFile::copy ( "data/testpublisher/data/testpublisher.rls", + iUi.widgetName() + "/testpublisher/data/testpublisher.rls"); + QFile::copy ( "data/testpublisher/data/testpublisher.rss", + iUi.widgetName() + "/testpublisher/data/testpublisher.rss"); + QFile::copy ( "data/testpublisher/data/testpublisher_reg.rss", + iUi.widgetName() + "/testpublisher/data/testpublisher_reg.rss"); + + dir.mkpath( iUi.widgetName() + "/testpublisher/gfx"); + QFile::copy ( "data/testpublisher/gfx/qgn_menu_TestPublisher.svg", + iUi.widgetName() + "/testpublisher/gfx/qgn_menu_TestPublisher.svg"); + QFile::copy ( "data/testpublisher/gfx/f1.png", + iUi.widgetName() + "/testpublisher/gfx/f1.png"); + QFile::copy ( "data/testpublisher/gfx/cricket.png", + iUi.widgetName() + "/testpublisher/gfx/cricket.png"); + QFile::copy ( "data/testpublisher/gfx/tennis.png", + iUi.widgetName() + "/testpublisher/gfx/tennis.png"); + + dir.mkpath( iUi.widgetName() + "/testpublisher/group"); + QFile::copy ( "data/testpublisher/group/bld.inf", + iUi.widgetName() + "/testpublisher/group/bld.inf"); + QFile::copy ( "data/testpublisher/group/icons_scalable_dc.mk", + iUi.widgetName() + "/testpublisher/group/icons_scalable_dc.mk"); + QFile::copy ( "data/testpublisher/group/testpublisher.mmp", + iUi.widgetName() + "/testpublisher/group/testpublisher.mmp"); + + dir.mkpath( iUi.widgetName() + "/testpublisher/inc"); + QFile::copy ( "data/testpublisher/inc/testpublisher.hrh", + iUi.widgetName() + "/testpublisher/inc/testpublisher.hrh"); + QFile::copy ( "data/testpublisher/inc/testpublisher.pan", + iUi.widgetName() + "/testpublisher/inc/testpublisher.pan"); + QFile::copy ( "data/testpublisher/inc/testpublisherapplication.h", + iUi.widgetName() + "/testpublisher/inc/testpublisherapplication.h"); + QFile::copy ( "data/testpublisher/inc/testpublisherappui.h", + iUi.widgetName() + "/testpublisher/inc/testpublisherappui.h"); + QFile::copy ( "data/testpublisher/inc/testpublisherappview.h", + iUi.widgetName() + "/testpublisher/inc/testpublisherappview.h"); + QFile::copy ( "data/testpublisher/inc/testpublisherdocument.h", + iUi.widgetName() + "/testpublisher/inc/testpublisherdocument.h"); + + dir.mkpath( iUi.widgetName() + "/testpublisher/sis"); + QFile::copy ( "data/testpublisher/sis/backup_registration.xml", + iUi.widgetName() + "/testpublisher/sis/backup_registration.xml"); + QFile::copy ( "data/testpublisher/sis/TestPublisher_S60_3_X_v_1_0_0.pkg", + iUi.widgetName() + "/testpublisher/sis/TestPublisher_S60_3_X_v_1_0_0.pkg"); + + dir.mkpath( iUi.widgetName() + "/testpublisher/src"); + QFile::copy ( "data/testpublisher/src/testpublisher.cpp", + iUi.widgetName() + "/testpublisher/src/testpublisher.cpp"); + QFile::copy ( "data/testpublisher/src/testpublisherapplication.cpp", + iUi.widgetName() + "/testpublisher/src/testpublisherapplication.cpp"); + QFile::copy ( "data/testpublisher/src/testpublisherappui.cpp", + iUi.widgetName() + "/testpublisher/src/testpublisherappui.cpp"); + //QFile::copy ( "data/testpublisher/src/testpublisherappview.cpp", + // iUi.widgetName() + "/testpublisher/src/testpublisherappview.cpp"); + QFile::copy ( "data/testpublisher/src/testpublisherdocument.cpp", + iUi.widgetName() + "/testpublisher/src/testpublisherdocument.cpp"); + + iUi.replaceData("data/testpublisher/src/testpublisherappview.cpp", + iUi.widgetName() + "/testpublisher/src/testpublisherappview.cpp" ); + +} diff -r 000000000000 -r b856a9924bbc publishercreator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/publishercreator.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,18 @@ +#ifndef PUBLISHERCREATOR_H +#define PUBLISHERCREATOR_H + +#include "mainwindow.h" + +class PublisherCreator +{ +public: + PublisherCreator(MainWindow& aUi); + +private: + void copyFiles(); + +private: + MainWindow& iUi; +}; + +#endif // PUBLISHERCREATOR_H diff -r 000000000000 -r b856a9924bbc renderercreator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/renderercreator.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,78 @@ +#include "renderercreator.h" +#include +#include + + +RendererCreator::RendererCreator(MainWindow& aUi) : iUi( aUi ) +{ + generateFolders(); + generateResource(); + generateBuildFile(); + generateMMP(); + generateHeader(); + generateSource(); +} + +void RendererCreator::generateFolders() +{ + QDir dir; + dir.mkpath( iUi.widgetName() + "/renderingplugin"); + dir.setPath( iUi.widgetName() + "/renderingplugin"); + dir.mkpath( "data" ); + dir.mkpath( "group" ); + dir.mkpath( "inc" ); + dir.mkpath( "src" ); +} + +void RendererCreator::generateResource() +{ + iUi.replaceData("data/renderingplugin/data/renderer.rss", + iUi.widgetName() + "/renderingplugin/data/" + iUi.rendererName() + "renderer.rss"); +} + +void RendererCreator::generateBuildFile() +{ + iUi.replaceData("data/renderingplugin/group/bld.inf", + iUi.widgetName() + "/renderingplugin/group/bld.inf"); +} + +void RendererCreator::generateMMP() +{ + iUi.replaceData("data/renderingplugin/group/renderer.mmp", + iUi.widgetName() + "/renderingplugin/group/" + iUi.rendererName() + "renderer.mmp"); +} + +void RendererCreator::generateHeader() +{ + iUi.replaceData("data/renderingplugin/inc/renderer.h", + iUi.widgetName() + "/renderingplugin/inc/" + iUi.rendererName() + "renderer.h"); +} + +void RendererCreator::generateSource() +{ + iUi.replaceData("data/renderingplugin/src/renderer.cpp", + iUi.widgetName() + "/renderingplugin/src/" + iUi.rendererName() + "renderer.cpp"); +} + +void RendererCreator::replaceData( QString sourceFile, QString destFile ) +{ + QFile infile(sourceFile); + if (!infile.open(QIODevice::ReadWrite | QIODevice::Text)) + return; + + QTextStream in(&infile); + + QFile outfile(destFile); + if (!outfile.open(QIODevice::ReadWrite | QIODevice::Text)) + return; + + QTextStream out(&outfile); + + while (!in.atEnd()) + { + QString line = in.readLine(); + line.replace(QString("#replace#"), iUi.rendererName()); + line.replace(QString("#replaceuid#"), iUi.rendererUid()); + out << line << "\n"; + } +} diff -r 000000000000 -r b856a9924bbc renderercreator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/renderercreator.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,27 @@ +#ifndef RENDERERCREATOR_H +#define RENDERERCREATOR_H + +#include + +#include "mainwindow.h" + +class RendererCreator : public QObject +{ +public: + RendererCreator(MainWindow& aUi); + +private: + void generateFolders(); + void generateResource(); + void generateBuildFile(); + void generateMMP(); + void generateHeader(); + void generateSource(); + + void replaceData( QString sourceFile, QString destFile ); + +private: + MainWindow& iUi; +}; + +#endif // RENDERERCREATOR_H diff -r 000000000000 -r b856a9924bbc widgetcreator.cpp --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetcreator.cpp Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,142 @@ +#include "widgetcreator.h" +#include +#include +#include + +WidgetCreator::WidgetCreator(MainWindow& aUi, QObject *parent ) : + QObject(parent), iUi( aUi ) +{ + generateFolders(); + generateBuildFile(); + generateHSPSManifest(); + generateEmptyDat(); + generateHSPSConf(); + generateXml(); + generateCss(); + generateDat(); + generateDtd(); + generatePkg(); + generateBur(); +} + + + +QString WidgetCreator::widgetName() +{ + return iUi.widgetName(); +} + +QString WidgetCreator::widgetUid() +{ + return iUi.widgetUid(); +} + +QString WidgetCreator::widgetLayout() +{ + return iUi.widgetLayout(); +} + +void WidgetCreator::generateFolders() +{ + QDir dir; + dir.mkpath( widgetName() + "/widget"); + dir.setPath( widgetName() + "/widget" ); + dir.mkpath( "group" ); + dir.mkpath( "hsps/00" ); + dir.mkpath( "xuikon/00" ); + dir.mkpath( "sis" ); +} + +void WidgetCreator::generateBuildFile() +{ + iUi.replaceData("data/" + widgetLayout() +"/group/bld.inf", widgetName() + "/widget/group/bld.inf", 1); +} + +void WidgetCreator::generateHSPSManifest() +{ + iUi.replaceData("data/" + widgetLayout() +"/hsps/00/manifest.dat", + widgetName() + "/widget/hsps/00/manifest.dat"); +} + +void WidgetCreator::generateHSPSConf() +{ + iUi.replaceData( "data/" + widgetLayout() +"/hsps/00/widgetconfiguration.xml", + widgetName() + "/widget/hsps/00/widgetconfiguration.xml" ); +} + +void WidgetCreator::generateEmptyDat() +{ + QDir dir; + dir.setPath( widgetName() + "/widget/hsps/00"); + QFile file(dir.filePath("empty.dat")); + if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) + return; +} + +void WidgetCreator::generateXml() +{ + if( iUi.rendererCheckBox().isChecked()) + { + iUi.replaceData( "data/" + widgetLayout() +"/xuikon/00/replacerenderer.xml", + widgetName() + "/widget/xuikon/00/" + iUi.widgetName() + ".xml"); + } + else + { + iUi.replaceData( "data/" + widgetLayout() +"/xuikon/00/replace.xml", + widgetName() + "/widget/xuikon/00/" + iUi.widgetName() + ".xml"); + } + +} + +void WidgetCreator::generateCss() +{ + if( iUi.rendererCheckBox().isChecked()) + { + iUi.replaceData( "data/" + widgetLayout() +"/xuikon/00/replacerenderer.css", + widgetName() + "/widget/xuikon/00/" + iUi.widgetName() + ".css"); + } + else + { + iUi.replaceData( "data/" + widgetLayout() +"/xuikon/00/replace.css", + widgetName() + "/widget/xuikon/00/" + iUi.widgetName() + ".css"); + } +} + +void WidgetCreator::generateDat() +{ + iUi.replaceData("data/" + widgetLayout() +"/xuikon/00/replace.dat", + widgetName() + "/widget/xuikon/00/" + widgetName() + "_" + iUi.widgetUidNoHex() + ".dat"); +} + +void WidgetCreator::generateDtd() +{ + QDir dir; + dir.setPath( widgetName() + "/widget/xuikon/00"); + QFile file(dir.filePath(widgetName()+".dtd")); + if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) + return; + +} + +void WidgetCreator::generatePkg() +{ + iUi.replaceData("data/" + widgetLayout() +"/sis/replace.pkg", + widgetName() + "/widget/sis/"+ widgetName() + ".pkg", 1); // 1 =no hex uid used + } + +void WidgetCreator::generateBur() +{ + QDir dir; + dir.setPath( widgetName() + "/widget/sis"); + QFile file(dir.filePath("backup_registration.xml")); + if (!file.open(QIODevice::ReadWrite | QIODevice::Text)) + return; + + QTextStream out(&file); + + out << "\n" + << "\n" + << "\n" + << "\n" + << "\n"; +} diff -r 000000000000 -r b856a9924bbc widgetcreator.h --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetcreator.h Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,42 @@ +#ifndef WIDGETCREATOR_H +#define WIDGETCREATOR_H + +#include + +#include "mainwindow.h" + +class QString; + +class WidgetCreator : public QObject +{ + Q_OBJECT +public: + explicit WidgetCreator( MainWindow& aUi, QObject *parent = 0); + +signals: + +public slots: + +private: + void generateFolders(); + void generateBuildFile(); + void generateHSPSManifest(); + void generateEmptyDat(); + void generateHSPSConf(); + void generateXml(); + void generateCss(); + void generateDat(); + void generateDtd(); + void generatePkg(); + void generateBur(); + + QString widgetName(); + QString widgetUid(); + QString widgetLayout(); + +private: + MainWindow& iUi; + +}; + +#endif // WIDGETCREATOR_H diff -r 000000000000 -r b856a9924bbc widgetgen.qrc --- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/widgetgen.qrc Wed Jun 02 13:22:05 2010 +0300 @@ -0,0 +1,14 @@ + + + images/feeds_layout.jpg + images/text_layout_3.jpg + images/iconstext_layout_1.jpg + images/iconstext_layout_2.jpg + images/iconstext_layout_3.jpg + images/text_layout_1.jpg + images/text_layout_2.jpg + images/graphictext_layout_1.jpg + images/graphictext_layout_2.jpg + images/graphictext_layout_3.jpg + +