Catchup to latest Symbian^4 GCC_SURGE
authorWilliam Roberts <williamr@symbian.org>
Thu, 22 Jul 2010 16:34:01 +0100
branchGCC_SURGE
changeset 27 848a3adde87f
parent 16 8c9427577f2a (current diff)
parent 25 19394c261aa5 (diff)
Catchup to latest Symbian^4
controlpanelplugins/themeplugin/image/qgn_menu_note.svg
controlpanelplugins/themeplugin/image/themePreview.png
controlpanelplugins/themeplugin/image/themePreview.svg
controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp
controlpanelplugins/themeplugin/src/cpthemechanger_p.h
controlpanelplugins/themeplugin/src/cpthemeclient_p.cpp
controlpanelplugins/themeplugin/src/cpthemeclient_p.h
controlpanelplugins/themeplugin/src/cpthemeclientqt_p.cpp
controlpanelplugins/themeplugin/src/cpthemeclientqt_p.h
controlpanelplugins/themeplugin/src/cpthemeclientsymbian_p.cpp
controlpanelplugins/themeplugin/src/cpthemeclientsymbian_p.h
controlpanelplugins/themeplugin/src/cpthemecommon_p.h
controlpanelplugins/themeplugin/src/cpthemesymbiancommon_p.h
controlpanelui/src/bwins/cpcategorymodelu.def
controlpanelui/src/bwins/cpprofilewrapperu.def
controlpanelui/src/bwins/cpringtoneviewu.def
controlpanelui/src/bwins/seccodeuiu.def
controlpanelui/src/eabi/cpcategorymodelu.def
controlpanelui/src/eabi/cpprofilewrapperu.def
controlpanelui/src/eabi/cpringtoneviewu.def
controlpanelui/src/eabi/seccodeuiu.def
controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/tonepreviewprivate.cpp
controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/tonepreviewprivate.h
controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.cpp
controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.h
--- a/controlpanelplugins/themeplugin/image/qgn_menu_note.svg	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,88 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg width="100%" height="100%" viewBox="0 0 88 88">
-<linearGradient id="_20" gradientUnits="userSpaceOnUse" x1="46.99" y1="48.62" x2="57.59" y2="67.17">
-<stop stop-color="#A2C2DD" offset="0.1"/>
-<stop stop-color="#6C83BB" offset="0.71"/>
-<stop stop-color="#003D6D" offset="0.99"/>
-</linearGradient>
-<path fill="url(#_20)" d="M37.755,14.563c-0.625-0.15-3.215-0.771-3.215-0.771l-6.344,9.318 C14.325,41.71,3.561,47.928,2.801,48.401l6.468,2.128l-1.694,2.4l1.111,3.48l41.153,18.198l14.238-26.409l16.804-2.157l2.899-4.356 l-1.079-7.683l-3.737-4.507l-5.312,0.944l0.463-0.857l0.251-6.262c0,0-4.423-1.069-4.374-1.063 c-0.755-3.548-4.226-3.896-6.26-1.475c-0.013-0.005-2.825-0.708-2.818-0.712c-0.742-3.492-4.2-3.939-6.269-1.469 c-0.004-0.012-2.582-0.668-2.595-0.661c-0.749-3.501-4.18-3.806-6.163-1.437c-0.027,0.008-2.09-0.508-2.088-0.523 C43.063,12.593,39.706,12.258,37.755,14.563z"/>
-<polygon fill="#FFFFFF" points="35.11,15.12 8.336,53.049 48.798,69.047 72.646,28.459 73.573,25.04 "/>
-<linearGradient id="_21" gradientUnits="userSpaceOnUse" x1="30.63" y1="59.56" x2="27.89" y2="65.83">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#496DA2" offset="0.71"/>
-<stop stop-color="#235487" offset="0.99"/>
-</linearGradient>
-<polygon fill="url(#_21)" points="8.45,52.959 48.528,68.704 49.52,73.706 9.246,55.897 "/>
-<linearGradient id="_22" gradientUnits="userSpaceOnUse" x1="56.86" y1="45.11" x2="69.16" y2="54.68">
-<stop stop-color="#DEE9F3" offset="0"/>
-<stop stop-color="#235487" offset="1"/>
-</linearGradient>
-<polygon fill="url(#_22)" points="48.528,68.704 73.633,23.86 73.411,29.393 49.52,73.706 "/>
-<linearGradient id="_23" gradientUnits="userSpaceOnUse" x1="4.44" y1="38.62" x2="45.79" y2="38.62">
-<stop stop-color="#CADCEC" offset="0"/>
-<stop stop-color="#87A8CB" offset="1"/>
-</linearGradient>
-<path fill="url(#_23)" d="M34.894,14.715C18.737,39.471,4.443,48.209,4.443,48.209 c7.75,2.391,41.35,14.314,41.35,14.314L34.894,14.715z"/>
-<linearGradient id="_24" gradientUnits="userSpaceOnUse" x1="15.64" y1="58.6" x2="44.93" y2="34.82">
-<stop stop-color="#FFFFFF" offset="0.15"/>
-<stop stop-color="#A2C2DD" offset="1"/>
-</linearGradient>
-<path fill="url(#_24)" d="M10.557,50.247c11.41,4.494,35.236,12.277,35.236,12.277 c15.358-11.682,27.74-38.658,27.74-38.658l-38.697-9.279L10.557,50.247z"/>
-<linearGradient id="_25" gradientUnits="userSpaceOnUse" x1="68.03" y1="52.73" x2="41.63" y2="18.62">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#496DA2" offset="0.71"/>
-<stop stop-color="#235487" offset="0.99"/>
-</linearGradient>
-<polygon fill="url(#_25)" points="33.619,23.77 33.263,24.6 64.586,33.327 64.445,31.303 "/>
-<polygon fill="url(#_25)" points="30.349,28.944 29.959,29.764 60.965,39.577 60.895,37.549 "/>
-<polygon fill="url(#_25)" points="26.981,34.229 26.567,35.036 57.195,45.958 57.195,43.926 "/>
-<polyline fill="url(#_25)" points="37.03,44.815 23.809,40.569 23.396,41.375 34.393,45.297 37.03,44.815 "/>
-<path fill="#3F5AA6" d="M37.265,17.37c-1.227,0.744-1.05,2.494,0.11,3.184c1.821,1.088,4.019-0.83,2.968-2.572 c0.449-1.01,1.511-1.695,1.794-1.643l1.055,0.223C42.339,13.018,37.265,17.37,37.265,17.37z"/>
-<linearGradient id="_29" gradientUnits="userSpaceOnUse" x1="39.83" y1="18.64" x2="40.83" y2="14.3">
-<stop stop-color="#87A8CB" offset="0"/>
-<stop stop-color="#CADCEC" offset="0.5"/>
-<stop stop-color="#87A8CB" offset="1"/>
-</linearGradient>
-<path fill="url(#_29)" d="M38.914,19.569c-0.589,0.107-1.317-0.102-1.613-0.867c-0.736-5.027,5.301-6.996,5.913-2.141 C42.121,14.176,39.059,15.401,38.914,19.569z"/>
-<path fill="#3F5AA6" d="M45.395,19.34c-1.25,0.758-1.071,2.543,0.112,3.248c1.859,1.107,4.099-0.848,3.027-2.625 c0.458-1.031,1.542-1.729,1.83-1.676l1.076,0.227C50.57,14.901,45.395,19.34,45.395,19.34z"/>
-<path fill="url(#_29)" d="M47.076,21.584c-0.601,0.107-1.342-0.105-1.645-0.887c-0.75-5.129,5.407-7.137,6.031-2.184 C50.348,16.081,47.225,17.331,47.076,21.584z"/>
-<path fill="#3F5AA6" d="M54.135,21.483c-1.274,0.775-1.092,2.594,0.114,3.314c1.897,1.129,4.181-0.863,3.088-2.678 c0.468-1.051,1.574-1.762,1.867-1.709l1.099,0.232C59.414,16.956,54.135,21.483,54.135,21.483z"/>
-<path fill="url(#_29)" d="M55.85,23.772c-0.611,0.111-1.367-0.107-1.676-0.902c-0.767-5.232,5.515-7.281,6.151-2.227 C59.188,18.161,56.002,19.436,55.85,23.772z"/>
-<path fill="#3F5AA6" d="M63.214,23.67c-1.275,0.775-1.093,2.596,0.114,3.314c1.897,1.131,4.181-0.863,3.088-2.678 c0.467-1.051,1.573-1.762,1.867-1.709l1.098,0.23C68.493,19.143,63.214,23.67,63.214,23.67z"/>
-<path fill="url(#_29)" d="M64.929,25.959c-0.612,0.111-1.368-0.105-1.677-0.902c-0.766-5.23,5.515-7.279,6.151-2.229 C68.267,20.348,65.081,21.624,64.929,25.959z"/>
-<linearGradient id="_33" gradientUnits="userSpaceOnUse" x1="39.98" y1="48.02" x2="38.35" y2="40.21">
-<stop stop-color="#81C7C8" offset="0"/>
-<stop stop-color="#BFDAE1" offset="0.01"/>
-<stop stop-color="#FFFFFF" offset="1"/>
-</linearGradient>
-<polygon fill="url(#_33)" points="44.766,36.286 32.146,45.174 47.337,49.641 "/>
-<linearGradient id="_34" gradientUnits="userSpaceOnUse" x1="76.2" y1="30.96" x2="76.09" y2="43.23">
-<stop stop-color="#D6E6EC" offset="0"/>
-<stop stop-color="#298595" offset="1"/>
-</linearGradient>
-<polygon fill="url(#_34)" points="78.675,30.256 82.024,34.297 83.039,41.52 80.464,45.389 69.202,39.09 "/>
-<linearGradient id="_35" gradientUnits="userSpaceOnUse" x1="32.44" y1="33.5" x2="65.81" y2="41.63">
-<stop stop-color="#D6E6EC" offset="0"/>
-<stop stop-color="#298595" offset="1"/>
-</linearGradient>
-<polygon fill="url(#_35)" points="76.59,34.737 77.632,41.426 45.104,46.104 44.105,39.893 "/>
-<linearGradient id="_36" gradientUnits="userSpaceOnUse" x1="30.73" y1="46.42" x2="88.73" y2="44.8">
-<stop stop-color="#E6EEF4" offset="0"/>
-<stop stop-color="#2F8E9A" offset="0.44"/>
-<stop stop-color="#003D6D" offset="0.94"/>
-</linearGradient>
-<polygon fill="url(#_36)" points="77.632,41.426 80.464,45.389 47.337,49.641 45.104,46.104 "/>
-<linearGradient id="_37" gradientUnits="userSpaceOnUse" x1="45.63" y1="37.46" x2="101.75" y2="28.96">
-<stop stop-color="#D6E6EC" offset="0"/>
-<stop stop-color="#298595" offset="1"/>
-</linearGradient>
-<polygon fill="url(#_37)" points="76.59,34.737 78.675,30.256 44.766,36.286 44.105,39.893 "/>
-<linearGradient id="_38" gradientUnits="userSpaceOnUse" x1="35.44" y1="45.89" x2="34.76" y2="40.93">
-<stop stop-color="#235487" offset="0"/>
-<stop stop-color="#496DA2" offset="0.5"/>
-<stop stop-color="#235487" offset="1"/>
-</linearGradient>
-<path fill="url(#_38)" d="M38.261,40.885l-6.462,4.201l7.347,2.1C38.319,46.098,37.854,42.79,38.261,40.885z"/>
-<rect fill="none" height="88" width="88"/>
-</svg>
\ No newline at end of file
Binary file controlpanelplugins/themeplugin/image/themePreview.nvg has changed
Binary file controlpanelplugins/themeplugin/image/themePreview.png has changed
--- a/controlpanelplugins/themeplugin/image/themePreview.svg	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,95 +0,0 @@
-<?xml version="1.0" encoding="UTF-8"?>
-<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
-<svg width="84" height="72" viewBox="0 0 84 72">
-<linearGradient id="_78" gradientUnits="userSpaceOnUse" x1="30.87" y1="28.75" x2="37.09" y2="60.51">
-<stop stop-color="#A2C2DD" offset="0.1"/>
-<stop stop-color="#6C83BB" offset="0.71"/>
-<stop stop-color="#003D6D" offset="0.99"/>
-</linearGradient>
-<path fill="url(#_78)" d="M23.531,11.281L5.719,42.5l1.328,2.391l24.031,6.734l17.641-13.141c0,0-0.158-2.493-0.162-2.503 c0,0-3.672-8.489-3.9-9.028c0.514-0.3,11.891-6.938,11.891-6.938l-0.109-2.859L23.531,11.281z"/>
-<path fill="url(#_78)" d="M52.281,29.016c0,0,2.75,11.217,2.875,11.734c-0.483,0.248-19.281,9.906-19.281,9.906l0.594,2.781 L59.5,63.391l19.641-32.897L78.938,27l-11.516-3.859L52.281,29.016z"/>
-<linearGradient id="_80" gradientUnits="userSpaceOnUse" x1="21.51" y1="35.87" x2="18.01" y2="49.87">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#496DA2" offset="0.71"/>
-<stop stop-color="#235487" offset="0.99"/>
-</linearGradient>
-<polygon fill="url(#_80)" points="6.549,42.57 7.615,44.447 31.021,50.963 30.717,48.865 "/>
-<linearGradient id="_81" gradientUnits="userSpaceOnUse" x1="13.09" y1="-0.2" x2="49.83" y2="61.22">
-<stop stop-color="#FFFFFF" offset="0.15"/>
-<stop stop-color="#A2C2DD" offset="1"/>
-</linearGradient>
-<polygon fill="url(#_81)" points="43.439,25.218 55.939,17.628 23.871,12.013 6.518,42.631 30.486,48.939 33.328,46.857 "/>
-<linearGradient id="_82" gradientUnits="userSpaceOnUse" x1="47.19" y1="50.73" x2="23.44" y2="19.48">
-<stop stop-color="#FFFFFF" offset="0.15"/>
-<stop stop-color="#A2C2DD" offset="1"/>
-</linearGradient>
-<polygon fill="url(#_82)" points="43.42,24.953 53.211,19.302 24.766,14.07 10.072,41.236 33.07,47.236 48.176,36.132 "/>
-<linearGradient id="_83" gradientUnits="userSpaceOnUse" x1="23.7" y1="56.84" x2="22.11" y2="42.87">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#A2C2DD" offset="0.35"/>
-<stop stop-color="#6C83BB" offset="0.7"/>
-<stop stop-color="#003D6D" offset="1"/>
-</linearGradient>
-<path fill="url(#_83)" d="M12.896,36.508l-2.679,4.568l22.774,6.088c0.578-0.389,0.99-0.688,1.199-0.844 C33.67,46.248,17.619,40.061,12.896,36.508z"/>
-<polygon fill="#115B7E" points="23.068,37.926 26.33,41.092 37.918,43.674 42.563,40.258 "/>
-<polygon fill="#BFDAE1" points="30.498,39.459 33.217,39.76 36.553,43.365 33.635,43.055 "/>
-<polygon fill="#2F8E9A" points="30.498,39.459 30.383,39.869 33.033,42.955 33.57,42.961 "/>
-<path fill="#298595" d="M25.684,41.143c-0.34,0.478-3.08,1.111-3.701,0.918c0.584,1.197,8.281,3.697,12.223,4.34 c1.152-0.844,2.383-1.745,3.625-2.655C37.682,43.734,29.107,42.438,25.684,41.143z"/>
-<linearGradient id="_84" gradientUnits="userSpaceOnUse" x1="21.12" y1="39.41" x2="24.58" y2="41.68">
-<stop stop-color="#D6E6EC" offset="0"/>
-<stop stop-color="#298595" offset="1"/>
-</linearGradient>
-<path fill="url(#_84)" d="M21.859,37.691c0,0,3.859,3.41,3.824,3.451c-0.486,0.532-1.895,1.582-3.225,1.356 c-1.406-0.969-1.516-2.535-1.516-2.535S21.143,38.691,21.859,37.691z"/>
-<path fill="#BFDAE1" d="M37.176,43.164c-3.891-0.346-8.678-1.727-10.75-2.424l-2.869-2.592 c2.453-0.051,12.23,1.278,18.695,2.393c0.133-0.098,0.266-0.193,0.395-0.287c-7.146-1.283-17.438-2.85-20.735-2.557 l3.785,3.512c2.773,1.098,7.793,2.355,11.797,2.68c0.063,0.006,0.117,0.006,0.178,0.01c0.293-0.215,0.588-0.428,0.879-0.643 C38.096,43.232,37.639,43.203,37.176,43.164z"/>
-<path fill="#FFFFFF" d="M43.801,25.99c-1.008,1.018-2.887,1.582-5.258,0.744c-3.121,0.617-14.422-1.703-18.314-4.434 l1.998-3.733c1.73-0.021,3.557,0.43,4.418,0.979c0.021-1.244,4.799-3.408,6.994-0.418c2.146-1.813,8.777-2.26,8.297,2.594 c1.927,0.375,2.727,1.459,2.671,2.562l-1.198,0.656L43.801,25.99z"/>
-<linearGradient id="_85" gradientUnits="userSpaceOnUse" x1="41.69" y1="29.27" x2="17.36" y2="33.57">
-<stop stop-color="#2B98A0" offset="0"/>
-<stop stop-color="#0A4A60" offset="1"/>
-</linearGradient>
-<polygon fill="url(#_85)" points="33.205,40.467 44.795,19.023 23.104,34.765 "/>
-<polygon fill="#2F8E9A" points="40.377,41.775 34.348,41.842 42.938,23.255 42.648,40.254 "/>
-<linearGradient id="_86" gradientUnits="userSpaceOnUse" x1="68.92" y1="17.39" x2="38.92" y2="25.01">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#496DA2" offset="0.71"/>
-<stop stop-color="#235487" offset="0.99"/>
-</linearGradient>
-<polygon fill="url(#_86)" points="55.939,17.628 56.088,19.786 44.148,26.745 43.408,24.939 "/>
-<linearGradient id="_87" gradientUnits="userSpaceOnUse" x1="69.87" y1="44.4" x2="30.62" y2="43.28">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#496DA2" offset="0.71"/>
-<stop stop-color="#235487" offset="0.99"/>
-</linearGradient>
-<polygon fill="url(#_87)" points="48.141,36.109 48.287,38.27 31.021,50.963 30.436,48.941 "/>
-<linearGradient id="_88" gradientUnits="userSpaceOnUse" x1="44.31" y1="7.26" x2="56.64" y2="37.42">
-<stop stop-color="#FFFFFF" offset="0.15"/>
-<stop stop-color="#A2C2DD" offset="1"/>
-</linearGradient>
-<path fill="url(#_88)" d="M78.33,27.458l-11.006-3.77c-0.477,0.186-3.596,1.404-3.596,1.404l-7.695,16.415 l-16.508,7.646l-3.176,1.65l21.958,9.551L78.33,27.458z"/>
-<linearGradient id="_89" gradientUnits="userSpaceOnUse" x1="61.03" y1="50.36" x2="53.03" y2="27.86">
-<stop stop-color="#FFFFFF" offset="0.15"/>
-<stop stop-color="#A2C2DD" offset="1"/>
-</linearGradient>
-<polyline fill="url(#_89)" points="57.227,56.859 74.799,28.55 64.098,24.958 52.76,29.253 55.58,40.939 39.156,49.361 "/>
-<path fill="#298595" d="M51.652,44.461c-1.846,1.014-3.752,1.346-5.568,1.35l-4.371,2.238 C46.66,48.316,49.598,46.246,51.652,44.461z"/>
-<path fill="#115B7E" d="M49.533,44.045l-2.205,1.146c1.115-0.109,2.188-0.34,3.188-0.75 C50.252,44.324,49.916,44.189,49.533,44.045z"/>
-<path fill="#CFECFF" d="M50.516,44.441c-1.002,0.41-2.072,0.641-3.188,0.75l-1.244,0.619 c1.512,0.034,2.809-0.218,4.102-0.668c0.455-0.168,0.939-0.392,1.467-0.685c-0.438-0.19-1.729-0.615-1.729-0.615 l-0.387,0.199C49.916,44.189,50.252,44.324,50.516,44.441z"/>
-<linearGradient id="_90" gradientUnits="userSpaceOnUse" x1="51.3" y1="60.44" x2="47.14" y2="39.31">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#A2C2DD" offset="0.35"/>
-<stop stop-color="#6C83BB" offset="0.7"/>
-<stop stop-color="#003D6D" offset="1"/>
-</linearGradient>
-<path fill="url(#_90)" d="M42.832,47.469l-3.646,1.877l18.055,7.525l2.504-3.982 C59.744,52.889,53.578,48.111,42.832,47.469z"/>
-<linearGradient id="_91" gradientUnits="userSpaceOnUse" x1="83.79" y1="20.58" x2="59.13" y2="60.86">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#496DA2" offset="0.71"/>
-<stop stop-color="#235487" offset="0.99"/>
-</linearGradient>
-<polygon fill="url(#_91)" points="78.363,27.452 58.451,59.945 59.256,62.68 78.479,30.382 "/>
-<linearGradient id="_92" gradientUnits="userSpaceOnUse" x1="51.25" y1="49.13" x2="46.5" y2="59.63">
-<stop stop-color="#FFFFFF" offset="0"/>
-<stop stop-color="#496DA2" offset="0.71"/>
-<stop stop-color="#235487" offset="0.99"/>
-</linearGradient>
-<polygon fill="url(#_92)" points="58.508,59.967 36.35,50.805 36.85,52.969 59.256,62.68 "/>
-</svg>
\ No newline at end of file
--- a/controlpanelplugins/themeplugin/src/cpthemechanger.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/src/cpthemechanger.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -14,19 +14,20 @@
  * Description:  
  *   
  */
+#include <QString>
 
 #include "cpthemechanger.h"
-#include "cpthemechanger_p.h"
+#include "cpthemeutil.h"
+#include "cpthemeinfo.h"
+
+#include <hbinstance.h>
+#include <restricted/hbthemeservices_r.h>
 
 /*!
-  @alpha
-  @hbcore
   \class CpThemeChanger
 
   \brief CpThemeChanger provides an interface for changing the current
-  theme and enumerating the available themes (e.g., for the UI to provide 
-  a list of themes to show).
-
+  theme.
   This API is only for use with the control panel and its theme
   changing plugin.
 */
@@ -36,71 +37,76 @@
 */
 CpThemeChanger::CpThemeChanger(QObject* p) :
     QObject(p),
-    d_ptr(new CpThemeChangerPrivate(this))
+    mCurrentTheme(0)
 {
+    connect(hbInstance->theme(),SIGNAL(changeFinished()), this, SLOT(changeFinished()));
+       
+    setCurrentTheme();
+}
+
+/*!
+    Returns a ThemeInfo object containing the current theme name and
+    corresponding icons.
+
+    If no repersentative icons exist, the HbIcon returned will be
+    uninitialized.
+*/
+const CpThemeInfo* CpThemeChanger::currentTheme() const
+{
+    return mCurrentTheme;
 }
 
 /*!
-    Provides a list of themes as a const QAbstractItemModel*.
-*/
-QAbstractItemModel& CpThemeChanger::model()
+ * Private helper function that gets the current theme from hbinstance and s
+ * ets class' current theme.  
+ */
+void CpThemeChanger::setCurrentTheme()
 {
-    Q_D(CpThemeChanger);
-   
-    return d->model;
+    QString themeName = "";
+    if (HbInstance::instance()) {
+        HbTheme *hbTheme = HbInstance::instance()->theme();
+        if(hbTheme) {
+            themeName = hbTheme->name();
+        }
+         
+    }
+       
+    if(mCurrentTheme && mCurrentTheme->name() == themeName) {
+        return;
+    }
+    else {
+        //buildThemeInfo creates new theme info.
+        CpThemeInfo* tmpTheme = CpThemeUtil::buildThemeInfo(HbThemeServices::themePath(), themeName);
+         
+        //delete old value. set the new value.
+        if(tmpTheme) {
+            if(mCurrentTheme){
+                delete mCurrentTheme;
+            }
+            mCurrentTheme = tmpTheme;
+        }
+    }
 }
 
 
 /*!
-  Creates a connection to the theme server for the purpose of 
-  changing the theme.
- */
-bool CpThemeChanger::connectToServer()
-{
-    Q_D(CpThemeChanger);
-
-    return d->connectToServer();
-}
-
-/*!
-  Indicates if the client is connected to the theme server.
-*/
-bool CpThemeChanger::isConnected() const
-{
-    Q_D(const CpThemeChanger);
-
-    return d->isConnected();
-}
-
-
-/*!
-    Returns a ThemeInfo struct containing the current theme name and
-    a repersentative HbIcon.
-
-    If no repersentative icon exists, the HbIcon returned will be
-    uninitialized.
-*/
-const CpThemeChanger::ThemeInfo& CpThemeChanger::currentTheme() const
-{
-    Q_D(const CpThemeChanger);
-
-    return d->currentTheme();
-}
-
-int CpThemeChanger::indexOf(const ThemeInfo& theme) const
-{
-    Q_D(const CpThemeChanger);
-    return d->indexOf(theme);
-}
-
-/*!
  Change a theme. Returns true on success, false otherwise.
  */
-bool CpThemeChanger::changeTheme(const QString& newtheme)
+bool CpThemeChanger::changeTheme(const QString& newTheme)
 {
-    Q_D(CpThemeChanger);
+    bool result = false;
+    // Skip doing this if the request is for the current theme
+    if (newTheme.isEmpty() || newTheme == mCurrentTheme->name()) {
+        return result;
+    }
 
-    return d->changeTheme(newtheme);
+    QString themePath = CpThemeUtil::themePath(newTheme);
+    
+    if(!themePath.isEmpty()) {
+        HbThemeServices::setTheme(themePath);
+        result = true;
+    }
+    return result;
 }
 
 /*!
@@ -108,11 +114,21 @@
  */
 CpThemeChanger::~CpThemeChanger()
 {
-    delete d_ptr;
-    d_ptr = 0;
+    delete mCurrentTheme;
+    mCurrentTheme = 0;
 }
 
-#include "moc_cpthemechanger.cpp"
+/*!
+ *  Slot to handle notification from theme server that theme change
+ *  is done.  Notify the owner.
+ */
+void CpThemeChanger::changeFinished()
+{
+  
+    setCurrentTheme();
+    
+    emit themeChangeFinished();
+}
 
 // End of file
 
--- a/controlpanelplugins/themeplugin/src/cpthemechanger.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/src/cpthemechanger.h	Thu Jul 22 16:34:01 2010 +0100
@@ -19,10 +19,12 @@
 #define CPTHEMECHANGER_H
 
 #include <QStringList>
+
 #include <hbicon.h>
 #include <hbglobal.h>
 
 class CpThemeChangerPrivate;
+class CpThemeInfo;
 
 QT_BEGIN_NAMESPACE
 class QAbstractItemModel;
@@ -31,44 +33,25 @@
 class CpThemeChanger : public QObject
 {
     Q_OBJECT
-
+    
 public:
      explicit CpThemeChanger(QObject* parent=0);
     ~CpThemeChanger();
-
-    struct ThemeInfo 
-    {
-        QString name;
-        HbIcon  icon;
-        HbIcon portraitPreviewIcon;
-        HbIcon landscapePreviewIcon;
-        bool operator < (const struct ThemeInfo &other) const   {			
-            return name.localeAwareCompare(other.name) < 0;
-        }	
-        bool operator == (const struct ThemeInfo &other) const {
-            return name.localeAwareCompare(other.name) == 0;
-        }
-    };
+    
+    const CpThemeInfo* currentTheme() const;
+    bool changeTheme(const QString& newtheme);
+    
+signals:
+    void themeChangeFinished();
     
-    enum ThemeListUserRole {
-        PortraitPreviewRole = Qt::UserRole,
-        LandscapePreviewRole
-    };
+public slots:
+    void changeFinished();
+	
+private:
+    void setCurrentTheme();
     
-    QAbstractItemModel& model();
-
-    const ThemeInfo& currentTheme() const;
-    int indexOf(const ThemeInfo& theme) const;
-
-    bool changeTheme(const QString& newtheme);
-	
-	bool connectToServer();
-	bool isConnected() const;
-
-private:
-    CpThemeChangerPrivate* d_ptr;
-    Q_DECLARE_PRIVATE(CpThemeChanger)
-    Q_PRIVATE_SLOT(d_func(), void _q_themeDirectoryChanged(const QString&))
+    CpThemeInfo* mCurrentTheme;
 };
 
+
 #endif /* CPTHEMECHANGER_H */
--- a/controlpanelplugins/themeplugin/src/cpthemechanger_p.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,401 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#include "cpthemechanger.h"
-#include "cpthemechanger_p.h"
-#include <QStringList>
-#include <QSettings>
-#include <QFileSystemWatcher>
-#include <QPixmap>
-#include <QSizeF>
-#include <hbicon.h>
-#include <hbinstance.h>
-#include "cpthemeclient_p.h"
-#include "cpthemecommon_p.h"
-#ifdef Q_OS_SYMBIAN
-#include "cpthemeclientsymbian_p.h"
-#else
-#include "cpthemeclientqt_p.h"
-#endif
-
-namespace {
-#if !defined(Q_OS_SYMBIAN)
-    #include <stdio.h>
-    static const char* KThemePathKey = "HB_THEMES_DIR";
-#endif
-
-    static const QString KDefaultTheme = "hbdefault";
-    static const char* KSettingsCategory = "currenttheme";
-   
-}
-
-CpThemeChangerPrivate::CpThemeChangerPrivate(CpThemeChanger* qq):
-    q_ptr(qq),
-    themeClient(CpThemeClient::global()),
-    fileWatcher(new QFileSystemWatcher(qq)),
-    model(this, qq)
-
-{
-    Q_Q(CpThemeChanger);
-
-    // Figure out where our themes are. This is platform-dependent,
-    // but not worth breaking out into platform-private implementations
-    // at the moment. Ideally, this would be given to us by the theme server,
-    #ifdef Q_OS_WIN
-    static char* _path=NULL;
-    static size_t _size=0;
-    _dupenv_s(&_path, &_size, KThemePathKey);
-    themeRootPath = QString(_path);
-    themeRootPathPostfix = QString();
-    free(_path);
-    #elif defined(Q_OS_SYMBIAN)
-    themeRootPath = "c:\\resource\\hb";
-    themeRootPathPostfix  = "resource\\hb";
-    #elif defined(Q_OS_UNIX)
-    themeRootPath = QString(getenv(KThemePathKey));
-    themeRootPathPostfix = QString();
-    #elif defined(Q_OS_MACX)
-    themeRootPath = QDir::homePath() + '/' + "Library" + QString("hb");
-    themeRootPathPostfix = QString();
-    #else
-    themeRootPath = "c:\\resource\\hb";
-    themeRootPathPostfix = QString();
-    #endif
-
-    // Get our current state
-    QSettings settings(QLatin1String(ORGANIZATION), QLatin1String(THEME_COMPONENT));
-    mCurrentTheme.name = settings.value(KSettingsCategory).toString();
-    updateThemeList(mCurrentTheme.name);
-
-    // Watch for changes to the theme directory in flash.
-    // This may change once we start offering a model.
-    fileWatcher->addPath(themeRootPath+"/themes/");
-    q->connect(fileWatcher, SIGNAL(directoryChanged(const QString&)),
-               q, SLOT(_q_themeDirectoryChanged(const QString&)));
-
-    // Connect to the theme server
-    connectToServer();
-}
-
-CpThemeChangerPrivate::~CpThemeChangerPrivate()
-{
-    themeClient->releaseInstance();
-}
-
-const CpThemeChanger::ThemeInfo& CpThemeChangerPrivate::currentTheme() const
-{
-    return mCurrentTheme;
-}
-
-const QString& CpThemeChangerPrivate::currentThemeName() const
-{
-    return mCurrentTheme.name.isEmpty() ? KDefaultTheme : mCurrentTheme.name;
-}
-
-int CpThemeChangerPrivate::indexOf(const CpThemeChanger::ThemeInfo& theme) const
-{
-    return themeList.indexOf(theme);
-}
-
-void CpThemeChangerPrivate::updateThemeList(const QString& newThemeName)
-{
-    if(!themeList.isEmpty()) {
-        themeList.clear();
-    }
-
-    mCurrentTheme.name = newThemeName.isEmpty() ? KDefaultTheme : newThemeName;
-
-    // Get the list of Drives here
-    QStringList themesPathList;
-
-#if defined(Q_OS_WIN32)
-    themesPathList << themeRootPath;
-#elif defined(Q_OS_SYMBIAN)
-    QFileInfoList driveInfoList = QDir::drives();
-    foreach (const QFileInfo &driveInfo, driveInfoList) {
-        const QString drive = driveInfo.absolutePath();
-        themesPathList << drive + themeRootPathPostfix;
-    }
-#elif defined(Q_OS_UNIX)
-    themesPathList << themeRootPath;
-#elif defined(Q_OS_MACX)
-    themesPathList << themeRootPath;
-#endif
-
-    foreach (const QString &path, themesPathList) {
-        QDir themeDir;
-        themeDir.setPath( path ) ;
-        QStringList iconthemeslist;
-        QStringList list = themeDir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name);
-        CpThemeChanger::ThemeInfo nameIconPair;
-
-        if(list.contains("themes",Qt::CaseSensitive )) {
-            QDir root(themeDir.path());
-            themeDir.setPath(root.path()+"/themes/icons/") ;
-            iconthemeslist=themeDir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name);
-            foreach(QString themefolder, iconthemeslist) {
-                QDir iconThemePath(root.path()+"/themes/icons/"+themefolder);
-                if(iconThemePath.exists("index.theme") &&
-                   (iconThemePath.exists("scalable") || iconThemePath.exists("pixmap") )) {
-                    QSettings iniSetting(iconThemePath.path()+"/index.theme",QSettings::IniFormat);
-                    iniSetting.beginGroup("Icon Theme");
-                    QString hidden = iniSetting.value("Hidden").toString();
-                    QString name = iniSetting.value("Name").toString();
-                    QString iconPath = iniSetting.value("PreviewThumbnailPath").toString();
-                    QString previewPathPrt = iniSetting.value("PreviewIconPath_prt").toString();
-                    QString previewPathLsc = iniSetting.value("PreviewIconPath_lsc").toString();
-                    if (name.isEmpty()) {
-                        continue;
-                    }
-                    
-                    QString fullPathToIcon(iconThemePath.path() + iconPath);
-                    
-                    if(iconPath.isEmpty()|| !QFileInfo(fullPathToIcon).exists()){
-                        
-                        //Set thumbnail
-                        if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_theme_preview_thumbnail.svg").exists()){
-                            nameIconPair.icon = HbIcon(fullPathToIcon + "/scalable/qtg_graf_theme_preview_thumbnail.svg");
-                        }else if(QFileInfo(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg").exists()){
-                            QPixmap px(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg");
-                            QIcon scaledIcon(px.scaled(QSize(64, 64)));
-                            nameIconPair.icon = HbIcon(scaledIcon);
-                            nameIconPair.icon.setIconName(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.svg");
-                           
-                        } else if(QFileInfo(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_prt.png").exists()){
-                            QPixmap px(fullPathToIcon + "/pixmap/qtg_graf_screen_bg_prt.png");
-                            QIcon scaledIcon(px.scaled(QSize(64, 64)));
-                            nameIconPair.icon = HbIcon(scaledIcon);
-                            nameIconPair.icon.setIconName(fullPathToIcon + "/scalable/qtg_graf_screen_bg_prt.png");
-                          
-                        } else{
-                            nameIconPair.icon = HbIcon(":/image/themePreview.svg");
-                        }
-                    } else {
-                        nameIconPair.icon = HbIcon(fullPathToIcon);
-                    }
-                    
-                    //Portrait preview
-                    QString fullPathToPreviewPrt = (iconThemePath.path() + previewPathPrt );
-                    
-                    if(previewPathPrt.isEmpty() || !QFileInfo(fullPathToPreviewPrt).exists()) {
-                    
-                        if(QFileInfo(fullPathToPreviewPrt + "/scalable/qtg_graf_theme_preview_prt.svg").exists()){
-                            nameIconPair.portraitPreviewIcon = HbIcon(fullPathToPreviewPrt + "/scalable/qtg_graf_theme_preview_prt.svg");
-                        }else if(QFileInfo(fullPathToPreviewPrt + "/scalable/qtg_graf_screen_bg_prt.svg").exists()){
-                            nameIconPair.portraitPreviewIcon = HbIcon(fullPathToPreviewPrt + "/scalable/qtg_graf_screen_bg_prt.svg");
-                        } else if(QFileInfo(fullPathToPreviewPrt + "/pixmap/qtg_graf_screen_bg_prt.png").exists()){
-                            nameIconPair.portraitPreviewIcon = HbIcon(fullPathToPreviewPrt + "/pixmap/qtg_graf_screen_bg_prt.png");
-                        } else{
-                            nameIconPair.portraitPreviewIcon = HbIcon(":/image/themePreview.svg");
-                        }
-                    }
-                    else {
-                        nameIconPair.portraitPreviewIcon = HbIcon(fullPathToPreviewPrt);
-                    }
-                    
-                    //Landscape preview
-                    QString fullPathToPreviewLsc = (iconThemePath.path() + previewPathLsc );
-                                    
-                    if(previewPathLsc.isEmpty() || !QFileInfo(fullPathToPreviewLsc).exists()) {
-                                
-                        if(QFileInfo(fullPathToPreviewLsc + "/scalable/qtg_graf_theme_preview_lsc.svg").exists()){
-                            nameIconPair.landscapePreviewIcon = HbIcon(fullPathToPreviewLsc + "/scalable/qtg_graf_theme_preview_lsc.svg");
-                        }else if(QFileInfo(fullPathToPreviewLsc + "/scalable/qtg_graf_screen_bg_lsc.svg").exists()){
-                            nameIconPair.landscapePreviewIcon = HbIcon(fullPathToPreviewLsc + "/scalable/qtg_graf_screen_bg_lsc.svg");
-                        } else if(QFileInfo(fullPathToPreviewLsc + "/pixmap/qtg_graf_screen_bg_lsc.png").exists()){
-                            nameIconPair.landscapePreviewIcon = HbIcon(fullPathToPreviewLsc + "/pixmap/qtg_graf_screen_bg_lsc.png");
-                        } else{
-                            nameIconPair.landscapePreviewIcon = HbIcon(":/image/themePreview.svg");
-                        }
-                    }
-                    else {
-                        nameIconPair.landscapePreviewIcon = HbIcon(fullPathToPreviewLsc);
-                    }
-                
-                    nameIconPair.name = name;
-                                        
-                    themeList.append(nameIconPair);
-
-                    if (name == mCurrentTheme.name) {
-                        mCurrentTheme = nameIconPair;
-                    }
-
-                    iniSetting.endGroup();
-                    if((hidden == "true") ||( hidden == "")||(name!=themefolder) ) {
-                        iconthemeslist.removeOne(themefolder);
-                        if(!themeList.isEmpty()) {
-                            themeList.removeLast();
-                        }
-                    }
-                } else {
-                    iconthemeslist.removeOne(themefolder);
-                    if(!themeList.isEmpty()) {
-                        themeList.removeLast();
-                    }
-                }
-            }
-        }
-    }
-    
-    if (mCurrentTheme.name == KDefaultTheme)
-    {
-        // Include default
-         CpThemeChanger::ThemeInfo def;
-         def.name = KDefaultTheme;
-         def.icon = HbIcon(":/image/themePreview.svg");
-         themeList.append(def);
-  
-         mCurrentTheme = def;
-    }
-
-}
-
-const QList<CpThemeChanger::ThemeInfo>& CpThemeChangerPrivate::themes() const
-{
-   return themeList;
-}
-
-bool CpThemeChangerPrivate::connectToServer()
-{
-    return themeClient->connectToServer();
-}
-
-/**
- * Indicate if the client is connected to the server
- */
-bool CpThemeChangerPrivate::isConnected() const
-{
-    return themeClient->isConnected();
-}
-
-/**
- * Change a theme
- */
-bool CpThemeChangerPrivate::changeTheme(const QString& newTheme)
-{
-    bool result = false;
-    // Skip doing this if the request is for the current theme
-    if (newTheme.isEmpty() || newTheme == mCurrentTheme.name) return result;
-
-    // Make sure it's a valid theme name
-    bool exists = false;
-    QList<CpThemeChanger::ThemeInfo> themeList = themes();
-    QList<CpThemeChanger::ThemeInfo>::const_iterator i;
-    for (i = themeList.constBegin(); i != themeList.constEnd(); ++i) {
-        if ( newTheme == i->name) {
-            exists = true;
-            break;
-        }
-    }
-
-    if (exists) {
-        result = themeClient->changeTheme(newTheme);
-		updateThemeList(newTheme);
-    }
-    return result;
-}
-
-void CpThemeChangerPrivate::_q_themeDirectoryChanged(const QString&)
-{
-    updateThemeList();
-}
-
-/*
-    HbThemeChangerModel provides an interface to the data contained in the
-    HbThemeChanger using QAbstractListModel.
-*/
-
-/*
-    Constructor
-*/
-HbThemeListModel::HbThemeListModel(CpThemeChangerPrivate *dd, QObject* parent)
-    : QAbstractListModel(parent)
-    , mThemeChangerPrivate(dd)
-{
-    connect(dd->fileWatcher, SIGNAL(directoryChanged(const QString&)),
-        this, SLOT(themeListChanged()));
-}
-
-/*
-    Destructor
-*/
-HbThemeListModel::~HbThemeListModel()
-{
-
-}
-
-/*
-    Reimplemented from QAbstractListModel.
-*/
-int HbThemeListModel::rowCount(const QModelIndex&) const
-{
-    return mThemeChangerPrivate->themeList.size();
-}
-
-/*
-    Reimplemented from QAbstractListModel.  Provides the data for Qt::DisplayRole and
-    Qt::DecorationRole.
-*/
-QVariant HbThemeListModel::data(const QModelIndex& index, int role) const
-{
-    QVariant retVal = QVariant();
-
-    if (index.isValid()) {
-        switch (role) {
-            case Qt::DisplayRole:
-                retVal = mThemeChangerPrivate->themeList.at(index.row()).name;
-                break;
-
-            case Qt::DecorationRole:
-                retVal = mThemeChangerPrivate->themeList.at(index.row()).icon;
-                break;
-
-        case Qt::SizeHintRole:
-                retVal = mThemeChangerPrivate->themeList.at(index.row()).icon.size();
-                break;
-        case CpThemeChanger::PortraitPreviewRole:
-                retVal = mThemeChangerPrivate->themeList.at(index.row()).portraitPreviewIcon;
-                break;
-        case CpThemeChanger::LandscapePreviewRole:
-                retVal = mThemeChangerPrivate->themeList.at(index.row()).landscapePreviewIcon;
-
-            default:
-                // do nothing
-                qt_noop();
-        }
-    }
-
-    return retVal;
-}
-
-/*
-    Responds appropriately when the underlying data in the theme changer is modified.
-
-    Unfortunately the directory watcher from QFileWatcher only says when something changed
-    not what changed.  Therefore the model is considered reset rather than having rows
-    with dataChanged.
-*/
-void HbThemeListModel::themeListChanged()
-{
-    beginResetModel();
-
-    mThemeChangerPrivate->themes();
-
-    endResetModel();
-}
-
-// End of file
--- a/controlpanelplugins/themeplugin/src/cpthemechanger_p.h	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,93 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#ifndef HBTHEMECHANGER_P_H
-#define HBTHEMECHANGER_P_H
-
-#include <hbglobal.h>
-
-#include <QObject>
-
-#include <QAbstractListModel>
-#include <QDir>
-#include <QModelIndex>
-#include <QString>
-#include <QStringList>
-
-#include "cpthemechanger.h"
-
-QT_BEGIN_NAMESPACE
-class QFileSystemWatcher;
-QT_END_NAMESPACE
-
-class CpThemeClient;
-
-class HbThemeListModel : public QAbstractListModel
-{
-    Q_OBJECT
-
-public:
-   
-    HbThemeListModel(CpThemeChangerPrivate* dd, QObject *parent = 0);
-    virtual ~HbThemeListModel();
-
-    virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
-    virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
-
-public slots:
-    void themeListChanged();
-
-private:
-    CpThemeChangerPrivate *mThemeChangerPrivate;
-};
-
-class CpThemeChangerPrivate
-{
-    CpThemeChanger* q_ptr;
-    Q_DECLARE_PUBLIC(CpThemeChanger)
-
-public:
-    CpThemeChangerPrivate(CpThemeChanger* q);
-    ~CpThemeChangerPrivate();
-
-    bool connectToServer();
-    bool isConnected() const;
-
-    const QList<CpThemeChanger::ThemeInfo>& themes() const;
-    void updateThemeList(const QString& currentThemeName = QString());
-
-    const CpThemeChanger::ThemeInfo& currentTheme() const;
-    int indexOf(const CpThemeChanger::ThemeInfo& theme) const;
-
-    const QString& currentThemeName() const;
-    bool changeTheme(const QString& newtheme);
-
-    void _q_themeDirectoryChanged(const QString&);
-
-    CpThemeChanger::ThemeInfo mCurrentTheme;
-
-    QString themeRootPath;
-    QString themeRootPathPostfix;
-
-    CpThemeClient* themeClient;
-    QFileSystemWatcher* fileWatcher;
-    QList<CpThemeChanger::ThemeInfo> themeList;
-	HbThemeListModel model;
-	friend class HbThemeChangerModel;
-};
-
-#endif /* HBTHEMECHANGER_P_H */
--- a/controlpanelplugins/themeplugin/src/cpthemeclient_p.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,91 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#include "cpthemeclient_p.h"
-
-#ifdef Q_OS_SYMBIAN
-#include "cpthemeclientsymbian_p.h"
-#else
-#include "cpthemeclientqt_p.h"
-#endif
-
-static CpThemeClient *clientInst=0;
-
-/**
- * Constructor
- */
-CpThemeClient::CpThemeClient():d_ptr(new CpThemeClientPrivate)
-{
-    
-}
-
-/**
- * CpThemeClient::connectToServer()
- */
-bool CpThemeClient::connectToServer()
-{
-    Q_D(CpThemeClient);
-    return d->connectToServer();
-}
-
-bool CpThemeClient::isConnected()
-{
-    Q_D(CpThemeClient);
-    return d->isConnected();
-}
-
-/**
- * Change a theme
- */
-bool CpThemeClient::changeTheme(const QString& newtheme)
-{
-    Q_D(CpThemeClient);
-    return d->changeTheme(newtheme);
-}
-
-
-
-/**
- * CpThemeClient::~CpThemeClient()
- */
-CpThemeClient::~CpThemeClient()
-{
-    Q_D(CpThemeClient);
-    delete d;
-}
-
-
-
-/**
- * CpThemeClient::global()
- */
-CpThemeClient *CpThemeClient::global()
-{
-    if ( !clientInst ) {
-        clientInst = new CpThemeClient;
-    }
-    return clientInst;
-}
-
-/**
- * CpThemeClient::releaseInstance()
- */
-void CpThemeClient::releaseInstance()
-{
-    delete clientInst;
-    clientInst = 0;
-}
--- a/controlpanelplugins/themeplugin/src/cpthemeclient_p.h	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,48 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#ifndef CPTHEMECLIENT_P_H
-#define CPTHEMECLIENT_P_H
-
-#include <qglobal.h>
-#include <QByteArray>
-
-
-class CpThemeClientPrivate;
-
-class CpThemeClient
-{
-    CpThemeClientPrivate* d_ptr;
-    Q_DECLARE_PRIVATE_D(d_ptr, CpThemeClient)
-
-public:
-    bool connectToServer();
-
-    bool changeTheme(const QString& newtheme);
-
-    bool isConnected();
-
-public:
-    static CpThemeClient *global();
-    static void releaseInstance();
-    ~CpThemeClient();
-
-private:
-    CpThemeClient();
-};
-
-#endif /* CPTHEMECLIENT_P_H */
--- a/controlpanelplugins/themeplugin/src/cpthemeclientqt_p.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,189 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#include "cpthemeclientqt_p.h"
-#include <QLocalSocket>
-#include <QProcess>
-#include <QFile>
-#include <QCoreApplication>
-#include <QDebug>
-#include <QDir>
-
-#include <hbinstance.h>
-
-
-#define WAIT_TIME_TO_CONNECT_TO_SERVER 500
-#define WAIT_TIME_TO_START_SERVER 5000
-//static const QString SERVERFILEPATH = QLatin1String(HB_BIN_DIR) + QDir::separator() + QLatin1String("hbthemeserver");
-
-/**
- * Constructor
- */
-CpThemeClientPrivate::CpThemeClientPrivate():clientConnected( false ),localSocket( new QLocalSocket() )
-{
-#ifdef THEME_SERVER_TRACES
-    qDebug() << Q_FUNC_INFO ;
-#endif
-}
-
-/**
- * connectToServer
- */
-bool CpThemeClientPrivate::connectToServer()
-{
-    localSocket->connectToServer(THEME_SERVER_NAME);
-    // This logic needs to be improved
-    bool success = localSocket->waitForConnected( WAIT_TIME_TO_CONNECT_TO_SERVER );
-
-#ifdef THEME_SERVER_TRACES
-    qDebug() << Q_FUNC_INFO << "Socket Connect status: " << success;
-#endif 
-
-// Stub shouldn't try starting the theme server yet again.
-#if 0
-    if(!success) {
-        QProcess *newProcess = new QProcess();
-        newProcess->start(SERVERFILEPATH);
-        success = newProcess->waitForStarted( WAIT_TIME_TO_START_SERVER );
-#ifdef THEME_SERVER_TRACES
-        qDebug() << Q_FUNC_INFO << "Server Start Status: " << success << "Error = " << newProcess->error ();
-#endif
-
-        // If server started
-        if (success) {
-            // ToDo: This is to wait for server to start running. Logic needs to be improved.
-            newProcess->waitForFinished(3000);
-#ifdef THEME_SERVER_TRACES
-            qDebug() <<Q_FUNC_INFO<< " Server Start Wait is over" ;
-#endif
-            localSocket->connectToServer(THEME_SERVER_NAME);
-            success = localSocket->waitForConnected();
-#ifdef THEME_SERVER_TRACES
-            qDebug() <<Q_FUNC_INFO<< "socketconnected : "<<success;
-#endif
-        }
-    }
-#endif
-    if (success) {
-        connect(localSocket, SIGNAL(readyRead()), this, SLOT(themeChanged()));
-    }
-    return clientConnected = success;
-}
-
-/**
- * isConnected
- */
-bool CpThemeClientPrivate::isConnected()
-{
-    return clientConnected;
-}
-
-/**
- * Destructor
- */
-CpThemeClientPrivate::~CpThemeClientPrivate()
-{
-    localSocket->disconnectFromServer();
-    delete localSocket;
-}
-
-/**
- * CpThemeClientPrivate::themeChanged()
- */
-void CpThemeClientPrivate::themeChanged()
-{
-#ifdef THEME_SERVER_TRACES
-    qDebug() << Q_FUNC_INFO;
-#endif
-
-    QByteArray inputByteArray = localSocket->readAll();
-    QDataStream inputDataStream(inputByteArray);
-    int request;
-    inputDataStream >> request;
-
-#ifdef THEME_SERVER_TRACES
-    qDebug() << Q_FUNC_INFO << "recognizer: "<<request;
-#endif
- 
-    if(EThemeSelection==request) {
-        QString themeName;
-        handleThemeChangeRequest(inputDataStream);
-    }
-#if 0
-    // TODO determine if we need this for the control panel app
-    if(EThemeContentUpdate == request) {
-        hbInstance->theme()->d_ptr->clearCache();
-    }
-#endif
-}
-
-/**
- * CpThemeClientPrivate::handleThemeChangeRequest()
- */
-void CpThemeClientPrivate::handleThemeChangeRequest(QDataStream &dataStream)
-{
-    QString themeName;
-    dataStream >> themeName;
-#ifdef THEME_SERVER_TRACES
-    qDebug() << Q_FUNC_INFO <<"themeName is : " <<themeName;
-#endif
-
-    if(!(hbInstance->theme()->name() == themeName)) {
-#ifdef THEME_SERVER_TRACES
-        qDebug() << Q_FUNC_INFO <<"themeChanged(): called";
-#endif
-#if 0
-        // TODO determine if we need this for the control panel app
-        hbInstance->theme()->d_ptr->handleThemeChange();
-#endif
-    }
-}
-
-/**
- * changeTheme
- */
-bool CpThemeClientPrivate::changeTheme(const QString &newTheme)
-{
-#ifdef THEME_CHANGER_TRACES
-    qDebug() <<"ThemeClientQt::changeTheme("<<newTheme<<") called";
-#endif
-    if( (themeName==newTheme) || (newTheme.isEmpty()) ) {
-#ifdef THEME_CHANGER_TRACES
-        qDebug() <<"ThemeClientQt:: return Sametheme applied";
-#endif
-        return false;
-    }
-    QByteArray outputByteArray;
-    QDataStream outputDataStream(&outputByteArray, QIODevice::WriteOnly);
-    ThemeServerRequest requestType = EThemeSelection;
-    outputDataStream << (int)requestType;
-    outputDataStream << newTheme;
-    themeName = newTheme;
-    int expected = outputByteArray.size();
-    int count = localSocket->write(outputByteArray);
-#ifdef THEME_CHANGER_TRACES
-    qDebug()<<"ThemeClientQt::ThemeName written to server";
-#endif
-    localSocket->flush();
-    return count == expected;
-}
-
-
-
-
-
-
--- a/controlpanelplugins/themeplugin/src/cpthemeclientqt_p.h	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#ifndef CPTHEMECLIENTQT_P_H
-#define CPTHEMECLIENTQT_P_H
-
-#include <QIcon>
-#include "cpthemecommon_p.h"
-
-class QString;
-class QSizeF;
-class QLocalSocket;
-
-class CpThemeClientPrivate : public QObject
-{
-    Q_OBJECT
-
-public:
-    CpThemeClientPrivate();
-    bool connectToServer();
-    bool isConnected();
-
-    bool changeTheme(const QString& newtheme);
-
-    ~CpThemeClientPrivate();
-    
-public slots:
-    void themeChanged();
-
-public:
-    bool clientConnected;
-
-private:
-    void handleThemeChangeRequest(QDataStream &dataStream);
-
-private:
-    QLocalSocket* localSocket;
-    QString themeName;
-};
-
-#endif // HBTHEMECLIENTQT_P_H
--- a/controlpanelplugins/themeplugin/src/cpthemeclientsymbian_p.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,132 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#include "cpthemeclientsymbian_p.h"
-#include "cpthemesymbiancommon_p.h"
-
-#include <QFile>
-#include <QDebug>
-#include <QTime>
-
-const TUint KDefaultMessageSlots = 4;
-
-/**
-* constructor
-*/
-CpThemeClientPrivate::CpThemeClientPrivate():
-    clientConnected(false)
-{
-}
-
-/**
-* CpThemeClientPrivate::connectToServer()
-*
-* Connects to the server
-*/
-bool CpThemeClientPrivate::connectToServer()
-{
-   
-    TInt error; 
-    
-    error = CreateSession(KThemeServerName, Version(), KDefaultMessageSlots);
-    return( clientConnected = (KErrNone == error ) );
-}
-
-/**
-Indicates a connection to the server
-*/
-bool CpThemeClientPrivate::isConnected()
-{
-    return connected;
-}
-
-
-
-/**
-Returns the version number
-*/  
-TVersion CpThemeClientPrivate::Version(void) const
-{
-    return(TVersion(KThemeServerMajorVersionNumber,
-                    KThemeServerMinorVersionNumber,
-                    KThemeServerBuildVersionNumber));
-}
-
-/**
- * Destructor
- */
-CpThemeClientPrivate::~CpThemeClientPrivate()
-{
-    RSessionBase::Close();
-}
-
-/**
- * StartServer
- */
-TInt CpThemeClientPrivate::StartServer()
-{
-    TFindServer findThemeServer(KThemeServerName);
-    TFullName name;
-    if ( KErrNone == findThemeServer.Next( name ) ) {
-        // Server already running
-        return KErrNone;
-    }
-    return CreateServerProcess();
-}
-
-/**
- * CreateServerProcess
- */
-TInt CpThemeClientPrivate::CreateServerProcess()
-{
-    TInt result;
-    const TUid KServerUid2={0x100039CE};
-    const TUidType serverUid( KNullUid, KServerUid2, KServerUid3 );
-    RProcess server;
-    _LIT(KThemeServerExe,"hbthemeserver.exe");
-    
-    result = server.Create( KThemeServerExe, KNullDesC, EOwnerProcess );
-    
-    if (KErrNone != result) {
-        return  result; 
-    }
-    else {
-        TRequestStatus status;
-        server.Rendezvous(status);
-        if (status!=KRequestPending) {
-            server.Kill(0); // abort startup
-        }
-        else {
-            server.Resume(); // logon OK - start the server
-        }
-        User::WaitForRequest(status);// wait for start or death
-        server.Close();
-        connected == status.Int() == KErrNone ? true : false;
-        return status.Int(); // return the error
-    }
-}
-
-/**
- * changeTheme
- */
-bool CpThemeClientPrivate::changeTheme(const QString& aString )
-{
-    TPtrC themeName(reinterpret_cast<const TUint16 *>(aString.constData()));
-    TIpcArgs args(&themeName);
-    TInt err = SendReceive(EThemeSelection, args);
-    return KErrNone == err;
-}
--- a/controlpanelplugins/themeplugin/src/cpthemeclientsymbian_p.h	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,60 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#ifndef CPTHEMECLIENTSYMBIAN_P_H
-#define CPTHEMECLIENTSYMBIAN_P_H
-
-
-#include <QIcon>
-// TODO Do we need this?
-//#include "hbthemecommon_p.h"
-//ToDo: replace this with forward declaration
-#if !defined(__E32BASE_H__)
-#include <e32base.h>
-#endif
-
-class CThemeListenerPrivate;
-class QSizeF;
-class HbEffectFxmlData;
-struct MeshItem;
-
-class CpThemeClientPrivate : public RSessionBase
-{
-public:
-    CpThemeClientPrivate();
-
-    bool connectToServer();
-    bool isConnected();
-
-    bool changeTheme(const QString& newtheme);
-    ~CpThemeClientPrivate();
-    
-public:
-    bool clientConnected;
-
-private:
-    TVersion Version() const;
-    TInt StartServer();
-    TInt CreateServerProcess();
-    
-private:
-    CThemeListenerPrivate *themelistener;
-    QString themeName;
-    bool connected;
-};
-
-#endif /* CPTHEMECLIENTSYMBIAN_P_H */
--- a/controlpanelplugins/themeplugin/src/cpthemecommon_p.h	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,196 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#ifndef HBTHEMECOMMON_P_H
-#define HBTHEMECOMMON_P_H
-
-#include <QImage>
-#include <QSize>
-#include <QStringList>
-#include <QColor>
-
-#define THEME_SERVER_NAME "hbthemeserver"
-#define HB_THEME_SHARED_PIXMAP_CHUNK "themeserver_chunk"
-#define ORGANIZATION "Nokia"
-#define THEME_COMPONENT "ThemeFramework"
-
-// To enable/disable debug messages for theme server functionality
-#undef THEME_SERVER_TRACES
-
-// To enable fute testing for cache
-//#define HB_ICON_CACHE_DEBUG
-struct MultiPartSizeData
-{
-    // Indexing order is:
-
-    // 'NinePieces'             -> tl, t, tr, l, c, r, bl, b, br
-    // 'ThreePiecesHorizontal'  -> l, c, r
-    // 'ThreePiecesVertical'    -> t, c, b
-    QString multiPartIconId;
-    QRect sources[9];       // rects used from the rasterized frame part pixmaps
-    QRect targets[9];       // frame part target rects inside the bounding rectangle of the frame
-    QSize pixmapSizes[9];   // frame part pixmaps are rasterized to these sizes
-};
-
-
-struct HbMultiIconParams
-{
-    QString multiPartIconId;
-    QStringList multiPartIconList;
-    MultiPartSizeData multiPartIconData;
-    QSizeF size;
-    int aspectRatioMode;
-    int mode;
-    int options;
-    bool mirrored;
-    QColor color;
-    int rgba;
-    bool colorflag;
-};
-
-
-enum IconFormatType {
-    INVALID_FORMAT = -1,
-    NVG,
-    PIC,
-    SVG,
-    BLOB,
-    OTHER_SUPPORTED_FORMATS
-};
-
-struct HbSharedPixmapInfo
-{
-    int offset;
-    int width;
-    int height;
-    int defaultWidth;
-    int defaultHeight;
-    QImage::Format format;
-};
-
-struct HbSharedNVGInfo
-{		
-    int offset;
-    int dataSize;
-    int width;
-    int height;
-    int defaultWidth;
-    int defaultHeight;
-    
-};
-
-struct HbSharedPICInfo
-{
-    int offset;
-    int dataSize;
-    int width;
-    int height;
-    int defaultWidth;
-    int defaultHeight;
-};
-
-struct HbSharedBLOBInfo
-{
-    int offset;
-    int dataSize;
-};
-
-struct HbSharedIconInfo
-{
-    IconFormatType type;
-    
-    union 
-    {
-    	HbSharedPixmapInfo pixmapData;
-    	HbSharedNVGInfo nvgData;
-    	HbSharedPICInfo picData;
-        HbSharedBLOBInfo blobData;
-    };	
-      
-};
-
-struct HbSharedStyleSheetInfo
-{
-    int offset;
-    int refCount;
-    HbSharedStyleSheetInfo(): 
-        offset(-1),
-        refCount(0)    
-    {}
-};
-
-struct HbSharedEffectInfo
-{
-    int offset;
-    HbSharedEffectInfo(): offset(-1){}
-};
-
-struct HbSharedWMLInfo
-{
-    int offset;
-    HbSharedWMLInfo() : offset(-1) {}
-};
-
-struct HbDeviceProfileInfo
-{
-    int offset;
-    HbDeviceProfileInfo() : offset(-1) {}
-};
-
-// Function codes (opcodes) used in message passing between client and server
-enum ThemeServerRequest
-    {
-     EIconLookup = 1,
-     EIconDefaultSize,
-     EStyleSheetLookup,
-     EThemeSelection,
-     EMultiPieceIcon,
-     EWidgetMLLookup,
-     EDeviceProfileOffset,
- #ifdef HB_ICON_CACHE_DEBUG
-     EIconCleanUp,
-     ECacheIconCount,
-     ERasterMemLimit,
-     EVectorMemLimit,
-     EFreeRasterMem,
-     EFreeVectorMem,
-     ELastAddedItemMem,
-     ELastAddedItemRefCount,
-     ELastRemovedItemMem,
-     ELastRemovedItemRefCount,
-     EEnableCache,
-     ECacheHit,
-     ECacheMiss,
-     ECleanRasterLRUList,
-     ECleanVectorLRUList,
-     EServerHeap,
-     EGpuLruCount,
-     ECpuLruCount,
-     EServerStat,
-     EServerHeapMarkStart,
-     EServerHeapMarkEnd,
-     EServerAllocFail,
-     EServerAllocReset,
- #endif
-     EThemeContentUpdate,
-	 EEffectLookupFilePath,
-	 EEffectAdd,
-     EUnloadIcon,
-     EThemeServerStop
-    };
-
-#endif /* HBTHEMECOMMON_P_H */
--- a/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -30,12 +30,12 @@
 
 #include <QString>
 #include <QModelIndex>
-#include <QStandardItemModel>
-#include <QStandardItem>
 #include <QTranslator>
 #include <QSortFilterProxyModel>
-#include <QDebug>
 #include <QThread>
+#include <QTimer>
+#include <QDesktopServices>
+#include <QUrl>
 
 #include <hbmainwindow.h>
 #include <hbinstance.h>
@@ -44,8 +44,12 @@
 #include "cpthemecontrol.h"
 #include "cpthemelistview.h"
 #include "cpthemepreview.h"
+#include "cpthemeinfo.h"
+#include "cpthemelistmodel.h"
 
-static const QString KPlaceholderPreview = ":/image/themePreview.svg";
+#include <hbdialog.h>
+#include <hblabel.h>
+
 
 /*!
 	Helper function to fetch the main window.
@@ -67,11 +71,10 @@
     mThemePreview(0), 
     mThemeChanger(0),
     mListModel(0),
-    mSortModel(0),
-    mIdleTimer(0)
+    mThemeChangeFinished(false),
+    mWaitDialog(0)
 {
     mThemeChanger = new CpThemeChanger();
-   
        
     QTranslator *translator = new QTranslator(this);
     QString lang = QLocale::system().name();
@@ -79,14 +82,11 @@
     translator->load("control_panel_" + lang, path);
     qApp->installTranslator(translator);
     
-    mIdleTimer = new QTimer(this);
-    connect(mIdleTimer, SIGNAL(timeout()), this, SLOT(themeChangeTimeout()));
-    connect(hbInstance->theme(),SIGNAL(changeFinished()), this, SLOT(themeChangeFinished()));
+    connect(mThemeChanger,SIGNAL(themeChangeFinished()), this, SLOT(themeChangeFinished()));
    
 }
 
 
-
 /*!
 	destorys the list view, preview and theme changer objects.
 */
@@ -100,6 +100,9 @@
 
     delete mThemePreview;
     mThemePreview = 0;
+    
+    delete mWaitDialog;
+    mWaitDialog = 0;
 }
 
 /*!
@@ -111,16 +114,12 @@
    
     mThemeListView = new CpThemeListView();
     
-    mListModel = &mThemeChanger->model();
+    if(!mListModel) {
+        mListModel = new CpThemeListModel(this);
+    }
     
-    mSortModel = new QSortFilterProxyModel(this);
-    mSortModel->setDynamicSortFilter(true);
-    mSortModel->setSortCaseSensitivity(Qt::CaseInsensitive);
-    mSortModel->sort(0);
-    mSortModel->setSourceModel(mListModel);
-
     // Set the model for theme list.
-    mThemeListView->setModel(mSortModel);
+    mThemeListView->setModel(mListModel);
     mThemeListView->themeList()->setSelectionMode(HbAbstractItemView::SingleSelection);
     
     setActiveThemeIndex();
@@ -142,8 +141,9 @@
 CpBaseSettingView* CpThemeControl::themeListView()
 {
     //If the view was removed before by control panel app, create it again.
-    if(!mThemeListView)
+    if(!mThemeListView) {
         createThemeList();
+    }
 
     return mThemeListView;
 }
@@ -153,7 +153,11 @@
 */
 QString CpThemeControl::currentThemeName() const
 {
-    return mThemeChanger->currentTheme().name;
+    QString name = "";
+    if(mThemeChanger->currentTheme()) {
+        name = mThemeChanger->currentTheme()->name();
+    }
+    return name;
 }
 
 /*!
@@ -161,7 +165,11 @@
 */
 HbIcon CpThemeControl::currentThemeIcon() const
 {
-    return mThemeChanger->currentTheme().icon;
+    HbIcon icon;
+    if(mThemeChanger->currentTheme()) {
+        icon = mThemeChanger->currentTheme()->icon();
+    }
+    return icon;
 }
 
 /*!
@@ -172,38 +180,66 @@
     if(!index.isValid()) {
         return;
     }
-
     
-    CpThemeChanger::ThemeInfo themeInfo;
+    CpThemeInfo themeInfo;
     QVariant data;
 
     //reset the current index to active theme, so that the selection remains on current
     //theme even though another list item is selected.
     setActiveThemeIndex();
     
+    // Figure out whether this is a URI and appropriately delegate
+    data = index.data(CpThemeListModel::ItemTypeRole);
+    if(data.isValid() && data.canConvert<CpThemeInfo::ThemeListItemType>()) {
+
+        CpThemeInfo::ThemeListItemType type = data.value<CpThemeInfo::ThemeListItemType>();
+
+        switch (type) {
+            case CpThemeInfo::ThemeListItemType_URL:
+                //get the URL
+                data = index.data(CpThemeListModel::ItemDataRole);
+                if(data.isValid()) {
+                    QString url = data.toString();
+                    // Launch the URL in the browser and 
+                    // continue to Preview if not successful
+                    if (QDesktopServices::openUrl(QUrl(url, QUrl::TolerantMode))) {
+                        return;
+                    }
+                }
+                break;
+    
+            case CpThemeInfo::ThemeListItemType_APP:
+                break;
+
+            default:
+                // do nothing
+                qt_noop();
+        }
+    }
+    
     //get the theme name.
     data = index.data(Qt::DisplayRole);
     if(data.isValid()) {
-        themeInfo.name = data.toString();
+        themeInfo.setName(data.toString());
     }
+    
     //get theme icon.
     data = index.data(Qt::DecorationRole);
     if(data.isValid()) {
-        themeInfo.icon = data.value<HbIcon>();
-    }
-    
-    data = index.data(CpThemeChanger::PortraitPreviewRole);
-    if(data.isValid()) {
-        themeInfo.portraitPreviewIcon = data.value<HbIcon>();
+        themeInfo.setIcon(data.value<HbIcon>());
     }
     
-    data = index.data(CpThemeChanger::LandscapePreviewRole);
+    data = index.data(CpThemeListModel::PortraitPreviewRole);
     if(data.isValid()) {
-        themeInfo.landscapePreviewIcon = data.value<HbIcon>();
+        themeInfo.setPortraitPreviewIcon(data.value<HbIcon>());
     }
-        
-        
-    //Set up the theme preview and set it to
+    
+    data = index.data(CpThemeListModel::LandscapePreviewRole);
+    if(data.isValid()) {
+        themeInfo.setLandscapePreviewIcon(data.value<HbIcon>());
+    }
+    
+   //Set up the theme preview and set it to
     //the current view of main window.
     HbMainWindow*  mWindow = ::mainWindow();
    
@@ -219,11 +255,10 @@
     } else {
         mThemePreview->setThemeInfo(themeInfo);
     }
-    //TODO: use qtTrId(text_id).
-    mThemePreview->setTitle(tr("Control Panel"));
-	  	
+    mThemePreview->setTitle(hbTrId("txt_cp_title_control_panel"));
+
     mWindow->setCurrentView(mThemePreview);
-	
+
 }
 
 /*!
@@ -231,23 +266,24 @@
 */
 void CpThemeControl::themeApplied(const QString& theme)
 {
-    bool success = false;
-
-    success = mThemeChanger->connectToServer();
+    QThread::currentThread()->setPriority(QThread::HighPriority);  
+    
+    if(mThemeChanger->changeTheme(theme)) {
     
-    if (success) {
-        QThread::currentThread()->setPriority(QThread::HighPriority);  
-        mThemeChanger->changeTheme(theme);
-        emit themeUpdated(mThemeChanger->currentTheme().name, mThemeChanger->currentTheme().icon);
+        //Start a timer. If theme change takes more than 1 seconds,
+        //we will show a dialog (mWaitDialog) until theme change
+        //is done (themeChangeFinished is called).
+        QTimer::singleShot(1000, this, SLOT(themeWaitTimeout()));
+        
+        mThemeChangeFinished = false;
+    } else {
+        //theme change failed, go back to control panel.
+        previewClosed();
+        triggerThemeListClose();
     }
+   
+}
 
-    //Go back to control panel view. Close theme preview.
-    previewClosed();
-    //ask the themelistview to close.  Control Panel will
-    //take care of removing it from window.
-    triggerThemeListClose();
-
-}
 /*!
 	Slot called when the theme preview view is closed.
 */
@@ -289,16 +325,54 @@
 
 void CpThemeControl::themeChangeTimeout()
 {
-    //qDebug() << "ThemeChangeTimeout " ;
-    mIdleTimer->stop();
-    QThread::currentThread()->setPriority(QThread::NormalPriority);    
-        
+    //Theme change is finished and idle timer has timed out,
+    //so revert back the application priority to normal
+    //and go back to control panel view.
+    if(mWaitDialog && mWaitDialog->isVisible()) {
+        mWaitDialog->hide();
+    }
+    
+    previewClosed();
+    //ask the themelistview to close.  Control Panel will
+    //take care of removing it from window.
+    triggerThemeListClose();
+    
+    QThread::currentThread()->setPriority(QThread::NormalPriority); 
+}
+
+void CpThemeControl::themeWaitTimeout()
+{
+    //If after this timeOut, theme change is still in progress,
+    //show a processing dialog.
+    if(!mThemeChangeFinished)
+    {
+        if(!mWaitDialog) {
+            mWaitDialog = new HbDialog();
+            mWaitDialog->setDismissPolicy(HbPopup::NoDismiss);
+            mWaitDialog->setModal(false);
+            mWaitDialog->setTimeout(HbPopup::NoTimeout);
+            //TODO: need localized text for Hb Dialog
+            // Create and set HbLabel as content widget.
+            HbLabel *label = new HbLabel("Processing ...");
+            label->setAlignment(Qt::AlignCenter);
+            mWaitDialog->setContentWidget(label);
+        }
+       // as we do not need any signals, calling show() instead of open()
+       mWaitDialog->show();
+    }
 }
 
 void CpThemeControl::themeChangeFinished()
 {
-    //qDebug() << "ThemeChangeFinished " ;
-    mIdleTimer->start(0);
+    //Theme change is done. Start an idle timer to let the UI
+    //finish remaining tasks.
+    QTimer::singleShot(0, this, SLOT(themeChangeTimeout()));
+    mThemeChangeFinished = true;
+    
+    if(mThemeChanger->currentTheme()) {
+        emit themeUpdated(mThemeChanger->currentTheme()->name(), mThemeChanger->currentTheme()->icon());
+    }
+    
 }
 
 /*!
@@ -308,11 +382,13 @@
 void CpThemeControl::setActiveThemeIndex()
 {
     //Get the index of current theme.
-    QModelIndex sourceIndex = mListModel->index(mThemeChanger->indexOf(mThemeChanger->currentTheme()),0);
-    //Map it to the sort model index.
-    QModelIndex sortedIndex = mSortModel->mapFromSource(sourceIndex);
-    //set current index.
-    mThemeListView->themeList()->setCurrentIndex(sortedIndex, QItemSelectionModel::SelectCurrent);
+    CpThemeListModel* themeListModel = dynamic_cast<CpThemeListModel*>(mListModel);
+    const CpThemeInfo* currentTheme = mThemeChanger->currentTheme();
+    if(themeListModel && currentTheme) {
+        QModelIndex sourceIndex = mListModel->index(themeListModel->indexOf(*currentTheme),0);
+        //set current index.
+        mThemeListView->themeList()->setCurrentIndex(sourceIndex, QItemSelectionModel::SelectCurrent);
+    }
 }
     
 
--- a/controlpanelplugins/themeplugin/src/cpthemecontrol.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/src/cpthemecontrol.h	Thu Jul 22 16:34:01 2010 +0100
@@ -20,7 +20,6 @@
 
 #include <QObject>
 #include <QList>
-#include <QTimer>
 
 #include "cpthemechanger.h"
 #include <hbicon.h>
@@ -31,10 +30,11 @@
 class QSortFilterProxyModel;
 QT_END_NAMESPACE
 
+class HbDialog;
 class CpThemeListView;
 class CpThemePreview;
 class CpBaseSettingView;
-
+class CpThemeListModel;
 
 
 class CpThemeControl : public QObject
@@ -57,6 +57,7 @@
     void themeApplied(const QString& theme);
     void themeListClosed();
     void themeChangeTimeout();
+    void themeWaitTimeout();
     void themeChangeFinished();
 
 private:
@@ -69,8 +70,8 @@
     CpThemePreview* mThemePreview;
     CpThemeChanger* mThemeChanger;
     QAbstractItemModel* mListModel;
-    QSortFilterProxyModel* mSortModel;
-    QTimer* mIdleTimer;
+    bool mThemeChangeFinished;
+    HbDialog* mWaitDialog;
 };
 
 #endif //CPTHEMECONTROL_H
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeinfo.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,102 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+/*!
+ * A simple class to represent theme information. This information includes:
+ *  1. Theme Name
+ *  2. Theme Preview Thumbnail
+ *  3. Theme Preview landscape and portrait icon
+ *  4. Theme list type: either an item representing a theme, or a link (e.g OviStore).
+ *  5. Item type data. Represents additional information (e.g for link type, the URL).
+ */
+#include <hbicon.h>
+
+#include "cpthemeinfo.h"
+
+ CpThemeInfo::CpThemeInfo()
+{
+}
+
+ 
+ CpThemeInfo::~CpThemeInfo()
+{
+}
+      
+QString CpThemeInfo::name() const
+{
+    return mName;
+}
+
+void CpThemeInfo::setName(const QString& newName)
+{
+    mName = newName;
+}
+      
+CpThemeInfo::ThemeListItemType CpThemeInfo::itemType() const
+{
+    return mItemType;
+}
+
+void CpThemeInfo::setItemType(CpThemeInfo::ThemeListItemType type)
+{
+    mItemType = type;
+}
+
+      
+QString CpThemeInfo::itemData() const
+{
+    return mItemData;
+}
+
+void CpThemeInfo::setItemData(const QString& data)
+{
+    mItemData = data;
+}
+
+      
+HbIcon CpThemeInfo::icon() const
+{
+    return mIcon;
+}
+  
+void CpThemeInfo::setIcon(const HbIcon& newIcon)
+{
+    mIcon = newIcon;
+}
+
+      
+HbIcon CpThemeInfo::portraitPreviewIcon() const
+{
+    return mPortraitPreviewIcon;
+}
+
+void CpThemeInfo::setPortraitPreviewIcon(const HbIcon& newIcon)
+{
+    mPortraitPreviewIcon = newIcon;
+}
+
+      
+HbIcon CpThemeInfo::landscapePreviewIcon() const
+{
+    return mLandscapePreviewIcon;
+}
+
+void CpThemeInfo::setLandscapePreviewIcon(const HbIcon& newIcon)
+{
+    mLandscapePreviewIcon = newIcon;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeinfo.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,77 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+#ifndef CPTHEMEINFO_H_
+#define CPTHEMEINFO_H_
+
+
+#include <QString>
+
+#include <hbicon.h>
+
+class CpThemeInfo {
+
+public:
+    
+    Q_ENUMS(ThemeListItemType)
+    
+    enum ThemeListItemType {
+                 ThemeListItemType_default = 0,
+                 ThemeListItemType_URL,
+                 ThemeListItemType_APP
+             };
+    
+     CpThemeInfo();
+     ~CpThemeInfo();
+     
+     QString name() const;
+     void setName(const QString& newName);
+     
+     ThemeListItemType itemType() const;
+     void setItemType(ThemeListItemType type);
+     
+     QString itemData() const;
+     void setItemData(const QString& data);
+     
+     HbIcon icon() const;
+     void setIcon(const HbIcon& newIcon);
+     
+     HbIcon portraitPreviewIcon() const;
+     void setPortraitPreviewIcon(const HbIcon& newIcon);
+     
+     HbIcon landscapePreviewIcon() const;
+     void setLandscapePreviewIcon(const HbIcon& newIcon);
+     
+     bool operator < (const CpThemeInfo &other) const   {            
+         return mName.toCaseFolded().localeAwareCompare(other.mName.toCaseFolded()) < 0;
+     }
+     bool operator == (const CpThemeInfo &other) const {
+         return mName.localeAwareCompare(other.mName) == 0;
+     }
+     
+private:
+     CpThemeInfo::ThemeListItemType mItemType;
+     QString mItemData;
+     QString mName;
+     HbIcon mIcon;
+     HbIcon mPortraitPreviewIcon;
+     HbIcon mLandscapePreviewIcon;
+
+};    
+Q_DECLARE_METATYPE(CpThemeInfo::ThemeListItemType)
+
+   
+#endif /* CPTHEMEINFO_H_ */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemelistmodel.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,177 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#include <QDir>
+#include <QStringList>
+#include <QFileSystemWatcher>
+
+#include <HbIcon>
+
+#include "cpthemelistmodel.h"
+#include "cpthemeinfo.h"
+#include "cpthemeutil.h"
+
+/*
+    CpThemeChangerModel provides an interface to the data contained in the
+    theme list using QAbstractListModel.
+*/
+
+/*
+    Constructor
+*/
+CpThemeListModel::CpThemeListModel(QObject* parent)
+    : QAbstractListModel(parent)
+    , mTopThemeList()
+    , mThemeList()
+    , mBottomThemeList()
+    , mFileWatcher(new QFileSystemWatcher(this))
+{
+    //Build theme list
+    mThemeList = CpThemeUtil::buildThemeList();
+    
+    //Look into theme paths and add a file watcher for it
+    //to get notified when themes are added.
+    QStringList themesPathList = CpThemeUtil::themePathList();
+    foreach (const QString &path, themesPathList) {
+        QDir themeDir;
+        themeDir.setPath( path ) ;
+        QStringList list = themeDir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name);
+        if(list.contains("themes", Qt::CaseSensitive )) {
+            mFileWatcher->addPath(themeDir.path() + "/themes/");
+        }
+    }
+    connect(mFileWatcher, SIGNAL(directoryChanged(const QString&)),
+           this, SLOT(themeListChanged()));
+       
+    // data for the list which appears after the themes:
+    CpThemeInfo fetchFromStore;
+    fetchFromStore.setName(hbTrId("txt_cp_list_get_more_tones"));
+    fetchFromStore.setItemType(CpThemeInfo::ThemeListItemType_URL);
+    fetchFromStore.setItemData(QString("http://lr.ovi.mobi/store/themes"));
+    fetchFromStore.setIcon(HbIcon("qtg_large_ovistore"));
+    mBottomThemeList.append(fetchFromStore);
+}
+
+/*
+    Destructor
+*/
+CpThemeListModel::~CpThemeListModel()
+{
+    delete mFileWatcher;
+    mFileWatcher = 0;
+
+}
+
+/*
+    Reimplemented from QAbstractListModel.
+*/
+int CpThemeListModel::rowCount(const QModelIndex&) const
+{
+    return mTopThemeList.size() +
+        mThemeList.size() +
+        mBottomThemeList.size();
+}
+
+/*
+    Reimplemented from QAbstractListModel. 
+*/
+QVariant CpThemeListModel::data(const QModelIndex& index, int role) const
+{
+    QVariant retVal = QVariant();
+
+    if (index.isValid()) {
+        // figure out which list we're in and do the appropriate mapping
+        int row = index.row();
+        const QList<CpThemeInfo> *list = 0;
+        if (row < mTopThemeList.size()) {
+            list = &mTopThemeList;
+        } else {
+            row -= mTopThemeList.size();
+            if ( row < mThemeList.size() ) {
+                list = &mThemeList;
+            } else {
+                row -= mThemeList.size();
+                if ( row < mBottomThemeList.size() ) {
+                    list = &mBottomThemeList;
+                }
+            }
+        }
+
+        if (list) {
+            switch (role) {
+                case Qt::DisplayRole:
+                    retVal = list->at(row).name();
+                    break;
+
+                case Qt::DecorationRole:
+                    retVal = list->at(row).icon();
+                    break;
+
+                case Qt::SizeHintRole:
+                    retVal = list->at(row).icon().size();
+                    break;
+                    
+                case PortraitPreviewRole:
+          	        retVal = list->at(row).portraitPreviewIcon();
+                    break;
+                    
+                case LandscapePreviewRole:
+                    retVal = list->at(row).landscapePreviewIcon();
+                    break;
+                    
+                case ItemDataRole:
+                    retVal = list->at(row).itemData();
+                    break;
+
+                case ItemTypeRole:
+                    retVal = QVariant::fromValue<CpThemeInfo::ThemeListItemType>(list->at(row).itemType());
+                    break;
+
+                default:
+                    // do nothing
+                    qt_noop();
+            }
+        }
+    }
+
+    return retVal;
+}
+
+/*
+    Responds appropriately when the underlying data in the theme changer is modified.
+
+    Unfortunately the directory watcher from QFileWatcher only says when something changed
+    not what changed.  Therefore the model is considered reset rather than having rows
+    with dataChanged.
+*/
+void CpThemeListModel::themeListChanged()
+{
+    beginResetModel();
+    if(!mThemeList.empty()) {
+        mThemeList.clear();
+    }
+    mThemeList = CpThemeUtil::buildThemeList();
+  
+    endResetModel();
+}
+/*!
+ * Returns index of theme infor within the theme list.
+ */
+int CpThemeListModel::indexOf(const CpThemeInfo& theme) const
+{
+    return mThemeList.indexOf(theme);
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemelistmodel.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,58 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#ifndef CP_THEME_LIST_MODEL_P_H
+#define CP_THEME_LIST_MODEL_P_H
+
+#include <QAbstractListModel>
+#include <QModelIndex>
+#include <QObject>
+#include "cpthemeutil.h"
+
+class QFileSystemWatcher;
+
+class CpThemeListModel : public QAbstractListModel
+{
+    Q_OBJECT
+
+public:
+    
+    enum ThemeListUserRole {
+               PortraitPreviewRole = Qt::UserRole,
+               LandscapePreviewRole,
+               ItemTypeRole,
+               ItemDataRole
+        };
+    
+    explicit CpThemeListModel(QObject *parent = 0);
+    virtual ~CpThemeListModel();
+
+    virtual int rowCount(const QModelIndex& parent = QModelIndex()) const;
+    virtual QVariant data(const QModelIndex& index, int role = Qt::DisplayRole) const;
+    int indexOf(const CpThemeInfo& theme) const;
+    
+public slots:
+    void themeListChanged();
+
+private:
+    QList<CpThemeInfo> mTopThemeList;
+    QList<CpThemeInfo> mThemeList;
+    QList<CpThemeInfo> mBottomThemeList;
+    QFileSystemWatcher *mFileWatcher;
+};
+
+#endif //CP_THEME_LIST_MODEL_P_H
--- a/controlpanelplugins/themeplugin/src/cpthemelistview.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/src/cpthemelistview.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -22,6 +22,7 @@
 #include <hbview.h>
 #include <hblabel.h>
 #include <hblistview.h>
+#include <hblistviewitem.h>
 
 #include "cpthemelistview.h"
 
@@ -45,17 +46,17 @@
     //Create a layout with a heading "Select theme" at top and the list below it.
     HbWidget* contentWidget = new HbWidget(this);
     QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
-    	
-   
     
     //setup the heading.
-    HbLabel* label = new HbLabel(hbTrId("txt_cp_title_select_theme"), contentWidget);
-    label->setFontSpec(HbFontSpec(HbFontSpec::Primary));
+    HbLabel* label = new HbLabel(hbTrId("txt_cp_title_select_theme"), contentWidget);//txt_cp_title_select_theme
     layout->addItem(label);
 
     connect(mThemeList, SIGNAL(activated(const QModelIndex&)),
             this, SIGNAL(newThemeSelected(const QModelIndex&)));
     
+    HbListViewItem* listViewItem = mThemeList->listItemPrototype();
+    listViewItem->setGraphicsSize(HbListViewItem::LargeIcon);
+   
     //add the list to layout.
     layout->addItem(mThemeList);
 
--- a/controlpanelplugins/themeplugin/src/cpthemepreview.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/src/cpthemepreview.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -18,7 +18,7 @@
 #include <QString>
 #include <QGraphicsPixmapItem>
 #include <QGraphicsLinearLayout>
-#include <QDebug>
+
 #include <hbaction.h>
 #include <hbtoolbar.h>
 #include <hbicon.h>
@@ -26,8 +26,10 @@
 #include <hblabel.h>
 #include <hbiconitem.h>
 #include <hbmainwindow.h>
+#include <HbParameterLengthLimiter>
 
 #include "cpthemepreview.h"
+#include "cpthemeinfo.h"
 
 /*!
     \class CpThemePreview
@@ -39,7 +41,7 @@
 /*!
     constructor.
 */
-CpThemePreview::CpThemePreview(const CpThemeChanger::ThemeInfo& theme, QGraphicsItem *parent) :
+CpThemePreview::CpThemePreview(const CpThemeInfo& theme, QGraphicsItem *parent) :
      HbView(parent), 
      mTheme(theme),
      mSoftKeyBackAction(0),
@@ -51,26 +53,23 @@
 
     
     //setup the heading.
-    //TODO: translation of string  hbTrId("txt_cp_title_preview_1")
-    
-    QString themeHeading = tr("Preview: ") + mTheme.name;
+    QString themeHeading = HbParameterLengthLimiter("txt_cp_title_preview_1").arg(mTheme.name());   
     HbLabel* label = new HbLabel(themeHeading, this);
-    label->setFontSpec(HbFontSpec(HbFontSpec::Primary));
    
-    label->setPreferredHeight(5.0);
     layout->addItem(label);
     
     layout->setAlignment(layout->itemAt(0), Qt::AlignTop);
+    layout->itemAt(0)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Fixed,QSizePolicy::DefaultType);
     
     //Create the toolbar and "Select" and "Cancel" actions.
     HbToolBar* mToolBar = new HbToolBar(this);
 
-    HbAction* selectAction = new HbAction(tr("Select"));
+    HbAction* selectAction = new HbAction(hbTrId("txt_common_button_select"));
     
     //Add Action to the toolbar and show toolbar
     mToolBar->addAction( selectAction );
 
-    HbAction* cancelAction = new HbAction(tr("Cancel"));
+    HbAction* cancelAction = new HbAction(hbTrId("txt_common_button_cancel"));
     mToolBar->addAction( cancelAction );
 
     QObject::connect( selectAction, SIGNAL(triggered()), 
@@ -84,14 +83,15 @@
        
    
     if(mainWindow()->orientation() == Qt::Horizontal) {
-        mPreviewIcon = new HbIconItem(mTheme.landscapePreviewIcon, this);
+        mPreviewIcon = new HbIconItem(mTheme.landscapePreviewIcon(), this);
     }
     else {
-        mPreviewIcon = new HbIconItem(mTheme.portraitPreviewIcon, this);
+        mPreviewIcon = new HbIconItem(mTheme.portraitPreviewIcon(), this);
     }
     layout->addItem(mPreviewIcon);
-    layout->setAlignment(layout->itemAt(0), Qt::AlignTop);
-    
+    layout->itemAt(1)->setSizePolicy(QSizePolicy::Preferred, QSizePolicy::Preferred,QSizePolicy::DefaultType);
+        
+ 
     setToolBar(mToolBar);
     setLayout(layout);
 
@@ -101,7 +101,7 @@
     QObject::connect(mSoftKeyBackAction, SIGNAL(triggered()), 
             this, SIGNAL(aboutToClose()) );
 
-    this->setNavigationAction(mSoftKeyBackAction);
+    setNavigationAction(mSoftKeyBackAction);
 }
 
 /*!
@@ -114,7 +114,7 @@
 /*!
   sets the theme to \a theme.
 */
-void CpThemePreview::setThemeInfo(const CpThemeChanger::ThemeInfo& theme)
+void CpThemePreview::setThemeInfo(const CpThemeInfo& theme)
 {
     mTheme = theme;
 }
@@ -124,7 +124,7 @@
 */
 const QString& CpThemePreview::themeName() const
 {
-    return mTheme.name;
+    return mTheme.name();
 }
 
 /*!
@@ -132,7 +132,7 @@
 */
 const HbIcon& CpThemePreview::themeIcon() const
 {
-    return mTheme.icon;
+    return mTheme.icon();
 }
 
 /*!
@@ -140,7 +140,7 @@
 */
 void CpThemePreview::themeSelected()
 {
-    emit applyTheme(mTheme.name);
+    emit applyTheme(mTheme.name());
 }
 
 /*! 
@@ -152,16 +152,14 @@
    
     QGraphicsLinearLayout* previewLayout = dynamic_cast<QGraphicsLinearLayout*>(layout());
    
-    if(mPreviewIcon == dynamic_cast<HbIconItem*>(previewLayout->itemAt(1)) ) {
+    if(mPreviewIcon && mPreviewIcon == dynamic_cast<HbIconItem*>(previewLayout->itemAt(1)) ) {
         previewLayout->removeAt(1);
-        delete mPreviewIcon;
-        mPreviewIcon = 0;
         
         if(orientation == Qt::Horizontal) {
-            mPreviewIcon = new HbIconItem(mTheme.landscapePreviewIcon, this);
+            mPreviewIcon->setIcon(mTheme.landscapePreviewIcon());
         }
         else {
-            mPreviewIcon = new HbIconItem(mTheme.portraitPreviewIcon, this);
+            mPreviewIcon->setIcon(mTheme.portraitPreviewIcon());
         }
         
         previewLayout->addItem(mPreviewIcon);
--- a/controlpanelplugins/themeplugin/src/cpthemepreview.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/src/cpthemepreview.h	Thu Jul 22 16:34:01 2010 +0100
@@ -21,7 +21,9 @@
 #include <hbview.h>
 #include <QObject>
 #include <hbicon.h>
-#include <cpthemechanger.h>
+#include "cpthemechanger.h"
+#include "cpthemeinfo.h"
+
 
 QT_BEGIN_NAMESPACE
 class QString;
@@ -36,9 +38,9 @@
     Q_OBJECT
 
 public:
-    explicit CpThemePreview(const CpThemeChanger::ThemeInfo &theme, QGraphicsItem *parent = 0);
+    explicit CpThemePreview(const CpThemeInfo &theme, QGraphicsItem *parent = 0);
     ~CpThemePreview();
-    void setThemeInfo(const CpThemeChanger::ThemeInfo& theme);
+    void setThemeInfo(const CpThemeInfo& theme);
     const QString& themeName() const;
     const HbIcon& themeIcon() const;
 	
@@ -51,7 +53,7 @@
     void previewOrientationChanged(Qt::Orientation orientation);
 
 private:
-    CpThemeChanger::ThemeInfo mTheme;
+    CpThemeInfo mTheme;
     HbAction* mSoftKeyBackAction;
     HbIconItem* mPreviewIcon;
 
--- a/controlpanelplugins/themeplugin/src/cpthemesymbiancommon_p.h	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,69 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0""
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- *
- * Contributors:
- *
- * Description:  
- *   
- */
-
-#ifndef HBTHEMESYMBIANCOMMON_P_H
-#define HBTHEMESYMBIANCOMMON_P_H
-
-#include <e32base.h>
-#include "cpthemecommon_p.h"
-struct TIconParams
-{
-    TBuf<256> fileName;
-    TReal width;
-    TReal height;
-    TUint8 aspectRatioMode;
-    TUint8 mode;
-    TUint8 options;
-    TBool mirrored;
-    TUint32 rgba;
-    TBool colorflag;
- };
-
-struct TMultiIconSymbParams
-{
-    TBuf<256> multiPartIconId;
-    TBuf<256> multiPartIconList[9];
-    TRect sources[9];
-    TRect targets[9];
-    TSize pixmapSizes[9];
-    QSizeF size;
-    TInt aspectRatioMode;
-    TInt mode;
-    TInt options;
-    TBool mirrored;
-    TInt rgba;
-    TBool colorflag;
- };
-
-// server name
-_LIT(KThemeServerName,"hbthemeserver");
-const TUid KServerUid3={0x20022E82};
-
-// A version must be specifyed when creating a session with the server
-
-
-const TUint KThemeServerMajorVersionNumber=0;
-const TUint KThemeServerMinorVersionNumber=1;
-const TUint KThemeServerBuildVersionNumber=1;
-
-enum TThemeServerLeave
-{
-    ENonNumericString = 99
-};
-
-#endif // HBTHEMESYMBIANCOMMON_P_H
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeutil.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,311 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#include "cpthemeinfo.h"
+#include "cpthemeutil.h"
+
+#include <QStringList>
+#include <QSettings>  
+#include <QFileInfoList>
+#include <QDir>
+#include <QList>
+
+#include <hbicon.h>
+#include <hbinstance.h>
+
+/*!
+ * This class provides utility function to get Theme information.  
+ */
+
+#if defined(Q_OS_SYMBIAN)
+#include <e32std.h>
+#include <centralrepository.h>
+        static const TUid KServerUid3={0x20022E82};
+        static const TUint32 KDefaultThemeNameKey = 0x2;
+        static const TUint32 KDefaultThemeRootPathKey = 0x3;
+
+#endif
+
+#if !defined(Q_OS_SYMBIAN)
+    #include <stdio.h>
+    static const char* KThemePathKey = "HB_THEMES_DIR";  //used for getting default theme.
+#endif
+    
+    
+#ifdef Q_OS_WIN
+    static char* _path = NULL;
+    static size_t _size = 0;
+    _dupenv_s(&_path, &_size, KThemePathKey);
+    static QString themeRootPath = QString(_path);
+    static QString themeRootPathPostfix = QString();
+    free(_path);
+#elif defined(Q_OS_SYMBIAN)
+    static QString themeRootPath = "c:\\resource\\hb";
+    static QString themeRootPathPostfix = "resource\\hb";
+#elif defined(Q_OS_MACX)
+    static QString themeRootPath = QDir::homePath() + '/' + "Library" + QString("hb");
+    static QString themeRootPathPostfix = QString();
+#elif defined(Q_OS_UNIX)
+    static QString themeRootPath = QString(getenv(KThemePathKey));
+    static QString themeRootPathPostfix = QString();
+#else
+    static QString themeRootPath = "c:\\resource\\hb";
+    static QString themeRootPathPostfix = QString();
+#endif
+
+    //Location of theme preview and background icons.
+    static const QString KPreviewThumbnailNVG = "/scalable/qtg_graf_theme_preview_thumbnail.nvg";
+    static const QString KPreviewThumbnailSVG = "/scalable/qtg_graf_theme_preview_thumbnail.svg";
+    
+    static const QString KPreviewPrtNVG       = "/scalable/qtg_graf_theme_preview_prt.nvg";
+    static const QString KPreviewLscNVG       = "/scalable/qtg_graf_theme_preview_lsc.nvg";
+    static const QString KPreviewPrtSVG       = "/scalable/qtg_graf_theme_preview_prt.svg";
+    static const QString KPreviewLscSVG       = "/scalable/qtg_graf_theme_preview_lsc.svg";
+   
+    static const QString KBackgroundPrtNVG    = "/scalable/qtg_graf_screen_bg_prt.nvg";
+    static const QString KBackgroundLscNVG    = "/scalable/qtg_graf_screen_bg_lsc.nvg";
+    static const QString KBackgroundPrtSVG    = "/scalable/qtg_graf_screen_bg_prt.svg";
+    static const QString KBackgroundLscSVG    = "/scalable/qtg_graf_screen_bg_lsc.svg";
+    
+    static const QString KBackgroundPrtPNG    = "/pixmap/qtg_graf_screen_bg_prt.png";                     
+    static const QString KBackgroundLscPNG    = "/pixmap/qtg_graf_screen_bg_lsc.png";
+    
+/*!
+ * Returns a list of paths where themes folder reside.  
+ */
+QStringList CpThemeUtil::themePathList()
+{
+    static QStringList themesPathList;
+    
+    if(themesPathList.isEmpty()) {
+
+#if defined(Q_OS_SYMBIAN)
+        QFileInfoList driveInfoList = QDir::drives();
+        foreach (const QFileInfo &driveInfo, driveInfoList) {
+            const QString themePath = driveInfo.absolutePath() + themeRootPathPostfix;
+            if(QDir(themePath).exists())
+                themesPathList << themePath;
+        }
+#else
+        themesPathList << themeRootPath;
+#endif
+    }
+    return themesPathList;
+}
+
+/*!
+ * Given the theme name, it returns the absolute path of the theme.
+ */
+QString CpThemeUtil::themePath(const QString& themeName)
+{
+    QString themePath = "";
+    QStringList themesPathList = themePathList();
+    foreach (const QString &path, themesPathList) {
+       QString tmpPath = path + "/themes/icons/" + themeName;
+       if(QDir(tmpPath).exists()) {
+           themePath = tmpPath;
+           break;
+       }
+    }
+    return themePath;
+}
+  
+/*
+ * Builds a CpThemeInfo object given theme path and theme name.  It creates the name and 
+ * preview icons for the object.  Creates a new CpThemeInfo objects. Caller takes ownership.
+ * Returns NULL if can't build the object.
+ */
+CpThemeInfo* CpThemeUtil::buildThemeInfo(const QString& themePath, const QString& themeName)
+{
+    CpThemeInfo *themeInfo = new CpThemeInfo();
+    QString iconPath;
+    
+    QString previewPathPrt;
+    QString previewPathLsc;
+    QString name = themeName;
+    QString hidden = "";
+    
+    //first look into the index.theme file to get theme information.
+   
+    if(QFileInfo(themePath + "/index.theme").exists()) {
+        QSettings iniSetting(themePath + "/index.theme", QSettings::IniFormat);
+        iniSetting.beginGroup("Icon Theme");
+        name = iniSetting.value("Name").toString();
+        hidden = iniSetting.value("Hidden").toString();
+        iconPath = iniSetting.value("PreviewThumbnailPath").toString();
+        previewPathPrt = iniSetting.value("PreviewIconPath_prt").toString();
+        previewPathLsc = iniSetting.value("PreviewIconPath_lsc").toString();
+        iniSetting.endGroup();
+       
+    }
+                       
+    if(name.isEmpty() || (hidden == "true") ||( hidden == "")) {
+        return NULL;
+    }
+   
+    themeInfo->setName(name);
+    themeInfo->setItemType(CpThemeInfo::ThemeListItemType_default);
+          
+    //Get the icons. Logic is as follow:
+    /* 1. If the icon path is in index.theme and the icon exist, use it.
+     * 2. Otherwise look for the icon in the theme folder.
+     * 2. If preview icon doesn't exist, use background icon.
+     * 3. If no icon exist (background or preview),use default theme icon.
+     */
+    if(iconPath.isEmpty() || !QFileInfo(themePath + iconPath).exists()){
+    //Set thumbnail
+        if(QFileInfo(themePath + KPreviewThumbnailNVG).exists()){
+            themeInfo->setIcon(HbIcon(themePath + KPreviewThumbnailNVG));
+        }else if(QFileInfo(themePath + KPreviewThumbnailSVG).exists()){
+            themeInfo->setIcon(HbIcon(themePath + KPreviewThumbnailSVG));
+        }else if(QFileInfo(themePath + KBackgroundPrtNVG).exists()){
+            themeInfo->setIcon(HbIcon(themePath + KBackgroundPrtNVG));
+        } else if(QFileInfo(themePath + KBackgroundPrtSVG).exists()){
+            themeInfo->setIcon(HbIcon(themePath + KBackgroundPrtSVG));
+        } else if(QFileInfo(themePath + KBackgroundPrtPNG).exists()){
+            themeInfo->setIcon(HbIcon(themePath + KBackgroundPrtPNG)); 
+        }else{
+            themeInfo->setIcon(HbIcon(defaultTheme()->icon()));
+        }
+
+    } else {
+        themeInfo->setIcon(HbIcon(themePath + iconPath));
+    }
+          
+    //Portrait preview
+          
+    if(previewPathPrt.isEmpty() || !QFileInfo(themePath + previewPathPrt).exists()) {
+          
+        if(QFileInfo(themePath + KPreviewPrtNVG).exists()){
+            themeInfo->setPortraitPreviewIcon(HbIcon(themePath + KPreviewPrtNVG));
+        }else if(QFileInfo(themePath + KPreviewPrtSVG).exists()){
+            themeInfo->setPortraitPreviewIcon(HbIcon(themePath + KPreviewPrtSVG));
+        }else if(QFileInfo(themePath + KBackgroundPrtNVG).exists()){
+            themeInfo->setPortraitPreviewIcon(HbIcon(themePath + KBackgroundPrtNVG));
+        } else if(QFileInfo(themePath + KBackgroundPrtSVG).exists()){
+            themeInfo->setPortraitPreviewIcon(HbIcon(themePath + KBackgroundPrtSVG));
+        } else if(QFileInfo(themePath + KBackgroundPrtPNG).exists()){
+            themeInfo->setPortraitPreviewIcon(HbIcon(themePath + KBackgroundPrtPNG));
+        } else{
+            themeInfo->setPortraitPreviewIcon(HbIcon(defaultTheme()->icon()));
+        }
+    }
+    else {
+        themeInfo->setPortraitPreviewIcon(HbIcon(themePath + previewPathPrt));
+    }
+          
+    //Landscape preview
+          
+    if(previewPathLsc.isEmpty() || !QFileInfo(themePath + previewPathLsc).exists()) {
+        if(QFileInfo(themePath + KPreviewLscNVG).exists()){
+            themeInfo->setLandscapePreviewIcon(HbIcon(themePath + KPreviewLscNVG));
+        }else if(QFileInfo(themePath + KPreviewLscSVG).exists()){
+            themeInfo->setLandscapePreviewIcon(HbIcon(themePath + KPreviewLscSVG));
+        }else if(QFileInfo(themePath + KBackgroundLscNVG).exists()){
+            themeInfo->setLandscapePreviewIcon(HbIcon(themePath + KBackgroundLscNVG));
+        } else if(QFileInfo(themePath + KBackgroundLscSVG).exists()){
+            themeInfo->setLandscapePreviewIcon(HbIcon(themePath + KBackgroundLscSVG));
+        } else if(QFileInfo(themePath + KBackgroundLscPNG).exists()){
+            themeInfo->setLandscapePreviewIcon(HbIcon(themePath + KBackgroundLscPNG));
+        } else{
+            themeInfo->setLandscapePreviewIcon(HbIcon(defaultTheme()->icon()));
+        }
+    }
+    else {
+        themeInfo->setLandscapePreviewIcon(HbIcon(themePath + previewPathLsc));
+    }
+    return themeInfo;
+
+}
+
+/*! Creates a list of CpThemeInfo objects representing theme information.
+ *  Caller should take ownership of the list.
+ */
+QList<CpThemeInfo> CpThemeUtil::buildThemeList()
+{
+    QList<CpThemeInfo> themeList; 
+  
+    QStringList mThemesPathList = themePathList();
+    
+    foreach (const QString &path, mThemesPathList) {
+        QDir themeDir;
+        themeDir.setPath( path ) ;
+        QStringList iconthemeslist;
+        QStringList list = themeDir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name);
+        CpThemeInfo* themeInfo;
+
+        if(list.contains("themes", Qt::CaseSensitive )) {
+            QDir root(themeDir.path());
+            themeDir.setPath(root.path() + "/themes/icons/") ;
+            iconthemeslist = themeDir.entryList(QDir::AllDirs|QDir::NoDotAndDotDot,QDir::Name);
+            foreach(QString themefolder, iconthemeslist) {
+                QDir iconThemePath(root.path() + "/themes/icons/" + themefolder);
+                if(iconThemePath.exists("index.theme") &&
+                   (iconThemePath.exists("scalable") || iconThemePath.exists("pixmap") )) {
+
+                    themeInfo = buildThemeInfo(iconThemePath.path(), themefolder);
+                    if(themeInfo && !themeInfo->name().isEmpty()) {
+                        themeList.append(*themeInfo);
+                    }
+                } 
+            }
+        }
+    }
+    qSort( themeList );
+    return themeList;
+}
+
+/*!
+ * Returns the default theme information. 
+ */
+CpThemeInfo* CpThemeUtil::defaultTheme()
+{
+    //static because default theme doesn't change.
+    static CpThemeInfo *defaultTheme = new CpThemeInfo();
+    QString defaultThemeName;
+    QString defaultThemeRootDir;
+    if(defaultTheme->name().isEmpty()) {
+       
+
+#ifdef Q_OS_SYMBIAN
+        CRepository *repository = 0;
+        TRAP_IGNORE(repository = CRepository::NewL(KServerUid3));
+        if (repository) {
+            TBuf<256> value;
+            if (KErrNone == repository->Get((TUint32)KDefaultThemeNameKey, value)) {
+                QString qvalue((QChar*)value.Ptr(), value.Length());
+                defaultThemeName = qvalue.trimmed();
+            }
+            value.Zero();
+            if (KErrNone == repository->Get((TUint32)KDefaultThemeRootPathKey, value)) {
+                QString qvalue((QChar*)value.Ptr(), value.Length());
+                defaultThemeRootDir = qvalue.trimmed();
+            }
+            else {
+                defaultThemeRootDir = themePath(defaultThemeName);
+            }
+            value.Zero();
+            delete repository;
+        }
+          
+#endif
+        defaultTheme = buildThemeInfo(defaultThemeRootDir, defaultThemeName);
+
+    }
+    return defaultTheme;
+}
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelplugins/themeplugin/src/cpthemeutil.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#ifndef CPTHEMEUTIL_H_
+#define CPTHEMEUTIL_H_
+
+#include <QList>
+
+class QStringList;
+class CpThemeInfo;
+
+class CpThemeUtil {
+
+public:
+    static QStringList themePathList();
+    static QList<CpThemeInfo> buildThemeList();
+    static CpThemeInfo* buildThemeInfo(const QString& themePath, const QString& themeName);
+    static QString themePath(const QString& themeName);
+    static CpThemeInfo* defaultTheme();
+};
+
+#endif /* CPTHEMEUTIL_H_ */
+
+
--- a/controlpanelplugins/themeplugin/themeplugin.pri	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/themeplugin.pri	Thu Jul 22 16:34:01 2010 +0100
@@ -1,52 +1,29 @@
-#
 # Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
 # All rights reserved.
 # This component and the accompanying materials are made available
 # under the terms of "Eclipse Public License v1.0"
 # which accompanies this distribution, and is available
 # at the URL "http://www.eclipse.org/legal/epl-v10.html".
-#
 # Initial Contributors:
 # Nokia Corporation - initial contribution.
-#
 # Contributors:
-#
 # Description: cpthemeplugin source files
-#
-
 # Input
 HEADERS += src/cpthemepreview.h \
-           src/cpthemecontrol.h \
-           src/cpthemeplugin.h \
-           src/cpthemelistview.h \
-           src/cpthemepluginentryitemdata.h
-
+    src/cpthemecontrol.h \
+    src/cpthemeplugin.h \
+    src/cpthemelistview.h \
+    src/cpthemelistmodel.h \
+    src/cpthemechanger.h \
+    src/cpthemepluginentryitemdata.h \
+    src/cpthemeutil.h \
+    src/cpthemeinfo.h
 SOURCES += src/cpthemepreview.cpp \
-           src/cpthemecontrol.cpp \
-	   src/cpthemeplugin.cpp \
-           src/cpthemelistview.cpp \
-           src/cpthemepluginentryitemdata.cpp
-
-# Remove once this goes into Hb.
-HEADERS += src/cpthemechanger.h \
-           src/cpthemeclient_p.h \
-           src/cpthemecommon_p.h \
-           src/cpthemechanger_p.h
-
-# Remove once this goes into Hb.
-SOURCES += src/cpthemechanger.cpp \
-           src/cpthemechanger_p.cpp \
-           src/cpthemeclient_p.cpp
-
-# Remove once this goes into Hb.
-win32|mac {
-    HEADERS += src/cpthemeclientqt_p.h
-    SOURCES += src/cpthemeclientqt_p.cpp
-}
-
-# Remove once this goes into Hb.
-symbian {
-    HEADERS += src/cpthemeclientsymbian_p.h \
-               src/cpthemesymbiancommon_p.h
-    SOURCES += src/cpthemeclientsymbian_p.cpp
-}
+    src/cpthemecontrol.cpp \
+    src/cpthemeplugin.cpp \
+    src/cpthemelistview.cpp \
+    src/cpthemelistmodel.cpp \
+    src/cpthemepluginentryitemdata.cpp \
+    src/cpthemechanger.cpp \
+    src/cpthemeutil.cpp \
+    src/cpthemeinfo.cpp
--- a/controlpanelplugins/themeplugin/themeplugin.pro	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/themeplugin.pro	Thu Jul 22 16:34:01 2010 +0100
@@ -65,6 +65,7 @@
 symbian {
     INCLUDEPATH += $$MW_LAYER_SYSTEMINCLUDE
     INCLUDEPATH += $$MOC_DIR
+    LIBS += -lcentralrepository
     TARGET.CAPABILITY = ALL -TCB
     TARGET.EPOCALLOWDLLDATA = 1
     TARGET.UID3 = 0X2002C2F3
--- a/controlpanelplugins/themeplugin/themeplugin.qrc	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelplugins/themeplugin/themeplugin.qrc	Thu Jul 22 16:34:01 2010 +0100
@@ -1,7 +1,5 @@
 <RCC>
     <qresource prefix="/" >
-        <file>image/qgn_menu_note.svg</file>
-        <file>image/themePreview.png</file>
-        <file>image/themePreview.svg</file>
+        <file>image/themePreview.nvg</file>
     </qresource>
 </RCC>
--- a/controlpanelui/examples/groupplugin/src/cpsamplegroup.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/examples/groupplugin/src/cpsamplegroup.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -42,11 +42,11 @@
 void CpSampleGroup::sliderValueChanged(int value)
 {
     //TODO: store your changes
-    HbMessageBox::launchInformationMessageBox(QString("slider value changed to:%1").arg(value));
+   // HbMessageBox::message(QString("slider value changed to:%1").arg(value));
 }
 void CpSampleGroup::checkBoxStateChanged(int state)
 {
     //TODO: store your changes
     QString str = (state ? "checked" : "un-checked");
-    HbMessageBox::launchInformationMessageBox(str);
+   // HbMessageBox::message(str);
 }
--- a/controlpanelui/examples/pluginlauncherclient/src/main.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/examples/pluginlauncherclient/src/main.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -19,14 +19,15 @@
 #include <QDir>
 #include <hbmainwindow.h>
 #include <hbstyleloader.h>
-#include <cpbasepath.h>
 #include "mainview.h"
 
 int main(int argc, char **argv)
 {
     HbApplication app(argc, argv);
     
-    HbStyleLoader::registerFilePath(CP_RESOURCE_PATH + QDir::separator() + WIDGETML_SUB_PATH);
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.css");
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem_color.css");
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.widgetml");
     
     HbMainWindow mainWindow;
     MainView *mainView = new MainView();
--- a/controlpanelui/examples/pluginlauncherclient/src/mainview.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/examples/pluginlauncherclient/src/mainview.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -24,16 +24,17 @@
 #include <hbmessagebox.h>
 #include <xqaiwrequest.h>
 #include <XQServiceRequest.h>
+#include <QTimer>
 
 MainView::MainView(QGraphicsItem *parent/* = 0*/)
-: HbView(parent)
+: HbView(parent),mRequest(0)
 {
 	init();
 }
 
 MainView::~MainView()
 {
-
+    delete mRequest;
 }
 
 void MainView::init()
@@ -60,16 +61,21 @@
 
 void MainView::launchQtHighwayProfileView()
 {
-    XQAiwRequest *request = mAppMgr.create("com.nokia.symbian.ICpPluginLauncher", "launchSettingView(QString,QVariant)", true);
+    if (mRequest) {
+        delete mRequest;
+        mRequest = 0;
+    }
+    
+    mRequest = mAppMgr.create("com.nokia.symbian.ICpPluginLauncher", "launchSettingView(QString,QVariant)", true);
 
-    if (!request)
+    if (!mRequest)
     {
         return;
     }
     else
     {
-        connect(request, SIGNAL(requestOk(QVariant)), SLOT(handleReturnValue(QVariant)));
-        connect(request, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
+        connect(mRequest, SIGNAL(requestOk(QVariant)), SLOT(handleReturnValue(QVariant)));
+        connect(mRequest, SIGNAL(requestError(int,QString)), SLOT(handleError(int,QString)));
     }
 
 
@@ -77,15 +83,18 @@
     QList<QVariant> args;
     args << QVariant( "cppersonalizationplugin.dll" );
     args << QVariant ( "profile_view" );
-    request->setArguments(args);
+    mRequest->setArguments(args);
 
+    mRequest->setSynchronous(false);
+    
+    QTimer::singleShot(20* 1000, this, SLOT(closeSettingView()));
+    
     // Make the request
-    if (!request->send())
+    if (!mRequest->send())
     {
         //report error     
     }
     
-    delete request;
 }
 
 void MainView::handleReturnValue(const QVariant &returnValue)
@@ -98,4 +107,12 @@
     HbMessageBox::information( QString("handle error:") + errorMessage);
 }
 
+void MainView::closeSettingView()
+{   
+    if (mRequest) {
+        delete mRequest;
+        mRequest = 0;
+    }
+}
+
 //End of File
--- a/controlpanelui/examples/pluginlauncherclient/src/mainview.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/examples/pluginlauncherclient/src/mainview.h	Thu Jul 22 16:34:01 2010 +0100
@@ -30,13 +30,19 @@
 	void init();
 private slots:
     void launchInProcessProfileView();
+    
     void launchQtHighwayProfileView();   
+    
     void handleReturnValue(const QVariant &returnValue);
     void handleError(int errorCode,const QString &errorMessage);
+    
+    void closeSettingView();
+    
 private:
     Q_DISABLE_COPY(MainView)
 private:
     XQApplicationManager mAppMgr;
+    XQAiwRequest *mRequest;
 };
 
 #endif
--- a/controlpanelui/examples/viewplugin/src/cpsampleview.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/examples/viewplugin/src/cpsampleview.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -60,12 +60,12 @@
 void CpSampleView::sliderValueChanged(int value)
 {
     //TODO: store your changes
-    HbMessageBox::launchInformationMessageBox(QString("slider value changed to:%1").arg(value));
+   // HbMessageBox::message(QString("slider value changed to:%1").arg(value));
 }
 void CpSampleView::checkBoxStateChanged(int state)
 {
     //TODO: store your changes
     QString str = (state ? "checked" : "un-checked");
-    HbMessageBox::launchInformationMessageBox(str);
+   // HbMessageBox::message(str);
 }
 
--- a/controlpanelui/rom/controlpanelui.iby	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/rom/controlpanelui.iby	Thu Jul 22 16:34:01 2010 +0100
@@ -24,15 +24,14 @@
 #define CP_UPGRADABLE_APP_REG_RSC(NAME) data=DATAZ_\PRIVATE\10003A3F\IMPORT\APPS\ ## NAME ## _reg.rsc        Private\10003a3f\import\apps\ ## NAME ## _reg.rsc
 
 file=ABI_DIR\BUILD_DIR\controlpanel.exe         			 SHARED_LIB_DIR\controlpanel.exe 
+data = ZRESOURCE\apps\controlpanel.mif                                   APP_RESOURCE_DIR\controlpanel.mif
 CP_UPGRADABLE_APP_REG_RSC(controlpanel)    
-S60_APP_RESOURCE(controlpanel)   
+
 
 file=ABI_DIR\BUILD_DIR\cpserviceprovider.exe         			 SHARED_LIB_DIR\cpserviceprovider.exe 
 CP_UPGRADABLE_APP_REG_RSC(cpserviceprovider)    
-S60_APP_RESOURCE(cpserviceprovider)  
 
 file=ABI_DIR\BUILD_DIR\cpcategorymodel.dll			  	 SHARED_LIB_DIR\cpcategorymodel.dll
-file=ABI_DIR\BUILD_DIR\seccodeui.dll                 SHARED_LIB_DIR\seccodeui.dll
 file=ABI_DIR\BUILD_DIR\cpprofilewrapper.dll           SHARED_LIB_DIR\cpprofilewrapper.dll
 file=ABI_DIR\BUILD_DIR\cpringtoneview.dll           SHARED_LIB_DIR\cpringtoneview.dll 
 
@@ -43,8 +42,6 @@
 file=ABI_DIR\BUILD_DIR\cpprivacyplugin.dll                   SHARED_LIB_DIR\cpprivacyplugin.dll
 file=ABI_DIR\BUILD_DIR\cplookfeelplugin.dll                  SHARED_LIB_DIR\cplookfeelplugin.dll
 file=ABI_DIR\BUILD_DIR\cpkeytouchfdbkplugin.dll              SHARED_LIB_DIR\cpkeytouchfdbkplugin.dll
-file=ABI_DIR\BUILD_DIR\cppincodeplugin.dll                   SHARED_LIB_DIR\cppincodeplugin.dll
-file=ABI_DIR\BUILD_DIR\cpdevicelockplugin.dll                SHARED_LIB_DIR\cpdevicelockplugin.dll
 file=ABI_DIR\BUILD_DIR\cpprofileactivator.dll                SHARED_LIB_DIR\cpprofileactivator.dll   
 file=ABI_DIR\BUILD_DIR\cpvolumeplugin.dll					SHARED_LIB_DIR\cpvolumeplugin.dll
 file=ABI_DIR\BUILD_DIR\cpringtoneplugin.dll					SHARED_LIB_DIR\cpringtoneplugin.dll	   
@@ -63,8 +60,6 @@
 data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpprivacyplugin.qtplugin                     resource\qt\plugins\controlpanel\cpprivacyplugin.qtplugin
 data=\epoc32\data\c\resource\qt\plugins\controlpanel\cplookfeelplugin.qtplugin                    resource\qt\plugins\controlpanel\cplookfeelplugin.qtplugin
 data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpkeytouchfdbkplugin.qtplugin                resource\qt\plugins\controlpanel\cpkeytouchfdbkplugin.qtplugin
-data=\epoc32\data\c\resource\qt\plugins\controlpanel\cppincodeplugin.qtplugin                     resource\qt\plugins\controlpanel\cppincodeplugin.qtplugin
-data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpdevicelockplugin.qtplugin                  resource\qt\plugins\controlpanel\cpdevicelockplugin.qtplugin
 data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpprofileactivator.qtplugin                  resource\qt\plugins\controlpanel\cpprofileactivator.qtplugin
 data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpvolumeplugin.qtplugin                  resource\qt\plugins\controlpanel\cpvolumeplugin.qtplugin
 data=\epoc32\data\c\resource\qt\plugins\controlpanel\cpringtoneplugin.qtplugin                  resource\qt\plugins\controlpanel\cpringtoneplugin.qtplugin
--- a/controlpanelui/rom/controlpanelui_resources.iby	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/rom/controlpanelui_resources.iby	Thu Jul 22 16:34:01 2010 +0100
@@ -24,7 +24,6 @@
 data=DATAZ_\QT_TRANSLATIONS_DIR\control_panel.qm QT_TRANSLATIONS_DIR\control_panel.qm
 data=DATAZ_\APP_RESOURCE_DIR\ControlPanel.RSC APP_RESOURCE_DIR\ControlPanel.rsc
 
-#data=DATAZ_\QT_TRANSLATIONS_DIR\cpserviceprovider.qm QT_TRANSLATIONS_DIR\cpserviceprovider.qm
-#data=DATAZ_\APP_RESOURCE_DIR\cpserviceprovider.RSC APP_RESOURCE_DIR\cpserviceprovider.rsc
+data=DATAZ_\APP_RESOURCE_DIR\cpserviceprovider.RSC APP_RESOURCE_DIR\cpserviceprovider.rsc
 
 #endif // CONTROLPANELUI_RESOURCES
\ No newline at end of file
--- a/controlpanelui/src/bwins/cpcategorymodelu.def	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,53 +0,0 @@
-EXPORTS
-	?stop@CpTaskExecutor@@QAEXXZ @ 1 NONAME ; void CpTaskExecutor::stop(void)
-	?tr@CpTaskExecutor@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString CpTaskExecutor::tr(char const *, char const *)
-	?getStaticMetaObject@CpTaskExecutor@@SAABUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const & CpTaskExecutor::getStaticMetaObject(void)
-	??1CpCategorySettingFormModel@@UAE@XZ @ 4 NONAME ; CpCategorySettingFormModel::~CpCategorySettingFormModel(void)
-	?beforeLoadingConfigPlugins@CpCategorySettingFormItemData@@EAEXAAVCpItemDataHelper@@@Z @ 5 NONAME ; void CpCategorySettingFormItemData::beforeLoadingConfigPlugins(class CpItemDataHelper &)
-	?trUtf8@CpCategorySettingFormModel@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString CpCategorySettingFormModel::trUtf8(char const *, char const *, int)
-	??0CpCategorySettingFormModel@@QAE@ABVQString@@@Z @ 7 NONAME ; CpCategorySettingFormModel::CpCategorySettingFormModel(class QString const &)
-	?staticMetaObject@CpTaskExecutor@@2UQMetaObject@@B @ 8 NONAME ; struct QMetaObject const CpTaskExecutor::staticMetaObject
-	??_ECpTaskExecutor@@UAE@I@Z @ 9 NONAME ; CpTaskExecutor::~CpTaskExecutor(unsigned int)
-	?trUtf8@CpTaskExecutor@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString CpTaskExecutor::trUtf8(char const *, char const *, int)
-	?trUtf8@CpCategorySettingFormItemData@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString CpCategorySettingFormItemData::trUtf8(char const *, char const *)
-	?tr@CpCategorySettingFormModel@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString CpCategorySettingFormModel::tr(char const *, char const *)
-	?tr@CpCategorySettingFormItemData@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString CpCategorySettingFormItemData::tr(char const *, char const *)
-	?getStaticMetaObject@CpCategorySettingFormModel@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & CpCategorySettingFormModel::getStaticMetaObject(void)
-	?destroyGlobalInstance@CpTaskExecutor@@SAXXZ @ 15 NONAME ; void CpTaskExecutor::destroyGlobalInstance(void)
-	?initialize@CpCategorySettingFormModel@@UAEXAAVCpItemDataHelper@@@Z @ 16 NONAME ; void CpCategorySettingFormModel::initialize(class CpItemDataHelper &)
-	?initialize@CpCategorySettingFormItemData@@QAEXAAVCpItemDataHelper@@@Z @ 17 NONAME ; void CpCategorySettingFormItemData::initialize(class CpItemDataHelper &)
-	?tr@CpTaskExecutor@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString CpTaskExecutor::tr(char const *, char const *, int)
-	??0CpTaskExecutor@@QAE@PAVQObject@@@Z @ 19 NONAME ; CpTaskExecutor::CpTaskExecutor(class QObject *)
-	?tr@CpCategorySettingFormItemData@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString CpCategorySettingFormItemData::tr(char const *, char const *, int)
-	?qt_metacast@CpTaskExecutor@@UAEPAXPBD@Z @ 21 NONAME ; void * CpTaskExecutor::qt_metacast(char const *)
-	??1CpCategorySettingFormItemData@@UAE@XZ @ 22 NONAME ; CpCategorySettingFormItemData::~CpCategorySettingFormItemData(void)
-	?beforeLoadingConfigPlugins@CpCategorySettingFormModel@@EAEXAAVCpItemDataHelper@@@Z @ 23 NONAME ; void CpCategorySettingFormModel::beforeLoadingConfigPlugins(class CpItemDataHelper &)
-	??1CpTaskExecutor@@UAE@XZ @ 24 NONAME ; CpTaskExecutor::~CpTaskExecutor(void)
-	?createCpPluginItemData@@YAHPAVCpCreatePluginItemDataEvent@@@Z @ 25 NONAME ; int createCpPluginItemData(class CpCreatePluginItemDataEvent *)
-	?trUtf8@CpCategorySettingFormModel@@SA?AVQString@@PBD0@Z @ 26 NONAME ; class QString CpCategorySettingFormModel::trUtf8(char const *, char const *)
-	?staticMetaObject@CpCategorySettingFormModel@@2UQMetaObject@@B @ 27 NONAME ; struct QMetaObject const CpCategorySettingFormModel::staticMetaObject
-	?qt_metacall@CpTaskExecutor@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 28 NONAME ; int CpTaskExecutor::qt_metacall(enum QMetaObject::Call, int, void * *)
-	??0CpCategorySettingFormItemData@@QAE@ABVQString@@PBVHbDataFormModelItem@@@Z @ 29 NONAME ; CpCategorySettingFormItemData::CpCategorySettingFormItemData(class QString const &, class HbDataFormModelItem const *)
-	?qt_metacast@CpCategorySettingFormItemData@@UAEPAXPBD@Z @ 30 NONAME ; void * CpCategorySettingFormItemData::qt_metacast(char const *)
-	?toFront@CpTaskExecutor@@QAE_NPAVCpTask@@@Z @ 31 NONAME ; bool CpTaskExecutor::toFront(class CpTask *)
-	?qt_metacall@CpCategorySettingFormModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 32 NONAME ; int CpCategorySettingFormModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?removeTasks@CpTaskExecutor@@AAEXXZ @ 33 NONAME ; void CpTaskExecutor::removeTasks(void)
-	?qt_metacall@CpCategorySettingFormItemData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 34 NONAME ; int CpCategorySettingFormItemData::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?qt_metacast@CpCategorySettingFormModel@@UAEPAXPBD@Z @ 35 NONAME ; void * CpCategorySettingFormModel::qt_metacast(char const *)
-	?afterLoadingConfigPlugins@CpCategorySettingFormModel@@EAEXAAVCpItemDataHelper@@@Z @ 36 NONAME ; void CpCategorySettingFormModel::afterLoadingConfigPlugins(class CpItemDataHelper &)
-	?getStaticMetaObject@CpCategorySettingFormItemData@@SAABUQMetaObject@@XZ @ 37 NONAME ; struct QMetaObject const & CpCategorySettingFormItemData::getStaticMetaObject(void)
-	?metaObject@CpTaskExecutor@@UBEPBUQMetaObject@@XZ @ 38 NONAME ; struct QMetaObject const * CpTaskExecutor::metaObject(void) const
-	??0CpCategorySettingFormItemData@@QAE@W4DataItemType@HbDataFormModelItem@@ABVQString@@1PBV2@@Z @ 39 NONAME ; CpCategorySettingFormItemData::CpCategorySettingFormItemData(enum HbDataFormModelItem::DataItemType, class QString const &, class QString const &, class HbDataFormModelItem const *)
-	?trUtf8@CpCategorySettingFormItemData@@SA?AVQString@@PBD0H@Z @ 40 NONAME ; class QString CpCategorySettingFormItemData::trUtf8(char const *, char const *, int)
-	?runTask@CpTaskExecutor@@QAE_NPAVCpTask@@_N@Z @ 41 NONAME ; bool CpTaskExecutor::runTask(class CpTask *, bool)
-	?afterLoadingConfigPlugins@CpCategorySettingFormItemData@@EAEXAAVCpItemDataHelper@@@Z @ 42 NONAME ; void CpCategorySettingFormItemData::afterLoadingConfigPlugins(class CpItemDataHelper &)
-	?metaObject@CpCategorySettingFormModel@@UBEPBUQMetaObject@@XZ @ 43 NONAME ; struct QMetaObject const * CpCategorySettingFormModel::metaObject(void) const
-	?tr@CpCategorySettingFormModel@@SA?AVQString@@PBD0H@Z @ 44 NONAME ; class QString CpCategorySettingFormModel::tr(char const *, char const *, int)
-	?staticMetaObject@CpCategorySettingFormItemData@@2UQMetaObject@@B @ 45 NONAME ; struct QMetaObject const CpCategorySettingFormItemData::staticMetaObject
-	?run@CpTaskExecutor@@MAEXXZ @ 46 NONAME ; void CpTaskExecutor::run(void)
-	?metaObject@CpCategorySettingFormItemData@@UBEPBUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const * CpCategorySettingFormItemData::metaObject(void) const
-	?trUtf8@CpTaskExecutor@@SA?AVQString@@PBD0@Z @ 48 NONAME ; class QString CpTaskExecutor::trUtf8(char const *, char const *)
-	??_ECpCategorySettingFormItemData@@UAE@I@Z @ 49 NONAME ; CpCategorySettingFormItemData::~CpCategorySettingFormItemData(unsigned int)
-	??_ECpCategorySettingFormModel@@UAE@I@Z @ 50 NONAME ; CpCategorySettingFormModel::~CpCategorySettingFormModel(unsigned int)
-	?globalInstance@CpTaskExecutor@@SAPAV1@XZ @ 51 NONAME ; class CpTaskExecutor * CpTaskExecutor::globalInstance(void)
-
--- a/controlpanelui/src/bwins/cpprofilewrapperu.def	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,57 +0,0 @@
-EXPORTS
-	?setKeyTouchScreenVibra@CpProfileModel@@QAEXHH@Z @ 1 NONAME ; void CpProfileModel::setKeyTouchScreenVibra(int, int)
-	?tr@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString CpProfileModel::tr(char const *, char const *, int)
-	?setReminderVibra@CpProfileModel@@QAEXH_N@Z @ 3 NONAME ; void CpProfileModel::setReminderVibra(int, bool)
-	?offLineMode@CpProfileModel@@QBE_NXZ @ 4 NONAME ; bool CpProfileModel::offLineMode(void) const
-	?masterVibra@CpProfileModel@@QBE_NXZ @ 5 NONAME ; bool CpProfileModel::masterVibra(void) const
-	?ringTone@CpProfileModel@@QBE?AVQString@@XZ @ 6 NONAME ; class QString CpProfileModel::ringTone(void) const
-	?qt_metacast@CpProfileModel@@UAEPAXPBD@Z @ 7 NONAME ; void * CpProfileModel::qt_metacast(char const *)
-	?setRingTone@CpProfileModel@@QAEXABVQString@@@Z @ 8 NONAME ; void CpProfileModel::setRingTone(class QString const &)
-	?setReminderTone@CpProfileModel@@QAEXHABVQString@@@Z @ 9 NONAME ; void CpProfileModel::setReminderTone(int, class QString const &)
-	?trUtf8@CpProfileModel@@SA?AVQString@@PBD0@Z @ 10 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *)
-	?silenceMode@CpProfileModel@@QBE_NXZ @ 11 NONAME ; bool CpProfileModel::silenceMode(void) const
-	?reminderVibra@CpProfileModel@@QBE_NH@Z @ 12 NONAME ; bool CpProfileModel::reminderVibra(int) const
-	?setEmailTone@CpProfileModel@@QAEXHABVQString@@@Z @ 13 NONAME ; void CpProfileModel::setEmailTone(int, class QString const &)
-	?ringAlertVibra@CpProfileModel@@QBE_NH@Z @ 14 NONAME ; bool CpProfileModel::ringAlertVibra(int) const
-	?emailTone@CpProfileModel@@QBE?AVQString@@H@Z @ 15 NONAME ; class QString CpProfileModel::emailTone(int) const
-	?activeProfileId@CpProfileModel@@QBEHXZ @ 16 NONAME ; int CpProfileModel::activeProfileId(void) const
-	?masterVolume@CpProfileModel@@QBEHXZ @ 17 NONAME ; int CpProfileModel::masterVolume(void) const
-	?notificationTone@CpProfileModel@@QBE_NH@Z @ 18 NONAME ; bool CpProfileModel::notificationTone(int) const
-	?tr@CpProfileModel@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString CpProfileModel::tr(char const *, char const *)
-	?getStaticMetaObject@CpProfileModel@@SAABUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const & CpProfileModel::getStaticMetaObject(void)
-	?keyTouchScreenTone@CpProfileModel@@QBEHH@Z @ 21 NONAME ; int CpProfileModel::keyTouchScreenTone(int) const
-	?setRingTone@CpProfileModel@@QAEXHABVQString@@@Z @ 22 NONAME ; void CpProfileModel::setRingTone(int, class QString const &)
-	?reminderTone@CpProfileModel@@QBE?AVQString@@H@Z @ 23 NONAME ; class QString CpProfileModel::reminderTone(int) const
-	?profileName@CpProfileModel@@QBE?AVQString@@H@Z @ 24 NONAME ; class QString CpProfileModel::profileName(int) const
-	?setKeyTouchScreenTone@CpProfileModel@@QAEXHH@Z @ 25 NONAME ; void CpProfileModel::setKeyTouchScreenTone(int, int)
-	?setMasterVolume@CpProfileModel@@QAEXH@Z @ 26 NONAME ; void CpProfileModel::setMasterVolume(int)
-	?staticMetaObject@CpProfileModel@@2UQMetaObject@@B @ 27 NONAME ; struct QMetaObject const CpProfileModel::staticMetaObject
-	?activateProfile@CpProfileModel@@QAEHH@Z @ 28 NONAME ; int CpProfileModel::activateProfile(int)
-	?profileNames@CpProfileModel@@QBE?AVQStringList@@XZ @ 29 NONAME ; class QStringList CpProfileModel::profileNames(void) const
-	?setNotificationVibra@CpProfileModel@@QAEXH_N@Z @ 30 NONAME ; void CpProfileModel::setNotificationVibra(int, bool)
-	?setNotificationTone@CpProfileModel@@QAEXH_N@Z @ 31 NONAME ; void CpProfileModel::setNotificationTone(int, bool)
-	?metaObject@CpProfileModel@@UBEPBUQMetaObject@@XZ @ 32 NONAME ; struct QMetaObject const * CpProfileModel::metaObject(void) const
-	?setRingAlertVibra@CpProfileModel@@QAEXH_N@Z @ 33 NONAME ; void CpProfileModel::setRingAlertVibra(int, bool)
-	??0CpProfileModel@@QAE@PAVQObject@@@Z @ 34 NONAME ; CpProfileModel::CpProfileModel(class QObject *)
-	?emailVibra@CpProfileModel@@QBE_NH@Z @ 35 NONAME ; bool CpProfileModel::emailVibra(int) const
-	?setProfileSettings@CpProfileModel@@QAEHHAAVCpProfileSettings@@@Z @ 36 NONAME ; int CpProfileModel::setProfileSettings(int, class CpProfileSettings &)
-	?setEmailVibra@CpProfileModel@@QAEXH_N@Z @ 37 NONAME ; void CpProfileModel::setEmailVibra(int, bool)
-	?setOffLineMode@CpProfileModel@@QAEX_N@Z @ 38 NONAME ; void CpProfileModel::setOffLineMode(bool)
-	??1CpProfileModel@@UAE@XZ @ 39 NONAME ; CpProfileModel::~CpProfileModel(void)
-	?notificationVibra@CpProfileModel@@QBE_NH@Z @ 40 NONAME ; bool CpProfileModel::notificationVibra(int) const
-	?qt_metacall@CpProfileModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 41 NONAME ; int CpProfileModel::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?messageTone@CpProfileModel@@QBE?AVQString@@H@Z @ 42 NONAME ; class QString CpProfileModel::messageTone(int) const
-	?profileSettings@CpProfileModel@@QAEXHAAVCpProfileSettings@@@Z @ 43 NONAME ; void CpProfileModel::profileSettings(int, class CpProfileSettings &)
-	?d_func@CpProfileModel@@ABEPBVCpProfileModelPrivate@@XZ @ 44 NONAME ; class CpProfileModelPrivate const * CpProfileModel::d_func(void) const
-	?setSilenceMode@CpProfileModel@@QAEX_N@Z @ 45 NONAME ; void CpProfileModel::setSilenceMode(bool)
-	?setMessageVibra@CpProfileModel@@QAEXH_N@Z @ 46 NONAME ; void CpProfileModel::setMessageVibra(int, bool)
-	?keyTouchScreenVibra@CpProfileModel@@QBEHH@Z @ 47 NONAME ; int CpProfileModel::keyTouchScreenVibra(int) const
-	?d_func@CpProfileModel@@AAEPAVCpProfileModelPrivate@@XZ @ 48 NONAME ; class CpProfileModelPrivate * CpProfileModel::d_func(void)
-	?initiationFlag@CpProfileModel@@QAEHXZ @ 49 NONAME ; int CpProfileModel::initiationFlag(void)
-	?messageVibra@CpProfileModel@@QBE_NH@Z @ 50 NONAME ; bool CpProfileModel::messageVibra(int) const
-	??_ECpProfileModel@@UAE@I@Z @ 51 NONAME ; CpProfileModel::~CpProfileModel(unsigned int)
-	?ringTone@CpProfileModel@@QBE?AVQString@@H@Z @ 52 NONAME ; class QString CpProfileModel::ringTone(int) const
-	?trUtf8@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 53 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *, int)
-	?setMessageTone@CpProfileModel@@QAEXHABVQString@@@Z @ 54 NONAME ; void CpProfileModel::setMessageTone(int, class QString const &)
-	?setMasterVibra@CpProfileModel@@QAEX_N@Z @ 55 NONAME ; void CpProfileModel::setMasterVibra(bool)
-
--- a/controlpanelui/src/bwins/cpringtoneviewu.def	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,20 +0,0 @@
-EXPORTS
-	?tr@CpRingToneView@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString CpRingToneView::tr(char const *, char const *)
-	?selOK@CpRingToneView@@IAEXABVQString@@@Z @ 2 NONAME ; void CpRingToneView::selOK(class QString const &)
-	??1CpRingToneView@@UAE@XZ @ 3 NONAME ; CpRingToneView::~CpRingToneView(void)
-	?getStaticMetaObject@CpRingToneView@@SAABUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const & CpRingToneView::getStaticMetaObject(void)
-	?handleError@CpRingToneView@@AAEXHABVQString@@@Z @ 5 NONAME ; void CpRingToneView::handleError(int, class QString const &)
-	?launchMediaFetcher@CpRingToneView@@AAEXABVQString@@0@Z @ 6 NONAME ; void CpRingToneView::launchMediaFetcher(class QString const &, class QString const &)
-	?onTypeSelected@CpRingToneView@@AAEXPAVHbListWidgetItem@@@Z @ 7 NONAME ; void CpRingToneView::onTypeSelected(class HbListWidgetItem *)
-	?selError@CpRingToneView@@IAEXHABVQString@@@Z @ 8 NONAME ; void CpRingToneView::selError(int, class QString const &)
-	?trUtf8@CpRingToneView@@SA?AVQString@@PBD0H@Z @ 9 NONAME ; class QString CpRingToneView::trUtf8(char const *, char const *, int)
-	?qt_metacall@CpRingToneView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 10 NONAME ; int CpRingToneView::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?staticMetaObject@CpRingToneView@@2UQMetaObject@@B @ 11 NONAME ; struct QMetaObject const CpRingToneView::staticMetaObject
-	?metaObject@CpRingToneView@@UBEPBUQMetaObject@@XZ @ 12 NONAME ; struct QMetaObject const * CpRingToneView::metaObject(void) const
-	?tr@CpRingToneView@@SA?AVQString@@PBD0H@Z @ 13 NONAME ; class QString CpRingToneView::tr(char const *, char const *, int)
-	??0CpRingToneView@@QAE@PAVQGraphicsItem@@@Z @ 14 NONAME ; CpRingToneView::CpRingToneView(class QGraphicsItem *)
-	??_ECpRingToneView@@UAE@I@Z @ 15 NONAME ; CpRingToneView::~CpRingToneView(unsigned int)
-	?trUtf8@CpRingToneView@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString CpRingToneView::trUtf8(char const *, char const *)
-	?handleOk@CpRingToneView@@AAEXABVQVariant@@@Z @ 17 NONAME ; void CpRingToneView::handleOk(class QVariant const &)
-	?qt_metacast@CpRingToneView@@UAEPAXPBD@Z @ 18 NONAME ; void * CpRingToneView::qt_metacast(char const *)
-
--- a/controlpanelui/src/bwins/seccodeuiu.def	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,33 +0,0 @@
-EXPORTS
-	?qt_metacall@SecCodeSettings@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 1 NONAME ; int SecCodeSettings::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?canSetModelIndex@SecCodeEditDataFormViewItem@@UBE_NABVQModelIndex@@@Z @ 2 NONAME ; bool SecCodeEditDataFormViewItem::canSetModelIndex(class QModelIndex const &) const
-	?qt_metacast@SecCodeEditDataFormViewItem@@UAEPAXPBD@Z @ 3 NONAME ; void * SecCodeEditDataFormViewItem::qt_metacast(char const *)
-	?staticMetaObject@SecCodeEditDataFormViewItem@@2UQMetaObject@@B @ 4 NONAME ; struct QMetaObject const SecCodeEditDataFormViewItem::staticMetaObject
-	??0SecCodeSettings@@QAE@PAVQObject@@@Z @ 5 NONAME ; SecCodeSettings::SecCodeSettings(class QObject *)
-	?tr@SecCodeEditDataFormViewItem@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString SecCodeEditDataFormViewItem::tr(char const *, char const *, int)
-	??_ESecCodeEditDataFormViewItem@@UAE@I@Z @ 7 NONAME ; SecCodeEditDataFormViewItem::~SecCodeEditDataFormViewItem(unsigned int)
-	?pinCodeRequest@SecCodeSettings@@QBE_NXZ @ 8 NONAME ; bool SecCodeSettings::pinCodeRequest(void) const
-	?metaObject@SecCodeSettings@@UBEPBUQMetaObject@@XZ @ 9 NONAME ; struct QMetaObject const * SecCodeSettings::metaObject(void) const
-	?createItem@SecCodeEditDataFormViewItem@@UAEPAVHbAbstractViewItem@@XZ @ 10 NONAME ; class HbAbstractViewItem * SecCodeEditDataFormViewItem::createItem(void)
-	?trUtf8@SecCodeEditDataFormViewItem@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString SecCodeEditDataFormViewItem::trUtf8(char const *, char const *)
-	??_ESecCodeSettings@@UAE@I@Z @ 12 NONAME ; SecCodeSettings::~SecCodeSettings(unsigned int)
-	?qt_metacall@SecCodeEditDataFormViewItem@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 13 NONAME ; int SecCodeEditDataFormViewItem::qt_metacall(enum QMetaObject::Call, int, void * *)
-	?changePin2Code@SecCodeSettings@@QAEXXZ @ 14 NONAME ; void SecCodeSettings::changePin2Code(void)
-	?trUtf8@SecCodeSettings@@SA?AVQString@@PBD0@Z @ 15 NONAME ; class QString SecCodeSettings::trUtf8(char const *, char const *)
-	?tr@SecCodeSettings@@SA?AVQString@@PBD0H@Z @ 16 NONAME ; class QString SecCodeSettings::tr(char const *, char const *, int)
-	?staticMetaObject@SecCodeSettings@@2UQMetaObject@@B @ 17 NONAME ; struct QMetaObject const SecCodeSettings::staticMetaObject
-	?setPinCodeRequest@SecCodeSettings@@QAEX_N@Z @ 18 NONAME ; void SecCodeSettings::setPinCodeRequest(bool)
-	?qt_metacast@SecCodeSettings@@UAEPAXPBD@Z @ 19 NONAME ; void * SecCodeSettings::qt_metacast(char const *)
-	?tr@SecCodeSettings@@SA?AVQString@@PBD0@Z @ 20 NONAME ; class QString SecCodeSettings::tr(char const *, char const *)
-	??1SecCodeSettings@@UAE@XZ @ 21 NONAME ; SecCodeSettings::~SecCodeSettings(void)
-	?getStaticMetaObject@SecCodeSettings@@SAABUQMetaObject@@XZ @ 22 NONAME ; struct QMetaObject const & SecCodeSettings::getStaticMetaObject(void)
-	?createCustomWidget@SecCodeEditDataFormViewItem@@MAEPAVHbWidget@@XZ @ 23 NONAME ; class HbWidget * SecCodeEditDataFormViewItem::createCustomWidget(void)
-	?trUtf8@SecCodeSettings@@SA?AVQString@@PBD0H@Z @ 24 NONAME ; class QString SecCodeSettings::trUtf8(char const *, char const *, int)
-	?changePinCode@SecCodeSettings@@QAEXXZ @ 25 NONAME ; void SecCodeSettings::changePinCode(void)
-	?tr@SecCodeEditDataFormViewItem@@SA?AVQString@@PBD0@Z @ 26 NONAME ; class QString SecCodeEditDataFormViewItem::tr(char const *, char const *)
-	?getStaticMetaObject@SecCodeEditDataFormViewItem@@SAABUQMetaObject@@XZ @ 27 NONAME ; struct QMetaObject const & SecCodeEditDataFormViewItem::getStaticMetaObject(void)
-	??1SecCodeEditDataFormViewItem@@UAE@XZ @ 28 NONAME ; SecCodeEditDataFormViewItem::~SecCodeEditDataFormViewItem(void)
-	?metaObject@SecCodeEditDataFormViewItem@@UBEPBUQMetaObject@@XZ @ 29 NONAME ; struct QMetaObject const * SecCodeEditDataFormViewItem::metaObject(void) const
-	?trUtf8@SecCodeEditDataFormViewItem@@SA?AVQString@@PBD0H@Z @ 30 NONAME ; class QString SecCodeEditDataFormViewItem::trUtf8(char const *, char const *, int)
-	??0SecCodeEditDataFormViewItem@@QAE@PAVQGraphicsItem@@@Z @ 31 NONAME ; SecCodeEditDataFormViewItem::SecCodeEditDataFormViewItem(class QGraphicsItem *)
-
--- a/controlpanelui/src/cpapplication/cpapplication.pro	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpapplication/cpapplication.pro	Thu Jul 22 16:34:01 2010 +0100
@@ -17,17 +17,21 @@
 TEMPLATE = app
 TARGET = ControlPanel
 
+ICON = resources/qtg_large_settings.svg
+
 include ( ../common.pri )
 include ( cpapplication.pri )
 
+CONFIG += hb
 
-CONFIG += hb
+RESOURCES += cpapplication.qrc
 
 LIBS += -lcpframework -lcpcategorymodel
 
 TRANSLATIONS = control_panel.ts
 
 symbian: { 
+          SKINICON = qtg_large_settings
 	  TARGET.UID3 = 0x20025FD9
 	  TARGET.EPOCHEAPSIZE = 0x020000 0x1000000
 	
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpapplication/cpapplication.qrc	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,5 @@
+<RCC>
+    <qresource prefix="/logconf" >
+        <file alias="controlpanellog.conf">data/controlpanellog.conf</file>
+    </qresource>  
+</RCC>
\ No newline at end of file
--- a/controlpanelui/src/cpapplication/data/controlpanellog.conf	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpapplication/data/controlpanellog.conf	Thu Jul 22 16:34:01 2010 +0100
@@ -1,6 +1,3 @@
-
-# copy the file(controlpanellog.conf) to C:/data/.config to enable logging
-
 [CpFramework]
 logdatetime = 1
 logloggername = 1
@@ -9,7 +6,7 @@
 fileoutput/logfile = C:/data/logs/cpframework.log
 fileoutput/truncate = 1
 
-#[CpPerformance]
+[CpPerformance]
 logdatetime = 1
 datetimeformat = hh:mm:ss:zzz
 output = fileoutput
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpapplication/resources/qtg_large_settings.svg	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,159 @@
+<?xml version="1.0" encoding="UTF-8" standalone="no"?>
+<!DOCTYPE svg PUBLIC "-//W3C//DTD SVG 1.1 Tiny//EN" "http://www.w3.org/Graphics/SVG/1.1/DTD/svg11-tiny.dtd">
+<svg xmlns="http://www.w3.org/2000/svg" xmlns:xlink="http://www.w3.org/1999/xlink" baseProfile="tiny" height="60" viewBox="0 0 60 60" width="60">
+<g>
+<rect fill="none" height="60" width="60"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_1_" x1="30" x2="30" y1="4.5" y2="55.3778">
+<stop offset="0" style="stop-color:#E8E8E8"/>
+<stop offset="0.3576" style="stop-color:#B2BDC2"/>
+<stop offset="0.7455" style="stop-color:#595C5E"/>
+<stop offset="1" style="stop-color:#A1ABB0"/>
+</linearGradient>
+<path d="M6.412,55.5c-1.055,0-1.912-0.857-1.912-1.911V6.411C4.5,5.357,5.357,4.5,6.412,4.5h47.176  c1.055,0,1.913,0.857,1.913,1.911v47.178c0,1.054-0.858,1.911-1.913,1.911H6.412z" fill="url(#SVGID_1_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_2_" x1="30.001" x2="30.001" y1="5.7139" y2="54.1698">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="0.1455" style="stop-color:#D7DDDE"/>
+<stop offset="0.3212" style="stop-color:#FFFFFF"/>
+<stop offset="0.7333" style="stop-color:#8E9699"/>
+<stop offset="1" style="stop-color:#D5E2E6"/>
+</linearGradient>
+<path d="M6.412,54.286c-0.385,0-0.697-0.313-0.697-0.697V6.411c0-0.384,0.313-0.697,0.697-0.697h47.176  c0.387,0,0.699,0.313,0.699,0.697v47.178c0,0.385-0.313,0.697-0.699,0.697H6.412z" fill="url(#SVGID_2_)"/>
+<path d="M53.588,5.106H6.412c-0.719,0-1.305,0.586-1.305,1.305v47.178  c0,0.719,0.586,1.305,1.305,1.305h47.176c0.72,0,1.307-0.586,1.307-1.305V6.411C54.895,5.692,54.308,5.106,53.588,5.106z   M53.68,53.589c0,0.05-0.041,0.09-0.092,0.09H6.412c-0.049,0-0.09-0.04-0.09-0.09V6.411c0-0.049,0.041-0.09,0.09-0.09h47.176  c0.051,0,0.092,0.041,0.092,0.09V53.589z" fill="#FFFFFF" fill-opacity="0.5"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_3_" x1="13.6074" x2="13.6074" y1="11.021" y2="48.3899">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<path d="M13,48.519c-1.339,0-2.428-1.09-2.428-2.429V13.304c0-1.34,1.089-2.43,2.428-2.43  h1.215c1.339,0,2.429,1.09,2.429,2.43V46.09c0,1.339-1.09,2.429-2.429,2.429H13z" fill="url(#SVGID_3_)" fill-opacity="0.3"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_4_" x1="15.9473" x2="11.1119" y1="29.6973" y2="29.6973">
+<stop offset="0" style="stop-color:#595C5E"/>
+<stop offset="0.3" style="stop-color:#ABB2B5"/>
+<stop offset="0.7" style="stop-color:#ABB2B5"/>
+<stop offset="1" style="stop-color:#595C5E"/>
+</linearGradient>
+<path d="M16.036,46.09c0,1.006-0.815,1.822-1.821,1.822H13c-1.006,0-1.821-0.816-1.821-1.822V13.304  c0-1.008,0.815-1.821,1.821-1.821h1.215c1.006,0,1.821,0.813,1.821,1.821V46.09z" fill="url(#SVGID_4_)"/>
+<path d="M14.215,11.482H13c-1.006,0-1.821,0.813-1.821,1.821V46.09c0,1.006,0.815,1.822,1.821,1.822h1.215  c1.006,0,1.821-0.816,1.821-1.822V13.304C16.036,12.296,15.221,11.482,14.215,11.482z M15.429,46.09  c0,0.669-0.544,1.214-1.214,1.214H13c-0.67,0-1.214-0.545-1.214-1.214V13.304c0-0.67,0.544-1.215,1.214-1.215h1.215  c0.67,0,1.214,0.545,1.214,1.215V46.09z" fill-opacity="0.1"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_5_" x1="11.7861" x2="15.4287" y1="36.0713" y2="36.0713">
+<stop offset="0" style="stop-color:#5AA913"/>
+<stop offset="0.497" style="stop-color:#A2ED21"/>
+<stop offset="1" style="stop-color:#58A813"/>
+</linearGradient>
+<path d="M13,47.304c-0.67,0-1.214-0.545-1.214-1.214V26.054c0-0.668,0.544-1.215,1.214-1.215h1.215  c0.67,0,1.214,0.547,1.214,1.215V46.09c0,0.669-0.544,1.214-1.214,1.214H13z" fill="url(#SVGID_5_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_6_" x1="13.6074" x2="13.6074" y1="19.6782" y2="28.6905">
+<stop offset="0" style="stop-color:#666666"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<path d="M10.572,28.483c-1.34,0-2.43-1.09-2.43-2.43v-4.25c0-1.34,1.09-2.428,2.43-2.428  h6.071c1.339,0,2.429,1.088,2.429,2.428v4.25c0,1.34-1.09,2.43-2.429,2.43H10.572z" fill="url(#SVGID_6_)" fill-opacity="0.2"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_7_" x1="13.6074" x2="13.6074" y1="19.4058" y2="27.2627">
+<stop offset="0" style="stop-color:#A6A8AB"/>
+<stop offset="1" style="stop-color:#231F20"/>
+</linearGradient>
+<path d="M10.572,27.268c-1.006,0-1.822-0.816-1.822-1.82v-4.252  c0-1.004,0.816-1.819,1.822-1.819h6.071c1.004,0,1.821,0.815,1.821,1.819v4.252c0,1.004-0.817,1.82-1.821,1.82H10.572z" fill="url(#SVGID_7_)" fill-opacity="0.6"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_8_" x1="13.6074" x2="13.6074" y1="20.2031" y2="26.8131">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="0.1212" style="stop-color:#FFFFFF"/>
+<stop offset="0.4182" style="stop-color:#B0B6B8"/>
+<stop offset="0.4182" style="stop-color:#9FA6A8"/>
+<stop offset="0.6606" style="stop-color:#7D8588"/>
+<stop offset="0.9697" style="stop-color:#ADB3B5"/>
+<stop offset="0.9697" style="stop-color:#595C5E"/>
+<stop offset="1" style="stop-color:#ADB3B5"/>
+<stop offset="1" style="stop-color:#595C5E"/>
+</linearGradient>
+<path d="M17.857,25.447c0,0.671-0.543,1.214-1.214,1.214h-6.071c-0.672,0-1.215-0.543-1.215-1.214v-4.252  c0-0.669,0.543-1.214,1.215-1.214h6.071c0.671,0,1.214,0.545,1.214,1.214V25.447z" fill="url(#SVGID_8_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_9_" x1="13.6074" x2="13.6074" y1="20.7715" y2="26.1783">
+<stop offset="0" style="stop-color:#E5E9EB"/>
+<stop offset="0.1212" style="stop-color:#E5E9EB"/>
+<stop offset="0.4182" style="stop-color:#B0B6B8"/>
+<stop offset="0.4182" style="stop-color:#9FA6A8"/>
+<stop offset="0.6606" style="stop-color:#7D8588"/>
+<stop offset="1" style="stop-color:#ADB3B5"/>
+</linearGradient>
+<path d="M10.572,26.054c-0.336,0-0.607-0.272-0.607-0.606v-4.252c0-0.335,0.271-0.605,0.607-0.605h6.071  c0.335,0,0.606,0.271,0.606,0.605v4.252c0,0.334-0.271,0.606-0.606,0.606H10.572z" fill="url(#SVGID_9_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_10_" x1="25.75" x2="25.75" y1="11.021" y2="48.3899">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<path d="M25.143,48.519c-1.339,0-2.428-1.09-2.428-2.429V13.304  c0-1.34,1.089-2.43,2.428-2.43h1.215c1.339,0,2.429,1.09,2.429,2.43V46.09c0,1.339-1.09,2.429-2.429,2.429H25.143z" fill="url(#SVGID_10_)" fill-opacity="0.3"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_11_" x1="28.0898" x2="23.2554" y1="29.6973" y2="29.6973">
+<stop offset="0" style="stop-color:#595C5E"/>
+<stop offset="0.3" style="stop-color:#ABB2B5"/>
+<stop offset="0.7" style="stop-color:#ABB2B5"/>
+<stop offset="1" style="stop-color:#595C5E"/>
+</linearGradient>
+<path d="M28.179,46.09c0,1.006-0.815,1.822-1.821,1.822h-1.215c-1.005,0-1.82-0.816-1.82-1.822V13.304  c0-1.008,0.815-1.821,1.82-1.821h1.215c1.006,0,1.821,0.813,1.821,1.821V46.09z" fill="url(#SVGID_11_)"/>
+<path d="M26.357,11.482h-1.215c-1.005,0-1.82,0.813-1.82,1.821V46.09c0,1.006,0.815,1.822,1.82,1.822h1.215  c1.006,0,1.821-0.816,1.821-1.822V13.304C28.179,12.296,27.363,11.482,26.357,11.482z M27.571,46.09  c0,0.669-0.544,1.214-1.214,1.214h-1.215c-0.67,0-1.214-0.545-1.214-1.214V13.304c0-0.67,0.544-1.215,1.214-1.215h1.215  c0.67,0,1.214,0.545,1.214,1.215V46.09z" fill-opacity="0.1"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_12_" x1="23.9287" x2="27.5713" y1="37.5898" y2="37.5898">
+<stop offset="0" style="stop-color:#5AA913"/>
+<stop offset="0.497" style="stop-color:#A2ED21"/>
+<stop offset="1" style="stop-color:#58A813"/>
+</linearGradient>
+<path d="M25.143,47.304c-0.67,0-1.214-0.545-1.214-1.214v-17c0-0.67,0.544-1.214,1.214-1.214h1.215  c0.67,0,1.214,0.544,1.214,1.214v17c0,0.669-0.544,1.214-1.214,1.214H25.143z" fill="url(#SVGID_12_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_13_" x1="25.75" x2="25.75" y1="26.9634" y2="35.9757">
+<stop offset="0" style="stop-color:#666666"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<path d="M22.715,35.769c-1.339,0-2.429-1.09-2.429-2.43V29.09  c0-1.34,1.09-2.429,2.429-2.429h6.071c1.339,0,2.429,1.089,2.429,2.429v4.249c0,1.34-1.09,2.43-2.429,2.43H22.715z" fill="url(#SVGID_13_)" fill-opacity="0.2"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_14_" x1="25.75" x2="25.75" y1="26.6909" y2="34.5488">
+<stop offset="0" style="stop-color:#A6A8AB"/>
+<stop offset="1" style="stop-color:#231F20"/>
+</linearGradient>
+<path d="M22.715,34.554c-1.005,0-1.822-0.816-1.822-1.821v-4.249  c0-1.006,0.817-1.822,1.822-1.822h6.071c1.005,0,1.821,0.816,1.821,1.822v4.249c0,1.005-0.816,1.821-1.821,1.821H22.715z" fill="url(#SVGID_14_)" fill-opacity="0.6"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_15_" x1="25.75" x2="25.75" y1="27.4893" y2="34.0982">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="0.1212" style="stop-color:#FFFFFF"/>
+<stop offset="0.4182" style="stop-color:#B0B6B8"/>
+<stop offset="0.4182" style="stop-color:#9FA6A8"/>
+<stop offset="0.6606" style="stop-color:#7D8588"/>
+<stop offset="0.9697" style="stop-color:#ADB3B5"/>
+<stop offset="0.9697" style="stop-color:#595C5E"/>
+<stop offset="1" style="stop-color:#ADB3B5"/>
+<stop offset="1" style="stop-color:#595C5E"/>
+</linearGradient>
+<path d="M30,32.732c0,0.671-0.543,1.214-1.214,1.214h-6.071c-0.671,0-1.215-0.543-1.215-1.214v-4.249  c0-0.672,0.544-1.216,1.215-1.216h6.071c0.671,0,1.214,0.544,1.214,1.216V32.732z" fill="url(#SVGID_15_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_16_" x1="25.75" x2="25.75" y1="28.0571" y2="33.463">
+<stop offset="0" style="stop-color:#E5E9EB"/>
+<stop offset="0.1212" style="stop-color:#E5E9EB"/>
+<stop offset="0.4182" style="stop-color:#B0B6B8"/>
+<stop offset="0.4182" style="stop-color:#9FA6A8"/>
+<stop offset="0.6606" style="stop-color:#7D8588"/>
+<stop offset="1" style="stop-color:#ADB3B5"/>
+</linearGradient>
+<path d="M22.715,33.339c-0.335,0-0.607-0.271-0.607-0.606v-4.249c0-0.336,0.272-0.607,0.607-0.607h6.071  c0.335,0,0.607,0.271,0.607,0.607v4.249c0,0.335-0.272,0.606-0.607,0.606H22.715z" fill="url(#SVGID_16_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_17_" x1="42.1426" x2="42.1426" y1="14.0352" y2="45.034">
+<stop offset="0" style="stop-color:#999999"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<path d="M36.982,45.179c-1.034,0-1.877-0.842-1.877-1.876V16.091  c0-1.035,0.843-1.876,1.877-1.876h10.322c1.035,0,1.876,0.841,1.876,1.876v27.212c0,1.034-0.841,1.876-1.876,1.876H36.982z" fill="url(#SVGID_17_)" fill-opacity="0.1"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_18_" x1="42.1426" x2="42.1426" y1="14.5083" y2="44.5696">
+<stop offset="0" style="stop-color:#999999"/>
+<stop offset="1" style="stop-color:#000000"/>
+</linearGradient>
+<path d="M36.982,44.71c-0.775,0-1.407-0.632-1.407-1.407V16.091  c0-0.775,0.632-1.408,1.407-1.408h10.322c0.775,0,1.406,0.633,1.406,1.408v27.212c0,0.775-0.631,1.407-1.406,1.407H36.982z" fill="url(#SVGID_18_)" fill-opacity="0.3"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_19_" x1="42.1436" x2="42.1436" y1="44.3218" y2="15.0707">
+<stop offset="0" style="stop-color:#5F6366"/>
+<stop offset="1" style="stop-color:#3E4142"/>
+</linearGradient>
+<path d="M48.242,43.303c0,0.519-0.419,0.938-0.938,0.938H36.982c-0.518,0-0.938-0.42-0.938-0.938V16.091  c0-0.518,0.42-0.938,0.938-0.938h10.322c0.519,0,0.938,0.42,0.938,0.938V43.303z" fill="url(#SVGID_19_)"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_20_" x1="42.1436" x2="42.1436" y1="16.8999" y2="43.2099">
+<stop offset="0" style="stop-color:#9CA4A6"/>
+<stop offset="0.1" style="stop-color:#F0F2F3"/>
+<stop offset="0.5" style="stop-color:#BBBEBF"/>
+<stop offset="0.9" style="stop-color:#F3F5F5"/>
+<stop offset="0.95" style="stop-color:#8E9699"/>
+<stop offset="1" style="stop-color:#686E70"/>
+</linearGradient>
+<path d="M36.982,43.771c-0.258,0-0.469-0.21-0.469-0.468V17.03c0-0.26,0.211-0.471,0.469-0.471h10.322  c0.259,0,0.469,0.211,0.469,0.471v26.272c0,0.258-0.21,0.468-0.469,0.468H36.982z" fill="url(#SVGID_20_)"/>
+<path d="M47.305,18.437H36.982c-0.258,0-0.469,0.211-0.469,0.469v0.471c0-0.26,0.211-0.471,0.469-0.471h10.322  c0.259,0,0.469,0.211,0.469,0.471v-0.471C47.773,18.647,47.563,18.437,47.305,18.437z" fill="#FFFFFF"/>
+<path d="M47.305,43.303H36.982c-0.258,0-0.469-0.21-0.469-0.47v0.47c0,0.258,0.211,0.468,0.469,0.468h10.322  c0.259,0,0.469-0.21,0.469-0.468v-0.47C47.773,43.093,47.563,43.303,47.305,43.303z" fill-opacity="0.3"/>
+<path d="M36.982,41.427c-0.259,0-0.469-0.212-0.469-0.47V19.376c0-0.26,0.21-0.471,0.469-0.471  h10.322c0.259,0,0.469,0.211,0.469,0.471v21.581c0,0.258-0.21,0.47-0.469,0.47H36.982z" fill="#FFFFFF" fill-opacity="0.3"/>
+<path d="M36.514,30.165v10.792c0,0.258,0.21,0.47,0.469,0.47h10.322  c0.259,0,0.469-0.212,0.469-0.47V30.165H36.514z" fill="#FFFFFF" fill-opacity="0.4"/>
+<linearGradient gradientUnits="userSpaceOnUse" id="SVGID_21_" x1="42.1436" x2="42.1436" y1="22.582" y2="19.8827">
+<stop offset="0" style="stop-color:#FFFFFF"/>
+<stop offset="1" style="stop-color:#808080"/>
+</linearGradient>
+<path d="M38.859,22.66c-0.26,0-0.469-0.212-0.469-0.471v-1.876  c0-0.26,0.209-0.47,0.469-0.47h6.568c0.26,0,0.469,0.21,0.469,0.47v1.876c0,0.259-0.209,0.471-0.469,0.471H38.859z" fill="url(#SVGID_21_)" fill-opacity="0.4"/>
+<rect fill="#FF1D25" height="1.876" width="6.568" x="38.859" y="20.313"/>
+<polygon fill-opacity="0.3" points="44.959,20.313 39.328,20.313 38.859,20.313 38.859,20.782 38.859,22.189 39.328,22.189   39.328,20.782 44.959,20.782 44.959,22.189 45.428,22.189 45.428,20.782 45.428,20.313 "/>
+<rect fill="none" height="60" width="60"/>
+</g>
+</svg>
--- a/controlpanelui/src/cpapplication/src/cpmainview.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpapplication/src/cpmainview.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -32,8 +32,6 @@
 { 
     //delay loading
     connect(mMainWindow,SIGNAL(viewReady()),this,SLOT(initializeMainModel()));
-    
-	setTitle( QObject::tr("Control Panel") );	//should use qtTrId("txt_cp_title_control_panel")
 }
 
 CpMainView::~CpMainView()
--- a/controlpanelui/src/cpapplication/src/cpmainwindow.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpapplication/src/cpmainwindow.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -19,7 +19,6 @@
 #include "cpmainview.h"
 #include <cpplugininterface.h>
 #include <cpcategorysettingformitemdata.h>
-#include <cpbasepath.h>
 #include <hbapplication.h>
 #include <cpevent.h>
 
--- a/controlpanelui/src/cpapplication/src/main.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpapplication/src/main.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -24,7 +24,6 @@
 #include <QLatin1String>
 #include <QDir>
 #include <cplogger.h>
-#include <cpbasepath.h>
 
 int main(int argc, char **argv)
 {
@@ -35,10 +34,15 @@
     QCoreApplication::setOrganizationDomain("Orbit");
     QCoreApplication::setApplicationName("ControlPanel");
 
+#ifdef ENABLE_CPFW_LOG
     Logger::instance(CPFW_LOGGER_NAME)->configure(
         CP_LOGGER_CONFIG_PATH,QSettings::IniFormat);
+#endif
+    
+#ifdef ENABLE_CPPERF_LOG
     Logger::instance(CPPERF_LOGGER_NAME)->configure(
         CP_LOGGER_CONFIG_PATH,QSettings::IniFormat);
+#endif
 
     CPFW_LOG("Entering ControlPanel.exe...");
     CPPERF_LOG("Entering ControlPanel.exe...");
@@ -48,8 +52,10 @@
     {
         qApp->installTranslator(&translator);
     }
-    
-    HbStyleLoader::registerFilePath(CP_RESOURCE_PATH + QDir::separator() + WIDGETML_SUB_PATH);
+        
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.css");
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem_color.css");
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.widgetml");
 
     CpMainWindow mainWindow;
     
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpcategorymodel/bwins/cpcategorymodelu.def	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,53 @@
+EXPORTS
+	?stop@CpTaskExecutor@@QAEXXZ @ 1 NONAME ; void CpTaskExecutor::stop(void)
+	?tr@CpTaskExecutor@@SA?AVQString@@PBD0@Z @ 2 NONAME ; class QString CpTaskExecutor::tr(char const *, char const *)
+	?getStaticMetaObject@CpTaskExecutor@@SAABUQMetaObject@@XZ @ 3 NONAME ; struct QMetaObject const & CpTaskExecutor::getStaticMetaObject(void)
+	??1CpCategorySettingFormModel@@UAE@XZ @ 4 NONAME ; CpCategorySettingFormModel::~CpCategorySettingFormModel(void)
+	?beforeLoadingConfigPlugins@CpCategorySettingFormItemData@@EAEXAAVCpItemDataHelper@@@Z @ 5 NONAME ; void CpCategorySettingFormItemData::beforeLoadingConfigPlugins(class CpItemDataHelper &)
+	?trUtf8@CpCategorySettingFormModel@@SA?AVQString@@PBD0H@Z @ 6 NONAME ; class QString CpCategorySettingFormModel::trUtf8(char const *, char const *, int)
+	??0CpCategorySettingFormModel@@QAE@ABVQString@@@Z @ 7 NONAME ; CpCategorySettingFormModel::CpCategorySettingFormModel(class QString const &)
+	?staticMetaObject@CpTaskExecutor@@2UQMetaObject@@B @ 8 NONAME ; struct QMetaObject const CpTaskExecutor::staticMetaObject
+	??_ECpTaskExecutor@@UAE@I@Z @ 9 NONAME ; CpTaskExecutor::~CpTaskExecutor(unsigned int)
+	?trUtf8@CpTaskExecutor@@SA?AVQString@@PBD0H@Z @ 10 NONAME ; class QString CpTaskExecutor::trUtf8(char const *, char const *, int)
+	?trUtf8@CpCategorySettingFormItemData@@SA?AVQString@@PBD0@Z @ 11 NONAME ; class QString CpCategorySettingFormItemData::trUtf8(char const *, char const *)
+	?tr@CpCategorySettingFormModel@@SA?AVQString@@PBD0@Z @ 12 NONAME ; class QString CpCategorySettingFormModel::tr(char const *, char const *)
+	?tr@CpCategorySettingFormItemData@@SA?AVQString@@PBD0@Z @ 13 NONAME ; class QString CpCategorySettingFormItemData::tr(char const *, char const *)
+	?getStaticMetaObject@CpCategorySettingFormModel@@SAABUQMetaObject@@XZ @ 14 NONAME ; struct QMetaObject const & CpCategorySettingFormModel::getStaticMetaObject(void)
+	?destroyGlobalInstance@CpTaskExecutor@@SAXXZ @ 15 NONAME ; void CpTaskExecutor::destroyGlobalInstance(void)
+	?initialize@CpCategorySettingFormModel@@UAEXAAVCpItemDataHelper@@@Z @ 16 NONAME ; void CpCategorySettingFormModel::initialize(class CpItemDataHelper &)
+	?initialize@CpCategorySettingFormItemData@@QAEXAAVCpItemDataHelper@@@Z @ 17 NONAME ; void CpCategorySettingFormItemData::initialize(class CpItemDataHelper &)
+	?tr@CpTaskExecutor@@SA?AVQString@@PBD0H@Z @ 18 NONAME ; class QString CpTaskExecutor::tr(char const *, char const *, int)
+	??0CpTaskExecutor@@QAE@PAVQObject@@@Z @ 19 NONAME ; CpTaskExecutor::CpTaskExecutor(class QObject *)
+	?tr@CpCategorySettingFormItemData@@SA?AVQString@@PBD0H@Z @ 20 NONAME ; class QString CpCategorySettingFormItemData::tr(char const *, char const *, int)
+	?qt_metacast@CpTaskExecutor@@UAEPAXPBD@Z @ 21 NONAME ; void * CpTaskExecutor::qt_metacast(char const *)
+	??1CpCategorySettingFormItemData@@UAE@XZ @ 22 NONAME ; CpCategorySettingFormItemData::~CpCategorySettingFormItemData(void)
+	?beforeLoadingConfigPlugins@CpCategorySettingFormModel@@EAEXAAVCpItemDataHelper@@@Z @ 23 NONAME ; void CpCategorySettingFormModel::beforeLoadingConfigPlugins(class CpItemDataHelper &)
+	??1CpTaskExecutor@@UAE@XZ @ 24 NONAME ; CpTaskExecutor::~CpTaskExecutor(void)
+	?createCpPluginItemData@@YAHPAVCpCreatePluginItemDataEvent@@@Z @ 25 NONAME ; int createCpPluginItemData(class CpCreatePluginItemDataEvent *)
+	?trUtf8@CpCategorySettingFormModel@@SA?AVQString@@PBD0@Z @ 26 NONAME ; class QString CpCategorySettingFormModel::trUtf8(char const *, char const *)
+	?staticMetaObject@CpCategorySettingFormModel@@2UQMetaObject@@B @ 27 NONAME ; struct QMetaObject const CpCategorySettingFormModel::staticMetaObject
+	?qt_metacall@CpTaskExecutor@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 28 NONAME ; int CpTaskExecutor::qt_metacall(enum QMetaObject::Call, int, void * *)
+	??0CpCategorySettingFormItemData@@QAE@ABVQString@@PBVHbDataFormModelItem@@@Z @ 29 NONAME ; CpCategorySettingFormItemData::CpCategorySettingFormItemData(class QString const &, class HbDataFormModelItem const *)
+	?qt_metacast@CpCategorySettingFormItemData@@UAEPAXPBD@Z @ 30 NONAME ; void * CpCategorySettingFormItemData::qt_metacast(char const *)
+	?toFront@CpTaskExecutor@@QAE_NPAVCpTask@@@Z @ 31 NONAME ; bool CpTaskExecutor::toFront(class CpTask *)
+	?qt_metacall@CpCategorySettingFormModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 32 NONAME ; int CpCategorySettingFormModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?removeTasks@CpTaskExecutor@@AAEXXZ @ 33 NONAME ; void CpTaskExecutor::removeTasks(void)
+	?qt_metacall@CpCategorySettingFormItemData@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 34 NONAME ; int CpCategorySettingFormItemData::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?qt_metacast@CpCategorySettingFormModel@@UAEPAXPBD@Z @ 35 NONAME ; void * CpCategorySettingFormModel::qt_metacast(char const *)
+	?afterLoadingConfigPlugins@CpCategorySettingFormModel@@EAEXAAVCpItemDataHelper@@@Z @ 36 NONAME ; void CpCategorySettingFormModel::afterLoadingConfigPlugins(class CpItemDataHelper &)
+	?getStaticMetaObject@CpCategorySettingFormItemData@@SAABUQMetaObject@@XZ @ 37 NONAME ; struct QMetaObject const & CpCategorySettingFormItemData::getStaticMetaObject(void)
+	?metaObject@CpTaskExecutor@@UBEPBUQMetaObject@@XZ @ 38 NONAME ; struct QMetaObject const * CpTaskExecutor::metaObject(void) const
+	??0CpCategorySettingFormItemData@@QAE@W4DataItemType@HbDataFormModelItem@@ABVQString@@1PBV2@@Z @ 39 NONAME ; CpCategorySettingFormItemData::CpCategorySettingFormItemData(enum HbDataFormModelItem::DataItemType, class QString const &, class QString const &, class HbDataFormModelItem const *)
+	?trUtf8@CpCategorySettingFormItemData@@SA?AVQString@@PBD0H@Z @ 40 NONAME ; class QString CpCategorySettingFormItemData::trUtf8(char const *, char const *, int)
+	?runTask@CpTaskExecutor@@QAE_NPAVCpTask@@_N@Z @ 41 NONAME ; bool CpTaskExecutor::runTask(class CpTask *, bool)
+	?afterLoadingConfigPlugins@CpCategorySettingFormItemData@@EAEXAAVCpItemDataHelper@@@Z @ 42 NONAME ; void CpCategorySettingFormItemData::afterLoadingConfigPlugins(class CpItemDataHelper &)
+	?metaObject@CpCategorySettingFormModel@@UBEPBUQMetaObject@@XZ @ 43 NONAME ; struct QMetaObject const * CpCategorySettingFormModel::metaObject(void) const
+	?tr@CpCategorySettingFormModel@@SA?AVQString@@PBD0H@Z @ 44 NONAME ; class QString CpCategorySettingFormModel::tr(char const *, char const *, int)
+	?staticMetaObject@CpCategorySettingFormItemData@@2UQMetaObject@@B @ 45 NONAME ; struct QMetaObject const CpCategorySettingFormItemData::staticMetaObject
+	?run@CpTaskExecutor@@MAEXXZ @ 46 NONAME ; void CpTaskExecutor::run(void)
+	?metaObject@CpCategorySettingFormItemData@@UBEPBUQMetaObject@@XZ @ 47 NONAME ; struct QMetaObject const * CpCategorySettingFormItemData::metaObject(void) const
+	?trUtf8@CpTaskExecutor@@SA?AVQString@@PBD0@Z @ 48 NONAME ; class QString CpTaskExecutor::trUtf8(char const *, char const *)
+	??_ECpCategorySettingFormItemData@@UAE@I@Z @ 49 NONAME ; CpCategorySettingFormItemData::~CpCategorySettingFormItemData(unsigned int)
+	??_ECpCategorySettingFormModel@@UAE@I@Z @ 50 NONAME ; CpCategorySettingFormModel::~CpCategorySettingFormModel(unsigned int)
+	?globalInstance@CpTaskExecutor@@SAPAV1@XZ @ 51 NONAME ; class CpTaskExecutor * CpTaskExecutor::globalInstance(void)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpcategorymodel/eabi/cpcategorymodelu.def	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,56 @@
+EXPORTS
+	_Z22createCpPluginItemDataP27CpCreatePluginItemDataEvent @ 1 NONAME
+	_ZN14CpTaskExecutor11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
+	_ZN14CpTaskExecutor11qt_metacastEPKc @ 3 NONAME
+	_ZN14CpTaskExecutor11removeTasksEv @ 4 NONAME
+	_ZN14CpTaskExecutor14globalInstanceEv @ 5 NONAME
+	_ZN14CpTaskExecutor16staticMetaObjectE @ 6 NONAME DATA 16
+	_ZN14CpTaskExecutor19getStaticMetaObjectEv @ 7 NONAME
+	_ZN14CpTaskExecutor21destroyGlobalInstanceEv @ 8 NONAME
+	_ZN14CpTaskExecutor3runEv @ 9 NONAME
+	_ZN14CpTaskExecutor4stopEv @ 10 NONAME
+	_ZN14CpTaskExecutor7runTaskEP6CpTaskb @ 11 NONAME
+	_ZN14CpTaskExecutor7toFrontEP6CpTask @ 12 NONAME
+	_ZN14CpTaskExecutorC1EP7QObject @ 13 NONAME
+	_ZN14CpTaskExecutorC2EP7QObject @ 14 NONAME
+	_ZN14CpTaskExecutorD0Ev @ 15 NONAME
+	_ZN14CpTaskExecutorD1Ev @ 16 NONAME
+	_ZN14CpTaskExecutorD2Ev @ 17 NONAME
+	_ZN26CpCategorySettingFormModel10initializeER16CpItemDataHelper @ 18 NONAME
+	_ZN26CpCategorySettingFormModel11qt_metacallEN11QMetaObject4CallEiPPv @ 19 NONAME
+	_ZN26CpCategorySettingFormModel11qt_metacastEPKc @ 20 NONAME
+	_ZN26CpCategorySettingFormModel16staticMetaObjectE @ 21 NONAME DATA 16
+	_ZN26CpCategorySettingFormModel19getStaticMetaObjectEv @ 22 NONAME
+	_ZN26CpCategorySettingFormModel25afterLoadingConfigPluginsER16CpItemDataHelper @ 23 NONAME
+	_ZN26CpCategorySettingFormModel26beforeLoadingConfigPluginsER16CpItemDataHelper @ 24 NONAME
+	_ZN26CpCategorySettingFormModelC1ERK7QString @ 25 NONAME
+	_ZN26CpCategorySettingFormModelC2ERK7QString @ 26 NONAME
+	_ZN26CpCategorySettingFormModelD0Ev @ 27 NONAME
+	_ZN26CpCategorySettingFormModelD1Ev @ 28 NONAME
+	_ZN26CpCategorySettingFormModelD2Ev @ 29 NONAME
+	_ZN29CpCategorySettingFormItemData10initializeER16CpItemDataHelper @ 30 NONAME
+	_ZN29CpCategorySettingFormItemData11qt_metacallEN11QMetaObject4CallEiPPv @ 31 NONAME
+	_ZN29CpCategorySettingFormItemData11qt_metacastEPKc @ 32 NONAME
+	_ZN29CpCategorySettingFormItemData16staticMetaObjectE @ 33 NONAME DATA 16
+	_ZN29CpCategorySettingFormItemData19getStaticMetaObjectEv @ 34 NONAME
+	_ZN29CpCategorySettingFormItemData25afterLoadingConfigPluginsER16CpItemDataHelper @ 35 NONAME
+	_ZN29CpCategorySettingFormItemData26beforeLoadingConfigPluginsER16CpItemDataHelper @ 36 NONAME
+	_ZN29CpCategorySettingFormItemDataC1EN19HbDataFormModelItem12DataItemTypeERK7QStringS4_PKS0_ @ 37 NONAME
+	_ZN29CpCategorySettingFormItemDataC1ERK7QStringPK19HbDataFormModelItem @ 38 NONAME
+	_ZN29CpCategorySettingFormItemDataC2EN19HbDataFormModelItem12DataItemTypeERK7QStringS4_PKS0_ @ 39 NONAME
+	_ZN29CpCategorySettingFormItemDataC2ERK7QStringPK19HbDataFormModelItem @ 40 NONAME
+	_ZN29CpCategorySettingFormItemDataD0Ev @ 41 NONAME
+	_ZN29CpCategorySettingFormItemDataD1Ev @ 42 NONAME
+	_ZN29CpCategorySettingFormItemDataD2Ev @ 43 NONAME
+	_ZNK14CpTaskExecutor10metaObjectEv @ 44 NONAME
+	_ZNK26CpCategorySettingFormModel10metaObjectEv @ 45 NONAME
+	_ZNK29CpCategorySettingFormItemData10metaObjectEv @ 46 NONAME
+	_ZTI14CpTaskExecutor @ 47 NONAME
+	_ZTI26CpCategorySettingFormModel @ 48 NONAME
+	_ZTI29CpCategorySettingFormItemData @ 49 NONAME
+	_ZTV14CpTaskExecutor @ 50 NONAME
+	_ZTV26CpCategorySettingFormModel @ 51 NONAME
+	_ZTV29CpCategorySettingFormItemData @ 52 NONAME
+	_ZThn8_N29CpCategorySettingFormItemDataD0Ev @ 53 NONAME
+	_ZThn8_N29CpCategorySettingFormItemDataD1Ev @ 54 NONAME
+
--- a/controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpcategorymodel/src/cpcategorymodelutility.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -19,9 +19,9 @@
 #include <QDir>
 #include <QFileInfo>
 #include <hbinstance.h>
-#include <cpbasepath.h>
 #include <cppluginloader.h>
 #include <cpplugininterface.h>
+#include <cpbasepath.h>
 #include <cplogger.h>
 #include <cpevent.h>
 #include <cptaskexecutor.h>
@@ -214,11 +214,7 @@
     }
     if (entryItemData->iconName().isEmpty()) {
         entryItemData->setIconName(
-                  CP_RESOURCE_PATH
-                  + QDir::separator() 
-                  + ICON_SUB_PATH 
-                  + QDir::separator() 
-                  + QLatin1String("qgn_prop_set_default_sub.svg") );
+                QLatin1String(":/icon/qgn_prop_set_default_sub.svg") );
     }
     
     return true;
--- a/controlpanelui/src/cpplugins/communicationplugin/communicationplugin.pro	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/communicationplugin/communicationplugin.pro	Thu Jul 22 16:34:01 2010 +0100
@@ -26,6 +26,7 @@
 
 symbian { 
     TARGET.UID3 = 0x20025FDF
+    LIBS +=  -lxqsettingsmanager
 }
 
 symbian { 
--- a/controlpanelui/src/cpplugins/communicationplugin/data/cpcommunicationplugin.cpcfg	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/communicationplugin/data/cpcommunicationplugin.cpcfg	Thu Jul 22 16:34:01 2010 +0100
@@ -13,7 +13,10 @@
   <plugin displayname = "Telephony" id = "0X20029F23"  dll = "cptelephonyplugin.dll">
     <desc></desc>
   </plugin>
-    <plugin displayname = "Network settings" id = "0X2002BC8F"  dll = "cpipsettingsplugin.dll">
+  <plugin displayname = "Network settings" id = "0X2002BC8F"  dll = "cpipsettingsplugin.dll">
+    <desc></desc>
+  </plugin>
+  <plugin displayname = "NFC" id = "0X20027040"  dll = "nfccpplugin.dll">
     <desc></desc>
   </plugin>
 </childplugins>
\ No newline at end of file
--- a/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -16,10 +16,16 @@
  */
 #include "cpcommunicationgroupitemdata.h"
 #include <QStringList>
+#include <QtAlgorithms>
+#include <CoreApplicationUIsSDKCRKeys.h>
+#include <xqsettingsmanager.h>
+#include <cpitemdatahelper.h>
 
 CpCommunicationGroupItemData::CpCommunicationGroupItemData(const QString &configFile,
                                                            const HbDataFormModelItem *parent):
-CpCategorySettingFormItemData(configFile,parent)
+                                                           CpCategorySettingFormItemData(configFile,parent),
+                                                           mAirplaneModeItem(0),
+                                                           mSettingManager(new XQSettingsManager())
 {
 
 }
@@ -28,24 +34,64 @@
                                                            const QString &label,
                                                            const QString &configFile,
                                                            const HbDataFormModelItem *parent):
-CpCategorySettingFormItemData(type, label, configFile, parent)
+                                                           CpCategorySettingFormItemData(type, label, configFile, parent),
+                                                           mAirplaneModeItem(0),
+                                                           mSettingManager(new XQSettingsManager())
 {
 
 }
+
 CpCommunicationGroupItemData::~CpCommunicationGroupItemData()
 {
+    delete mSettingManager;
+}
+
+void CpCommunicationGroupItemData::beforeLoadingConfigPlugins(CpItemDataHelper &itemDataHelper)
+{
+    mAirplaneModeItem = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem);
+    mAirplaneModeItem->setDescription(hbTrId("txt_cp_info_in_offline_mode_all_wireless_communica"));
+    
+    itemDataHelper.addConnection(mAirplaneModeItem,
+            SIGNAL(clicked()),
+            this,
+            SLOT(toggleAirplaneMode()));
+    
+    XQCentralRepositorySettingsKey key(KCRUidCoreApplicationUIs.iUid,KCoreAppUIsNetworkConnectionAllowed);
+    QVariant airplaneMode = mSettingManager->readItemValue(key,XQSettingsManager::TypeInt);
+    settingValueChanged(key,airplaneMode);
+    
+    mSettingManager->startMonitoring(key,XQSettingsManager::TypeInt);
+    connect(mSettingManager, SIGNAL(valueChanged (XQSettingsKey, QVariant)),
+            this, SLOT(settingValueChanged(XQSettingsKey, QVariant)));
+    
+    this->appendChild(mAirplaneModeItem);
     
 }
-void CpCommunicationGroupItemData::beforeLoadingConfigPlugins(CpItemDataHelper &/*itemDataHelper*/)
+
+void CpCommunicationGroupItemData::toggleAirplaneMode()
+{
+    XQCentralRepositorySettingsKey key(KCRUidCoreApplicationUIs.iUid,KCoreAppUIsNetworkConnectionAllowed);
+    QVariant airplaneMode = mSettingManager->readItemValue(key,XQSettingsManager::TypeInt);
+        
+    airplaneMode.setValue( static_cast<int> (!airplaneMode.toBool()) );
+
+    mSettingManager->writeItemValue(key,airplaneMode);
+}
+
+void CpCommunicationGroupItemData::settingValueChanged(const XQSettingsKey &key, const QVariant &value)
 {
-    HbDataFormModelItem *airPlaneMode = new HbDataFormModelItem(HbDataFormModelItem::ToggleValueItem,
-                                                                tr("Offline mode"));
-    QStringList airModeList;
-    airModeList << QObject::tr("On") << QObject::tr("Off");
-    
-    airPlaneMode->setContentWidgetData("text",airModeList.at(1));
-    airPlaneMode->setContentWidgetData("additionalText",airModeList.at(0));
+    if (mAirplaneModeItem 
+        && key.uid() == KCRUidCoreApplicationUIs.iUid 
+        && key.key() == KCoreAppUIsNetworkConnectionAllowed 
+        && value.isValid()) {
+        QString text = hbTrId("txt_cp_setlabel_offline_mode_val_on");
+        QString additionalText = hbTrId("txt_cp_setlabel_offline_mode_val_off");
+        if (ECoreAppUIsNetworkConnectionAllowed == value.toInt()) {
+            ::qSwap (text, additionalText);
+        }
+        mAirplaneModeItem->setContentWidgetData("text",text);
+        mAirplaneModeItem->setContentWidgetData("additionalText",additionalText);
+    }
+}
 
-    this->appendChild(airPlaneMode);
-    
-}
+//End of File
--- a/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationgroupitemdata.h	Thu Jul 22 16:34:01 2010 +0100
@@ -19,8 +19,12 @@
 
 #include <cpcategorysettingformitemdata.h>
 class CpItemDataHelper;
+class XQSettingsManager;
+class XQSettingsKey;
+
 class CpCommunicationGroupItemData: public CpCategorySettingFormItemData
 {
+    Q_OBJECT
 public:
     explicit CpCommunicationGroupItemData(const QString &configFile = QString(),
         const HbDataFormModelItem *parent = 0);
@@ -31,7 +35,13 @@
         const HbDataFormModelItem *parent = 0);
 
     ~CpCommunicationGroupItemData();
+private slots:
+    void toggleAirplaneMode();
+    void settingValueChanged(const XQSettingsKey &key, const QVariant &value);
 private:
     virtual void beforeLoadingConfigPlugins(CpItemDataHelper &itemDataHelper);
+private:
+     HbDataFormModelItem *mAirplaneModeItem;  
+     XQSettingsManager *mSettingManager;
 };
 #endif /* CPCOMMUNICATIONGROUPITEMDATA_H */
--- a/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationplugin.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/communicationplugin/src/cpcommunicationplugin.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -32,7 +32,7 @@
     CpCategorySettingFormItemData *itemData = 
             new CpCommunicationGroupItemData(
             HbDataFormModelItem::GroupItem,
-            QString("Connectivity"),
+            hbTrId("txt_cp_subhead_connectivity"),
             QString("cpcommunicationplugin.cpcfg") );
     return QList<CpSettingFormItemData*>() << itemData;
 }
--- a/controlpanelui/src/cpplugins/deviceplugin/data/cpdeviceplugin.cpcfg	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/deviceplugin/data/cpdeviceplugin.cpcfg	Thu Jul 22 16:34:01 2010 +0100
@@ -3,17 +3,17 @@
   <plugin displayname = "Time &amp; data" id = "0X102818E9"  dll = "datetimesettingsplugin.dll">
     <desc></desc>
   </plugin>
-  <plugin displayname = "Language" id = "0X0"  dll = "TBD">
+  <plugin displayname = "Language and region" id = "0X2002873C"  dll = "cplanguageplugin.dll">
     <desc></desc>
   </plugin>
-  <plugin displayname = "Text and keyboard" id = "0X0"  dll = "TBD">
+  <plugin displayname = "Text and keyboard" id = "0X20025FDD"  dll = "cpinputsettingplugin.dll">
     <desc></desc>
   </plugin>
   <plugin displayname = "Positioning" id = "0x2002C318"  dll = "possettingsplugin.dll">
     <desc></desc>
   </plugin>
-   <plugin displayname = "Voice commands" id = "0X0"  dll = "TBD">
-    <desc></desc>
+  <plugin displayname = "Power management" id = "0x2000E51E" dll = "cppsmplugin.dll">
+    <desc>power save mode </desc>
   </plugin> 
   <plugin displayname = "Device updates" id = "0X2002DD04"  dll = "deviceupdatesplugin.dll">
     <desc></desc>
@@ -21,7 +21,7 @@
   <plugin displayname = "Reset" id = "0x10275117"  dll = "cprfsplugin.dll">
     <desc></desc>
   </plugin> 
-  <plugin displayname = "About" id = "0X0"  dll = "TBD">
+  <plugin displayname = "About" id = "0X2002873B"  dll = "cpaboutplugin.dll">
     <desc></desc>
   </plugin> 
 </childplugins>
\ No newline at end of file
--- a/controlpanelui/src/cpplugins/deviceplugin/src/cpdeviceplugin.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/deviceplugin/src/cpdeviceplugin.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -32,7 +32,7 @@
     CpCategorySettingFormItemData *itemData = 
             new CpCategorySettingFormItemData(
             HbDataFormModelItem::GroupItem,
-            tr("Device"),
+            hbTrId("txt_cp_subhead_device"),
             QString("cpdeviceplugin.cpcfg") );
     return QList<CpSettingFormItemData*>() << itemData;
 }
--- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenconstants.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenconstants.h	Thu Jul 22 16:34:01 2010 +0100
@@ -18,16 +18,6 @@
 #ifndef CPKEYSCREENCONSTANTS_H
 #define CPKEYSCREENCONSTANTS_H
 
-enum KeyscreenLockItems{
-    EKeyScreenLockItem1,
-    EKeyScreenLockItem2,
-    EKeyScreenLockItem3,
-    EKeyScreenLockItem4,
-    EKeyScreenLockItem5
-};
-
-const int KCpKeyscreenTimeCoeff = 15;
-
 const int KCpKeyscreenLock15s = 15;
 const int KCpKeyscreenLock30s = 30;
 const int KCpKeyscreenLock45s = 45;
--- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenplugin.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenplugin.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -29,8 +29,11 @@
 QList<CpSettingFormItemData*> CpKeyScreenPlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
 {
     CpSettingFormItemData* itemData = new CpSettingFormEntryItemDataImpl<CpKeyScreenView>(
+            CpSettingFormEntryItemData::ListEntryItem,  // item type
 			itemDataHelper,
-			hbTrId("Keys & screen"));
+			hbTrId("txt_cp_list_keys_screen"),  // text
+			QString(" "),                       // description
+			"qtg_large_key_screen");            // icon name
     return QList<CpSettingFormItemData*>() << itemData;
 }
 
--- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -25,18 +25,27 @@
 #include <hbdataformmodel.h>
 #include <cpsettingformitemdata.h>
 #include <hbmessagebox.h>
+#include <hbslider.h>
 
 
 CpKeyScreenView::CpKeyScreenView(QGraphicsItem *parent) :
     CpBaseSettingView(0,parent),
-    mScreenRadioButton(0),
+    mScreenComboButton(0),
     mRotateCheckbox(0),
 	mBrightSliderItem(0),
 	mCallibItem(0),
 	mModel(0)
-{
+{   
     HbDataForm *form = qobject_cast<HbDataForm*> ( widget() );
     if (form) {
+        // Valid range is:
+        // 15 secs, 30 secs, 45 secs, 1 min, 2 mins
+        mScreenLockValues.insert(KCpKeyscreenLock15s,hbTrId("txt_cp_setlabel_keys_screen_val_15_seconds"));
+        mScreenLockValues.insert(KCpKeyscreenLock30s,hbTrId("txt_cp_setlabel_keys_screen_val_30_seconds"));
+        mScreenLockValues.insert(KCpKeyscreenLock45s,hbTrId("txt_cp_setlabel_keys_screen_val_45_seconds"));
+        mScreenLockValues.insert(KCpKeyscreenLock60s,hbTrId("txt_cp_setlabel_keys_screen_val_1_minute"));
+        mScreenLockValues.insert(KCpKeyscreenLock120s,hbTrId("txt_cp_setlabel_keys_screen_val_2_minutes"));
+        
         form->setHeading(hbTrId("txt_cp_subhead_keys_screen"));
         mModel = new CpKeyScreenModel();
         HbDataFormModel *model = new HbDataFormModel;
@@ -51,9 +60,9 @@
 
         makeBrightnessItem(*model);
 
-        if ( mModel->isCallibrationSupported() ) {
+       /* if ( mModel->isCallibrationSupported() ) {
             makeCallibrationItem(*model);
-        }
+        }*/
 
         form->setModel(model);
     }
@@ -61,30 +70,36 @@
 
 void CpKeyScreenView::makeScreenItem(HbDataFormModel& model)
 {
-    mScreenRadioButton = new CpSettingFormItemData(HbDataFormModelItem::RadioButtonListItem,
-            hbTrId("txt_cp_setlabel_keys_screen_locked_after"));
-    qobject_cast<HbDataForm*> ( widget() )->addConnection(mScreenRadioButton,SIGNAL(itemSelected(int)),this,SLOT(screenValueChanged(int)));
-    model.appendDataFormItem(mScreenRadioButton, model.invisibleRootItem());
+    mScreenComboButton = new CpSettingFormItemData(HbDataFormModelItem::ComboBoxItem,
+            hbTrId("txt_cp_setlabel_keys_screen_locked_after"));    
+    
+    qobject_cast<HbDataForm*> ( widget() )->addConnection(
+            mScreenComboButton,SIGNAL(currentIndexChanged(QString)),
+            this,SLOT(screenValueChanged(QString)));
+    
+    model.appendDataFormItem(mScreenComboButton, model.invisibleRootItem());
 
-    // Valid range is:
-    // 15 secs, 30 secs, 45 secs, 1 min, 2 mins
-    QStringList sList;
-    sList<< hbTrId("txt_cp_setlabel_keys_screen_val_15_seconds")<< hbTrId("txt_cp_setlabel_keys_screen_val_30_seconds")
-         << hbTrId("txt_cp_setlabel_keys_screen_val_45_seconds")<< hbTrId("txt_cp_setlabel_keys_screen_val_1_minute")
-         << hbTrId("txt_cp_setlabel_keys_screen_val_2_minutes");
     int period = mModel->keyguard();
-    int selectedIndex = period/KCpKeyscreenTimeCoeff - 1;
-    if ( KCpKeyscreenLock120s == period ){ // 2 minutes
-        selectedIndex = EKeyScreenLockItem5;
+    
+    int selectedIndex(-1);    
+    
+    QMap<int,QString>::iterator it = mScreenLockValues.find(period);
+    if (it == mScreenLockValues.end()) {
+        mModel->setKeyguard(KCpKeyscreenLockDefault30s); // Set keyguard and backlight period to default
+        selectedIndex = 1;
     }
-    if ( (KCpKeyscreenLock15s != period) && (KCpKeyscreenLock30s != period) && 
-            (KCpKeyscreenLock45s != period) && (KCpKeyscreenLock60s != period) && 
-            (KCpKeyscreenLock120s != period) ){
-        mModel->setKeyguard(KCpKeyscreenLockDefault30s);  // Set keyguard and backlight period to default
-        selectedIndex = EKeyScreenLockItem2;
+    else {
+        for (it = mScreenLockValues.begin();it != mScreenLockValues.end();++it) {
+            selectedIndex++;
+            if (it.key() == period) {
+                break;
+            }
+        }
     }
-    mScreenRadioButton->setContentWidgetData( QString("items"), sList );
-    mScreenRadioButton->setContentWidgetData( QString("selected"), selectedIndex);
+    
+    QStringList items = mScreenLockValues.values();
+    mScreenComboButton->setContentWidgetData( QString("items"), items );
+    mScreenComboButton->setContentWidgetData( QString("currentIndex"), selectedIndex);
 }
 
 void CpKeyScreenView::makeRotateItem(HbDataFormModel& model)
@@ -110,9 +125,17 @@
     qobject_cast<HbDataForm*> ( widget() )->addConnection(mBrightSliderItem,SIGNAL(valueChanged(int)),this,SLOT(brightValueChanged(int)));
     model.appendDataFormItem(mBrightSliderItem, model.invisibleRootItem());
 
+    QList<QVariant> sliderElements;
+    sliderElements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement)
+                   << QVariant(HbSlider::DecreaseElement);
+    mBrightSliderItem->setContentWidgetData("sliderElements",sliderElements);
     mBrightSliderItem->setContentWidgetData( QString("value"), mModel->brightness() );
     mBrightSliderItem->setContentWidgetData( QString("minimum"), 1 );
     mBrightSliderItem->setContentWidgetData( QString("maximum"), 5 );
+    QMap< QString, QVariant > iconElements;
+    iconElements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg"));
+    iconElements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") );
+    mBrightSliderItem->setContentWidgetData( QString( "elementIcons" ), iconElements );
 }
 
 void CpKeyScreenView::makeCallibrationItem(HbDataFormModel& model)
@@ -130,13 +153,15 @@
 	mModel = 0;
 }
 
-void CpKeyScreenView::screenValueChanged(int index)
-{
-    int period = (index + 1) * KCpKeyscreenTimeCoeff;
-    if (EKeyScreenLockItem5 == index){
-        period = KCpKeyscreenLock120s;
+void CpKeyScreenView::screenValueChanged(const QString &value)
+{    
+    for (QMap<int,QString>::iterator it = mScreenLockValues.begin();
+         it != mScreenLockValues.end();++it) {
+        if (it.value() == value) {
+            mModel->setKeyguard(it.key());
+            break;
+        }
     }
-    mModel->setKeyguard(period);
 }
 
 void CpKeyScreenView::rotateValueChanged(int value)
--- a/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/keytouchfdbkplugin/src/cpkeyscreenview.h	Thu Jul 22 16:34:01 2010 +0100
@@ -17,6 +17,7 @@
 #ifndef	CPKEYSCREENVIEW_H
 #define	CPKEYSCREENVIEW_H
 
+#include <QMap>
 #include <cpbasesettingview.h>
 #include <hbdataformmodelitem.h>
 
@@ -24,6 +25,8 @@
 class HbDataFormModel;
 class CpSettingFormItemData;
 class CpKeyScreenModel;
+class QPersistentModelIndex;
+class QVariant;
 
 class CpKeyScreenView : public CpBaseSettingView
 {
@@ -39,17 +42,18 @@
     void makeCallibrationItem(HbDataFormModel& model);
     
 private slots:
-    //need handling your member's value change
-    void screenValueChanged(int index);
+    void screenValueChanged(const QString&);
     void rotateValueChanged(int value);
     void brightValueChanged(int value);
     void launchCallib();
 
 private:
-    CpSettingFormItemData *mScreenRadioButton;
+    CpSettingFormItemData *mScreenComboButton;
     CpSettingFormItemData *mRotateCheckbox;
 	CpSettingFormItemData *mBrightSliderItem;
 	CpSettingFormItemData *mCallibItem;
 	CpKeyScreenModel* mModel;
+	
+	QMap<int,QString> mScreenLockValues;
 };
 #endif//	CPKEYSCREENVIEW_H
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationgroupitemdata.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -56,6 +56,9 @@
     CpSettingFormEntryItemData *advanceSettingItem = 
             new CpSettingFormEntryItemDataImpl<CpPersonalizationAdvanceView>(CpSettingFormEntryItemData::ButtonEntryItem,
             		itemDataHelper, hbTrId("txt_cp_button_advanced_settings"));
+    
+    advanceSettingItem->setContentWidgetData("textAlignment", QVariant( Qt::AlignHCenter | Qt::AlignVCenter) );
+    
     appendChild(advanceSettingItem);
     CPFW_LOG("CpPersonalizationGroupItemData::afterLoadingConfigPlugins(), END");
 }
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cppersonalizationplugin.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -35,7 +35,7 @@
     CpPersonalizationGroupItemData *personalItemData = 
             new CpPersonalizationGroupItemData(
             HbDataFormModelItem::GroupItem,
-            tr("Personalization"),
+            hbTrId("txt_cp_subhead_personalization"),
             QString("cppersonalizationplugin.cpcfg") );
 
     return QList<CpSettingFormItemData*>() << personalItemData;
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -30,7 +30,7 @@
 #include <QModelIndex>
 #include <QMap>
 
-#include <XQSettingsManager.h>
+#include <xqsettingsmanager.h>
 #include <ProfileEngineInternalCRKeys.h>
 
 CpProfileSettingForm::CpProfileSettingForm()
@@ -102,7 +102,7 @@
     //ring tone item
     QFileInfo ringToneFileInfo( profileSettings.mRingTone );
     HbDataFormModelItem *modelItem = new CpPersonalizationEntryItemData( *mItemDataHelper,
-            hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), mFileIconProvider->icon( ringToneFileInfo ),
+            hbTrId("txt_cp_dblist_ringtone"), ringToneFileInfo.fileName(), "qtg_large_ring_tone",
             CpPersonalizationEntryItemData::TONE_Ring, profileId );
     mModel->appendDataFormItem(modelItem, parent);
     modelItems.insert(ProfileItemRingTone,modelItem);
@@ -110,7 +110,7 @@
     //message tone item
     QFileInfo messageToneFileInfo( profileSettings.mMessageTone );
     modelItem = new CpPersonalizationEntryItemData( *mItemDataHelper,
-            hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), mFileIconProvider->icon( messageToneFileInfo ),
+            hbTrId("txt_cp_dblist_message_tone"), messageToneFileInfo.fileName(), "qtg_large_message",
             CpPersonalizationEntryItemData::TONE_Message,
             profileId );
     mModel->appendDataFormItem(modelItem , parent);
@@ -119,7 +119,7 @@
     //email tone item
     QFileInfo emailToneFileInfo( profileSettings.mEmailTone );
     modelItem = new CpPersonalizationEntryItemData( *mItemDataHelper,
-            hbTrId("txt_cp_dblist_email_tone"),  emailToneFileInfo.fileName(), mFileIconProvider->icon( emailToneFileInfo ),
+            hbTrId("txt_cp_dblist_email_tone"),  emailToneFileInfo.fileName(), "qtg_large_email",
             CpPersonalizationEntryItemData::TONE_Email,
             profileId );
     mModel->appendDataFormItem(modelItem , parent);
@@ -128,7 +128,7 @@
     //reminder tone item
     QFileInfo reminderToneFileInfo( profileSettings.mReminderTone );
     modelItem = new CpPersonalizationEntryItemData( *mItemDataHelper,
-            hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), mFileIconProvider->icon( reminderToneFileInfo ),
+            hbTrId("txt_cp_dblist_reminder_tone"), reminderToneFileInfo.fileName(), "qtg_large_calendar",
             CpPersonalizationEntryItemData::TONE_Reminder,
             profileId );
     mModel->appendDataFormItem(modelItem , parent);
@@ -188,9 +188,18 @@
     //Touch Screen Vibra item
     modelItem = mModel->appendDataFormItem( HbDataFormModelItem::SliderItem, QString( hbTrId( "txt_cp_setlabel_touch_screen_vibra" ) ), parent );
      //TODO: profileModel need provide Max and Min value( 0-5 ), current max value from profileModel is 3
+    sliderElements.clear();
+    sliderElements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement)
+                << QVariant(HbSlider::DecreaseElement);
+    modelItem->setContentWidgetData("sliderElements",sliderElements);
+        
     modelItem->setContentWidgetData( QString( "minimum" ), 0 );
     modelItem->setContentWidgetData( QString( "maximum" ), 5 );
     modelItem->setContentWidgetData( QString("value"), profileSettings.mKeyTouchScreenVibra );
+    QMap< QString, QVariant > iconElements;
+    iconElements.insert(QString("IncreaseElement") , QVariant(":/icon/hb_vol_slider_increment.svg"));
+    iconElements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg") );
+    modelItem->setContentWidgetData( QString( "elementIcons" ), iconElements );
     
     if (profileId == EProfileWrapperGeneralId) {
         addConnection( modelItem, SIGNAL( valueChanged( int )), this, SLOT( on_general_screenVibra_ValueChanged( int )));
@@ -410,18 +419,7 @@
     HbDataFormModelItem *modelItem = profileItem(EProfileWrapperGeneralId,ProfileItemKeyandTouchScreenTones);
     if (modelItem) {
         modelItem->setContentWidgetData( QString("value"), value );
-        QMap< QString, QVariant > elements;
-        if (value != 0) {      
-            elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg"));
-            elements.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg"));
-            elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg") );            
-        }
-        else {
-            elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg"));
-            elements.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg"));
-            elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") );  
-        }
-        modelItem->setContentWidgetData( QString( "elementIcons" ), elements );            
+        setMuteIcon(modelItem, (value == 0) );            
     }
 }
 
@@ -472,18 +470,7 @@
     HbDataFormModelItem *modelItem = profileItem(EProfileWrapperMeetingId,ProfileItemKeyandTouchScreenTones);
     if (modelItem) {
         modelItem->setContentWidgetData( QString("value"), value );
-        QMap< QString, QVariant > elements;
-        if (value != 0) {
-            elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg"));
-            elements.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg"));
-            elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg") );            
-        }
-        else {
-            elements.insert(QString("DecreaseElement"), QVariant(":/icon/hb_vol_slider_decrement.svg"));
-            elements.insert(QString("IncreaseElement"), QVariant(":/icon/hb_vol_slider_increment.svg"));
-            elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg") );  
-        }
-        modelItem->setContentWidgetData( QString( "elementIcons" ), elements );            
+        setMuteIcon(modelItem, (value == 0) );            
     }
 }
 
@@ -548,7 +535,13 @@
             for (int i = 0; i < sizeof(silenceSensitiveModelItemIds)/sizeof(silenceSensitiveModelItemIds[0]);++i) {           
                 QHash<int,HbDataFormModelItem*>::const_iterator found = it.value().find(silenceSensitiveModelItemIds[i]);
                 if (found != it.value().end()) {
-                    found.value()->setEnabled(!value.toBool());
+                    if (found.key() == CpProfileSettingForm::ProfileItemKeyandTouchScreenTones) {
+                        int currentValue = found.value()->contentWidgetData("value").toInt();
+                        // change the mute icon when the silence mode is changed
+                        bool isMute = value.toBool() || (currentValue == 0);
+                        setMuteIcon(found.value(), isMute); 
+                    } 
+                    found.value()->setEnabled(!value.toBool());                             
                 }
             }   
         }
@@ -560,4 +553,30 @@
     return mProfileModelItems.value(profileId).value(profileItemId);
 }
 
+/*!
+ *  Set the slider icon to mute or unmute
+ *  @param isMute: identified the icon of slider, mute or unmute
+ *  @param profileId: identified which slider should be changed
+ */
+
+void CpProfileSettingForm::setMuteIcon(HbDataFormModelItem *sliderItem, bool isMute)
+{
+    if (sliderItem == 0) {
+        return;
+    }
+    //VolumeSliderItem will be depreacted, so ignore the assert about it
+    if (sliderItem->type() != HbDataFormModelItem::SliderItem) {
+        return;
+    }
+    
+    QMap<QString, QVariant> elements = sliderItem->contentWidgetData("elementIcons").toMap();
+    
+    if (isMute) {        
+        elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_muted.svg"));
+    }
+    else {
+        elements.insert(QString("IconElement"), QVariant(":/icon/hb_vol_slider_unmuted.svg"));
+    }
+    sliderItem->setContentWidgetData( QString( "elementIcons" ), elements ); 
+}
 //End of File
--- a/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/personalizationplugin/src/cpprofilesettingform.h	Thu Jul 22 16:34:01 2010 +0100
@@ -89,6 +89,7 @@
     
     void initProfileItems(int profileId,HbDataFormModelItem *parent);
     HbDataFormModelItem *profileItem(int profileId,int profileItemId);
+    void setMuteIcon(HbDataFormModelItem *silderItem, bool isMute);
 private:
     HbDataFormModel *mModel;
     CpItemDataHelper *mItemDataHelper;
--- a/controlpanelui/src/cpplugins/privacyplugin/data/cpprivacyplugin.cpcfg	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/privacyplugin/data/cpprivacyplugin.cpcfg	Thu Jul 22 16:34:01 2010 +0100
@@ -3,11 +3,11 @@
     <desc></desc>
   </plugin> 
   
-  <plugin displayname = "Device lock" id = "0X2002E683"  dll = "cpdevicelockplugin.dll">
+  <plugin displayname = "Device lock" id = "0X2002E683"  dll = "devicelockplugin.dll">
     <desc></desc>
   </plugin> 
   
-  <plugin displayname = "Advanced security" id = "0X0"  dll = "TBD">
+  <plugin displayname = "Advanced security" id = "0X2002E684"  dll = "cpadvancedsecplugin.dll">
     <desc></desc>
   </plugin> 
   
--- a/controlpanelui/src/cpplugins/privacyplugin/src/cpprivacyplugin.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/privacyplugin/src/cpprivacyplugin.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -34,7 +34,7 @@
     CpCategorySettingFormItemData *itemData = 
             new CpCategorySettingFormItemData(
             HbDataFormModelItem::GroupItem,
-            tr("Security"),
+            hbTrId("txt_cp_subhead_security"),
             QString("cpprivacyplugin.cpcfg") );
     return QList<CpSettingFormItemData*>() << itemData;
 }
--- a/controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pro	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/profileactivatorplugin.pro	Thu Jul 22 16:34:01 2010 +0100
@@ -27,4 +27,5 @@
     TARGET.UID3 = 0X20028739
     TARGET.CAPABILITY = All -TCB 
     TARGET.EPOCALLOWDLLDATA = 1
+    LIBS +=  -lprofileeng
 }
--- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -20,7 +20,11 @@
 #include <hbaction.h>
 #include <hbdataformmodelitem.h>
 #include <hbpopup.h>
+#include <hblabel.h>
 #include "cpprofileactivatorentryitem.h"
+#include <QGraphicsLinearLayout>
+#include <QGraphicsWidget>
+
 CpProfileActivatorDialog::CpProfileActivatorDialog(CpSettingFormItemData *profileActivator,
                                                     CpProfileModel &profileModel,
                                                     QGraphicsItem *parent):HbDialog(parent),
@@ -28,11 +32,19 @@
                                                      mProfileList(0),
                                                      mProfileActivator(profileActivator)
 {
+    mTitleLabel = new HbLabel(this);
+    mTitleLabel->setPlainText(hbTrId("txt_cp_title_profile"));
+    mContentWidget = new QGraphicsWidget(this);
+    setContentWidget(mContentWidget);
+    mLayout = new QGraphicsLinearLayout();
+    mLayout->setOrientation( Qt::Vertical );
     mProfileIds << EProfileWrapperGeneralId
                 << EProfileWrapperMeetingId;
     mProfileList = new HbRadioButtonList();
     mProfileList->setItems(profileModel.profileNames());
-    
+    mLayout->addItem(mTitleLabel);
+    mLayout->addItem(mProfileList);
+       
     int currentId = mProfileModel.activeProfileId();
     mProfileList->setSelected(mProfileIds.indexOf(static_cast<ProfileWrapperProfileId>(currentId)));
     
@@ -46,12 +58,11 @@
         
     
     this->addAction(mConfirmProfile);
-    this->addAction(mCancelProfile);
-    
-    this->setContentWidget(mProfileList);
+    this->addAction(mCancelProfile);    
     this->setModal(true);
     this->setDismissPolicy(HbPopup::NoDismiss);
     this->setTimeout(HbPopup::NoTimeout);
+    mContentWidget->setLayout( mLayout );
 }
 
 CpProfileActivatorDialog::~CpProfileActivatorDialog()
@@ -61,6 +72,9 @@
 void CpProfileActivatorDialog::confirmProfileSelection()
 {
     int currentIndex = mProfileList->selected();
+    if (currentIndex == -1) {
+        return;
+    }
     
     // the best choice is no need to convert the index to id
     mProfileModel.activateProfile(mProfileIds.at(currentIndex));
--- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatordialog.h	Thu Jul 22 16:34:01 2010 +0100
@@ -24,6 +24,9 @@
 class HbDataFormModelItem;
 class CpProfileActivatorEntryItem;
 class CpSettingFormItemData;
+class QGraphicsLinearLayout;
+class QGraphicsWidget;
+class HbLabel;
 
 class CpProfileActivatorDialog: public HbDialog
 {
@@ -44,5 +47,8 @@
     QPointer<HbAction> mConfirmProfile;
     QPointer<HbAction> mCancelProfile;
     QList<ProfileWrapperProfileId> mProfileIds;
+    QGraphicsLinearLayout *mLayout;
+    QGraphicsWidget *mContentWidget;
+    HbLabel *mTitleLabel;
 };
 #endif
--- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -20,23 +20,31 @@
 #include <cpitemdatahelper.h>
 #include <cpprofilemodel.h>
 #include <QScopedPointer>
+#include "cpprofilemonitor.h"
+
 CpProfileActivatorEntryItem::CpProfileActivatorEntryItem(CpItemDataHelper &itemDataHelper,
                 const QString &text,
                 const QString &description,
-                const HbIcon &icon,
+                const QString &icon,
                 const HbDataFormModelItem *parent)
-                :CpSettingFormEntryItemData(itemDataHelper,text,description,
-                                            icon,parent)
+                :CpSettingFormEntryItemData(CpSettingFormEntryItemData::ListEntryItem, itemDataHelper,text,description,
+                                            icon,parent),mProfileModel(0),mProfileMonitor(0)
 {
+    mProfileMonitor = new CpProfileMonitor();
     mProfileModel = new CpProfileModel();
+    
     int currentId = mProfileModel->activeProfileId();
     QString currentName = mProfileModel->profileName(currentId);
     this->setDescription(currentName);
+    connect(mProfileMonitor, SIGNAL(profileActivated(int)), this, SLOT(onProfileChanged(int)));        
 }
+
 CpProfileActivatorEntryItem::~CpProfileActivatorEntryItem()
 {
     delete mProfileModel;
+    delete mProfileMonitor;
 }
+
 void CpProfileActivatorEntryItem::onLaunchView()
 {
     CpProfileActivatorDialog *dialog = 
@@ -46,6 +54,12 @@
     dialog->show();
     
 }
+
+void CpProfileActivatorEntryItem::onProfileChanged(int activeProfileId)
+{
+    QString profileName = mProfileModel->profileName(activeProfileId);
+    this->setDescription(profileName);    
+}
 /*void CpPersonalizationEntryItemData::handleOk(const QVariant &result)
 {
     if (!result.canConvert<QString>())
--- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorentryitem.h	Thu Jul 22 16:34:01 2010 +0100
@@ -20,23 +20,27 @@
 #include <cpsettingformentryitemdata.h>
 
 class CpProfileModel;
+class CpProfileMonitor;
+
 class CpProfileActivatorEntryItem : public CpSettingFormEntryItemData
 {
 Q_OBJECT
 public:
     explicit CpProfileActivatorEntryItem(CpItemDataHelper &itemDataHelper,
             const QString &text = QString(), const QString &description =
-                    QString(), const HbIcon &icon = HbIcon(),
+                    QString(), const QString &icon = QString(),
             const HbDataFormModelItem *parent = 0);
     virtual ~CpProfileActivatorEntryItem();
 private slots:
     void onLaunchView();
+    void onProfileChanged(int activeProfileId);
     //void handleOk(const QVariant &result);
     //void handleError(int errorCode, const QString& errorMessage);
 private:
     virtual CpBaseSettingView *createSettingView() const;
 private:
     CpProfileModel *mProfileModel;
+    CpProfileMonitor *mProfileMonitor;
 };
 
 #endif // CPPROFILEACTIVATORENTRYITEM_H
--- a/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorplugin.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofileactivatorplugin.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -30,7 +30,9 @@
 {
     CpSettingFormItemData* itemData = new CpProfileActivatorEntryItem(
                                             itemDataHelper,
-                                            hbTrId("txt_cp_dblist_profile"));
+                                            hbTrId("txt_cp_dblist_profile"),
+                                            " ",
+                                            "qtg_large_profiles");
     return QList<CpSettingFormItemData*>() << itemData;
 }
 
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofilemonitor.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,38 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#include "cpprofilemonitor.h"
+
+#include <CProfileChangeNotifyHandler.h>
+
+CpProfileMonitor::CpProfileMonitor(QObject *parent)
+    :QObject(parent),mProfileNotifier(0)
+{
+    mProfileNotifier = CProfileChangeNotifyHandler::NewL(this);    
+}
+
+CpProfileMonitor::~CpProfileMonitor()
+{    
+    delete mProfileNotifier;        
+}
+
+void CpProfileMonitor::HandleActiveProfileEventL(TProfileEvent aProfileEvent, TInt aProfileId)
+{
+    if (EProfileNewActiveProfile == aProfileEvent) {
+        emit profileActivated(aProfileId);
+    }
+}
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpplugins/profileactivatorplugin/src/cpprofilemonitor.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,42 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0""
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ *
+ * Contributors:
+ *
+ * Description:  
+ *   
+ */
+
+#ifndef CPPROFILEMONITOR_H_
+#define CPPROFILEMONITOR_H_
+
+#include <QObject>
+#include <MProfileChangeObserver.h>
+
+class CProfileChangeNotifyHandler;
+
+class CpProfileMonitor: public QObject,public MProfileChangeObserver
+{
+    Q_OBJECT
+public:
+    explicit CpProfileMonitor(QObject *parent = 0);
+    ~CpProfileMonitor();
+signals:
+    void profileActivated(int activeProfileId);
+private:
+    virtual void HandleActiveProfileEventL(
+                TProfileEvent aProfileEvent, TInt aProfileId );
+
+private:
+    CProfileChangeNotifyHandler* mProfileNotifier;
+};
+
+#endif /* CPPROFILEMONITOR_H_ */
--- a/controlpanelui/src/cpplugins/ringtoneplugin/src/cppersonalizationentryitemdata.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/ringtoneplugin/src/cppersonalizationentryitemdata.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -31,11 +31,11 @@
 CpPersonalizationEntryItemData::CpPersonalizationEntryItemData(CpItemDataHelper &itemDataHelper,
                 const QString &text,
                 const QString &description,
-                const HbIcon &icon,
+                const QString &icon,
                 Profile_Tone_Types toneType,
                 int profileId,
                 const HbDataFormModelItem *parent)
-                :CpSettingFormEntryItemData( itemDataHelper,text,description,icon,parent),
+                :CpSettingFormEntryItemData(CpSettingFormEntryItemData::ListEntryItem, itemDataHelper,text,description,icon,parent),
                 mProfileModel(0),
                 m_profileID(profileId),
                 mToneType(toneType),
--- a/controlpanelui/src/cpplugins/ringtoneplugin/src/cppersonalizationentryitemdata.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/ringtoneplugin/src/cppersonalizationentryitemdata.h	Thu Jul 22 16:34:01 2010 +0100
@@ -38,7 +38,7 @@
         explicit CpPersonalizationEntryItemData(CpItemDataHelper &itemDataHelper,
                 const QString &text = QString(),
                 const QString &description = QString(),
-                const HbIcon &icon = HbIcon(),
+                const QString &icon = QString(),
                 Profile_Tone_Types toneType = TONE_Ring,
                 int profileId = -1,
                 const HbDataFormModelItem *parent = 0);
--- a/controlpanelui/src/cpplugins/ringtoneplugin/src/cpringtoneplugin.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/ringtoneplugin/src/cpringtoneplugin.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -27,9 +27,12 @@
 
 QList<CpSettingFormItemData*> CpRingTonePlugin::createSettingFormItemData(CpItemDataHelper &itemDataHelper) const
 {
-    CpPersonalizationEntryItemData *itemData = new CpPersonalizationEntryItemData(itemDataHelper,
-																		tr("Ring tone"),
-																		tr("Default ring tone"));
+    CpPersonalizationEntryItemData *itemData 
+        = new CpPersonalizationEntryItemData(
+                itemDataHelper,
+                hbTrId("txt_cp_dblist_ringtone"),
+				QString(""),
+				"qtg_large_ring_tone");
     return QList<CpSettingFormItemData*>() << itemData;
 }
 
--- a/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumecontroller.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -27,7 +27,7 @@
 //#include <hbslider.h>
 //#include <hbpushbutton.h>
 
-#include <XQSettingsManager.h>
+#include <xqsettingsmanager.h>
 #include <ProfileEngineInternalCRKeys.h>
 #include <ProfileInternal.hrh>
 
--- a/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpplugins/volumeplugin/src/cpvolumegroupitemdata.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -28,7 +28,7 @@
 #include <hbslider.h>
 
 CpVolumeGroupItemData::CpVolumeGroupItemData(CpItemDataHelper &itemDataHelper)
-: CpSettingFormItemData(HbDataFormModelItem::GroupItem,tr("txt_cp_subhead_volume")),//mSilenceIndicator(0),
+: CpSettingFormItemData(HbDataFormModelItem::GroupItem,hbTrId("txt_cp_subhead_volume")),//mSilenceIndicator(0),
                                                                                    //mMasterVolume(0),
                                                                                    //mMasterVibra(0),
                                                                                    mVolumeController(0),
@@ -57,7 +57,7 @@
     this->appendChild(silenceIndicator);
     
     HbDataFormModelItem *masterVolume = new HbDataFormModelItem(HbDataFormModelItem::SliderItem,
-                                            hbTrId("txt_cp_setlabel_volume"));
+                                            hbTrId("txt_cp_setlabel_ringing_volume"));
     mItemList.insert(CpVolumeGroupItemData::EVolumeMasterVolumeItem, masterVolume);
     QList<QVariant> elements;
     elements << QVariant(HbSlider::IncreaseElement) << QVariant(HbSlider::TrackElement)
@@ -76,11 +76,11 @@
     masterVolume->setContentWidgetData("majorTickInterval",1);
     masterVolume->setContentWidgetData("tickPosition",Hb::SliderTicksBelow);
 
-    QStringList tickLabels;
+    /*QStringList tickLabels;
     tickLabels<<hbTrId("txt_cp_setlabel_volume_val_soft")
               <<hbTrId("txt_cp_setlabel_volume_val_med")
               <<hbTrId("txt_cp_setlabel_volume_val_loud");
-    masterVolume->setContentWidgetData("majorTickLabels",tickLabels);
+    masterVolume->setContentWidgetData("majorTickLabels",tickLabels);*/
     
     masterVolume->setContentWidgetData("iconCheckable",false);
     this->appendChild(masterVolume);
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpprofilewrapper/bwins/cpprofilewrapperu.def	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,57 @@
+EXPORTS
+	?setKeyTouchScreenVibra@CpProfileModel@@QAEXHH@Z @ 1 NONAME ; void CpProfileModel::setKeyTouchScreenVibra(int, int)
+	?tr@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 2 NONAME ; class QString CpProfileModel::tr(char const *, char const *, int)
+	?setReminderVibra@CpProfileModel@@QAEXH_N@Z @ 3 NONAME ; void CpProfileModel::setReminderVibra(int, bool)
+	?offLineMode@CpProfileModel@@QBE_NXZ @ 4 NONAME ; bool CpProfileModel::offLineMode(void) const
+	?masterVibra@CpProfileModel@@QBE_NXZ @ 5 NONAME ; bool CpProfileModel::masterVibra(void) const
+	?ringTone@CpProfileModel@@QBE?AVQString@@XZ @ 6 NONAME ; class QString CpProfileModel::ringTone(void) const
+	?qt_metacast@CpProfileModel@@UAEPAXPBD@Z @ 7 NONAME ; void * CpProfileModel::qt_metacast(char const *)
+	?setRingTone@CpProfileModel@@QAEXABVQString@@@Z @ 8 NONAME ; void CpProfileModel::setRingTone(class QString const &)
+	?setReminderTone@CpProfileModel@@QAEXHABVQString@@@Z @ 9 NONAME ; void CpProfileModel::setReminderTone(int, class QString const &)
+	?trUtf8@CpProfileModel@@SA?AVQString@@PBD0@Z @ 10 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *)
+	?silenceMode@CpProfileModel@@QBE_NXZ @ 11 NONAME ; bool CpProfileModel::silenceMode(void) const
+	?reminderVibra@CpProfileModel@@QBE_NH@Z @ 12 NONAME ; bool CpProfileModel::reminderVibra(int) const
+	?setEmailTone@CpProfileModel@@QAEXHABVQString@@@Z @ 13 NONAME ; void CpProfileModel::setEmailTone(int, class QString const &)
+	?ringAlertVibra@CpProfileModel@@QBE_NH@Z @ 14 NONAME ; bool CpProfileModel::ringAlertVibra(int) const
+	?emailTone@CpProfileModel@@QBE?AVQString@@H@Z @ 15 NONAME ; class QString CpProfileModel::emailTone(int) const
+	?activeProfileId@CpProfileModel@@QBEHXZ @ 16 NONAME ; int CpProfileModel::activeProfileId(void) const
+	?masterVolume@CpProfileModel@@QBEHXZ @ 17 NONAME ; int CpProfileModel::masterVolume(void) const
+	?notificationTone@CpProfileModel@@QBE_NH@Z @ 18 NONAME ; bool CpProfileModel::notificationTone(int) const
+	?tr@CpProfileModel@@SA?AVQString@@PBD0@Z @ 19 NONAME ; class QString CpProfileModel::tr(char const *, char const *)
+	?getStaticMetaObject@CpProfileModel@@SAABUQMetaObject@@XZ @ 20 NONAME ; struct QMetaObject const & CpProfileModel::getStaticMetaObject(void)
+	?keyTouchScreenTone@CpProfileModel@@QBEHH@Z @ 21 NONAME ; int CpProfileModel::keyTouchScreenTone(int) const
+	?setRingTone@CpProfileModel@@QAEXHABVQString@@@Z @ 22 NONAME ; void CpProfileModel::setRingTone(int, class QString const &)
+	?reminderTone@CpProfileModel@@QBE?AVQString@@H@Z @ 23 NONAME ; class QString CpProfileModel::reminderTone(int) const
+	?profileName@CpProfileModel@@QBE?AVQString@@H@Z @ 24 NONAME ; class QString CpProfileModel::profileName(int) const
+	?setKeyTouchScreenTone@CpProfileModel@@QAEXHH@Z @ 25 NONAME ; void CpProfileModel::setKeyTouchScreenTone(int, int)
+	?setMasterVolume@CpProfileModel@@QAEXH@Z @ 26 NONAME ; void CpProfileModel::setMasterVolume(int)
+	?staticMetaObject@CpProfileModel@@2UQMetaObject@@B @ 27 NONAME ; struct QMetaObject const CpProfileModel::staticMetaObject
+	?activateProfile@CpProfileModel@@QAEHH@Z @ 28 NONAME ; int CpProfileModel::activateProfile(int)
+	?profileNames@CpProfileModel@@QBE?AVQStringList@@XZ @ 29 NONAME ; class QStringList CpProfileModel::profileNames(void) const
+	?setNotificationVibra@CpProfileModel@@QAEXH_N@Z @ 30 NONAME ; void CpProfileModel::setNotificationVibra(int, bool)
+	?setNotificationTone@CpProfileModel@@QAEXH_N@Z @ 31 NONAME ; void CpProfileModel::setNotificationTone(int, bool)
+	?metaObject@CpProfileModel@@UBEPBUQMetaObject@@XZ @ 32 NONAME ; struct QMetaObject const * CpProfileModel::metaObject(void) const
+	?setRingAlertVibra@CpProfileModel@@QAEXH_N@Z @ 33 NONAME ; void CpProfileModel::setRingAlertVibra(int, bool)
+	??0CpProfileModel@@QAE@PAVQObject@@@Z @ 34 NONAME ; CpProfileModel::CpProfileModel(class QObject *)
+	?emailVibra@CpProfileModel@@QBE_NH@Z @ 35 NONAME ; bool CpProfileModel::emailVibra(int) const
+	?setProfileSettings@CpProfileModel@@QAEHHAAVCpProfileSettings@@@Z @ 36 NONAME ; int CpProfileModel::setProfileSettings(int, class CpProfileSettings &)
+	?setEmailVibra@CpProfileModel@@QAEXH_N@Z @ 37 NONAME ; void CpProfileModel::setEmailVibra(int, bool)
+	?setOffLineMode@CpProfileModel@@QAEX_N@Z @ 38 NONAME ; void CpProfileModel::setOffLineMode(bool)
+	??1CpProfileModel@@UAE@XZ @ 39 NONAME ; CpProfileModel::~CpProfileModel(void)
+	?notificationVibra@CpProfileModel@@QBE_NH@Z @ 40 NONAME ; bool CpProfileModel::notificationVibra(int) const
+	?qt_metacall@CpProfileModel@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 41 NONAME ; int CpProfileModel::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?messageTone@CpProfileModel@@QBE?AVQString@@H@Z @ 42 NONAME ; class QString CpProfileModel::messageTone(int) const
+	?profileSettings@CpProfileModel@@QAEXHAAVCpProfileSettings@@@Z @ 43 NONAME ; void CpProfileModel::profileSettings(int, class CpProfileSettings &)
+	?d_func@CpProfileModel@@ABEPBVCpProfileModelPrivate@@XZ @ 44 NONAME ; class CpProfileModelPrivate const * CpProfileModel::d_func(void) const
+	?setSilenceMode@CpProfileModel@@QAEX_N@Z @ 45 NONAME ; void CpProfileModel::setSilenceMode(bool)
+	?setMessageVibra@CpProfileModel@@QAEXH_N@Z @ 46 NONAME ; void CpProfileModel::setMessageVibra(int, bool)
+	?keyTouchScreenVibra@CpProfileModel@@QBEHH@Z @ 47 NONAME ; int CpProfileModel::keyTouchScreenVibra(int) const
+	?d_func@CpProfileModel@@AAEPAVCpProfileModelPrivate@@XZ @ 48 NONAME ; class CpProfileModelPrivate * CpProfileModel::d_func(void)
+	?initiationFlag@CpProfileModel@@QAEHXZ @ 49 NONAME ; int CpProfileModel::initiationFlag(void)
+	?messageVibra@CpProfileModel@@QBE_NH@Z @ 50 NONAME ; bool CpProfileModel::messageVibra(int) const
+	??_ECpProfileModel@@UAE@I@Z @ 51 NONAME ; CpProfileModel::~CpProfileModel(unsigned int)
+	?ringTone@CpProfileModel@@QBE?AVQString@@H@Z @ 52 NONAME ; class QString CpProfileModel::ringTone(int) const
+	?trUtf8@CpProfileModel@@SA?AVQString@@PBD0H@Z @ 53 NONAME ; class QString CpProfileModel::trUtf8(char const *, char const *, int)
+	?setMessageTone@CpProfileModel@@QAEXHABVQString@@@Z @ 54 NONAME ; void CpProfileModel::setMessageTone(int, class QString const &)
+	?setMasterVibra@CpProfileModel@@QAEX_N@Z @ 55 NONAME ; void CpProfileModel::setMasterVibra(bool)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpprofilewrapper/eabi/cpprofilewrapperu.def	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,55 @@
+EXPORTS
+	_ZN14CpProfileModel11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
+	_ZN14CpProfileModel11qt_metacastEPKc @ 2 NONAME
+	_ZN14CpProfileModel11setRingToneERK7QString @ 3 NONAME
+	_ZN14CpProfileModel11setRingToneEiRK7QString @ 4 NONAME
+	_ZN14CpProfileModel12setEmailToneEiRK7QString @ 5 NONAME
+	_ZN14CpProfileModel13setEmailVibraEib @ 6 NONAME
+	_ZN14CpProfileModel14initiationFlagEv @ 7 NONAME
+	_ZN14CpProfileModel14setMasterVibraEb @ 8 NONAME
+	_ZN14CpProfileModel14setMessageToneEiRK7QString @ 9 NONAME
+	_ZN14CpProfileModel14setOffLineModeEb @ 10 NONAME
+	_ZN14CpProfileModel14setSilenceModeEb @ 11 NONAME
+	_ZN14CpProfileModel15activateProfileEi @ 12 NONAME
+	_ZN14CpProfileModel15profileSettingsEiR17CpProfileSettings @ 13 NONAME
+	_ZN14CpProfileModel15setMasterVolumeEi @ 14 NONAME
+	_ZN14CpProfileModel15setMessageVibraEib @ 15 NONAME
+	_ZN14CpProfileModel15setReminderToneEiRK7QString @ 16 NONAME
+	_ZN14CpProfileModel16setReminderVibraEib @ 17 NONAME
+	_ZN14CpProfileModel16staticMetaObjectE @ 18 NONAME DATA 16
+	_ZN14CpProfileModel17setRingAlertVibraEib @ 19 NONAME
+	_ZN14CpProfileModel18setProfileSettingsEiR17CpProfileSettings @ 20 NONAME
+	_ZN14CpProfileModel19getStaticMetaObjectEv @ 21 NONAME
+	_ZN14CpProfileModel19setNotificationToneEib @ 22 NONAME
+	_ZN14CpProfileModel20setNotificationVibraEib @ 23 NONAME
+	_ZN14CpProfileModel21setKeyTouchScreenToneEii @ 24 NONAME
+	_ZN14CpProfileModel22setKeyTouchScreenVibraEii @ 25 NONAME
+	_ZN14CpProfileModelC1EP7QObject @ 26 NONAME
+	_ZN14CpProfileModelC2EP7QObject @ 27 NONAME
+	_ZN14CpProfileModelD0Ev @ 28 NONAME
+	_ZN14CpProfileModelD1Ev @ 29 NONAME
+	_ZN14CpProfileModelD2Ev @ 30 NONAME
+	_ZNK14CpProfileModel10emailVibraEi @ 31 NONAME
+	_ZNK14CpProfileModel10metaObjectEv @ 32 NONAME
+	_ZNK14CpProfileModel11masterVibraEv @ 33 NONAME
+	_ZNK14CpProfileModel11messageToneEi @ 34 NONAME
+	_ZNK14CpProfileModel11offLineModeEv @ 35 NONAME
+	_ZNK14CpProfileModel11profileNameEi @ 36 NONAME
+	_ZNK14CpProfileModel11silenceModeEv @ 37 NONAME
+	_ZNK14CpProfileModel12masterVolumeEv @ 38 NONAME
+	_ZNK14CpProfileModel12messageVibraEi @ 39 NONAME
+	_ZNK14CpProfileModel12profileNamesEv @ 40 NONAME
+	_ZNK14CpProfileModel12reminderToneEi @ 41 NONAME
+	_ZNK14CpProfileModel13reminderVibraEi @ 42 NONAME
+	_ZNK14CpProfileModel14ringAlertVibraEi @ 43 NONAME
+	_ZNK14CpProfileModel15activeProfileIdEv @ 44 NONAME
+	_ZNK14CpProfileModel16notificationToneEi @ 45 NONAME
+	_ZNK14CpProfileModel17notificationVibraEi @ 46 NONAME
+	_ZNK14CpProfileModel18keyTouchScreenToneEi @ 47 NONAME
+	_ZNK14CpProfileModel19keyTouchScreenVibraEi @ 48 NONAME
+	_ZNK14CpProfileModel8ringToneEi @ 49 NONAME
+	_ZNK14CpProfileModel8ringToneEv @ 50 NONAME
+	_ZNK14CpProfileModel9emailToneEi @ 51 NONAME
+	_ZTI14CpProfileModel @ 52 NONAME
+	_ZTV14CpProfileModel @ 53 NONAME
+
--- a/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpprofilewrapper/src/cpprofilemodel_p.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -33,14 +33,14 @@
 #include <MProfileFeedbackSettings.h>
 #include <MProfileSetFeedbackSettings.h>
 #include <MProfilesNamesArray.h>
-#include <SettingsInternalCRKeys.h>
+#include <settingsinternalcrkeys.h>
 #include <hbglobal.h>
 #include <QtCore/QStringList>
 #include <MProfileExtended2.h>
 #include <MProfileSetExtraTones2.h>
 #include <MProfileExtraTones2.h>
 #include <MProfileVibraSettings.h>
-#include <MPRofileSetVibraSettings.h>
+#include <MProfileSetVibraSettings.h>
 #include <TProfileToneSettings.h>
 #include <hwrmvibrasdkcrkeys.h>
 #include <centralrepository.h>
@@ -142,9 +142,9 @@
     // so hard code here, wait for engine's correcting.
     switch (profileId) {
     case EProfileWrapperGeneralId:
-        return hbTrId("txt_cp_setlabel_active_profile_val_general");
+        return hbTrId("txt_cp_list_general");
     case EProfileWrapperMeetingId:
-        return hbTrId("txt_cp_setlabel_active_profile_val_meeting");
+        return hbTrId("txt_cp_list_meeting");
     default:
         return QString("");
     }
@@ -153,8 +153,8 @@
 {
     //hard code, until engine part support qt localized name
     QStringList nameList;
-    nameList<<hbTrId("txt_cp_setlabel_active_profile_val_general")
-            <<hbTrId("txt_cp_setlabel_active_profile_val_meeting");
+    nameList<<hbTrId("txt_cp_list_general")
+            <<hbTrId("txt_cp_list_meeting");
     return nameList;
 }
 
@@ -201,6 +201,7 @@
     profileSettings.mEmailTone = stringFromDescriptor(extTones.EmailAlertTone());
     profileSettings.mReminderTone = stringFromDescriptor(extTones.ReminderTone());
     profileSettings.mNotificationTone = toneSettings.iWarningAndGameTones;
+    // only use Keypad Volume as a base value for display in key & touch screen setting option
     profileSettings.mKeyTouchScreenTone = toneSettings.iKeypadVolume;
     
     profileSettings.mRingAlertVibra = vibraSettings.RingAlertVibra();
@@ -211,6 +212,11 @@
     profileSettings.mKeyTouchScreenVibra = feedbackSettings.TactileFeedback();
 						
 }
+/*!
+     set profile settings
+     \param profileId identify the profile
+     \param profileSettings value of profile options
+ */
 int CpProfileModelPrivate::setProfileSettings(int profileId, CpProfileSettings& profileSettings)
 {
     MProfileExtended2 *profileExtend = mProfileList.value(profileId);
@@ -224,7 +230,7 @@
             profileExtend->ProfileSetExtraSettings();
     MProfileSetFeedbackSettings &setFeedbackSettings =
             extraSettings.ProfileSetFeedbackSettings();
-    // ignore here, wait for the exception deal framework of qt-symbian
+    
     TRAP_IGNORE(
             setTones.SetRingingTone1L(*descriptorFromString(
                     profileSettings.mRingTone));
@@ -237,8 +243,12 @@
             )
     toneSettings.iWarningAndGameTones
             = profileSettings.mNotificationTone;
+    // Change the keypad volume and touch screen tone together
     toneSettings.iKeypadVolume
-            = static_cast<TProfileKeypadVolume> (profileSettings.mKeyTouchScreenTone);
+            = static_cast<TProfileKeypadVolume> (profileSettings.mKeyTouchScreenTone);    
+    setFeedbackSettings.SetAudioFeedback(
+            static_cast<TProfileAudioFeedback> (profileSettings.mKeyTouchScreenTone));
+   
     setVibraSettings.SetRingAlertVibra(profileSettings.mRingAlertVibra);
     setVibraSettings.SetMessageAlertVibra(profileSettings.mMessageVibra);
     setVibraSettings.SetEmailAlertVibra(profileSettings.mEmailVibra);
@@ -429,7 +439,10 @@
             mEngine->CommitChangeL(*profileExtend);
             ) 
 }
-
+/*!
+     return key & touch screen tone's value
+     \sa setKeyTouchScreenTone
+ */
 int CpProfileModelPrivate::keyTouchScreenTone(int profileId) const
 {
     MProfileExtended2 *profileExtend = mProfileList.value(profileId);
@@ -440,7 +453,12 @@
     int keyTouchScreenTone = toneSettings.iKeypadVolume;
     return keyTouchScreenTone;        
 }
-
+/*!
+     set key & touch screen tone
+     \param profileId identify the profile
+     \param level 0-5
+     \sa keyTouchScreenTone
+ */
 void CpProfileModelPrivate::setKeyTouchScreenTone(int profileId, int level)
 {
     MProfileExtended2 *profileExtend = mProfileList.value(profileId);                    
@@ -449,8 +467,16 @@
     TProfileToneSettings &toneSettings =
             setTones.SetToneSettings();
 
+    MProfileSetExtraSettings &extraSettings =
+                profileExtend->ProfileSetExtraSettings();
+    MProfileSetFeedbackSettings &setFeedbackSettings =
+                extraSettings.ProfileSetFeedbackSettings();
+
     toneSettings.iKeypadVolume
             = static_cast<TProfileKeypadVolume> (level);
+    
+    setFeedbackSettings.SetAudioFeedback(
+            static_cast<TProfileAudioFeedback> (level));
     TRAP_IGNORE (
             mEngine->CommitChangeL(*profileExtend);
     )    
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpringtoneview/bwins/cpringtoneviewu.def	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,20 @@
+EXPORTS
+	?tr@CpRingToneView@@SA?AVQString@@PBD0@Z @ 1 NONAME ; class QString CpRingToneView::tr(char const *, char const *)
+	?selOK@CpRingToneView@@IAEXABVQString@@@Z @ 2 NONAME ; void CpRingToneView::selOK(class QString const &)
+	??1CpRingToneView@@UAE@XZ @ 3 NONAME ; CpRingToneView::~CpRingToneView(void)
+	?getStaticMetaObject@CpRingToneView@@SAABUQMetaObject@@XZ @ 4 NONAME ; struct QMetaObject const & CpRingToneView::getStaticMetaObject(void)
+	?handleError@CpRingToneView@@AAEXHABVQString@@@Z @ 5 NONAME ; void CpRingToneView::handleError(int, class QString const &)
+	?launchMediaFetcher@CpRingToneView@@AAEXABVQString@@0@Z @ 6 NONAME ; void CpRingToneView::launchMediaFetcher(class QString const &, class QString const &)
+	?selError@CpRingToneView@@IAEXHABVQString@@@Z @ 7 NONAME ; void CpRingToneView::selError(int, class QString const &)
+	?trUtf8@CpRingToneView@@SA?AVQString@@PBD0H@Z @ 8 NONAME ; class QString CpRingToneView::trUtf8(char const *, char const *, int)
+	?qt_metacall@CpRingToneView@@UAEHW4Call@QMetaObject@@HPAPAX@Z @ 9 NONAME ; int CpRingToneView::qt_metacall(enum QMetaObject::Call, int, void * *)
+	?staticMetaObject@CpRingToneView@@2UQMetaObject@@B @ 10 NONAME ; struct QMetaObject const CpRingToneView::staticMetaObject
+	?metaObject@CpRingToneView@@UBEPBUQMetaObject@@XZ @ 11 NONAME ; struct QMetaObject const * CpRingToneView::metaObject(void) const
+	?tr@CpRingToneView@@SA?AVQString@@PBD0H@Z @ 12 NONAME ; class QString CpRingToneView::tr(char const *, char const *, int)
+	??0CpRingToneView@@QAE@PAVQGraphicsItem@@@Z @ 13 NONAME ; CpRingToneView::CpRingToneView(class QGraphicsItem *)
+	?itemActivated@CpRingToneView@@AAEXABVQModelIndex@@@Z @ 14 NONAME ; void CpRingToneView::itemActivated(class QModelIndex const &)
+	??_ECpRingToneView@@UAE@I@Z @ 15 NONAME ; CpRingToneView::~CpRingToneView(unsigned int)
+	?trUtf8@CpRingToneView@@SA?AVQString@@PBD0@Z @ 16 NONAME ; class QString CpRingToneView::trUtf8(char const *, char const *)
+	?handleOk@CpRingToneView@@AAEXABVQVariant@@@Z @ 17 NONAME ; void CpRingToneView::handleOk(class QVariant const &)
+	?qt_metacast@CpRingToneView@@UAEPAXPBD@Z @ 18 NONAME ; void * CpRingToneView::qt_metacast(char const *)
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/cpringtoneview/eabi/cpringtoneviewu.def	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,24 @@
+EXPORTS
+	_ZN14CpRingToneView11handleErrorEiRK7QString @ 1 NONAME
+	_ZN14CpRingToneView11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
+	_ZN14CpRingToneView11qt_metacastEPKc @ 3 NONAME
+	_ZN14CpRingToneView13itemActivatedERK11QModelIndex @ 4 NONAME
+	_ZN14CpRingToneView16staticMetaObjectE @ 5 NONAME DATA 16
+	_ZN14CpRingToneView18launchMediaFetcherERK7QStringS2_ @ 6 NONAME
+	_ZN14CpRingToneView19getStaticMetaObjectEv @ 7 NONAME
+	_ZN14CpRingToneView5selOKERK7QString @ 8 NONAME
+	_ZN14CpRingToneView8handleOkERK8QVariant @ 9 NONAME
+	_ZN14CpRingToneView8selErrorEiRK7QString @ 10 NONAME
+	_ZN14CpRingToneViewC1EP13QGraphicsItem @ 11 NONAME
+	_ZN14CpRingToneViewC2EP13QGraphicsItem @ 12 NONAME
+	_ZN14CpRingToneViewD0Ev @ 13 NONAME
+	_ZN14CpRingToneViewD1Ev @ 14 NONAME
+	_ZN14CpRingToneViewD2Ev @ 15 NONAME
+	_ZNK14CpRingToneView10metaObjectEv @ 16 NONAME
+	_ZTI14CpRingToneView @ 17 NONAME
+	_ZTV14CpRingToneView @ 18 NONAME
+	_ZThn16_N14CpRingToneViewD0Ev @ 19 NONAME
+	_ZThn16_N14CpRingToneViewD1Ev @ 20 NONAME
+	_ZThn8_N14CpRingToneViewD0Ev @ 21 NONAME
+	_ZThn8_N14CpRingToneViewD1Ev @ 22 NONAME
+
--- a/controlpanelui/src/cpringtoneview/src/cpringtoneview.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpringtoneview/src/cpringtoneview.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -19,69 +19,70 @@
 #include <QGraphicsLinearLayout>
 #include <HbLabel>
 #include <QList>
+#include <QPair>
 #include <QModelIndex>
 #include <QStandardItemModel>
 #include <QStandardItem>
 #include <xqaiwrequest.h>
 #include <cplogger.h>
+#include <hbstyleloader.h>
+#include <hbdataformmodel.h>
+#include <hbdataformmodelitem.h>
+#include <hbdataform.h>
+#include <cpsettingformentryitemdata.h>
 
 CpRingToneView::CpRingToneView( QGraphicsItem *parent ):
                               CpBaseSettingView(0, parent),
                               mToneTypeList( new HbListWidget(this) ),
                               mReq(0)
 {
-    HbWidget* contentWidget = new HbWidget(this);
-    QGraphicsLinearLayout* layout = new QGraphicsLinearLayout(Qt::Vertical);
-
-    //setup the heading.
-    HbLabel* label = new HbLabel( hbTrId("txt_cp_subhead_select_tone_type"), contentWidget );
-    layout->addItem(label);
-    //handling user click
-    bool bret = connect(mToneTypeList, SIGNAL( activated(HbListWidgetItem *) ),
-            this, SLOT(onTypeSelected(HbListWidgetItem *)));
-    //initialize the list contents
-    QList<QString> tonesTypeList;
-    tonesTypeList <<
-            hbTrId("txt_cp_list_no_tone")<<
-            hbTrId("txt_cp_list_tone")<<
-            hbTrId("txt_cp_list_music")<<
-            hbTrId("txt_cp_list_recording")<<
-            hbTrId("txt_cp_list_get_more_tones");
-    for ( int i = 0; i < tonesTypeList.count(); i++ )
-    {
-        mToneTypeList->addItem(tonesTypeList.at(i));
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.css");
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem_color.css");
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.widgetml");
+    
+    HbDataForm *form = qobject_cast<HbDataForm*> ( widget() );
+    form->setHeading("txt_cp_subhead_select_tone_type");   
+    
+    HbDataFormModel *model = new HbDataFormModel();  
+    QList< QPair<QString,QString> > tonesTypeList;
+    tonesTypeList << qMakePair( QString("qtg_large_tone_off"), hbTrId("txt_cp_list_no_tone") )
+                 << qMakePair( QString("qtg_large_tone"), hbTrId("txt_cp_list_tone") )
+                 << qMakePair( QString("qtg_large_music"), hbTrId("txt_cp_list_music") )                 
+                 << qMakePair( QString("qtg_large_ovistore"), hbTrId("txt_cp_list_get_more_tones") );
+       
+    for (int i = 0; i < tonesTypeList.count(); ++i) {
+        HbDataFormModelItem *itemData = new HbDataFormModelItem();
+        itemData->setType ( static_cast<HbDataFormModelItem::DataItemType> (CpSettingFormEntryItemData::ListEntryItem) );
+        itemData->setLabel(tonesTypeList.at(i).second);
+        itemData->setIcon(tonesTypeList.at(i).first);
+        model->appendDataFormItem(itemData, model->invisibleRootItem());
     }
-    //add the list to layout.
-    layout->addItem(mToneTypeList);
-
-    contentWidget->setLayout(layout);
-
-    setWidget(contentWidget);
+    connect(form, SIGNAL(activated(QModelIndex)), this, SLOT(itemActivated(QModelIndex)));
+    form->setModel(model);
 }
 CpRingToneView::~CpRingToneView()
 {
     if(mReq)    delete mReq;
 }
-void CpRingToneView::onTypeSelected(HbListWidgetItem *item)
+void CpRingToneView::itemActivated( const QModelIndex &index )
 {
-    int nRow = mToneTypeList->row( item );
-    switch(nRow)
-    {
+    int nRow = index.row();
+
+    switch(nRow) {
         case 0:         //no tone, set default no sound
                 emit selOK(QString(""));
                 emit aboutToClose();
                 break;
         case 1:         //tone
-        //        launchMediaFetcher( "com.nokia.symbian.IToneFetch", "fetch(QString)" );
+                launchMediaFetcher( "com.nokia.symbian.IToneFetch", "fetch()" );
                 break;
         case 2:         //music
-                launchMediaFetcher("com.nokia.symbian.IMusicFetch", "fetch(void)" );
+                launchMediaFetcher("com.nokia.symbian.IMusicFetch", "fetch()" );
                 break;
-        case 3:         //recording
-        case 4:         //get more tones
-        default:
-                break;
-    }
+        case 3:         //get more tones
+		default:
+		        break;
+	 }
 }
 void CpRingToneView::handleOk(const QVariant &result)
 {
@@ -110,7 +111,7 @@
         mReq = 0;
     }
         //launch media fetcher
-    mReq = mAppMgr.create( strService, strItface, true);
+    mReq = mAppMgr.create(strService, strItface, true);
     if (!mReq)
     {
       CPFW_LOG("CpRingToneView::launchMediaFetcher, Mediafetcher start failed");
@@ -121,12 +122,10 @@
         connect(mReq, SIGNAL( requestOk( const QVariant&)), SLOT( handleOk(const QVariant&)) );
         connect(mReq, SIGNAL( requestError( int,const QString&)), SLOT(handleError(int,const QString&)) );
     }
-
-    // Set arguments for request (music fetcher application title)
-    //QList<QVariant> args;
-    //args << QVariant( strTitle );
-    //mReq->setArguments(args);
-
+    
+    QList<QVariant> args;
+    args << QVariant(QString("<app_name>"));
+    mReq->setArguments(args);
     // Make the request
     if (!mReq->send())
     {
--- a/controlpanelui/src/cpserviceprovider/cpserviceprovider.pro	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpserviceprovider/cpserviceprovider.pro	Thu Jul 22 16:34:01 2010 +0100
@@ -27,8 +27,8 @@
 
 SERVICE.FILE = service_conf.xml
 SERVICE.OPTIONS = embeddable
-SERVICE.OPTIONS += hidden embeddable
+SERVICE.OPTIONS += hidden
 
 libFiles.sources = xqservice.dll
 libFiles.path = "!:\sys\bin"
-DEPLOYMENT += libFiles
\ No newline at end of file
+DEPLOYMENT += libFiles
--- a/controlpanelui/src/cpserviceprovider/src/cplauncherservice.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpserviceprovider/src/cplauncherservice.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -31,6 +31,7 @@
 {
     CPSP_LOG("CpLauncherService Constructing...");
     publishAll();
+    connect(this,SIGNAL(clientDisconnected()),this,SLOT(handleClientDisconnected()));
 }
 
 CpLauncherService::~CpLauncherService()
@@ -38,11 +39,13 @@
     CPSP_LOG("CpLauncherService Destructing...");
 }
 
-void CpLauncherService::complete()
+bool CpLauncherService::complete()
 {
     CPSP_LOG( QString("CpLauncherService::complete() mAsyncRequestIndex = %1, mReturnValue = %2").arg(
             mAsyncRequestIndex).arg(mReturnValue.toBool()) );
-    completeRequest(mAsyncRequestIndex, mReturnValue);
+    bool ret = completeRequest(mAsyncRequestIndex, mReturnValue);
+    mAsyncRequestIndex = -1;
+    return ret;
 }
 
 void CpLauncherService::setReturnValue(const QVariant &returnValue)
@@ -86,4 +89,9 @@
     return succeed;
 }
 
+void CpLauncherService::handleClientDisconnected()
+{
+    qApp->quit();
+}
+
 //End of File
--- a/controlpanelui/src/cpserviceprovider/src/cplauncherservice.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpserviceprovider/src/cplauncherservice.h	Thu Jul 22 16:34:01 2010 +0100
@@ -28,11 +28,12 @@
 public:
     explicit CpLauncherService(HbMainWindow *mainWindow = 0);
     virtual ~CpLauncherService();
-    void complete();
+    bool complete();
 public slots:
     bool launchSettingView(const QString &pluginFile,const QVariant &hint);
 private slots:
     void setReturnValue(const QVariant &returnValue);
+    void handleClientDisconnected();
 private:
     HbMainWindow *mMainWindow;
     int mAsyncRequestIndex;
--- a/controlpanelui/src/cpserviceprovider/src/cpservicemainwindow.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpserviceprovider/src/cpservicemainwindow.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -22,7 +22,7 @@
 #include "cpsplogger.h"
 
 CpServiceMainWindow::CpServiceMainWindow(QWidget *parent /* = 0*/)
-: HbMainWindow(parent), mLauncherService(0)
+: HbMainWindow(parent), mLauncherService(0), mPreviousView(0)
 {
     CPSP_LOG("CpServiceMainWindow Constructing...");
     mLauncherService = new CpLauncherService(this);
@@ -37,6 +37,8 @@
 {
     mSettingViewPointer = settingView;
     
+    mPreviousView = currentView();
+    
     connect(settingView, SIGNAL(aboutToClose()), this, SLOT(quit()));    
     addView(settingView);
     setCurrentView(settingView);
@@ -46,6 +48,8 @@
 {
     CPSP_LOG("CpServiceMainWindow::quit()");
     
+    closeSettingView();
+    
     connect(mLauncherService, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
     mLauncherService->complete();
   
@@ -59,4 +63,14 @@
     */
 }
 
+void CpServiceMainWindow::closeSettingView()
+{
+    if (mSettingViewPointer) {
+        removeView(mSettingViewPointer);
+        mSettingViewPointer->deleteLater();
+    }
+    
+    setCurrentView(mPreviousView);
+}
+
 //End of File
--- a/controlpanelui/src/cpserviceprovider/src/cpservicemainwindow.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpserviceprovider/src/cpservicemainwindow.h	Thu Jul 22 16:34:01 2010 +0100
@@ -31,12 +31,21 @@
     explicit CpServiceMainWindow(QWidget *parent = 0);
     virtual ~CpServiceMainWindow();
     
+    /*
+     * set the setting view as current view
+     */
     void setSettingView(CpBaseSettingView *settingView);
     
+    /*
+     * close current setting view
+     */
+    void closeSettingView();
+    
 public slots:
     void quit();
 private:
     CpLauncherService *mLauncherService;
+    HbView *mPreviousView;
     QPointer<CpBaseSettingView> mSettingViewPointer;
 };
 
--- a/controlpanelui/src/cpserviceprovider/src/main.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/cpserviceprovider/src/main.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -17,7 +17,8 @@
 #include <hbapplication.h>
 #include <hbstyleloader.h>
 #include <QDir>
-#include <cpbasepath.h>
+#include <QTranslator>
+#include <QLocale>
 #include "cpservicemainwindow.h"
 #include "cpsplogger.h"
 
@@ -29,7 +30,15 @@
             CPSP_LOGGER_CONFIG_PATH,QSettings::IniFormat);
     CPSP_LOG("Entering CpServiceProvider.exe...");
     
-    HbStyleLoader::registerFilePath(CP_RESOURCE_PATH + QDir::separator() + WIDGETML_SUB_PATH);
+    QTranslator translator;
+    if (translator.load("control_panel_" + QLocale::system().name(),"Z:/resource/qt/translations"))
+    {
+        qApp->installTranslator(&translator);
+    }
+    
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.css");
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem_color.css");
+    HbStyleLoader::registerFilePath(":/widgetml/cpdataformlistentryviewitem.widgetml");
     
     CpServiceMainWindow wnd;
     wnd.show();
--- a/controlpanelui/src/eabi/cpcategorymodelu.def	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,56 +0,0 @@
-EXPORTS
-	_Z22createCpPluginItemDataP27CpCreatePluginItemDataEvent @ 1 NONAME
-	_ZN14CpTaskExecutor11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
-	_ZN14CpTaskExecutor11qt_metacastEPKc @ 3 NONAME
-	_ZN14CpTaskExecutor11removeTasksEv @ 4 NONAME
-	_ZN14CpTaskExecutor14globalInstanceEv @ 5 NONAME
-	_ZN14CpTaskExecutor16staticMetaObjectE @ 6 NONAME DATA 16
-	_ZN14CpTaskExecutor19getStaticMetaObjectEv @ 7 NONAME
-	_ZN14CpTaskExecutor21destroyGlobalInstanceEv @ 8 NONAME
-	_ZN14CpTaskExecutor3runEv @ 9 NONAME
-	_ZN14CpTaskExecutor4stopEv @ 10 NONAME
-	_ZN14CpTaskExecutor7runTaskEP6CpTaskb @ 11 NONAME
-	_ZN14CpTaskExecutor7toFrontEP6CpTask @ 12 NONAME
-	_ZN14CpTaskExecutorC1EP7QObject @ 13 NONAME
-	_ZN14CpTaskExecutorC2EP7QObject @ 14 NONAME
-	_ZN14CpTaskExecutorD0Ev @ 15 NONAME
-	_ZN14CpTaskExecutorD1Ev @ 16 NONAME
-	_ZN14CpTaskExecutorD2Ev @ 17 NONAME
-	_ZN26CpCategorySettingFormModel10initializeER16CpItemDataHelper @ 18 NONAME
-	_ZN26CpCategorySettingFormModel11qt_metacallEN11QMetaObject4CallEiPPv @ 19 NONAME
-	_ZN26CpCategorySettingFormModel11qt_metacastEPKc @ 20 NONAME
-	_ZN26CpCategorySettingFormModel16staticMetaObjectE @ 21 NONAME DATA 16
-	_ZN26CpCategorySettingFormModel19getStaticMetaObjectEv @ 22 NONAME
-	_ZN26CpCategorySettingFormModel25afterLoadingConfigPluginsER16CpItemDataHelper @ 23 NONAME
-	_ZN26CpCategorySettingFormModel26beforeLoadingConfigPluginsER16CpItemDataHelper @ 24 NONAME
-	_ZN26CpCategorySettingFormModelC1ERK7QString @ 25 NONAME
-	_ZN26CpCategorySettingFormModelC2ERK7QString @ 26 NONAME
-	_ZN26CpCategorySettingFormModelD0Ev @ 27 NONAME
-	_ZN26CpCategorySettingFormModelD1Ev @ 28 NONAME
-	_ZN26CpCategorySettingFormModelD2Ev @ 29 NONAME
-	_ZN29CpCategorySettingFormItemData10initializeER16CpItemDataHelper @ 30 NONAME
-	_ZN29CpCategorySettingFormItemData11qt_metacallEN11QMetaObject4CallEiPPv @ 31 NONAME
-	_ZN29CpCategorySettingFormItemData11qt_metacastEPKc @ 32 NONAME
-	_ZN29CpCategorySettingFormItemData16staticMetaObjectE @ 33 NONAME DATA 16
-	_ZN29CpCategorySettingFormItemData19getStaticMetaObjectEv @ 34 NONAME
-	_ZN29CpCategorySettingFormItemData25afterLoadingConfigPluginsER16CpItemDataHelper @ 35 NONAME
-	_ZN29CpCategorySettingFormItemData26beforeLoadingConfigPluginsER16CpItemDataHelper @ 36 NONAME
-	_ZN29CpCategorySettingFormItemDataC1EN19HbDataFormModelItem12DataItemTypeERK7QStringS4_PKS0_ @ 37 NONAME
-	_ZN29CpCategorySettingFormItemDataC1ERK7QStringPK19HbDataFormModelItem @ 38 NONAME
-	_ZN29CpCategorySettingFormItemDataC2EN19HbDataFormModelItem12DataItemTypeERK7QStringS4_PKS0_ @ 39 NONAME
-	_ZN29CpCategorySettingFormItemDataC2ERK7QStringPK19HbDataFormModelItem @ 40 NONAME
-	_ZN29CpCategorySettingFormItemDataD0Ev @ 41 NONAME
-	_ZN29CpCategorySettingFormItemDataD1Ev @ 42 NONAME
-	_ZN29CpCategorySettingFormItemDataD2Ev @ 43 NONAME
-	_ZNK14CpTaskExecutor10metaObjectEv @ 44 NONAME
-	_ZNK26CpCategorySettingFormModel10metaObjectEv @ 45 NONAME
-	_ZNK29CpCategorySettingFormItemData10metaObjectEv @ 46 NONAME
-	_ZTI14CpTaskExecutor @ 47 NONAME
-	_ZTI26CpCategorySettingFormModel @ 48 NONAME
-	_ZTI29CpCategorySettingFormItemData @ 49 NONAME
-	_ZTV14CpTaskExecutor @ 50 NONAME
-	_ZTV26CpCategorySettingFormModel @ 51 NONAME
-	_ZTV29CpCategorySettingFormItemData @ 52 NONAME
-	_ZThn8_N29CpCategorySettingFormItemDataD0Ev @ 53 NONAME
-	_ZThn8_N29CpCategorySettingFormItemDataD1Ev @ 54 NONAME
-
--- a/controlpanelui/src/eabi/cpprofilewrapperu.def	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,55 +0,0 @@
-EXPORTS
-	_ZN14CpProfileModel11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
-	_ZN14CpProfileModel11qt_metacastEPKc @ 2 NONAME
-	_ZN14CpProfileModel11setRingToneERK7QString @ 3 NONAME
-	_ZN14CpProfileModel11setRingToneEiRK7QString @ 4 NONAME
-	_ZN14CpProfileModel12setEmailToneEiRK7QString @ 5 NONAME
-	_ZN14CpProfileModel13setEmailVibraEib @ 6 NONAME
-	_ZN14CpProfileModel14initiationFlagEv @ 7 NONAME
-	_ZN14CpProfileModel14setMasterVibraEb @ 8 NONAME
-	_ZN14CpProfileModel14setMessageToneEiRK7QString @ 9 NONAME
-	_ZN14CpProfileModel14setOffLineModeEb @ 10 NONAME
-	_ZN14CpProfileModel14setSilenceModeEb @ 11 NONAME
-	_ZN14CpProfileModel15activateProfileEi @ 12 NONAME
-	_ZN14CpProfileModel15profileSettingsEiR17CpProfileSettings @ 13 NONAME
-	_ZN14CpProfileModel15setMasterVolumeEi @ 14 NONAME
-	_ZN14CpProfileModel15setMessageVibraEib @ 15 NONAME
-	_ZN14CpProfileModel15setReminderToneEiRK7QString @ 16 NONAME
-	_ZN14CpProfileModel16setReminderVibraEib @ 17 NONAME
-	_ZN14CpProfileModel16staticMetaObjectE @ 18 NONAME DATA 16
-	_ZN14CpProfileModel17setRingAlertVibraEib @ 19 NONAME
-	_ZN14CpProfileModel18setProfileSettingsEiR17CpProfileSettings @ 20 NONAME
-	_ZN14CpProfileModel19getStaticMetaObjectEv @ 21 NONAME
-	_ZN14CpProfileModel19setNotificationToneEib @ 22 NONAME
-	_ZN14CpProfileModel20setNotificationVibraEib @ 23 NONAME
-	_ZN14CpProfileModel21setKeyTouchScreenToneEii @ 24 NONAME
-	_ZN14CpProfileModel22setKeyTouchScreenVibraEii @ 25 NONAME
-	_ZN14CpProfileModelC1EP7QObject @ 26 NONAME
-	_ZN14CpProfileModelC2EP7QObject @ 27 NONAME
-	_ZN14CpProfileModelD0Ev @ 28 NONAME
-	_ZN14CpProfileModelD1Ev @ 29 NONAME
-	_ZN14CpProfileModelD2Ev @ 30 NONAME
-	_ZNK14CpProfileModel10emailVibraEi @ 31 NONAME
-	_ZNK14CpProfileModel10metaObjectEv @ 32 NONAME
-	_ZNK14CpProfileModel11masterVibraEv @ 33 NONAME
-	_ZNK14CpProfileModel11messageToneEi @ 34 NONAME
-	_ZNK14CpProfileModel11offLineModeEv @ 35 NONAME
-	_ZNK14CpProfileModel11profileNameEi @ 36 NONAME
-	_ZNK14CpProfileModel11silenceModeEv @ 37 NONAME
-	_ZNK14CpProfileModel12masterVolumeEv @ 38 NONAME
-	_ZNK14CpProfileModel12messageVibraEi @ 39 NONAME
-	_ZNK14CpProfileModel12profileNamesEv @ 40 NONAME
-	_ZNK14CpProfileModel12reminderToneEi @ 41 NONAME
-	_ZNK14CpProfileModel13reminderVibraEi @ 42 NONAME
-	_ZNK14CpProfileModel14ringAlertVibraEi @ 43 NONAME
-	_ZNK14CpProfileModel15activeProfileIdEv @ 44 NONAME
-	_ZNK14CpProfileModel16notificationToneEi @ 45 NONAME
-	_ZNK14CpProfileModel17notificationVibraEi @ 46 NONAME
-	_ZNK14CpProfileModel18keyTouchScreenToneEi @ 47 NONAME
-	_ZNK14CpProfileModel19keyTouchScreenVibraEi @ 48 NONAME
-	_ZNK14CpProfileModel8ringToneEi @ 49 NONAME
-	_ZNK14CpProfileModel8ringToneEv @ 50 NONAME
-	_ZNK14CpProfileModel9emailToneEi @ 51 NONAME
-	_ZTI14CpProfileModel @ 52 NONAME
-	_ZTV14CpProfileModel @ 53 NONAME
-
--- a/controlpanelui/src/eabi/cpringtoneviewu.def	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,24 +0,0 @@
-EXPORTS
-	_ZN14CpRingToneView11handleErrorEiRK7QString @ 1 NONAME
-	_ZN14CpRingToneView11qt_metacallEN11QMetaObject4CallEiPPv @ 2 NONAME
-	_ZN14CpRingToneView11qt_metacastEPKc @ 3 NONAME
-	_ZN14CpRingToneView14onTypeSelectedEP16HbListWidgetItem @ 4 NONAME
-	_ZN14CpRingToneView16staticMetaObjectE @ 5 NONAME DATA 16
-	_ZN14CpRingToneView18launchMediaFetcherERK7QStringS2_ @ 6 NONAME
-	_ZN14CpRingToneView19getStaticMetaObjectEv @ 7 NONAME
-	_ZN14CpRingToneView5selOKERK7QString @ 8 NONAME
-	_ZN14CpRingToneView8handleOkERK8QVariant @ 9 NONAME
-	_ZN14CpRingToneView8selErrorEiRK7QString @ 10 NONAME
-	_ZN14CpRingToneViewC1EP13QGraphicsItem @ 11 NONAME
-	_ZN14CpRingToneViewC2EP13QGraphicsItem @ 12 NONAME
-	_ZN14CpRingToneViewD0Ev @ 13 NONAME
-	_ZN14CpRingToneViewD1Ev @ 14 NONAME
-	_ZN14CpRingToneViewD2Ev @ 15 NONAME
-	_ZNK14CpRingToneView10metaObjectEv @ 16 NONAME
-	_ZTI14CpRingToneView @ 17 NONAME
-	_ZTV14CpRingToneView @ 18 NONAME
-	_ZThn16_N14CpRingToneViewD0Ev @ 19 NONAME
-	_ZThn16_N14CpRingToneViewD1Ev @ 20 NONAME
-	_ZThn8_N14CpRingToneViewD0Ev @ 21 NONAME
-	_ZThn8_N14CpRingToneViewD1Ev @ 22 NONAME
-
--- a/controlpanelui/src/eabi/seccodeuiu.def	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,37 +0,0 @@
-EXPORTS
-	_ZN15SecCodeSettings11qt_metacallEN11QMetaObject4CallEiPPv @ 1 NONAME
-	_ZN15SecCodeSettings11qt_metacastEPKc @ 2 NONAME
-	_ZN15SecCodeSettings13changePinCodeEv @ 3 NONAME
-	_ZN15SecCodeSettings14changePin2CodeEv @ 4 NONAME
-	_ZN15SecCodeSettings16staticMetaObjectE @ 5 NONAME DATA 16
-	_ZN15SecCodeSettings17setPinCodeRequestEb @ 6 NONAME
-	_ZN15SecCodeSettings19getStaticMetaObjectEv @ 7 NONAME
-	_ZN15SecCodeSettingsC1EP7QObject @ 8 NONAME
-	_ZN15SecCodeSettingsC2EP7QObject @ 9 NONAME
-	_ZN15SecCodeSettingsD0Ev @ 10 NONAME
-	_ZN15SecCodeSettingsD1Ev @ 11 NONAME
-	_ZN15SecCodeSettingsD2Ev @ 12 NONAME
-	_ZN27SecCodeEditDataFormViewItem10createItemEv @ 13 NONAME
-	_ZN27SecCodeEditDataFormViewItem11qt_metacallEN11QMetaObject4CallEiPPv @ 14 NONAME
-	_ZN27SecCodeEditDataFormViewItem11qt_metacastEPKc @ 15 NONAME
-	_ZN27SecCodeEditDataFormViewItem16staticMetaObjectE @ 16 NONAME DATA 16
-	_ZN27SecCodeEditDataFormViewItem18createCustomWidgetEv @ 17 NONAME
-	_ZN27SecCodeEditDataFormViewItem19getStaticMetaObjectEv @ 18 NONAME
-	_ZN27SecCodeEditDataFormViewItemC1EP13QGraphicsItem @ 19 NONAME
-	_ZN27SecCodeEditDataFormViewItemC2EP13QGraphicsItem @ 20 NONAME
-	_ZN27SecCodeEditDataFormViewItemD0Ev @ 21 NONAME
-	_ZN27SecCodeEditDataFormViewItemD1Ev @ 22 NONAME
-	_ZN27SecCodeEditDataFormViewItemD2Ev @ 23 NONAME
-	_ZNK15SecCodeSettings10metaObjectEv @ 24 NONAME
-	_ZNK15SecCodeSettings14pinCodeRequestEv @ 25 NONAME
-	_ZNK27SecCodeEditDataFormViewItem10metaObjectEv @ 26 NONAME
-	_ZNK27SecCodeEditDataFormViewItem16canSetModelIndexERK11QModelIndex @ 27 NONAME
-	_ZTI15SecCodeSettings @ 28 NONAME
-	_ZTI27SecCodeEditDataFormViewItem @ 29 NONAME
-	_ZTV15SecCodeSettings @ 30 NONAME
-	_ZTV27SecCodeEditDataFormViewItem @ 31 NONAME
-	_ZThn16_N27SecCodeEditDataFormViewItemD0Ev @ 32 NONAME
-	_ZThn16_N27SecCodeEditDataFormViewItemD1Ev @ 33 NONAME
-	_ZThn8_N27SecCodeEditDataFormViewItemD0Ev @ 34 NONAME
-	_ZThn8_N27SecCodeEditDataFormViewItemD1Ev @ 35 NONAME
-
--- a/controlpanelui/src/inc/cpringtoneview.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/inc/cpringtoneview.h	Thu Jul 22 16:34:01 2010 +0100
@@ -36,7 +36,7 @@
    void selError(  int errorCode, const QString& errorMessage );
 
 private slots:
-    void onTypeSelected( HbListWidgetItem *item );
+    void itemActivated( const QModelIndex &index );
     void handleOk(const QVariant &result);
     void handleError(int errorCode, const QString& errorMessage);
 
--- a/controlpanelui/src/inc/cpuids.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/inc/cpuids.h	Thu Jul 22 16:34:01 2010 +0100
@@ -47,8 +47,8 @@
 #define QUID_RINGTONE 0X20028738
 #define QUID_PROFILEACTIVATOR  0X20028739
 #define QUID_RINGTONESELVIEW  0X2002873A
-#define QUID_RESERVED8  0X2002873B
-#define QUID_RESERVED9  0X2002873C
+#define QUID_CPPLUGIN_ABOUT  0X2002873B
+#define QUID_CPPLUGIN_LANGUAGE  0X2002873C
 #define QUID_RESERVED10 0X2002873D
 #define QUID_RESERVED11 0X2002873E
 #define QUID_CPSERVICEPROVIDER 0X2002873F
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/inc/tonefetcherlog.conf	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,7 @@
+[ToneFetcher]
+logdatetime = 1
+logloggername = 1
+datetimeformat = hh:mm:ss:zzz
+output = debugoutput fileoutput
+fileoutput/logfile = C:/data/logs/tonefetcher.log
+fileoutput/truncate = 1
\ No newline at end of file
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/inc/tonefetcherlogger.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,39 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The header file for tone fetcher utilities.
+ *     
+ */
+
+#ifndef TONEFETCHERLOGGER_H
+#define TONEFETCHERLOGGER_H
+
+#include <QLatin1String>
+#include <logger.h>
+
+#define TONEFETCHER_LOGGER_NAME       QLatin1String("ToneFetcher")
+
+#if defined (Q_OS_SYMBIAN)
+    #define TF_LOGGER_CONFIG_PATH QLatin1String("C:/data/.config/tonefetcherlog.conf")
+#elif defined (Q_WS_WIN)
+    #ifdef _DEBUG
+        #define TF_LOGGER_CONFIG_PATH QLatin1String("C:/controlpanel/debug/bin/tonefetcherlog.conf")
+    #else 
+        #define TF_LOGGER_CONFIG_PATH QLatin1String("C:/controlpanel/release/bin/tonefetcherlog.conf")
+    #endif
+#endif
+
+#define TF_LOG(str)   Logger::instance(TONEFETCHER_LOGGER_NAME)->log(str);
+
+#endif /* TONEFETCHERLOGGER_H */
--- a/controlpanelui/src/tonefetcher/inc/tonefetcherutils.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/inc/tonefetcherutils.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -15,6 +15,7 @@
  *     The source file for tone fetcher utilities.
  *     
  */
+
 #include "tonefetcherutils.h"
 #include <QDir>
 #include <QChar>
--- a/controlpanelui/src/tonefetcher/inc/tonefetcherutils.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/inc/tonefetcherutils.h	Thu Jul 22 16:34:01 2010 +0100
@@ -15,6 +15,7 @@
  *     The header file for tone fetcher utilities.
  *     
  */
+
 #ifndef TONEFETCHERUTILS_H
 #define TONEFETCHERUTILS_H
 
@@ -23,7 +24,7 @@
 class ToneFetcherUtils
 {
 public:
-     
+    //replace '/' and '\' with QDir::separator()
     static QString normalizeSeperator(const QString &path);
 };
 
--- a/controlpanelui/src/tonefetcher/src/main.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/main.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -19,10 +19,17 @@
 #include "tonefetcher.h"
 #include "tonefetchermainwindow.h"
 #include <hbapplication.h>
+#include <tonefetcherlogger.h>
 
 int main(int argc, char *argv[])
 {
     HbApplication a(argc, argv);
+    
+    
+    Logger::instance(TONEFETCHER_LOGGER_NAME)->configure(
+            TF_LOGGER_CONFIG_PATH,QSettings::IniFormat);
+
+    TF_LOG("Entering tonefetcher.exe...");
     ToneFetcherMainWindow w;   
     w.show();
     return a.exec();
--- a/controlpanelui/src/tonefetcher/src/tonefetcher.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetcher.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -22,7 +22,7 @@
 #include "tonefetcherutils.h"
 #include <QChar>
 #include <QDir>
-#include <cplogger.h>
+#include <tonefetcherlogger.h>
 
 ToneFetcher::ToneFetcher(HbMainWindow *mainWindow)
     : XQServiceProvider(QString("tonefetcher.com.nokia.symbian.IToneFetch"), mainWindow),
@@ -39,7 +39,7 @@
 
 }
 
-void ToneFetcher::fetch(QString)
+void ToneFetcher::fetch()
 {
     mAsyncRequestIndex = setCurrentRequestAsync();    
     if (mMainWindow) {
@@ -50,7 +50,7 @@
             mMainWindow->addView(toneView);
             mMainWindow->setCurrentView(toneView);            
         } else {
-            CPFW_LOG("ToneFetcher::fetch: ToneFetcherView failed to be created");
+            TF_LOG("ToneFetcher::fetch: ToneFetcherView failed to be created");
         }
     }
 }
@@ -66,8 +66,7 @@
 }
 
 void ToneFetcher::setSelectedPath(const QString & tonePath)
-{
-    QString path(ToneFetcherUtils::normalizeSeperator(tonePath));
-    mReturnValue.setValue(path);
+{    
+    mReturnValue.setValue(ToneFetcherUtils::normalizeSeperator(tonePath));
 }
 //End of File
--- a/controlpanelui/src/tonefetcher/src/tonefetcher.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetcher.h	Thu Jul 22 16:34:01 2010 +0100
@@ -39,9 +39,15 @@
     bool isActive();
         
 public slots:
-    void fetch(QString);
+    /*
+     * tone fetcher service's operation
+     */
+    void fetch();
     
 private slots:
+    /*
+     * set the selected tone's path to be the return value
+     */
     void setSelectedPath(const QString &tonePath);
 
 private:
--- a/controlpanelui/src/tonefetcher/src/tonefetchermainwindow.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetchermainwindow.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -30,11 +30,4 @@
 {
     delete mToneFetcher;
 }
-
-void ToneFetcherMainWindow::quit()
-{
-    connect(mToneFetcher, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
-    mToneFetcher->complete();   
-}
-
 //End of File
--- a/controlpanelui/src/tonefetcher/src/tonefetchermainwindow.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetchermainwindow.h	Thu Jul 22 16:34:01 2010 +0100
@@ -30,8 +30,6 @@
     explicit ToneFetcherMainWindow(QWidget *parent = 0);
     virtual ~ToneFetcherMainWindow();
     
-public slots:
-    void quit();
 private:
     ToneFetcher *mToneFetcher;
 };
--- a/controlpanelui/src/tonefetcher/src/tonefetchermodel.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetchermodel.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -15,9 +15,11 @@
  *     The source file for tone list model
  */
 #include "tonefetchermodel.h"
+#include <QFileInfo>
+#include <QtAlgorithms>
 
 ToneFetcherModel::ToneFetcherModel(QObject *parent) 
-    : QStandardItemModel(parent)
+    : QStringListModel(parent)
 {
 }
 
@@ -27,70 +29,37 @@
 
 QVariant ToneFetcherModel::data(const QModelIndex &index, int role) const
 {
-    if (role == Qt::UserRole) {
-        return  mUserDataLst.at(index.row());
+    if (role == Qt::DisplayRole) {
+        return  QFileInfo(QStringListModel::data(index, role).toString()).baseName();        
     } else {
-        return QStandardItemModel::data(index, role);
-    }    
+        return QStringListModel::data(index, role);
+    }
 }
 
-void ToneFetcherModel::insertInOrder(QStandardItem *fileName, QStandardItem *filePath, int role)
-{
-    QString name = fileName->text();
-    QString path = filePath->text();
-    int index = this->insertIndex(0, rowCount(), name);
-    
-    mUserDataLst.insert(index, path);
-    QStandardItemModel::insertRow(index, fileName);
-}
-
-QString ToneFetcherModel::path(const QModelIndex &index) const
-{
-    QString str =  data(index, Qt::UserRole).toString();
-    return str;
+QString ToneFetcherModel::getPath(const QModelIndex &index) const
+{    
+    return  QStringListModel::data(index, Qt::DisplayRole).toString();
 }
 
-int ToneFetcherModel::insertIndex(int low, int high,  QString value)
+void ToneFetcherModel::sort()
 {
-    if (low == high) {
-        return low;   
-    }
-    int middle = (low + high - 1)/2;
-    QModelIndex lowItemIndex = ((QStandardItemModel *)this)->index(low, 0);
-    QModelIndex highItemIndex = ((QStandardItemModel *)this)->index(high - 1, 0);
-    QModelIndex middleItemIndex = (( QStandardItemModel *)this)->index(middle, 0);
-    QString lowString = data(lowItemIndex).toString();
-    QString highString = data(highItemIndex).toString();
-    QString middleString = data(middleItemIndex).toString();
-    
-    if (value >= highString) {
-        return high;
-    }
-    if (value < lowString) {
-        return low;
-    }
-    high = high - 1;
-    while (low < high) {
-        middle = (low + high)/2;
-        middleItemIndex = ((QStandardItemModel *)this)->index(middle, 0);
-        middleString = data(middleItemIndex).toString();
-        if (value >= middleString) {
-            low = middle + 1;
-        } else {
-            high = middle;
-        }        
-    }
-    return low;
+    QStringList list = stringList();
+    qStableSort(list.begin(), list.end(), caseSensitiveLessThan);   
+    removeRows(0, rowCount());
+    setStringList(list);
+}
+void ToneFetcherModel::layoutToBeChanged()
+{
+    emit layoutAboutToBeChanged();
 }
 
-void ToneFetcherModel::refresh()
+void ToneFetcherModel::layoutHasChanged()
 {
     emit layoutChanged();
 }
 
-void ToneFetcherModel::clearAll()
+bool ToneFetcherModel::caseSensitiveLessThan(const QString &s1, const QString &s2)
 {
-    mUserDataLst.clear();
-    QStandardItemModel::clear();
+    return QFileInfo(s1).baseName().toLower() < QFileInfo(s2).baseName().toLower();
 }
 //End of File
--- a/controlpanelui/src/tonefetcher/src/tonefetchermodel.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetchermodel.h	Thu Jul 22 16:34:01 2010 +0100
@@ -19,40 +19,31 @@
 #ifndef TONEFETCHERMODEL_H
 #define TONEFETCHERMODEL_H
 
-#include <QStandardItemModel>
+#include <QStringListModel>
 #include <QStringList>
 
 // CLASS DECLARATION
 /**
  *  This class is used for storing tone list items.
- *  inherited from QStandardItemModel so that many existing functions could be used.
+ *  inherited from QStringListModel so that many existing functions could be used.
  *
  */
-class ToneFetcherModel : public QStandardItemModel
+class ToneFetcherModel : public QStringListModel
 {
 public:
     explicit ToneFetcherModel( QObject *parent );
     virtual ~ToneFetcherModel();
-    //from QAbstractItemModel
-    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;
-    void insertInOrder(QStandardItem *fileName, QStandardItem *filePath, int role = Qt::DisplayRole);    
-    QString path(const QModelIndex &index) const;
-    void refresh();
-    void clearAll();
-private:
-    /*
-     * binary search (ascendant) for the correct index to insert.
-     * @param low the start of search
-     * @param high the end of search.
-     * @return the correct index
-     */
-    int insertIndex(int low, int high, QString variant);
-    
-    /*
-     * save the absolute path of the tone.
-     */
-    QStringList mUserDataLst;   
-    
+    //from QStringListModel
+    QVariant data(const QModelIndex &index, int role = Qt::DisplayRole) const;        
+    QString getPath(const QModelIndex &index) const;
+    //sort the list
+    void sort();
+    //sort method
+    bool static caseSensitiveLessThan(const QString &s1, const QString &s2);
+    //emit the signal of layoutToBeChanged();
+    void layoutToBeChanged();
+    //emit the signal of layoutChanged();
+    void layoutHasChanged();
 };
 
-#endif /* TONEFETCHERMODEL_H_ */
+#endif /* TONEFETCHERMODEL_H */
--- a/controlpanelui/src/tonefetcher/src/tonefetcherview.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetcherview.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -46,9 +46,9 @@
 }
 
 void ToneFetcherView::quit()
-{
+{    
+    connect(mServiceProvider, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));
     mServiceProvider->complete();
-    connect(mServiceProvider, SIGNAL(returnValueDelivered()), qApp, SLOT(quit()));    
 }
 
 void ToneFetcherView::initToolBar()
@@ -77,10 +77,12 @@
 }
 
 void ToneFetcherView::on_rightAction_triggered()
-{
-    QString path(mWidget->getCurrentItemPath());    
-    emit itemSelected(path);
+{       
+    emit itemSelected(mWidget->getCurrentItemPath());
     quit();
+    /*QDir dir("c:\\data\\Sounds\\Simple\\");
+    dir.remove("def.aac");
+    dir.remove("abc.aac");   */ 
 }
 
 void ToneFetcherView::enableToolBar(bool enable)
--- a/controlpanelui/src/tonefetcher/src/tonefetcherview.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetcherview.h	Thu Jul 22 16:34:01 2010 +0100
@@ -33,6 +33,10 @@
     explicit ToneFetcherView(ToneFetcher *service);
     ~ToneFetcherView();
     void quit();
+
+signals:
+        void itemSelected(const QString &path);
+        
 private:
     void initMainWidget();
     void initToolBar();
@@ -46,9 +50,6 @@
     void on_rightAction_triggered();
     void enableToolBar(bool enable);
     
-signals:
-    void itemSelected(const QString &path);    
-    
 private:
     ToneFetcherWidget *mWidget;
     ToneFetcher *mServiceProvider; //not own
@@ -56,4 +57,4 @@
     HbAction *mToolBarRightAction;
     };
 
-#endif /* TONEFETCHERVIEW_H_ */
+#endif /* TONEFETCHERVIEW_H */
--- a/controlpanelui/src/tonefetcher/src/tonefetcherwidget.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetcherwidget.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -34,6 +34,7 @@
 #include "tonefetcherview.h"
 #include "tonefetchermodel.h"
 #include <hbmessagebox.h>
+#include <hbprogressdialog.h>
 
 ToneFetcherWidget::ToneFetcherWidget( ToneFetcherView *serviceView  ) 
     : HbWidget(this),
@@ -42,65 +43,58 @@
       mLayout(0),
       mToneModel(0),
       mServiceView(serviceView),         
-      mServiceEngine(0)
+      mServiceEngine(0),
+      mWaitNote(0)
       
-{
-    mSelected = false;
+{    
     init();
     connect(mServiceEngine, SIGNAL(mdeSessionOpened()), 
             this, SLOT(mdeSessionOpened()));
     connect(mServiceEngine, SIGNAL(mdeSessionError(int)),
             this, SLOT(mdeSessionError(int)));
-    connect(mServiceEngine, SIGNAL(queryComplete(QStringList, QStringList)), 
-            this, SLOT(queryComplete(QStringList, QStringList)));
+    connect(mServiceEngine, SIGNAL(queryComplete(QStringList)), 
+            this, SLOT(queryComplete(QStringList)));
     connect(mServiceEngine, SIGNAL(queryError(int)), 
             this, SLOT(queryError(int)));
     connect(mServiceEngine, 
-           SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int)), 
-           this, SLOT(previewEvent(ToneServiceEngine::TPreviewEvent, int)));
+           SIGNAL(notifyPreviewEvent(int)), 
+           this, SLOT(previewEvent(int)));
     connect( mServiceEngine, SIGNAL(notifyObjectChanged()),
             this, SLOT(onObjectChanged()));
 }
 
 ToneFetcherWidget::~ToneFetcherWidget()
 {
-    delete mToneModel;    
+    delete mToneModel;
+    mToneModel = 0;
+    delete mWaitNote;
+    mWaitNote = 0;
 }
 
 void ToneFetcherWidget::on_list_activated(const QModelIndex &index)
 {  
-    QModelIndexList modelIndexList = mListView->selectionModel()->selectedIndexes();
-    
     //stop previewing when clicking another item.
-    if (mServiceEngine->IsPlaying()) {
-        mServiceEngine->preview(getCurrentItemPath());
+    if (mServiceEngine->isPlaying()) {
+        mServiceEngine->stopPlaying();
     }
     /*
      * when one item is selected, reselecting it will deselect it. selecting another 
      * will also deselect it, while the other is selected.
      */
-    if (mSelected){
-        if(mOldSeletedItem != index) {
-            mListView->selectionModel()->select(index, QItemSelectionModel::Select);
-            mOldSeletedItem = index;
-            emit triggerToolBar(true);
-        } else {
-            mListView->selectionModel()->select(index, QItemSelectionModel::Deselect);
-            mSelected = false;
-            emit triggerToolBar(false);
-        }        
-        return;
+    QItemSelectionModel *selectionModel = mListView->selectionModel();        
+    if (mOldSeletedItem == index) {
+        selectionModel->select(index,QItemSelectionModel::Toggle);
     }
-    if (modelIndexList.count() > 0) {
-        for (QModelIndexList::const_iterator it = modelIndexList.begin(); it != modelIndexList.end(); ++it) {
-            if ((*it) == index) {
-                mSelected = true;
-                mOldSeletedItem = index;
-                emit triggerToolBar(true);
-            }            
-        }
-        
-    }   
+    
+    QModelIndexList modelIndexList = selectionModel->selectedIndexes();
+    if (modelIndexList.isEmpty()) {
+        mOldSeletedItem = QModelIndex();
+    }
+    else {
+        mOldSeletedItem = modelIndexList.front();
+    }
+    emit triggerToolBar(selectionModel->hasSelection());
+
     
 }
 
@@ -120,32 +114,35 @@
     mListView->setSelectionMode(HbAbstractItemView::SingleSelection);
      
     mServiceEngine = new ToneFetcherEngine(this);     
-    mToneModel = new ToneFetcherModel(this);
-    addRomFiles();
+    mToneModel = new ToneFetcherModel(this);    
+    
+    initRomSoundList();    
     
     connect(mListView, SIGNAL(activated(QModelIndex)),
         this, SLOT(on_list_activated(QModelIndex )));
+    if( !mWaitNote ){
+        mWaitNote = new HbProgressDialog( HbProgressDialog::WaitDialog );
+        mWaitNote->setText( hbTrId( "Refreshing..." ) );
+        QAction *action = mWaitNote->actions().at(0);//disable Cancel buttion.
+        action->setEnabled(false);
+    }
 }
 
 void ToneFetcherWidget::mdeSessionOpened()
 {
-    mServiceEngine->getTone();
+    mServiceEngine->getTones();
 }
 
-void ToneFetcherWidget::queryComplete(const QStringList &nameList, const QStringList &uriList)
+void ToneFetcherWidget::queryComplete(const QStringList &uriList)
 {
-    QStandardItem *fileName = 0;
-    QStandardItem *filePath = 0; 
-    for (int i = 0; i < nameList.size(); ++i) { 
-        QString tr1 = nameList.at(i);
-        tr1 = uriList.at(i);
-        fileName = new QStandardItem(nameList.at(i));
-        filePath = new QStandardItem(uriList.at(i));
-        mToneModel->insertInOrder(fileName, filePath);       
-    }   
-    mLabel->setPlainText(QString::number(mSimpleSoundList.size() + mDigitalSoundList.size() + nameList.size()) + " tones");
-    mListView->setModel(mToneModel);
-    mToneModel->refresh();
+    addFilesFromMDE(uriList);
+    addFilesFromRom();
+    mToneModel->sort();
+    mToneModel->layoutHasChanged();
+    if (!mListView->model()) {    
+        mListView->setModel(mToneModel);
+    }
+    refreshFinish();
 }
 
 void ToneFetcherWidget::queryError(int error)
@@ -163,22 +160,27 @@
 {
     QModelIndexList modelIndexList = mListView->selectionModel()->selectedIndexes();
     if (modelIndexList.count() > 0) {
-        QModelIndex index = modelIndexList.at(0);
-        return mToneModel->data(index, Qt::UserRole).toString();
+        QModelIndex index = modelIndexList.front();
+        QString path = mToneModel->getPath(index);
+        return path;
     }
     return QString();
 }
 
 void ToneFetcherWidget::playOrPause() 
 {
-    mServiceEngine->preview(getCurrentItemPath());
+    if(mServiceEngine->isPlaying()) {
+        mServiceEngine->stopPlaying();
+    } else {    
+        mServiceEngine->play(getCurrentItemPath());
+    }
+    
 }
 
-void ToneFetcherWidget::previewEvent(ToneFetcherEngine::TPreviewEvent event, int errorId) 
+void ToneFetcherWidget::previewEvent(int event) 
 {
-    Q_UNUSED(errorId);
-    if (event == ToneFetcherEngine::EAudioPreviewComplete) {
-        //reserved
+    if (event == 0) {
+        //preview successful, reserved
     } else {
         HbMessageBox::information(QString(hbTrId("Preview Error")));
     }
@@ -186,35 +188,53 @@
 
 void ToneFetcherWidget::onObjectChanged()
 {
-    mToneModel->clearAll();
-    mDigitalSoundList.clear();
-    mSimpleSoundList.clear();
-    addRomFiles();
-    mServiceEngine->getTone();    
+    refreshStart();
+    if (mServiceEngine->isPlaying()) {
+        mServiceEngine->stopPlaying();      
+    }
+    mToneModel->layoutToBeChanged();
+    emit triggerToolBar(false);    
+    mToneModel->removeRows(0, mToneModel->rowCount());           
+    mServiceEngine->getTones();    
+}
+
+void ToneFetcherWidget::addFilesFromRom() 
+{     
+    int currentCount = mToneModel->rowCount();
+    mToneModel->insertRows(currentCount, mRomSoundList.size());
+    for (int i = 0; i < mRomSoundList.size(); ++i) {
+        mToneModel->setData(mToneModel->index(i + currentCount), 
+            QFileInfo(mRomSoundList.at(i)).absoluteFilePath());
+    }  
 }
 
-void ToneFetcherWidget::addRomFiles() 
+void ToneFetcherWidget::addFilesFromMDE(const QStringList &uriList)
 {
-    QStandardItem *fileName = 0;
-    QStandardItem *filePath = 0;
-    QDir digitalSoundPath(XQUtils::romRootPath() + XQUtils::digitalSoundsPath());
-    mDigitalSoundList = digitalSoundPath.entryInfoList();  
-           
-    QDir simpleSoundPath(XQUtils::romRootPath() + XQUtils::simpleSoundsPath());
-    mSimpleSoundList = simpleSoundPath.entryInfoList();
+    int currentCount = mToneModel->rowCount();
+    mToneModel->insertRows(currentCount, uriList.size());
+    for (int i = 0; i < uriList.size(); ++i) {
+        mToneModel->setData(mToneModel->index(i + currentCount), QFileInfo(uriList.at(i)).absoluteFilePath());
+    }   
+}
 
-    for (int i = 0; i < mDigitalSoundList.size(); ++i) {
-        QFileInfo fileInfo = mDigitalSoundList.at(i);        
-        fileName = new QStandardItem(fileInfo.fileName());
-        filePath = new QStandardItem(fileInfo.absoluteFilePath());
-        mToneModel->insertInOrder(fileName, filePath);
-    }
-      
-    for (int i = 0; i < mSimpleSoundList.size(); ++i) {
-        QFileInfo fileInfo = mSimpleSoundList.at(i);       
-        fileName = new QStandardItem(fileInfo.fileName());
-        filePath = new QStandardItem(fileInfo.absoluteFilePath());
-        mToneModel->insertInOrder(fileName, filePath);  
+void ToneFetcherWidget::refreshFinish()
+{
+    if (mWaitNote) {
+        mWaitNote->close();
     }
 }
+
+void ToneFetcherWidget::refreshStart()
+{
+    if (mWaitNote) {
+        mWaitNote->open();
+    }
+}
+
+void ToneFetcherWidget::initRomSoundList()
+{
+    QDir digitalSoundPath(XQUtils::romRootPath() + XQUtils::digitalSoundsPath());
+    QDir simpleSoundPath(XQUtils::romRootPath() + XQUtils::simpleSoundsPath());
+    mRomSoundList = digitalSoundPath.entryInfoList() + simpleSoundPath.entryInfoList();
+}
 //End of File
--- a/controlpanelui/src/tonefetcher/src/tonefetcherwidget.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/src/tonefetcherwidget.h	Thu Jul 22 16:34:01 2010 +0100
@@ -32,6 +32,7 @@
 class ToneFetcherView;
 class ToneFetcherModel;
 class HbLabel;
+class HbProgressDialog;
 
 class ToneFetcherWidget : public HbWidget
 {
@@ -47,18 +48,23 @@
     void itemClicked(const QString &item);
     void triggerToolBar(bool enable);
     
+    
+private:
+    void init();
+    void addFilesFromRom();
+    void initRomSoundList();
+    void addFilesFromMDE(const QStringList &uriList);
+    
 private slots:
     void on_list_activated(const QModelIndex &index);    
     void mdeSessionOpened();
     void mdeSessionError(int error);
-    void queryComplete(const QStringList &nameList, const QStringList &uriList);
+    void queryComplete(const QStringList &uriList);
     void queryError(int error );
-    void previewEvent(ToneFetcherEngine::TPreviewEvent event, int errorId);
+    void previewEvent(int event);
     void onObjectChanged();
-    
-private:
-    void init();
-    void addRomFiles();
+    void refreshFinish();
+    void refreshStart();
     
 private:
     HbLabel *mLabel;
@@ -69,9 +75,8 @@
     ToneFetcherView *mServiceView;
     ToneFetcherEngine *mServiceEngine;
     
-    QFileInfoList mSimpleSoundList;
-    QFileInfoList mDigitalSoundList;    
-    bool mSelected;
+    QFileInfoList mRomSoundList;    
     QModelIndex mOldSeletedItem;
+    HbProgressDialog *mWaitNote;
 };
-#endif /* TONEFETCHERWIDGET_H_ */
+#endif /* TONEFETCHERWIDGET_H */
--- a/controlpanelui/src/tonefetcher/tonefetcher.pri	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/tonefetcher.pri	Thu Jul 22 16:34:01 2010 +0100
@@ -32,12 +32,20 @@
            src/main.cpp 
 
 symbian {
-    HEADERS +=  tonefetcherengine/private/symbian/toneselectionengine_p.h \
-                tonefetcherengine/private/symbian/tonepreviewprivate.h
+    HEADERS +=  tonefetcherengine/private/CTonePlayer.h \
+                tonefetcherengine/private/CToneSelection.h \
+                tonefetcherengine/private/MTonePlayingWatcher.h \
+                tonefetcherengine/private/MToneSelectionWatcher.h \
+                tonefetcherengine/private/tonefetcherengine_symbian.h
+                
 
 
-    SOURCES += tonefetcherengine/private/symbian/toneselectionengine_p.cpp \
-               tonefetcherengine/private/symbian/tonepreviewprivate.cpp
+    SOURCES += tonefetcherengine/private/CTonePlayer.cpp \
+               tonefetcherengine/private/CToneSelection.cpp \
+               tonefetcherengine/private/tonefetcherengine_symbian.cpp
+} else {
+    HEADERS +=  tonefetcherengine/private/tonefetcherengine_stub.h
+    SOURCES += tonefetcherengine/private/tonefetcherengine_stub.cpp
 }
 
 
--- a/controlpanelui/src/tonefetcher/tonefetcher.pro	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/tonefetcher.pro	Thu Jul 22 16:34:01 2010 +0100
@@ -39,7 +39,10 @@
             -lDrmHelper \
             -ldrmutility \
             -lapmime \
-            -lecom
+            -lecom \
+            -lcone \
+            -lapgrfx
+
             TARGET.UID3 = 0x2002BCCA
             TARGET.CAPABILITY = ALL -TCB
             BLD_INF_RULES.prj_exports += "./service_conf.xml z:/private/2002BCCA/service_conf.xml"
@@ -51,7 +54,7 @@
              
 SERVICE.FILE = service_conf.xml
 SERVICE.OPTIONS = embeddable
-#SERVICE.OPTIONS += hidden     
+SERVICE.OPTIONS += hidden     
 libFiles.sources = xqservice.dll
 libFiles.path = "!:\sys\bin"
 DEPLOYMENT += libFiles
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/CTonePlayer.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,626 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The source file for tone playing.
+ *     
+ */
+#include "CTonePlayer.h"
+#include "tonefetcherutils.h"
+#include <AudioPreference.h>             // KAudioPriorityPreview
+#include <c3dringingtoneinterface.h>     // C3DRingingToneInterface
+#include <ctsydomainpskeys.h>            // for phone call states
+#include <MProfileEngine.h>
+#include <MProfile.h>
+#include <MProfileTones.h>
+#include "TProfileToneSettings.h"
+#include <MProfileExtraSettings.h>
+#include <MProfile3DToneSettings.h>
+#include <ProfileInternal.hrh>
+#include <ProfileEngineDomainCRKeys.h>   // KProEngDefaultRingingTone
+#include "MTonePlayingWatcher.h"
+
+
+CMFPreviewHandlerBase::CMFPreviewHandlerBase()
+    {
+    iMediaType = KErrNotFound;
+    iRingingVolume = KErrNotFound;
+    iRingingType = KErrNotFound;
+    iVibra = KErrNotFound;
+    i3DEffect = KErrNotFound;
+    i3DEcho = KErrNotFound;
+    iFileSize = KErrNotFound;    
+    iFullName = 0;    
+    iActiveProfileRead = EFalse;
+    iPlayerStatus = EPlayerNotCreated;
+
+    }
+
+void CMFPreviewHandlerBase::ConstructL()
+    {
+    // To allow/not allow screensaver
+    // Errors ignored, no actions needed if API is not available
+    //iProperty.Attach( KPSUidScreenSaver, KScreenSaverAllowScreenSaver );    
+    TRAP_IGNORE(User::LeaveIfError( iApaSession.Connect() ) );
+    
+    TRAP_IGNORE( ReadDefaultToneL() );
+    // To keep backlight on while a video is being previewed
+    iBacklightTimer = CPeriodic::NewL( EPriorityLow );
+    }
+
+CMFPreviewHandlerBase::~CMFPreviewHandlerBase()
+    {
+    delete iFullName;
+    iProperty.Close();
+    
+    iApaSession.Close();
+    }
+
+void CMFPreviewHandlerBase::SetAttrL( const TDesC& aFileName )
+    {
+    if ( aFileName.Length() )
+        {        
+        delete iFullName;
+        iFullName = 0;
+        iFullName = aFileName.AllocL();      
+        }
+    }
+
+TInt CMFPreviewHandlerBase::RingingVolume()
+    {
+    const TInt KDefaultVolumeLevel = 7; // see profile.hrh for volume levels
+    
+    if ( iRingingVolume != KErrNotFound )
+        {
+        return iRingingVolume;
+        }
+        
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfileRingingVolume;
+        }
+
+    return KDefaultVolumeLevel;
+    }
+
+TInt CMFPreviewHandlerBase::RingingType()
+    {
+    if ( iRingingType != KErrNotFound )
+        {
+        return iRingingType;
+        }
+        
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfileRingingType;
+        }
+
+    return ERingingTypeRinging;
+    }
+
+TInt CMFPreviewHandlerBase::Vibra()
+    {
+    if ( iVibra != KErrNotFound )
+        {
+        return iVibra;
+        }
+        
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfileVibra;
+        }
+    
+    return 0;  // in case of error vibra is off
+    }
+
+TInt CMFPreviewHandlerBase::Echo3D()
+    {
+    if ( i3DEcho != KErrNotFound )
+        {
+        return i3DEcho;
+        }
+    
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfile3DEcho;
+        }
+
+    return EProfile3DEchoOff;  // from ProfileInternal.hrh
+    }
+
+TInt CMFPreviewHandlerBase::Effect3D()
+    {
+    if ( i3DEffect != KErrNotFound )
+        {
+        return i3DEffect;
+        }
+    
+    if ( iActiveProfileRead )
+        {
+        return iActiveProfile3DEffect;
+        }
+
+    return EProfile3DEffectOff;
+    }
+
+TInt CMFPreviewHandlerBase::ConvertVolume( TInt aVolume, TInt aMaxVolume )
+    {
+    const TInt KMinVolumeLevel = 1;
+    const TInt KMaxVolumeLevel = 10;
+        
+    TInt result = aMaxVolume * aVolume / KMaxVolumeLevel;
+    
+    // if user has selected minimum volume level set HW volume 1
+    if ( aVolume == KMinVolumeLevel && result == 0 )
+        {
+        result = 1;
+        }
+
+    return result;
+    }
+  
+void CMFPreviewHandlerBase::ReadActiveProfileL()
+    {
+    iActiveProfileRead = EFalse;
+    
+    MProfileEngine* profileEngine = CreateProfileEngineL();
+    CleanupReleasePushL( *profileEngine );
+    
+    MProfile* activeProfile  = profileEngine->ActiveProfileL();
+    CleanupReleasePushL( *activeProfile );
+        
+    const MProfileTones& profileTones = activeProfile->ProfileTones();
+     
+    const TProfileToneSettings& toneSettings = profileTones.ToneSettings();
+    iActiveProfileVibra = toneSettings.iVibratingAlert;
+    iActiveProfileRingingVolume = toneSettings.iRingingVolume;
+    iActiveProfileRingingType = toneSettings.iRingingType;
+          
+    const MProfileExtraSettings& extra = activeProfile->ProfileExtraSettings();
+    const MProfile3DToneSettings& threeD = extra.Profile3DToneSettings();
+    
+    iActiveProfile3DEffect = threeD.Effect();
+    iActiveProfile3DEcho = threeD.Echo();
+   
+    CleanupStack::PopAndDestroy( activeProfile ); 
+    CleanupStack::PopAndDestroy( profileEngine );
+    
+    iActiveProfileRead = ETrue;
+    }
+ 
+void CMFPreviewHandlerBase::ReadDefaultToneL()
+    {
+    CRepository* cenrep = CRepository::NewLC( KCRUidProfileEngine );
+
+    User::LeaveIfError( cenrep->Get( KProEngDefaultRingingTone, iDefaultTone ) );
+    CleanupStack::PopAndDestroy( cenrep );
+    }
+
+TInt CMFPreviewHandlerBase::GetDataType( const TDesC& aFileName, TDataType& aDataType )
+    {
+    TUid dummyUid( KNullUid );
+    return iApaSession.AppForDocument( aFileName, dummyUid, aDataType );
+    }
+
+TInt CMFPreviewHandlerBase::DoResetInactivityTimer( TAny* /*aObject*/ )
+    {
+    User::ResetInactivityTime();
+    return KErrNone;
+    }
+
+void CMFPreviewHandlerBase::DisableBackLight()
+    {
+        const TInt KResetInactivityTimerDelay = 2000000;
+    iBacklightTimer->Cancel(); // Just in case
+    // Disable backlight turn off during video preview
+    iBacklightTimer->Start( KResetInactivityTimerDelay,
+                            KResetInactivityTimerDelay,
+                            TCallBack( DoResetInactivityTimer, 0 ) );
+    
+    }
+
+CTonePlayer* CTonePlayer::NewL( MTonePlayingWatcher *aWatcher )
+    {
+    CTonePlayer* self = CTonePlayer::NewLC( aWatcher );
+    CleanupStack::Pop();
+    return self;
+    }
+
+CTonePlayer* CTonePlayer::NewLC( MTonePlayingWatcher *aWatcher )
+    {
+    CTonePlayer* self = new ( ELeave ) CTonePlayer( aWatcher );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+void CTonePlayer::ConstructL()
+    {
+    iAudioPlayerStatus = EPlayerNotCreated;
+    CMFPreviewHandlerBase::ConstructL();
+    iTonePlayerStatus = EPlayerNotCreated;
+    CCoeEnv* coeEnv = CCoeEnv::Static();
+    coeEnv->AddForegroundObserverL( *this );
+    }
+
+CTonePlayer::CTonePlayer( MTonePlayingWatcher *aWatcher ) : iTonePlayWatcher( aWatcher )
+    {    
+    }
+
+CTonePlayer::~CTonePlayer()
+    {
+    Cancel();
+    
+    delete iAudioPlayer;
+    delete iTonePlayer;
+    delete i3dRingingTonePlugin;
+    }
+
+TBool CTonePlayer::IsPlaying()
+    {
+    if ( iAudioPlayerStatus != EPlayerNotCreated )
+        {
+        return ETrue;
+        }
+    
+    if ( iTonePlayerStatus != EPlayerNotCreated )
+        {
+        return ETrue;
+        }
+
+    return EFalse;
+    }
+
+void CTonePlayer::PlayL()
+    {    
+    //sequence for playing a beep once sound
+    _LIT8( KFileListBeepSequence, "\x00\x11\x06\x0A\x08\x73\x0A\x40\x28\x0A\xF7\
+    \x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B" ); 
+
+    // rng mime type
+    _LIT( KFileListRngMimeType, "application/vnd.nokia.ringing-tone" );
+    
+    Cancel(); // stop previous play
+    
+    if ( !iFullName || iFullName->Des().Length() == 0 )
+        {
+        User::Leave( KErrNotFound );
+        }
+
+    TRAP_IGNORE( ReadActiveProfileL() );
+
+    TPtrC fileName( iFullName->Des() );
+    TDataType dataType;
+    TInt err = GetDataType( fileName, dataType );
+    if ( err == KErrNotFound )
+        {
+        fileName.Set( iDefaultTone );
+        if ( fileName.Length() == 0 )
+             {
+             User::Leave( KErrNotFound );
+             }
+        }
+    else if ( err != KErrNone )
+        {
+        User::Leave( err );
+        }
+        
+    TBool mimeTypeRng = EFalse;
+    
+    if ( err == KErrNone )
+        {
+        if( dataType.Des().CompareF( KFileListRngMimeType ) == 0 )
+            {
+            mimeTypeRng = ETrue;
+            }
+        }
+
+    TInt ringingType = RingingType();
+    if ( ringingType == ERingingTypeBeepOnce )
+        {
+        // Active profile ringing tone is set to Beep Once
+        // Don't initialize a FileSequence but use DesSequence instead
+        iTonePlayer = CMdaAudioToneUtility::NewL( *this );
+        iTonePlayer->PrepareToPlayDesSequence( KFileListBeepSequence() );
+        iTonePlayerStatus = EPlayerInitializing;
+        }
+    else
+        {
+        if( mimeTypeRng )
+            {
+            //Ringingtone is a RNG-file
+            iTonePlayer = CMdaAudioToneUtility::NewL( *this );
+            iTonePlayer->PrepareToPlayFileSequence( fileName );
+            iTonePlayerStatus = EPlayerInitializing;
+            }
+        else
+            {
+            delete iAudioPlayer;
+            iAudioPlayer = 0;
+
+            iAudioPlayer = CDrmPlayerUtility::NewFilePlayerL(
+                fileName, *this, KAudioPriorityRingingTonePreview,
+                ( TMdaPriorityPreference )KAudioPrefRingFilePreview );
+    
+            iAudioPlayerStatus = EPlayerInitializing;
+            }
+        }
+    DisableBackLight();
+    }
+
+void CTonePlayer::Stop()
+    {
+    Cancel();
+    }
+
+TInt CTonePlayer::ConvertVolume( TInt aVolume )
+    {
+    TInt result = 0;
+    if ( iAudioPlayer )
+        {
+        result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iAudioPlayer->MaxVolume() );
+        }
+    else if ( iTonePlayer )
+        {
+        result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iTonePlayer->MaxVolume() );
+        }
+        
+    //if user has selected silent ringing type, set volume off
+    TInt ringingType = RingingType();
+    if( ringingType == ERingingTypeSilent )
+        {
+        result = 0;
+        }
+
+    return result;
+    }
+
+void CTonePlayer::SetToneRingingType( TInt aRingingType )
+    {
+    const TInt KToneInterval = 1000000; // 1 second pause between tones
+    const TInt KAscendingVolumeInterval = 3000000; // 3 seconds
+    
+    if ( !iTonePlayer )
+        {
+        return;
+        }
+    TInt ringingVolume = RingingVolume();
+    
+    switch( aRingingType )
+        {
+        case ERingingTypeRinging:
+        case ERingingTypeSilent:
+            {
+            iTonePlayer->SetRepeats( KMdaAudioToneRepeatForever,
+                                     TTimeIntervalMicroSeconds( KToneInterval ) );
+            break;
+            }
+        case ERingingTypeAscending:
+            {
+            iTonePlayer->SetRepeats( KMdaAudioToneRepeatForever,
+                                     TTimeIntervalMicroSeconds( KToneInterval ) );
+            
+            TInt volRamp = KAscendingVolumeInterval * ringingVolume;
+            iTonePlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) );
+            break;
+            }
+        case ERingingTypeRingOnce:
+        case ERingingTypeBeepOnce:
+            {
+            iTonePlayer->SetRepeats( 0, TTimeIntervalMicroSeconds( KToneInterval ) );
+            break;
+            }
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+void CTonePlayer::SetAudioRingingType( TInt aRingingType )
+    {
+    const TInt KToneInterval = 1000000; // 1 second pause between tones
+    const TInt KAscendingVolumeInterval = 3000000; // 3 seconds
+    
+    if ( !iAudioPlayer )
+        {
+        return;
+        }
+
+    TInt ringingVolume = RingingVolume();
+        
+    switch( aRingingType )
+        {
+        case ERingingTypeRinging:
+        case ERingingTypeSilent:
+            {
+            iAudioPlayer->SetRepeats( KMdaAudioToneRepeatForever,
+                                      TTimeIntervalMicroSeconds( KToneInterval ) );
+            break;
+            }
+        case ERingingTypeAscending:
+            {
+            iAudioPlayer->SetRepeats( KMdaAudioToneRepeatForever,
+                                      TTimeIntervalMicroSeconds( KToneInterval ) );
+            TInt volRamp = KAscendingVolumeInterval * ringingVolume;
+            iAudioPlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) );
+            break;
+            }
+        case ERingingTypeRingOnce:
+            {
+            iAudioPlayer->SetRepeats( 0, TTimeIntervalMicroSeconds( KToneInterval ) );
+            break;
+            }
+
+        default:
+            {
+            break;
+            }
+        }
+    }
+
+void CTonePlayer::Cancel()
+    {
+    TBool isPlaying = EFalse;
+    
+    if ( iAudioPlayer )
+        {
+        isPlaying = ETrue;
+        if ( iAudioPlayerStatus == EPlayerPlayingWith3DEffect )
+            {
+            i3dRingingTonePlugin->Stop();
+            // plugin calls AudioPlayer->Stop()
+            iAudioPlayer->Close();
+            }
+        if ( iAudioPlayerStatus == EPlayerPlaying )
+            {
+            iAudioPlayer->Stop();
+            iAudioPlayer->Close();
+            }
+        
+        delete iAudioPlayer;
+        iAudioPlayer = 0;
+        iAudioPlayerStatus = EPlayerNotCreated;
+        }
+    
+    if ( iTonePlayer )
+        {
+        isPlaying = ETrue;
+        if ( iTonePlayerStatus == EPlayerPlaying )
+            {
+            iTonePlayer->CancelPlay();
+            }
+        
+        delete iTonePlayer;
+        iTonePlayer = 0;
+        iTonePlayerStatus = EPlayerNotCreated;
+        }
+        
+
+    if ( isPlaying )
+        {
+        //User::InfoPrint(_L("cancel"));
+//        EnableScreenSaver( ETrue );
+        iBacklightTimer->Cancel();
+        }
+    }
+
+void CTonePlayer::MatoPlayComplete( TInt aError )
+    {
+    Cancel();
+    iTonePlayWatcher->HandlePreviewEvent( aError );
+    }
+
+void CTonePlayer::MatoPrepareComplete( TInt aError )
+    {
+    if ( aError != KErrNone )
+        {
+        Cancel();
+        
+        iTonePlayWatcher->HandlePreviewEvent( aError );
+        return;
+        }
+
+    TInt ringingVolume = RingingVolume();
+    TInt ringingType = RingingType();
+    TInt vibra = Vibra();
+       
+    iTonePlayerStatus = EPlayerInitialized;
+    SetToneRingingType( ringingType );
+    iTonePlayer->SetVolume( ConvertVolume( ringingVolume ) );
+    
+    TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview;               
+    if ( vibra )
+        {
+        pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra;
+        }
+    iTonePlayer->SetPriority( KAudioPriorityPreview, pref );
+                                             
+    iTonePlayer->Play();
+    iTonePlayerStatus = EPlayerPlaying;
+    }
+
+void CTonePlayer::MdapcInitComplete( TInt aError, 
+                        const TTimeIntervalMicroSeconds& /* aDuration */ )
+    {
+    if ( aError != KErrNone )
+        {
+        Cancel();
+        iTonePlayWatcher->HandlePreviewEvent( aError );
+        return;
+        }
+        
+
+    TInt ringingVolume = RingingVolume();
+    TInt ringingType = RingingType();
+    TInt vibra = Vibra();
+    TInt echo3D = Echo3D();
+    TInt effect3D = Effect3D();
+
+    
+
+    iAudioPlayerStatus = EPlayerInitialized;
+    SetAudioRingingType( ringingType );
+    iAudioPlayer->SetVolume( ConvertVolume( ringingVolume ) );
+    
+    TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview;               
+    if ( vibra )
+        {
+        pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra;
+        }
+    iAudioPlayer->SetPriority( KAudioPriorityPreview, pref );
+     
+    iAudioPlayerStatus = EPlayerPlaying;
+    
+    if ( effect3D == EProfile3DEffectOff )
+        {
+        iAudioPlayer->Play();  // 3D not used
+        return;
+        }
+
+    if ( !i3dRingingTonePlugin )
+        {
+        TUid emptyUid = { 0 };
+        TRAPD( err, i3dRingingTonePlugin = C3DRingingToneInterface::NewL( emptyUid ) );
+        if ( err != KErrNone || !i3dRingingTonePlugin )
+            {
+            iAudioPlayer->Play();
+            return;
+            }
+        }       
+   
+    i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEffect, effect3D );
+    i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEcho, echo3D );    
+    i3dRingingTonePlugin->SetAttr( E3DRTIAttrDrmPlayerUtility, iAudioPlayer );
+    TRAP_IGNORE( i3dRingingTonePlugin->PlayL() );
+
+    iAudioPlayerStatus = EPlayerPlayingWith3DEffect;
+    }
+
+void CTonePlayer::MdapcPlayComplete( TInt aError )
+    {  
+    Cancel();
+    iTonePlayWatcher->HandlePreviewEvent( aError );
+    }
+
+void CTonePlayer::HandleLosingForeground()
+    {
+    if ( IsPlaying() )
+        {
+        Stop();
+        }
+    }
+void CTonePlayer::HandleGainingForeground()
+    {
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/CTonePlayer.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,202 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The header file for tone playing.
+ *     
+ */
+
+#ifndef CTONEPLAYER_H
+#define CTONEPLAYER_H
+
+#include <e32base.h>
+#include <coemain.h>
+#include <DrmAudioSamplePlayer.h>
+#include <mdaaudiotoneplayer.h>
+#include <videoplayer.h>
+#include <centralrepository.h>
+#include <apgcli.h>  // for RApaLsSession
+#include <e32property.h>
+
+class C3DRingingToneInterface;
+class RWindow;
+class MTonePlayingWatcher;
+/**
+* CMFPreviewHandlerBase
+*
+* Base class for CMFAudioPreviewHandler.
+ */
+class CMFPreviewHandlerBase : public CBase
+                        
+    {
+    public:     
+       enum TMediaFileType
+           {
+           EMediaFileTypeAudio = 0,
+           EMediaFileTypeVideo
+           };
+        enum TPlayerStatus
+            {
+            EPlayerNotCreated,
+            EPlayerInitializing,
+            EPlayerReady,
+            EPlayerPlaying,
+            EPlayerInitialized,
+            EPlayerPlayingWith3DEffect
+            };
+    
+        // these must match with the ones in Profile Engine
+        enum TRingingTypes
+            {
+            ERingingTypeRinging = 0,
+            ERingingTypeAscending,
+            ERingingTypeRingOnce,
+            ERingingTypeBeepOnce,
+            ERingingTypeSilent
+            };
+    
+        enum TFLAllowScreenSaver
+            {
+            EFLScreenSaverAllowed = 0, EFLScreenSaverNotAllowed
+            };
+    public:    
+        void SetAttrL(const TDesC& aFileName);    
+        TInt Attr(TInt aAttr);    
+        virtual void PlayL() = 0;
+        virtual void Stop() = 0;
+        virtual TBool IsPlaying() = 0;
+           
+    protected:    
+        virtual ~CMFPreviewHandlerBase();
+    
+    protected:    
+        /**
+         * C++ default constructor.
+         */
+        CMFPreviewHandlerBase( );    
+        /**
+         * By default Symbian OS constructor is private.
+         */
+        void ConstructL();
+     
+    protected:
+        TInt ConvertVolume(TInt aVolume);
+        void ReadActiveProfileL();
+        TInt GetDataType(const TDesC& aFileName, TDataType& aDataType);
+        void ReadDefaultToneL();   
+        void DisableBackLight();    
+        static TInt DoResetInactivityTimer(TAny* aObject);
+        TInt RingingVolume();
+        TInt RingingType();
+        TInt Vibra();
+        TInt Echo3D();
+        TInt Effect3D();
+        static TInt ConvertVolume(TInt aVolume, TInt aMaxVolume);    
+    
+    protected:
+        TInt iRingingVolume;
+        TInt iRingingType;
+        TInt iVibra;
+        TInt i3DEffect;
+        TInt i3DEcho;
+        TInt iMediaType;
+        TInt iFileSize;
+        HBufC* iFullName;    
+        TBool iActiveProfileRead;
+        TInt iActiveProfileRingingVolume;
+        TInt iActiveProfileRingingType;
+        TInt iActiveProfileVibra;
+        TInt iActiveProfile3DEffect;
+        TInt iActiveProfile3DEcho;    
+        TInt iPlayerStatus;    
+        // handle to window
+        RWindow* iWindow; // does not own    
+        // for getting file MIME types
+        RApaLsSession iApaSession;    
+        // for setting screensaver on/off
+        RProperty iProperty;    
+        // default ringing tone
+        TFileName iDefaultTone;        
+        /**
+         * Timer for resetting the user inactivity timeout
+         */
+        CPeriodic* iBacklightTimer;
+    };
+
+// CLASS DECLARATION
+/**
+ *  This class is used for playing the tones.
+ *
+ */
+
+class CTonePlayer : public CMFPreviewHandlerBase,
+                    public MDrmAudioPlayerCallback,
+                    public MMdaAudioToneObserver,
+                    public MCoeForegroundObserver
+    {
+    public:
+        static CTonePlayer* NewL( MTonePlayingWatcher *aWatcher );
+        static CTonePlayer* NewLC( MTonePlayingWatcher *aWatcher );
+        virtual ~CTonePlayer();   
+    
+        
+    public:
+        void PlayL();
+        void Stop();
+        TBool IsPlaying();
+    
+    private:
+        CTonePlayer( MTonePlayingWatcher *aWatcher );
+        void ConstructL();
+        void Cancel();
+        void SetAudioRingingType( TInt aRingingType );
+        void SetToneRingingType( TInt aRingingType );
+        TInt ConvertVolume( TInt aVolume );        
+            
+    private:
+        // from MMdaAudioToneObserver
+        virtual void MatoPrepareComplete( TInt aError );
+        virtual void MatoPlayComplete(TInt aError);
+    
+    private:
+        // from MDrmAudioPlayerCallback
+        void MdapcInitComplete(TInt aError,
+                const TTimeIntervalMicroSeconds& aDuration);
+        void MdapcPlayComplete(TInt aError);
+        
+        // from MCoeForegroundObserver
+        void HandleLosingForeground();
+        void HandleGainingForeground();
+    
+    private:
+        //wacher of the playing process
+        MTonePlayingWatcher* iTonePlayWatcher;
+        
+        // audio player
+        CDrmPlayerUtility* iAudioPlayer;
+    
+        /// Audioplayer status
+        TPlayerStatus iAudioPlayerStatus;
+    
+        /// toneplayer
+        CMdaAudioToneUtility* iTonePlayer;
+    
+        /// Toneplayer status
+        TPlayerStatus iTonePlayerStatus;
+        
+        // plugin for playing 3D effects
+        C3DRingingToneInterface* i3dRingingTonePlugin;
+    
+    };
+    
+#endif /* CTONEPLAYER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/CToneSelection.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,405 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The source file for mde tone fetcher.
+ *     
+ */
+#include "CToneSelection.h"
+#include <pathinfo.h>
+#include <bautils.h>
+#include "tonefetcherengine.h"
+#include "MToneSelectionWatcher.h"
+#include <centralrepository.h>
+#include <ProfileEngineDomainCRKeys.h>
+#include <tonefetcherlogger.h>
+#include <QString>
+
+//refresh interval, 2 seconds.
+const TInt KTimerInterval = 2 * 1000 * 1000;
+const TInt KObserverCallStep = 100;
+// CONSTANTS
+_LIT( KMimeMp3, "mp3" );
+
+CMFActiveCaller* CMFActiveCaller::NewL( CToneSelection* aObserver )
+    {
+    CMFActiveCaller* self = new (ELeave) CMFActiveCaller( aObserver );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    CleanupStack::Pop( self );
+
+    return self;
+    }
+
+CMFActiveCaller::~CMFActiveCaller()
+    {
+    Cancel();
+    iTimer.Close();
+    }
+
+CMFActiveCaller::CMFActiveCaller(CToneSelection* aObserver) : CActive(CActive::EPriorityStandard)
+    {
+    iObserver = aObserver;
+    }
+
+void CMFActiveCaller::ConstructL()
+    {
+    User::LeaveIfError( iTimer.CreateLocal() );
+    CActiveScheduler::Add( this );
+    }
+
+void CMFActiveCaller::DoCancel()
+    {
+    iTimer.Cancel();
+    }
+
+void CMFActiveCaller::RunL()
+    {
+    iObserver->ChangeObject();
+    }
+
+void CMFActiveCaller::Request()
+    {
+    Cancel();
+    SetActive();
+    TRequestStatus* status = &iStatus;
+    User::RequestComplete( status, KErrNone );
+    }
+
+void CMFActiveCaller::Start( TInt aMilliseconds )
+    {    
+    Cancel();
+
+    if ( aMilliseconds <= 0 )
+        {
+        Request();  // no delay - complete asap
+        }
+    else
+        {
+        iTimer.After( iStatus, aMilliseconds );
+        SetActive();
+        }
+    }
+
+void CMFActiveCaller::Stop()
+    {
+    Cancel();
+    }
+
+CToneSelection* CToneSelection::NewL( MToneSelectionWatcher *aWatcher )
+    {
+    CToneSelection* self = CToneSelection::NewLC(aWatcher);
+    CleanupStack::Pop( self );
+    return self;
+    }
+
+CToneSelection* CToneSelection::NewLC( MToneSelectionWatcher *aWatcher )
+    {
+    CToneSelection* self = new ( ELeave ) CToneSelection( aWatcher );
+    CleanupStack::PushL( self );
+    self->ConstructL();
+    return self;
+    }
+
+void CToneSelection::ConstructL()
+    {
+    iSession = CMdESession::NewL( *this );    
+    iObjectNotificationCaller = CMFActiveCaller::NewL( this );    
+    }
+
+CToneSelection::CToneSelection( MToneSelectionWatcher *aWatcher ) : iToneSelectionWatcher( aWatcher )
+    {
+    iMediaFileCounter = 0;
+    iIsQuerying = EFalse;
+    }
+
+CToneSelection::~CToneSelection()
+    {
+    iResultArray.ResetAndDestroy();
+    delete iQuery;
+    delete iSession;
+    delete iObjectNotificationCaller;
+    }
+
+void CToneSelection::HandleSessionOpened( CMdESession& /*aSession*/, TInt aError )
+    {
+    if ( aError != KErrNone )
+        {
+        iDefNS = 0;
+        delete iSession;
+        iSession = 0;
+        iSessionOpen = EFalse;
+        iToneSelectionWatcher->HandleMdeSessionError( aError );
+        }
+    else
+        {
+        iDefNS = &iSession->GetDefaultNamespaceDefL();
+        iSessionOpen = ETrue;
+        TRAP_IGNORE( AddObjectObserverL() );
+        iToneSelectionWatcher->HandleMdeSessionOpened();
+        }
+    }
+
+
+
+void CToneSelection::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
+    {
+    if ( aError == KErrNone )
+        {
+        return;
+        }
+        
+    delete iSession;
+    iSession = 0;
+    iSessionOpen = EFalse;
+    iToneSelectionWatcher->HandleMdeSessionError( aError );
+    }
+
+void CToneSelection::HandleQueryNewResults( CMdEQuery& /*aQuery*/, 
+                                               TInt /*aFirstNewItemIndex*/,
+                                               TInt /*aNewItemCount*/ )
+    {
+    }
+
+void CToneSelection::HandleObjectNotification( CMdESession& /*aSession*/, 
+                                        TObserverNotificationType aType,
+                                        const RArray<TItemId>& aObjectIdArray )
+    {   
+    /*if ( aObjectIdArray.Count() > 0 && ( aType == ENotifyAdd || aType == ENotifyModify || aType == ENotifyRemove ) )
+        {
+        QString str("CToneSelection::HandleObjectNotification " + QString::number(aObjectIdArray.Count()) + " " + QString::number(aType));
+        TF_LOG(str);        
+        iMediaFileCounter = iMediaFileCounter + aObjectIdArray.Count();
+        if ( iMediaFileCounter >= KObserverCallStep )
+            {
+            iMediaFileCounter = 0;
+            iToneSelectionWatcher->HandleObjectChanged();
+            }
+        else 
+            {
+            iObjectNotificationCaller->Start(KTimerInterval);
+            }        
+        }*/
+    }
+
+void CToneSelection::AddObjectObserverL()
+    {
+    if ( iSessionOpen )
+        {
+        TUint32 notificationType = ENotifyAdd | ENotifyModify | ENotifyRemove;        
+        iSession->AddObjectObserverL( *this, 0, notificationType, iDefNS );
+        
+        iSession->AddObjectPresentObserverL( *this );
+        }
+    }
+
+void CToneSelection::HandleObjectPresentNotification( CMdESession& /*aSession*/, 
+                         TBool /*aPresent*/, const RArray<TItemId>& aObjectIdArray )
+    {
+    
+    if( aObjectIdArray.Count() > 0 )
+        {
+        //if query is executing, we do not allow the fresh of contents
+        if ( iIsQuerying )
+            {
+            iMediaFileCounter = 0;
+            return;
+            }
+        QString str("CToneSelection::HandleObjectPresentNotification " + QString::number(aObjectIdArray.Count()));
+        TF_LOG(str);
+        iMediaFileCounter = iMediaFileCounter + aObjectIdArray.Count();
+        if ( iMediaFileCounter > KObserverCallStep )
+            {
+            iMediaFileCounter = 0;
+            iToneSelectionWatcher->HandleObjectChanged();
+            }
+        else 
+            {
+            iObjectNotificationCaller->Start(KTimerInterval);
+            }    
+        }    
+    }
+
+void CToneSelection::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError )
+    {
+    iIsQuerying = EFalse;
+    iResultArray.ResetAndDestroy();
+    if ( aError == KErrCancel )
+        {      
+        iToneSelectionWatcher->HandleQueryError( aError );
+        return;
+        }
+    else
+        {
+        CMdEObjectQuery* query = static_cast<CMdEObjectQuery*> (&aQuery);
+        TInt count = query->Count();
+        for (TInt i = 0; i < count; ++i)
+            {
+            CMdEObject* object =
+                    (CMdEObject*) query->TakeOwnershipOfResult(i);
+            CleanupStack::PushL(object);
+            CMdEPropertyDef& propDef = 
+                        CToneSelection::PropertyDefL( iSession, CToneSelection::EAttrSongName  );
+                
+            CMdEProperty* property = 0;
+            TInt err = object->Property( propDef, property, 0 );
+            if ( err != KErrNotFound && property )
+                {            
+                HBufC* songUri = HBufC::NewL( object->Uri().Length() );
+                TPtr ptr = songUri->Des();
+                ptr.Copy( object->Uri() );
+                iResultArray.AppendL( songUri );
+                }
+            CleanupStack::PopAndDestroy( object );
+            }
+        iToneSelectionWatcher->HandleQueryComplete( iResultArray );     
+        }
+    }
+
+void CToneSelection::QueryTonesL()
+    {
+    LeaveIfSessionClosedL();
+    delete iQuery;
+    iQuery = 0;
+    CMdEObjectDef& musicObjectDef =
+            iDefNS->GetObjectDefL( MdeConstants::Audio::KAudioObject );    
+    iQuery = iSession->NewObjectQueryL( *iDefNS, musicObjectDef, this );    
+    
+    // set attributes that are included in query result  
+    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
+    iQuery->AddPropertyFilterL( &namePropertyDef );
+    
+    iQuery->SetResultMode( EQueryResultModeItem );
+    
+    CMdELogicCondition& conditions = iQuery->Conditions();
+    ExcludeMusicPropertiesL( conditions );
+    iIsQuerying = ETrue;
+    iQuery->FindL();
+    }
+
+void CToneSelection::LeaveIfSessionClosedL()
+    {
+    if ( !iSession || !iSessionOpen )
+        {
+        User::Leave( KErrDisconnected );
+        }
+    }
+
+CMdEPropertyDef& CToneSelection::PropertyDefL( TInt aAttr )
+    {
+    return PropertyDefL( iSession, aAttr );
+    }
+
+CMdEPropertyDef& CToneSelection::PropertyDefL( CMdESession* aSession, TInt aAttr )
+    {
+    CMdEObjectDef& objectDef = 
+            iDefNS->GetObjectDefL( MdeConstants::Audio::KAudioObject );
+   
+    if ( aAttr == EAttrFileSize )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
+        }
+    else if ( aAttr == EAttrMediaType )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
+        }
+    else if ( aAttr == EAttrSongName || aAttr == EAttrFileName )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
+        }
+    else if ( aAttr == EAttrArtist )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty );
+        }
+    else if ( aAttr == EAttrAlbum )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty );
+        }
+    else if ( aAttr == EAttrGenre )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
+        }
+    else if ( aAttr == EAttrComposer )
+        {
+        return objectDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty );
+        }
+    else
+        {
+        User::Leave( KErrNotSupported );
+        }
+    }
+
+void CToneSelection::ExcludeMusicPropertiesL( CMdELogicCondition& aCondition )
+    {
+    TInt sizeLimitKB = 0;
+    CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
+    CleanupStack::PushL( cenrep );
+    User::LeaveIfError( cenrep->Get( KProEngRingingToneMaxSize, sizeLimitKB ) );
+    CleanupStack::PopAndDestroy(); // cenrep
+
+    SetAttr( CToneSelection::EAttrFileSize, sizeLimitKB );
+    CMdEPropertyDef& sizeTypeDef = PropertyDefL( EAttrFileSize );
+    CMdEPropertyDef& mimeTypeDef = PropertyDefL( EAttrMediaType );
+    CMdEPropertyDef& artistTypeDef = PropertyDefL( EAttrArtist );
+    CMdEPropertyDef& albumTypeDef = PropertyDefL( EAttrAlbum );
+    CMdEPropertyDef& genreTypeDef = PropertyDefL( EAttrGenre );
+    CMdEPropertyDef& composerTypeDef = PropertyDefL( EAttrComposer );
+    
+    CMdELogicCondition& condition = 
+                        aCondition.AddLogicConditionL( ELogicConditionOperatorAnd );
+    condition.AddPropertyConditionL( sizeTypeDef, TMdEIntRange(0, iMaxFileSize, EMdERangeTypeBetween) );
+    condition.AddPropertyConditionL( mimeTypeDef, 
+            ETextPropertyConditionCompareContains, KMimeMp3 );
+    condition.AddPropertyConditionL( artistTypeDef );
+    condition.AddPropertyConditionL( albumTypeDef );
+    condition.AddPropertyConditionL( genreTypeDef );
+    condition.AddPropertyConditionL( composerTypeDef );
+    
+    condition.SetNegate( ETrue );
+    }
+
+void CToneSelection::SetAttr( int attr, int value )
+{
+    switch ( attr )
+        {
+        case CToneSelection::EAttrFileSize:
+            {
+            iMaxFileSize = value;
+            break;
+            }            
+        default:
+            {
+            break;
+            }
+        }
+}
+
+void CToneSelection::ChangeObject()
+    {    
+    if ( QueryReady() )
+        {
+        iToneSelectionWatcher->HandleObjectChanged();
+        }
+    }
+
+TBool CToneSelection::QueryReady() 
+    {
+    if ( iQuery )
+        {
+        return iQuery->IsComplete();    
+        }
+     
+    return ETrue;
+    }
+// End of File
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/CToneSelection.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,170 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The header file for mde tone fetcher.
+ *     
+ */
+
+#ifndef CTONESELECTION_H
+#define CTONESELECTION_H
+
+#include <e32base.h>
+#include <mdesession.h>
+#include <mdequery.h>
+#include <mdelogiccondition.h>
+#include <mdeconstants.h>
+#include <mdeobjectquery.h>
+#include <mdccommon.h>
+#include <mdeitem.h>
+#include <mdeobject.h>
+
+// FORWARD DECLARATIONS
+class MToneSelectionWatcher;
+class CToneSelection;
+
+/**
+* CMFActiveCaller
+*
+* CMFActiveCaller is used for generating a call from active scheduler.
+* Typical use is to start some operation after a short delay.
+*/
+NONSHARABLE_CLASS (CMFActiveCaller) : public CActive
+    {
+    public:
+        static CMFActiveCaller* NewL( CToneSelection* aObserver );
+        virtual ~CMFActiveCaller();
+
+    private:
+        CMFActiveCaller( CToneSelection* aObserver );
+        void ConstructL();
+
+    public:
+        void Start( TInt aMilliseconds );
+        void Stop();
+        void Request();
+
+    private:
+        void RunL();
+        void DoCancel();
+        
+    private:
+        // timer
+        RTimer iTimer;
+
+        // observer that gets called
+        CToneSelection* iObserver;
+    };
+
+// CLASS DECLARATION
+/**
+ *  This class is used for quering tones from mde.
+ *
+ */
+class CToneSelection : public CBase, 
+                       public MMdESessionObserver,
+                       public MMdEQueryObserver,
+                       public MMdEObjectObserver,
+                       public MMdEObjectPresentObserver                            
+    {
+    public:
+        enum TStorageType
+            {
+            EPhoneMemory = 0, ERomStorage, EMassStorage, EMemoryCard
+            };
+        
+        enum TQueryAttribute
+            {
+            EAttrMediaType = 20, // integer
+            EAttrFileSize, // integer
+            EAttrStorageType, // integer
+            EAttrMediaFileId, // integer
+            EAttrFileName, // string
+            EAttrFullName, // string
+            EAttrSongName, // string
+            EAttrArtist, // string
+            EAttrAlbum, // string
+            EAttrGenre, // string
+            EAttrComposer
+            };
+    
+    public:
+        static CToneSelection* NewL( MToneSelectionWatcher *aWatcher );
+        static CToneSelection* NewLC( MToneSelectionWatcher *aWatcher );
+        
+        virtual ~CToneSelection();
+        //iTimer's callback function.
+        void ChangeObject();
+        void QueryTonesL();   
+        void SetAttr( int attr, int value );
+        TBool QueryReady();
+    
+    private:   
+        CToneSelection(  MToneSelectionWatcher *aWatcher );
+        void ConstructL(); 
+        void ExcludeMusicPropertiesL( CMdELogicCondition& aCondition );    
+        void LeaveIfSessionClosedL();
+        CMdEPropertyDef& PropertyDefL(TInt aAttr);
+        CMdEPropertyDef& PropertyDefL(CMdESession* aSession, TInt aAttr);
+    
+    private:
+        // from MMdESessionObserver
+        void HandleSessionOpened( CMdESession& aSession, TInt aError );
+        void HandleSessionError( CMdESession& aSession, TInt aError );
+    
+    private:
+        // from MMdEQueryObserver (mdequery.h)
+        void HandleQueryNewResults( CMdEQuery& aQuery, TInt aFirstNewItemIndex,
+                TInt aNewItemCount );
+        void HandleQueryCompleted( CMdEQuery& aQuery, TInt aError );    
+    private:
+        // from MMdEObjectObserver
+        void HandleObjectNotification( CMdESession& aSession,
+                TObserverNotificationType aType,
+                const RArray<TItemId>& aObjectIdArray );
+    
+    private:
+        // from MMdEObjectPresentObserver
+        void HandleObjectPresentNotification( CMdESession& aSession,
+                TBool aPresent, const RArray<TItemId>& aObjectIdArray);
+        void AddObjectObserverL();
+        void HandleObjectChanged();
+    private:
+    
+        MToneSelectionWatcher* iToneSelectionWatcher;
+    
+        // session to metadata engine
+        CMdESession* iSession;
+        
+        CMdENamespaceDef* iDefNS; 
+    
+        // metadata query
+        CMdEObjectQuery* iQuery;
+        TBool iIsQuerying;
+    
+        // used for saving the quering result.
+        RPointerArray<TDesC> iResultArray;
+    
+        // is metadata session open
+        TBool iSessionOpen;
+    
+        // max audio file file size
+        TInt iMaxFileSize;
+        
+        TInt iMediaFileCounter;
+        // for generating active object calls
+        CMFActiveCaller* iObjectNotificationCaller;
+        
+    };
+#endif /* CTONESELECTION_H */
+
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/MTonePlayingWatcher.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,34 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ * 
+ *     
+ */
+
+#ifndef MTONEPLAYINGWATCHER_H
+#define MTONEPLAYINGWATCHER_H
+
+#include <e32def.h>
+
+/*
+ * this class is used to watch tone playing event, inherited by ToneFetcherEnginePrivate
+ */
+class MTonePlayingWatcher
+    {
+    public:
+        // handle preview event
+        virtual void HandlePreviewEvent( TInt event ) = 0;
+    };
+
+#endif /* MTONEPLAYINGWATCHER_H */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/MToneSelectionWatcher.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,47 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *   
+ *     
+ */
+
+#ifndef MTONESELECTIONWATCHER_H
+#define MTONESELECTIONWATCHER_H
+
+#include <e32def.h>
+#include <e32cmn.h> 
+
+/*
+ * this class is used to watch MDE system change, inherited by ToneFetcherEnginePrivate
+ */
+class MToneSelectionWatcher
+    {
+    public:
+        // handle mde session error event
+        virtual void HandleMdeSessionError( TInt aError ) = 0;
+        
+        // handle mde session open event
+        virtual void HandleMdeSessionOpened() = 0;
+        
+        // handle query error event        
+        virtual void HandleQueryError( TInt aError ) = 0;
+        
+        // handle query complete event
+        virtual void HandleQueryComplete( RPointerArray<TDesC>& ) = 0;
+        
+        // handle object changed event
+        virtual void HandleObjectChanged() = 0;
+    };
+
+#endif /* MTONESELECTIONWATCHER_H */
--- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/tonepreviewprivate.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,603 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- *     The source file for tone previewing.
- *     
- */
-#include "tonepreviewprivate.h"
-#include "tonefetcherutils.h"
-#include <AudioPreference.h>             // KAudioPriorityPreview
-#include <c3dringingtoneinterface.h>     // C3DRingingToneInterface
-#include <ctsydomainpskeys.h>            // for phone call states
-#include <MProfileEngine.h>
-#include <MProfile.h>
-#include <MProfileTones.h>
-#include "TProfileToneSettings.h"
-#include <MProfileExtraSettings.h>
-#include <MProfile3DToneSettings.h>
-#include <ProfileInternal.hrh>
-#include <ProfileEngineDomainCRKeys.h>   // KProEngDefaultRingingTone
-#include <XQConversions>
-#include <QChar>
-
-CMFPreviewHandlerBase::CMFPreviewHandlerBase( QObject *parent  ) : QObject( parent )
-    {
-    iMediaType = KErrNotFound;
-    iRingingVolume = KErrNotFound;
-    iRingingType = KErrNotFound;
-    iVibra = KErrNotFound;
-    i3DEffect = KErrNotFound;
-    i3DEcho = KErrNotFound;
-    iFileSize = KErrNotFound;    
-    iFullName = 0;    
-    iActiveProfileRead = EFalse;
-    iPlayerStatus = EPlayerNotCreated;
-
-    }
-
-void CMFPreviewHandlerBase::ConstructL()
-    {
-    // To allow/not allow screensaver
-    // Errors ignored, no actions needed if API is not available
-    //iProperty.Attach( KPSUidScreenSaver, KScreenSaverAllowScreenSaver );    
-    TRAP_IGNORE(User::LeaveIfError( iApaSession.Connect() ) );
-    
-    TRAP_IGNORE( ReadDefaultToneL() );
-    // To keep backlight on while a video is being previewed
-    iBacklightTimer = CPeriodic::NewL( EPriorityLow );
-    }
-
-CMFPreviewHandlerBase::~CMFPreviewHandlerBase()
-    {
-    delete iFullName;
-    iProperty.Close();
-    
-    iApaSession.Close();
-    }
-
-void CMFPreviewHandlerBase::SetAttr(const QString &file )
-    {
-    if ( !file.isNull() )
-        {
-        QString path = ToneFetcherUtils::normalizeSeperator(file);
-        delete iFullName;
-        iFullName = 0;
-        iFullName = XQConversions::qStringToS60Desc( path );         
-        }
-    }
-
-TInt CMFPreviewHandlerBase::RingingVolume()
-    {
-    const TInt KDefaultVolumeLevel = 7; // see profile.hrh for volume levels
-    
-    if ( iRingingVolume != KErrNotFound )
-        {
-        return iRingingVolume;
-        }
-        
-    if ( iActiveProfileRead )
-        {
-        return iActiveProfileRingingVolume;
-        }
-
-    return KDefaultVolumeLevel;
-    }
-
-TInt CMFPreviewHandlerBase::RingingType()
-    {
-    if ( iRingingType != KErrNotFound )
-        {
-        return iRingingType;
-        }
-        
-    if ( iActiveProfileRead )
-        {
-        return iActiveProfileRingingType;
-        }
-
-    return ERingingTypeRinging;
-    }
-
-TInt CMFPreviewHandlerBase::Vibra()
-    {
-    if ( iVibra != KErrNotFound )
-        {
-        return iVibra;
-        }
-        
-    if ( iActiveProfileRead )
-        {
-        return iActiveProfileVibra;
-        }
-    
-    return 0;  // in case of error vibra is off
-    }
-
-TInt CMFPreviewHandlerBase::Echo3D()
-    {
-    if ( i3DEcho != KErrNotFound )
-        {
-        return i3DEcho;
-        }
-    
-    if ( iActiveProfileRead )
-        {
-        return iActiveProfile3DEcho;
-        }
-
-    return EProfile3DEchoOff;  // from ProfileInternal.hrh
-    }
-
-TInt CMFPreviewHandlerBase::Effect3D()
-    {
-    if ( i3DEffect != KErrNotFound )
-        {
-        return i3DEffect;
-        }
-    
-    if ( iActiveProfileRead )
-        {
-        return iActiveProfile3DEffect;
-        }
-
-    return EProfile3DEffectOff;
-    }
-
-TInt CMFPreviewHandlerBase::ConvertVolume( TInt aVolume, TInt aMaxVolume )
-    {
-    const TInt KMinVolumeLevel = 1;
-    const TInt KMaxVolumeLevel = 10;
-        
-    TInt result = aMaxVolume * aVolume / KMaxVolumeLevel;
-    
-    // if user has selected minimum volume level set HW volume 1
-    if ( aVolume == KMinVolumeLevel && result == 0 )
-        {
-        result = 1;
-        }
-
-    return result;
-    }
-  
-void CMFPreviewHandlerBase::ReadActiveProfileL()
-    {
-    iActiveProfileRead = EFalse;
-    
-    MProfileEngine* profileEngine = CreateProfileEngineL();
-    CleanupReleasePushL( *profileEngine );
-    
-    MProfile* activeProfile  = profileEngine->ActiveProfileL();
-    CleanupReleasePushL( *activeProfile );
-        
-    const MProfileTones& profileTones = activeProfile->ProfileTones();
-     
-    const TProfileToneSettings& toneSettings = profileTones.ToneSettings();
-    iActiveProfileVibra = toneSettings.iVibratingAlert;
-    iActiveProfileRingingVolume = toneSettings.iRingingVolume;
-    iActiveProfileRingingType = toneSettings.iRingingType;
-          
-    const MProfileExtraSettings& extra = activeProfile->ProfileExtraSettings();
-    const MProfile3DToneSettings& threeD = extra.Profile3DToneSettings();
-    
-    iActiveProfile3DEffect = threeD.Effect();
-    iActiveProfile3DEcho = threeD.Echo();
-   
-    CleanupStack::PopAndDestroy( activeProfile ); 
-    CleanupStack::PopAndDestroy( profileEngine );
-    
-    iActiveProfileRead = ETrue;
-    }
- 
-void CMFPreviewHandlerBase::ReadDefaultToneL()
-    {
-    CRepository* cenrep = CRepository::NewLC( KCRUidProfileEngine );
-
-    User::LeaveIfError( cenrep->Get( KProEngDefaultRingingTone, iDefaultTone ) );
-    CleanupStack::PopAndDestroy( cenrep );
-    }
-
-TInt CMFPreviewHandlerBase::GetDataType( const TDesC& aFileName, TDataType& aDataType )
-    {
-    TUid dummyUid( KNullUid );
-    return iApaSession.AppForDocument( aFileName, dummyUid, aDataType );
-    }
-
-TInt CMFPreviewHandlerBase::DoResetInactivityTimer( TAny* /*aObject*/ )
-    {
-    User::ResetInactivityTime();
-    return KErrNone;
-    }
-
-void CMFPreviewHandlerBase::DisableBackLight()
-    {
-        const TInt KResetInactivityTimerDelay = 2000000;
-    iBacklightTimer->Cancel(); // Just in case
-    // Disable backlight turn off during video preview
-    iBacklightTimer->Start( KResetInactivityTimerDelay,
-                            KResetInactivityTimerDelay,
-                            TCallBack( DoResetInactivityTimer, 0 ) );
-    
-    }
-
-
-
-TonePreviewPrivate::TonePreviewPrivate( QObject *parent ) : CMFPreviewHandlerBase( parent )
-    {
-    iAudioPlayerStatus = EPlayerNotCreated;
-    CMFPreviewHandlerBase::ConstructL();
-    iTonePlayerStatus = EPlayerNotCreated;
-    }
-
-TonePreviewPrivate::~TonePreviewPrivate()
-    {
-    Cancel();
-    
-    delete iAudioPlayer;
-    delete iTonePlayer;
-    delete i3dRingingTonePlugin;
-    }
-
-TBool TonePreviewPrivate::IsPlaying()
-    {
-    if ( iAudioPlayerStatus != EPlayerNotCreated )
-        {
-        return ETrue;
-        }
-    
-    if ( iTonePlayerStatus != EPlayerNotCreated )
-        {
-        return ETrue;
-        }
-
-    return EFalse;
-    }
-
-void TonePreviewPrivate::Play()
-    {
-    if( IsPlaying() )
-        {
-        Stop();
-        return;
-        }
-    //sequence for playing a beep once sound
-    _LIT8( KFileListBeepSequence, "\x00\x11\x06\x0A\x08\x73\x0A\x40\x28\x0A\xF7\
-    \x05\xFC\x40\x64\x0A\x08\x40\x32\x0A\xF7\x06\x0B" ); 
-
-    // rng mime type
-    _LIT( KFileListRngMimeType, "application/vnd.nokia.ringing-tone" );
-    
-    Cancel(); // stop previous play
-    
-    if ( !iFullName || iFullName->Des().Length() == 0 )
-        {
-        User::Leave( KErrNotFound );
-        }
-
-    TRAP_IGNORE( ReadActiveProfileL() );
-
-    TPtrC fileName( iFullName->Des() );
-    TDataType dataType;
-    TInt err = GetDataType( fileName, dataType );
-    if ( err == KErrNotFound )
-        {
-        fileName.Set( iDefaultTone );
-        if ( fileName.Length() == 0 )
-             {
-             User::Leave( KErrNotFound );
-             }
-        }
-    else if ( err != KErrNone )
-        {
-        User::Leave( err );
-        }
-        
-    TBool mimeTypeRng = EFalse;
-    
-    if ( err == KErrNone )
-        {
-        if( dataType.Des().CompareF( KFileListRngMimeType ) == 0 )
-            {
-            mimeTypeRng = ETrue;
-            }
-        }
-
-    TInt ringingType = RingingType();
-    if ( ringingType == ERingingTypeBeepOnce )
-        {
-        // Active profile ringing tone is set to Beep Once
-        // Don't initialize a FileSequence but use DesSequence instead
-        iTonePlayer = CMdaAudioToneUtility::NewL( *this );
-        iTonePlayer->PrepareToPlayDesSequence( KFileListBeepSequence() );
-        iTonePlayerStatus = EPlayerInitializing;
-        }
-    else
-        {
-        if( mimeTypeRng )
-            {
-            //Ringingtone is a RNG-file
-            iTonePlayer = CMdaAudioToneUtility::NewL( *this );
-            iTonePlayer->PrepareToPlayFileSequence( fileName );
-            iTonePlayerStatus = EPlayerInitializing;
-            }
-        else
-            {
-            delete iAudioPlayer;
-            iAudioPlayer = 0;
-
-            iAudioPlayer = CDrmPlayerUtility::NewFilePlayerL(
-                fileName, *this, KAudioPriorityRingingTonePreview,
-                ( TMdaPriorityPreference )KAudioPrefRingFilePreview );
-    
-            iAudioPlayerStatus = EPlayerInitializing;
-            }
-        }
-    DisableBackLight();
-    }
-
-void TonePreviewPrivate::Stop()
-    {
-    Cancel();
-    }
-
-TInt TonePreviewPrivate::ConvertVolume( TInt aVolume )
-    {
-    TInt result = 0;
-    if ( iAudioPlayer )
-        {
-        result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iAudioPlayer->MaxVolume() );
-        }
-    else if ( iTonePlayer )
-        {
-        result = CMFPreviewHandlerBase::ConvertVolume( aVolume, iTonePlayer->MaxVolume() );
-        }
-        
-    //if user has selected silent ringing type, set volume off
-    TInt ringingType = RingingType();
-    if( ringingType == ERingingTypeSilent )
-        {
-        result = 0;
-        }
-
-    return result;
-    }
-
-void TonePreviewPrivate::SetToneRingingType( TInt aRingingType )
-    {
-    const TInt KToneInterval = 1000000; // 1 second pause between tones
-    const TInt KAscendingVolumeInterval = 3000000; // 3 seconds
-    
-    if ( !iTonePlayer )
-        {
-        return;
-        }   
-
-
-    TInt ringingVolume = RingingVolume();
-
-    switch( aRingingType )
-        {
-        case ERingingTypeRinging:
-        case ERingingTypeSilent:
-            {
-            iTonePlayer->SetRepeats( KMdaAudioToneRepeatForever,
-                                     TTimeIntervalMicroSeconds( KToneInterval ) );
-            break;
-            }
-        case ERingingTypeAscending:
-            {
-            iTonePlayer->SetRepeats( KMdaAudioToneRepeatForever,
-                                     TTimeIntervalMicroSeconds( KToneInterval ) );
-            
-            TInt volRamp = KAscendingVolumeInterval * ringingVolume;
-            iTonePlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) );
-            break;
-            }
-        case ERingingTypeRingOnce:
-        case ERingingTypeBeepOnce:
-            {
-            iTonePlayer->SetRepeats( 0, TTimeIntervalMicroSeconds( KToneInterval ) );
-            break;
-            }
-        default:
-            {
-            break;
-            }
-        }
-    }
-
-void TonePreviewPrivate::SetAudioRingingType( TInt aRingingType )
-    {
-    const TInt KToneInterval = 1000000; // 1 second pause between tones
-    const TInt KAscendingVolumeInterval = 3000000; // 3 seconds
-    
-    if ( !iAudioPlayer )
-        {
-        return;
-        }
-
-    TInt ringingVolume = RingingVolume();
-        
-    switch( aRingingType )
-        {
-        case ERingingTypeRinging:
-        case ERingingTypeSilent:
-            {
-            iAudioPlayer->SetRepeats( KMdaAudioToneRepeatForever,
-                                      TTimeIntervalMicroSeconds( KToneInterval ) );
-            break;
-            }
-        case ERingingTypeAscending:
-            {
-            iAudioPlayer->SetRepeats( KMdaAudioToneRepeatForever,
-                                      TTimeIntervalMicroSeconds( KToneInterval ) );
-            TInt volRamp = KAscendingVolumeInterval * ringingVolume;
-            iAudioPlayer->SetVolumeRamp( TTimeIntervalMicroSeconds( volRamp ) );
-            break;
-            }
-        case ERingingTypeRingOnce:
-            {
-            iAudioPlayer->SetRepeats( 0, TTimeIntervalMicroSeconds( KToneInterval ) );
-            break;
-            }
-
-        default:
-            {
-            break;
-            }
-        }
-    }
-
-void TonePreviewPrivate::Cancel()
-    {
-    TBool isPlaying = EFalse;
-    
-    if ( iAudioPlayer )
-        {
-        isPlaying = ETrue;
-        if ( iAudioPlayerStatus == EPlayerPlayingWith3DEffect )
-            {
-            i3dRingingTonePlugin->Stop();
-            // plugin calls AudioPlayer->Stop()
-            iAudioPlayer->Close();
-            }
-        if ( iAudioPlayerStatus == EPlayerPlaying )
-            {
-            iAudioPlayer->Stop();
-            iAudioPlayer->Close();
-            }
-        
-        delete iAudioPlayer;
-        iAudioPlayer = 0;
-        iAudioPlayerStatus = EPlayerNotCreated;
-        }
-    
-    if ( iTonePlayer )
-        {
-        isPlaying = ETrue;
-        if ( iTonePlayerStatus == EPlayerPlaying )
-            {
-            iTonePlayer->CancelPlay();
-            }
-        
-        delete iTonePlayer;
-        iTonePlayer = 0;
-        iTonePlayerStatus = EPlayerNotCreated;
-        }
-        
-
-    if ( isPlaying )
-        {
-        //User::InfoPrint(_L("cancel"));
-//        EnableScreenSaver( ETrue );
-        iBacklightTimer->Cancel();
-        }
-    }
-
-void TonePreviewPrivate::MatoPlayComplete( TInt aError )
-    {
-    Cancel();
-    emit notifyPreviewEvent( ToneFetcherEngine::EAudioPreviewComplete, aError );
-    }
-
-void TonePreviewPrivate::MatoPrepareComplete( TInt aError )
-    {
-    if ( aError != KErrNone )
-        {
-        Cancel();
-        
-        emit notifyPreviewEvent( ToneFetcherEngine::EPreviewError, aError );        
-        return;
-        }
-
-    TInt ringingVolume = RingingVolume();
-    TInt ringingType = RingingType();
-    TInt vibra = Vibra();
-       
-    iTonePlayerStatus = EPlayerInitialized;
-    SetToneRingingType( ringingType );
-    iTonePlayer->SetVolume( ConvertVolume( ringingVolume ) );
-    
-    TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview;               
-    if ( vibra )
-        {
-        pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra;
-        }
-    iTonePlayer->SetPriority( KAudioPriorityPreview, pref );
-                                             
-    iTonePlayer->Play();
-    iTonePlayerStatus = EPlayerPlaying;
-    }
-
-void TonePreviewPrivate::MdapcInitComplete( TInt aError, 
-                        const TTimeIntervalMicroSeconds& /* aDuration */ )
-    {
-    if ( aError != KErrNone )
-        {
-        Cancel();
-        emit notifyPreviewEvent( ToneFetcherEngine::EPreviewError, aError );
-        return;
-        }
-        
-
-    TInt ringingVolume = RingingVolume();
-    TInt ringingType = RingingType();
-    TInt vibra = Vibra();
-    TInt echo3D = Echo3D();
-    TInt effect3D = Effect3D();
-
-    
-
-    iAudioPlayerStatus = EPlayerInitialized;
-    SetAudioRingingType( ringingType );
-    iAudioPlayer->SetVolume( ConvertVolume( ringingVolume ) );
-    
-    TMdaPriorityPreference pref = (TMdaPriorityPreference) KAudioPrefRingFilePreview;               
-    if ( vibra )
-        {
-        pref = (TMdaPriorityPreference) KAudioPrefRingFilePreviewVibra;
-        }
-    iAudioPlayer->SetPriority( KAudioPriorityPreview, pref );
-     
-    iAudioPlayerStatus = EPlayerPlaying;
-    
-    if ( effect3D == EProfile3DEffectOff )
-        {
-        iAudioPlayer->Play();  // 3D not used
-        return;
-        }
-
-    if ( !i3dRingingTonePlugin )
-        {
-        TUid emptyUid = { 0 };
-        TRAPD( err, i3dRingingTonePlugin = C3DRingingToneInterface::NewL( emptyUid ) );
-        if ( err != KErrNone || !i3dRingingTonePlugin )
-            {
-            iAudioPlayer->Play();
-            return;
-            }
-        }       
-   
-    i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEffect, effect3D );
-    i3dRingingTonePlugin->SetAttr( E3DRTIAttr3DEcho, echo3D );    
-    i3dRingingTonePlugin->SetAttr( E3DRTIAttrDrmPlayerUtility, iAudioPlayer );
-    TRAP_IGNORE( i3dRingingTonePlugin->PlayL() );
-
-    iAudioPlayerStatus = EPlayerPlayingWith3DEffect;
-    }
-
-void TonePreviewPrivate::MdapcPlayComplete( TInt aError )
-    {  
-    Cancel();
-    emit notifyPreviewEvent( ToneFetcherEngine::EAudioPreviewComplete, aError );
-    }
--- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/tonepreviewprivate.h	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,218 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- *     The header file for tone previewing.
- *     
- */
-
-#ifndef TONEPREVIEWPRIVATE_H
-#define TONEPREVIEWPRIVATE_H
-#include <e32base.h>
-#include <DrmAudioSamplePlayer.h>
-#include <mdaaudiotoneplayer.h>
-#include <videoplayer.h>
-#include <centralrepository.h>
-#include <apgcli.h>  // for RApaLsSession
-#include <e32property.h>
-#include <QObject>
-#include "tonefetcherengine.h"
-
-class C3DRingingToneInterface;
-class RWindow;
-
-/**
-* CMFPreviewHandlerBase
-*
-* Base class for CMFAudioPreviewHandler.
- */
-class CMFPreviewHandlerBase : public QObject, public CBase
-                        
-{
-Q_OBJECT
-public: 
-
-   enum TMediaFileType
-       {
-       EMediaFileTypeAudio = 0,
-       EMediaFileTypeVideo
-       };
-    enum TPlayerStatus
-        {
-        EPlayerNotCreated,
-        EPlayerInitializing,
-        EPlayerReady,
-        EPlayerPlaying,
-        EPlayerInitialized,
-        EPlayerPlayingWith3DEffect
-        };
-
-    // these must match with the ones in Profile Engine
-    enum TRingingTypes
-        {
-        ERingingTypeRinging = 0,
-        ERingingTypeAscending,
-        ERingingTypeRingOnce,
-        ERingingTypeBeepOnce,
-        ERingingTypeSilent
-        };
-
-    enum TFLAllowScreenSaver
-        {
-        EFLScreenSaverAllowed = 0, EFLScreenSaverNotAllowed
-        };
-
-protected:
-
-    virtual ~CMFPreviewHandlerBase();
-
-protected:
-
-    /**
-     * C++ default constructor.
-     */
-    CMFPreviewHandlerBase( QObject *parent );
-
-    /**
-     * By default Symbian OS constructor is private.
-     */
-    void ConstructL();
-
-public:    
-    void SetAttr(const QString &file);    
-    TInt Attr(TInt aAttr);    
-    virtual void Play() = 0;
-    virtual void Stop() = 0;
-    virtual TBool IsPlaying() = 0;
-
-protected:
-    TInt ConvertVolume(TInt aVolume);
-    void ReadActiveProfileL();
-    TInt GetDataType(const TDesC& aFileName, TDataType& aDataType);
-    void ReadDefaultToneL();   
-    
-
-    void DisableBackLight();
-
-    static TInt DoResetInactivityTimer(TAny* aObject);
-protected:
-    TInt RingingVolume();
-    TInt RingingType();
-    TInt Vibra();
-    TInt Echo3D();
-    TInt Effect3D();
-
-protected:
-    static TInt ConvertVolume(TInt aVolume, TInt aMaxVolume);    
-
-protected:
-    TInt iRingingVolume;
-    TInt iRingingType;
-    TInt iVibra;
-    TInt i3DEffect;
-    TInt i3DEcho;
-    TInt iMediaType;
-    TInt iFileSize;
-    HBufC* iFullName;
-
-    TBool iActiveProfileRead;
-    TInt iActiveProfileRingingVolume;
-    TInt iActiveProfileRingingType;
-    TInt iActiveProfileVibra;
-    TInt iActiveProfile3DEffect;
-    TInt iActiveProfile3DEcho;
-   
-
-    TInt iPlayerStatus;
-
-    // handle to window
-    RWindow* iWindow; // does not own
-
-    // for getting file MIME types
-    RApaLsSession iApaSession;
-
-    // for setting screensaver on/off
-    RProperty iProperty;
-
-    // default ringing tone
-    TFileName iDefaultTone;
-
-    // file server session
-    //RFs iFsSession;
-
-    /**
-     * Timer for resetting the user inactivity timeout
-     */
-    CPeriodic* iBacklightTimer;
-};
-
-// CLASS DECLARATION
-/**
- *  This class is used for previewing the tones.
- *
- */
-
-class TonePreviewPrivate : public CMFPreviewHandlerBase,
-                           public MDrmAudioPlayerCallback,
-                           public MMdaAudioToneObserver
-
-{
-Q_OBJECT
-public:
-    TonePreviewPrivate( QObject *parent );
-    virtual ~TonePreviewPrivate();   
-signals:
-    void notifyPreviewEvent( ToneFetcherEngine::TPreviewEvent event, int errorId );
-    
-public:
-    void Play();
-    void Stop();
-    TBool IsPlaying();
-
-private:
-    void Cancel();
-    void SetAudioRingingType( TInt aRingingType );
-    void SetToneRingingType( TInt aRingingType );
-    TInt ConvertVolume( TInt aVolume );
-        
-        
-private:
-    // from MMdaAudioToneObserver
-    virtual void MatoPrepareComplete( TInt aError );
-    virtual void MatoPlayComplete(TInt aError);
-
-private:
-    // from MDrmAudioPlayerCallback
-    void MdapcInitComplete(TInt aError,
-            const TTimeIntervalMicroSeconds& aDuration);
-    void MdapcPlayComplete(TInt aError);
-
-private:
-    // audio player
-    CDrmPlayerUtility* iAudioPlayer;
-
-    /// Audioplayer status
-    TPlayerStatus iAudioPlayerStatus;
-
-    /// toneplayer
-    CMdaAudioToneUtility* iTonePlayer;
-
-    /// Toneplayer status
-    TPlayerStatus iTonePlayerStatus;
-    
-    // plugin for playing 3D effects
-    C3DRingingToneInterface* i3dRingingTonePlugin;
-
-};
-    
-#endif /* TONEPREVIEWPRIVATE_H_ */
--- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,272 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- *     The source file for mde tone fetcher.
- *     
- */
-#include "toneselectionengine_p.h"
-#include <XQConversions>
-#include <pathinfo.h>
-#include <bautils.h>
-#include "tonepreviewprivate.h"
-#include "tonefetcherengine.h"
-#include <centralrepository.h>
-#include <ProfileEngineDomainCRKeys.h>
-
-ToneSelectionEnginePrivate::ToneSelectionEnginePrivate( ToneFetcherEngine *engine ) : mServiceEngine( engine )
-
-    {
-    iSession = CMdESession::NewL( *this );
-    
-    }
-
-ToneSelectionEnginePrivate::~ToneSelectionEnginePrivate()
-    {
-    delete iQuery;
-    delete iSession;
-    }
-
-void ToneSelectionEnginePrivate::HandleSessionOpened( CMdESession& /*aSession*/, TInt aError )
-    {
-    if ( aError != KErrNone )
-        {
-        delete iSession;
-        iSession = 0;
-        iSessionOpen = EFalse;
-        emit mdeSessionError( aError );
-        }
-    else
-        {
-        iSessionOpen = ETrue;
-        TRAP_IGNORE( AddObjectObserverL() );
-        emit mdeSessionOpened();
-        }
-    }
-
-
-
-void ToneSelectionEnginePrivate::HandleSessionError( CMdESession& /*aSession*/, TInt aError )
-    {
-    if ( aError == KErrNone )
-        {
-        return;
-        }
-        
-    delete iSession;
-    iSession = 0;
-    iSessionOpen = EFalse;
-    emit mdeSessionError( aError );            
-    }
-
-
-void ToneSelectionEnginePrivate::HandleQueryNewResults( CMdEQuery& /*aQuery*/, 
-                                               TInt /*aFirstNewItemIndex*/,
-                                               TInt /*aNewItemCount*/ )
-    {
-    }
-
-void ToneSelectionEnginePrivate::HandleObjectNotification( CMdESession& /*aSession*/, 
-                                        TObserverNotificationType aType,
-                                        const RArray<TItemId>& /*aObjectIdArray*/ )
-    {    
-    if ( aType == ENotifyAdd || aType == ENotifyModify || aType == ENotifyRemove )
-        {
-        emit notifyObjectChanged();
-        }
-    }
-
-void ToneSelectionEnginePrivate::AddObjectObserverL()
-    {
-    if ( iSessionOpen )
-        {
-        TUint32 notificationType = ENotifyAdd | ENotifyModify | ENotifyRemove;
-        CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
-        iSession->AddObjectObserverL( *this, 0, notificationType, &defNS );
-        
-        iSession->AddObjectPresentObserverL( *this );
-        }
-    }
-
-void ToneSelectionEnginePrivate::HandleObjectPresentNotification( CMdESession& /*aSession*/, 
-                         TBool /*aPresent*/, const RArray<TItemId>& aObjectIdArray )
-    {
-    if( aObjectIdArray.Count() > 0 )
-        {
-        emit notifyObjectChanged();
-        }    
-    }
-
-void ToneSelectionEnginePrivate::HandleQueryCompleted( CMdEQuery& aQuery, TInt aError )
-    {
-    iNameList.clear();
-    iUriList.clear();
-    if ( aError == KErrCancel )
-        {      
-        emit queryError( aError );
-        return;
-        }
-    else
-        {
-        CMdEObjectQuery* query = static_cast<CMdEObjectQuery*> (&aQuery);
-        TInt count = query->Count();
-        for (TInt i = 0; i < count; ++i)
-            {
-            CMdEObject* object =
-                    (CMdEObject*) query->TakeOwnershipOfResult(i);
-            CleanupStack::PushL(object);
-            CMdEPropertyDef& propDef = 
-                        ToneSelectionEnginePrivate::PropertyDefL( iSession, ToneSelectionEnginePrivate::EAttrSongName  );
-                
-            CMdEProperty* property = 0;
-            TInt err = object->Property( propDef, property, 0 );
-            if ( err != KErrNotFound && property )
-                {
-                QString songName( XQConversions::s60DescToQString( property->TextValueL() ) );
-                QString uriValue( XQConversions::s60DescToQString( object->Uri() ) );
-                iNameList.append( songName );
-                iUriList.append( uriValue );
-                }
-            CleanupStack::PopAndDestroy(object);
-            }
-        emit queryComplete(iNameList, iUriList );        
-        }
-    }
-
-void ToneSelectionEnginePrivate::QueryTones()
-    {
-    LeaveIfSessionClosedL();
-        
-    CMdENamespaceDef& defNS = iSession->GetDefaultNamespaceDefL();
-    CMdEObjectDef& musicObjectDef =
-    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
-  
-    delete iQuery;
-    iQuery = 0;
-    iQuery = iSession->NewObjectQueryL( defNS, musicObjectDef, this );    
-    
-    
-    // set attributes that are included in query result  
-    CMdEPropertyDef& namePropertyDef = PropertyDefL( EAttrSongName );
-    iQuery->AddPropertyFilterL( &namePropertyDef );
-    
-    iQuery->SetResultMode( EQueryResultModeItem );
-    
-    CMdELogicCondition& conditions = iQuery->Conditions();
-    ExcludeMusicPropertiesL( conditions );
-
-    iQuery->FindL();
-    }
-
-void ToneSelectionEnginePrivate::LeaveIfSessionClosedL()
-    {
-    if ( !iSession || !iSessionOpen )
-        {
-        User::Leave( KErrDisconnected );
-        }
-    }
-
-CMdEPropertyDef& ToneSelectionEnginePrivate::PropertyDefL( TInt aAttr )
-    {
-    return PropertyDefL( iSession, aAttr );
-    }
-
-CMdEPropertyDef& ToneSelectionEnginePrivate::PropertyDefL( CMdESession* aSession, TInt aAttr )
-    {
-    CMdENamespaceDef& defNS = aSession->GetDefaultNamespaceDefL();
-    
-    CMdEObjectDef& objectDef =
-    defNS.GetObjectDefL( MdeConstants::Audio::KAudioObject );
-   
-    if ( aAttr == EAttrFileSize )
-        {
-        return objectDef.GetPropertyDefL( MdeConstants::Object::KSizeProperty );
-        }
-    else if ( aAttr == EAttrMediaType )
-        {
-        return objectDef.GetPropertyDefL( MdeConstants::Object::KItemTypeProperty );
-        }
-    else if ( aAttr == EAttrSongName || aAttr == EAttrFileName )
-        {
-        return objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
-        }
-    else if ( aAttr == EAttrArtist )
-        {
-        return objectDef.GetPropertyDefL( MdeConstants::MediaObject::KArtistProperty );
-        }
-    else if ( aAttr == EAttrAlbum )
-        {
-        return objectDef.GetPropertyDefL( MdeConstants::Audio::KAlbumProperty );
-        }
-    else if ( aAttr == EAttrGenre )
-        {
-        return objectDef.GetPropertyDefL( MdeConstants::MediaObject::KGenreProperty );
-        }
-    else if ( aAttr == EAttrComposer )
-        {
-        return objectDef.GetPropertyDefL( MdeConstants::Audio::KComposerProperty );
-        }
-    else
-        {
-        User::Leave( KErrNotSupported );
-        }
-    
-    return objectDef.GetPropertyDefL( MdeConstants::Object::KTitleProperty );
-    }
-
-void ToneSelectionEnginePrivate::ExcludeMusicPropertiesL( CMdELogicCondition& aCondition )
-    {
-    TInt sizeLimitKB = 0;
-    CRepository* cenrep = CRepository::NewL( KCRUidProfileEngine );
-    CleanupStack::PushL( cenrep );
-    User::LeaveIfError( cenrep->Get( KProEngRingingToneMaxSize, sizeLimitKB ) );
-    CleanupStack::PopAndDestroy(); // cenrep
-
-    SetAttr( ToneFetcherEngine::EAttrFileSize, sizeLimitKB );
-    CMdEPropertyDef& sizeTypeDef = PropertyDefL( EAttrFileSize );
-    CMdEPropertyDef& mimeTypeDef = PropertyDefL( EAttrMediaType );
-    CMdEPropertyDef& artistTypeDef = PropertyDefL( EAttrArtist );
-    CMdEPropertyDef& albumTypeDef = PropertyDefL( EAttrAlbum );
-    CMdEPropertyDef& genreTypeDef = PropertyDefL( EAttrGenre );
-    CMdEPropertyDef& composerTypeDef = PropertyDefL( EAttrComposer );
-    
-    CMdELogicCondition& condition = 
-                        aCondition.AddLogicConditionL( ELogicConditionOperatorAnd );
-    condition.AddPropertyConditionL( sizeTypeDef, TMdEIntRange(0, iMaxFileSize, EMdERangeTypeBetween) );
-    condition.AddPropertyConditionL( mimeTypeDef, 
-            ETextPropertyConditionCompareContains, KMimeMp3 );
-    condition.AddPropertyConditionL( artistTypeDef );
-    condition.AddPropertyConditionL( albumTypeDef );
-    condition.AddPropertyConditionL( genreTypeDef );
-    condition.AddPropertyConditionL( composerTypeDef );
-    
-    condition.SetNegate( ETrue );
-    }
-
-void ToneSelectionEnginePrivate::SetAttr( int attr, int value )
-{
-    switch ( attr )
-        {
-        case ToneFetcherEngine::EAttrFileSize:
-            {
-            iMaxFileSize = value;
-            break;
-            }            
-        default:
-            {
-            break;
-            }
-        }
-}
-// End of File
-
--- a/controlpanelui/src/tonefetcher/tonefetcherengine/private/symbian/toneselectionengine_p.h	Fri Jun 11 16:24:15 2010 +0100
+++ /dev/null	Thu Jan 01 00:00:00 1970 +0000
@@ -1,142 +0,0 @@
-/*
- * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
- * All rights reserved.
- * This component and the accompanying materials are made available
- * under the terms of "Eclipse Public License v1.0"
- * which accompanies this distribution, and is available
- * at the URL "http://www.eclipse.org/legal/epl-v10.html".
- *
- * Initial Contributors:
- * Nokia Corporation - initial contribution.
- * 
- * Contributors:
- * 
- * Description:
- *     The header file for mde tone fetcher.
- *     
- */
-#ifndef TONESELECTIONENGINEPRIVATE_H
-#define TONESELECTIONENGINEPRIVATE_H
-
-#include "toneselectionengine_p.h"
-#include <mdesession.h>
-#include <mdequery.h>
-#include <mdelogiccondition.h>
-#include <mdeconstants.h>
-#include <mdeobjectquery.h>
-#include <mdccommon.h>
-#include <mdeitem.h>
-#include <mdeobject.h>
-#include <e32base.h>
-#include <QObject>
-#include <QStringList>
-// FORWARD DECLARATIONS
-class ToneFetcherEngine;
-// CONSTANTS
-_LIT( KMimeMp3, "mp3" );
-
-// CLASS DECLARATION
-/**
- *  This class is used for quering tones from mde.
- *
- */
-class ToneSelectionEnginePrivate : public QObject,
-                            public CBase, 
-                            public MMdESessionObserver,
-                            public MMdEQueryObserver,
-                            public MMdEObjectObserver,
-                            public MMdEObjectPresentObserver                            
-{
-    Q_OBJECT
-public:
-
-    enum TStorageType
-        {
-        EPhoneMemory = 0, ERomStorage, EMassStorage, EMemoryCard
-        };
-    
-    enum TQueryAttribute
-        {
-        EAttrMediaType = 20, // integer
-        EAttrFileSize, // integer
-        EAttrStorageType, // integer
-        EAttrMediaFileId, // integer
-        EAttrFileName, // string
-        EAttrFullName, // string
-        EAttrSongName, // string
-        EAttrArtist, // string
-        EAttrAlbum, // string
-        EAttrGenre, // string
-        EAttrComposer
-        // string
-        };
-
-public:
-    ToneSelectionEnginePrivate(  ToneFetcherEngine *engine );
-    virtual ~ToneSelectionEnginePrivate();
-    
-signals:
-    void mdeSessionOpened();
-    void mdeSessionError( int error );
-    void queryComplete( QStringList nameList, QStringList uriList );
-    void queryError( int error );
-    void notifyObjectChanged();
-
-
-public:
-    static CMdEPropertyDef& PropertyDefL(CMdESession* aSession, TInt aAttr);
-    void QueryTones();   
-    void SetAttr( int attr, int value );
-
-private:   
-    void ExcludeMusicPropertiesL(CMdELogicCondition& aCondition);    
-    void LeaveIfSessionClosedL();
-    CMdEPropertyDef& PropertyDefL(TInt aAttr);
-
-private:
-    // from MMdESessionObserver
-    void HandleSessionOpened(CMdESession& aSession, TInt aError);
-    void HandleSessionError(CMdESession& aSession, TInt aError);
-
-private:
-    // from MMdEQueryObserver (mdequery.h)
-    void HandleQueryNewResults(CMdEQuery& aQuery, TInt aFirstNewItemIndex,
-            TInt aNewItemCount);
-    void HandleQueryCompleted(CMdEQuery& aQuery, TInt aError);    
-private:
-    // from MMdEObjectObserver
-    void HandleObjectNotification(CMdESession& aSession,
-            TObserverNotificationType aType,
-            const RArray<TItemId>& aObjectIdArray);
-
-private:
-    // from MMdEObjectPresentObserver
-    void HandleObjectPresentNotification(CMdESession& aSession,
-            TBool aPresent, const RArray<TItemId>& aObjectIdArray);
-    void AddObjectObserverL();
-private:
-
-    ToneFetcherEngine *mServiceEngine;
-
-    // session to metadata engine
-    CMdESession* iSession;
-
-    // metadata query
-    CMdEObjectQuery* iQuery;
-
-    // used for saving the quering result.
-    //both name and uri.
-    QStringList iNameList;
-    QStringList iUriList;
-
-    // is metadata session open
-    TBool iSessionOpen;
-
-    // max audio file file size
-    TInt iMaxFileSize;
-    
-    // query error
-    TInt iQueryError;
-};
-#endif /* TONESELECTIONENGINE_H_ */
-
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/tonefetcherengine_stub.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,49 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The source file for tone fetcher engine private class of other platforms.
+ *     
+ */
+
+#include "tonefetcherengine_stub.h"
+
+ToneFetcherEnginePrivate::ToneFetcherEnginePrivate()
+    {
+    
+    }
+
+virtual ~ToneFetcherEnginePrivate::ToneFetcherEnginePrivate()
+    {
+    
+    }
+
+void ToneFetcherEnginePrivate::getTones()
+    {
+    
+    }
+
+void ToneFetcherEnginePrivate::play( const QString & )
+    {
+    
+    }
+
+bool ToneFetcherEnginePrivate::isPlaying()
+    {
+    return false;
+    }
+
+void ToneFetcherEnginePrivate::stopPlaying()
+    {
+    
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/tonefetcherengine_stub.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,37 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The header file for tone fetcher engine private class of other platforms.
+ *     
+ */
+
+#ifndef TONEFETCHERENGINE_STUB_H
+#define TONEFETCHERENGINE_STUB_H
+
+#include <QObject>
+
+class ToneFetcherEnginePrivate : public QObject
+{
+    Q_OBJECT
+    
+public:
+    ToneFetcherEnginePrivate();
+    virtual ~ToneFetcherEnginePrivate();
+    void getTones();    
+    void play( const QString & );
+    bool isPlaying();
+    void stopPlaying();
+};
+
+#endif /* TONEFETCHERENGINE_STUB */
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/tonefetcherengine_symbian.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,94 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The source file for tone fetcher engine private class.
+ *     
+ */
+
+
+#include "tonefetcherengine_symbian.h"
+#include "CToneSelection.h"
+#include "CTonePlayer.h"
+#include "tonefetcherutils.h"
+#include <XQConversions>
+
+ToneFetcherEnginePrivate::ToneFetcherEnginePrivate()
+    {
+    TRAPD( err, mToneSelection = CToneSelection::NewL( this ) ); 
+    TRAPD( error, mTonePlayer = CTonePlayer::NewL( this ) );    
+    }
+
+ToneFetcherEnginePrivate::~ToneFetcherEnginePrivate()
+    {
+    mResultList.clear();
+    delete mToneSelection;
+    delete mTonePlayer;
+    }
+
+void ToneFetcherEnginePrivate::getTones()
+    {
+    QT_TRAP_THROWING( mToneSelection->QueryTonesL() );
+    }
+
+void ToneFetcherEnginePrivate::play(const QString &file)
+    {    
+    QT_TRAP_THROWING( mTonePlayer->SetAttrL( XQConversions::qStringToS60Desc( ToneFetcherUtils::normalizeSeperator(file) )->Des() ) );
+    QT_TRAP_THROWING( mTonePlayer->PlayL() );
+    }
+
+bool ToneFetcherEnginePrivate::isPlaying()
+    {
+    return mTonePlayer->IsPlaying();
+    }
+
+void ToneFetcherEnginePrivate::stopPlaying()
+    {
+    mTonePlayer->Stop();
+    }
+
+void ToneFetcherEnginePrivate::HandleMdeSessionError( TInt aError )
+    {
+    emit mdeSessionError( aError );
+    }
+
+void ToneFetcherEnginePrivate::HandleMdeSessionOpened()
+    {
+    emit mdeSessionOpened();
+    }
+
+void ToneFetcherEnginePrivate::HandleQueryError( TInt aError )
+    {
+    emit queryError(aError);
+    }
+
+void ToneFetcherEnginePrivate::HandleQueryComplete( RPointerArray<TDesC>& aResultArray )
+    {
+    mResultList.clear();
+    for ( int i = 0; i < aResultArray.Count(); ++i ) 
+        {
+        mResultList.append( XQConversions::s60DescToQString( *(aResultArray[i]) ) );
+        }
+    aResultArray.ResetAndDestroy();
+    emit queryComplete(mResultList);
+    }
+
+void ToneFetcherEnginePrivate::HandleObjectChanged()
+    {
+    emit notifyObjectChanged();
+    }
+
+void ToneFetcherEnginePrivate::HandlePreviewEvent( TInt event )
+    {
+    emit notifyPreviewEvent(event);
+    }
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/private/tonefetcherengine_symbian.h	Thu Jul 22 16:34:01 2010 +0100
@@ -0,0 +1,68 @@
+/*
+ * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
+ * All rights reserved.
+ * This component and the accompanying materials are made available
+ * under the terms of "Eclipse Public License v1.0"
+ * which accompanies this distribution, and is available
+ * at the URL "http://www.eclipse.org/legal/epl-v10.html".
+ *
+ * Initial Contributors:
+ * Nokia Corporation - initial contribution.
+ * 
+ * Contributors:
+ * 
+ * Description:
+ *     The header file for tone fetcher engine private class of symbian platform.
+ *     
+ */
+
+#ifndef TONEFETCHERENGINEPRIVATE_H
+#define TONEFETCHERENGINEPRIVATE_H
+
+//#include <e32base.h>
+#include "MToneSelectionWatcher.h"
+#include "MTonePlayingWatcher.h"
+#include <QObject>
+#include <QStringList>
+
+class CToneSelection;
+class CTonePlayer;
+
+class ToneFetcherEnginePrivate : public QObject,                                 
+                                 public MToneSelectionWatcher,
+                                 public MTonePlayingWatcher
+{
+    Q_OBJECT
+    
+public:
+    ToneFetcherEnginePrivate();
+    virtual ~ToneFetcherEnginePrivate();
+    void getTones();    
+    void play( const QString &file );
+    bool isPlaying();
+    void stopPlaying();
+    
+public:
+    //from MToneSelectionWatcher
+    void HandleMdeSessionError( TInt aError );
+    void HandleMdeSessionOpened();
+    void HandleQueryError( TInt aError );
+    void HandleQueryComplete( RPointerArray<TDesC>& aResultArray );
+    void HandleObjectChanged();
+    //from MTonePlayingWatcher
+    void HandlePreviewEvent( TInt event );
+    
+signals:
+    void mdeSessionOpened();
+    void mdeSessionError(int error);
+    void queryComplete(const QStringList& uriList);
+    void queryError(int error);
+    void notifyObjectChanged();  
+    void notifyPreviewEvent(int event);
+
+private:
+    QStringList mResultList;
+    CToneSelection* mToneSelection;
+    CTonePlayer* mTonePlayer;
+};
+#endif /* TONEFETCHERENGINEPRIVATE_H */
--- a/controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -16,27 +16,29 @@
  *     
  */
 #include "tonefetcherengine.h"
-#include "toneselectionengine_p.h"
-#include "tonepreviewprivate.h"
+#ifdef Q_OS_SYMBIAN
+#include "tonefetcherengine_symbian.h"
+#else
+#include "tonefetcherengine_stub.h"
+#endif
 
 ToneFetcherEngine::ToneFetcherEngine(QObject* parent) : QObject(parent)
 {
-    d = new ToneSelectionEnginePrivate(this);
+    d = new ToneFetcherEnginePrivate();
     Q_ASSERT(d);
-    mAudioPlayer = new TonePreviewPrivate( this );
-    Q_ASSERT(mAudioPlayer);
+    
     connect(d, SIGNAL(mdeSessionOpened()), 
             this, SIGNAL(mdeSessionOpened()));
     connect(d, SIGNAL(mdeSessionError(int)),
             this, SIGNAL(mdeSessionError(int)));
-    connect(d, SIGNAL(queryComplete(QStringList, QStringList)),
-            this, SIGNAL(queryComplete(QStringList, QStringList)));
+    connect(d, SIGNAL(queryComplete(QStringList)),
+            this, SIGNAL(queryComplete(QStringList)));
     connect(d, SIGNAL(queryError(int)),
             this, SIGNAL(queryError(int)));
     connect(d, SIGNAL(notifyObjectChanged()),
-            this, SIGNAL(notifyObjectChanged()));
-    connect(mAudioPlayer, SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int)),
-            this, SIGNAL(notifyPreviewEvent(ToneServiceEngine::TPreviewEvent, int)));
+            this, SIGNAL(notifyObjectChanged()));    
+    connect(d, SIGNAL(notifyPreviewEvent(int)),
+            this, SIGNAL(notifyPreviewEvent(int)));
 }
 
 ToneFetcherEngine::~ToneFetcherEngine()
@@ -44,19 +46,24 @@
     delete d;
 }
 
-void ToneFetcherEngine::getTone()
+void ToneFetcherEngine::getTones()
 {
-    d->QueryTones();
+    d->getTones();
+}
+
+void ToneFetcherEngine::play(const QString &file)
+{    
+    d->play(file);
 }
 
-void ToneFetcherEngine::preview(const QString &file )
+bool ToneFetcherEngine::isPlaying()
 {
-    mAudioPlayer->SetAttr(file);
-    mAudioPlayer->Play();
+    return d->isPlaying();
 }
 
-bool ToneFetcherEngine::IsPlaying()
+void ToneFetcherEngine::stopPlaying()
 {
-    mAudioPlayer->IsPlaying();
+    d->stopPlaying();
 }
+
 //End of File
--- a/controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.h	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/tonefetcherengine/tonefetcherengine.h	Thu Jul 22 16:34:01 2010 +0100
@@ -19,15 +19,14 @@
 #ifndef TONEFETCHERENGINE_H
 #define TONEFETCHERENGINE_H
 #include <QObject>
-#include "toneselectionengine_p.h"
 #include <QStringList>
-class TonePreviewPrivate;
-class ToneSelectionEnginePrivate;
+
+class ToneFetcherEnginePrivate;
 
 // CLASS DECLARATION
 /**
  *  This class is used for interacting with platform based codes
- *  including fetching tones from MDE (Metadata Engine) and previewing tones
+ *  including fetching tones from MDE (Metadata Engine) and playing tones
  *  using platform-dependant interface.
  *
  */
@@ -35,62 +34,36 @@
 {
     Q_OBJECT
     
-public:
-    enum TMediaFileListAttribute {
-        // max media file size
-        EAttrFileSize = 0,
-        // ringing volume (TProfileRingingVolume from Profile.hrh)
-        EAttrVolume,
-        // ringing type,  (TProfileRingingType from Profile.hrh)
-        EAttrRingingType,
-        // vibra on/off   (Boolean) 
-        EAttrVibra,
-        // 3D effect      (TProfile3DToneEffect from ProfileInternal.hrh)
-        EAttr3DEffect,
-        // 3D echo        (TProfile3DToneEcho from ProfileInternal.hrh)
-        EAttr3DEcho,
-        // excluded mime type text
-        EAttrExcludeMimeType,
-        // for file protection checking
-        EAttrAutomatedType,
-        // media file dialog title
-        EAttrTitle,
-        // excluded folder (see enum TFolderType)
-        EAttrExcludeFolder
-    };
-    
-    enum State {
-    SessionConnected = 0,
-    SessionError    
-    };
-    
-    enum TPreviewEvent {         
-        EAudioPreviewComplete, 
-        EPreviewError
-    };
+public:    
     explicit ToneFetcherEngine( QObject* parent = 0 );
     ~ToneFetcherEngine();
     /*
      * search the tone using MDE, not including rom files.
      */
-    void getTone();
+    void getTones();
     
     /*
      * preview the tone
      * @param file the absolute path of the file.
      */
-    void preview(const QString &file);
+    void play(const QString &file);
+    
+    bool isPlaying();
     
-    bool IsPlaying();
+    /*
+     * stop playing
+     */
+    void stopPlaying();
+    
 signals:
     void mdeSessionOpened();
     void mdeSessionError(int error);
-    void queryComplete(const QStringList &nameList, const QStringList &uriList);
+    void queryComplete(const QStringList &uriList);
     void queryError(int error);
-    void notifyPreviewEvent(ToneFetcherEngine::TPreviewEvent event, int errorId);
+    void notifyPreviewEvent(int event);
     void notifyObjectChanged();
+    
 private:
-    ToneSelectionEnginePrivate *d;
-    TonePreviewPrivate *mAudioPlayer;
+    ToneFetcherEnginePrivate *d;
 };
 #endif
--- a/controlpanelui/src/tonefetcher/tsrc/tonetestapp.cpp	Fri Jun 11 16:24:15 2010 +0100
+++ b/controlpanelui/src/tonefetcher/tsrc/tonetestapp.cpp	Thu Jul 22 16:34:01 2010 +0100
@@ -136,7 +136,7 @@
     
     if (!mReq)
    {
-        mReq = mAppMgr.create("com.nokia.symbian.IToneFetch", "fetch(QString)", true);
+        mReq = mAppMgr.create("com.nokia.symbian.IToneFetch", "fetch()", true);
      //   XQServiceRequest snd("com.nokia.services.toneserviceprovider.tone", "queryTone()", true);
        // QVariant retValue;