src/hbcore/style/hbstyle.cpp
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
    61 #include "hbstyleoptiondataform.h"
    61 #include "hbstyleoptiondataform.h"
    62 #include "hbstyleoptiongroupbox.h"
    62 #include "hbstyleoptiongroupbox.h"
    63 #include "hbstyleoptionindexfeedback.h"
    63 #include "hbstyleoptionindexfeedback.h"
    64 #include "hbstyleoptioncombobox.h"
    64 #include "hbstyleoptioncombobox.h"
    65 #include "hbstyleoptioninputdialog.h"
    65 #include "hbstyleoptioninputdialog.h"
       
    66 #include "hbstyleoptionprogresssliderhandle_p.h"
       
    67 #include "hbstyleoptionprogressslider.h"
    66 
    68 
    67 #include <hbicon.h>
    69 #include <hbicon.h>
    68 #include <hbstyle.h>
    70 #include <hbstyle.h>
    69 #include <hbframedrawer.h>
    71 #include <hbframedrawer.h>
    70 #include <hbiconitem.h>
    72 #include <hbiconitem.h>
    93 #include "hbstyleselector_p.h"
    95 #include "hbstyleselector_p.h"
    94 #include "hblayeredstyleloader_p.h"
    96 #include "hblayeredstyleloader_p.h"
    95 #include "hbwidgetstyleloader_p.h"
    97 #include "hbwidgetstyleloader_p.h"
    96 #include "hbcssparser_p.h"
    98 #include "hbcssparser_p.h"
    97 #include "hbrepeaticonitem_p.h"
    99 #include "hbrepeaticonitem_p.h"
    98 #include "hbcolortheme_p.h"
       
    99 #include "hbnamespace_p.h"
   100 #include "hbnamespace_p.h"
   100 
   101 
   101 
   102 
   102 #include "hbmeshlayout_p.h"
   103 #include "hbmeshlayout_p.h"
   103 
   104 
   107 #include "hbdeviceprofile.h"
   108 #include "hbdeviceprofile.h"
   108 #include "hbrepeatitem_p.h"
   109 #include "hbrepeatitem_p.h"
   109 
   110 
   110 #include <QDebug>
   111 #include <QDebug>
   111 
   112 
   112 //Uncomment next define in order to get more debug prints.
   113 //Uncomment next define(s) in order to get more debug prints.
   113 //Similar define exists also in the engine side.
   114 //Similar define exists also in the engine side.
   114 //#define HBSTYLE_DEBUG
   115 //#define HBSTYLE_DEBUG
   115 
   116 #define HBSTYLE_DEBUG_FONT
   116 #ifdef HBSTYLE_DEBUG
       
   117 #include <QDebug>
       
   118 #endif
       
   119 
   117 
   120 /*!
   118 /*!
   121     @beta
   119     @beta
   122     @hbcore
   120     @hbcore
   123     \class HbStyle
   121     \class HbStyle
   139     itself it does not need a paint() method at all since primitives (widget's childs) are doing the drawing. 
   137     itself it does not need a paint() method at all since primitives (widget's childs) are doing the drawing. 
   140     Painting for the primitives occurs from the graphics scene.
   138     Painting for the primitives occurs from the graphics scene.
   141 
   139 
   142 */
   140 */
   143 
   141 
   144 
   142 /*!
       
   143         
       
   144 	    \deprecated P_PushButton_icon
       
   145         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   146 
       
   147 
       
   148         \deprecated P_PushButton_text
       
   149         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   150 
       
   151         
       
   152         \deprecated P_PushButton_additionaltext
       
   153         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   154 
       
   155 
       
   156         \deprecated P_PushButton_background
       
   157         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   158 
       
   159 
       
   160         \deprecated P_PushButton_toucharea
       
   161         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   162 
       
   163 
       
   164         \deprecated P_PushButton_focus
       
   165         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   166 
       
   167 
       
   168         \deprecated P_DataGrou\deprecated P_background
       
   169         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   170 
       
   171 
       
   172         \deprecated P_DataGroupComboBackground
       
   173         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   174 
       
   175 
       
   176         \deprecated P_DataGrou\deprecated P_heading
       
   177         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   178 
       
   179 
       
   180         \deprecated P_DataGrou\deprecated P_description
       
   181         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   182 
       
   183 
       
   184         \deprecated P_DataForm_heading
       
   185         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   186 
       
   187 
       
   188         \deprecated P_DataForm_heading_background
       
   189         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   190 
       
   191 
       
   192         \deprecated P_DataForm_description
       
   193         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   194 
       
   195 
       
   196         \deprecated P_DataGrou\deprecated P_icon
       
   197         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   198 
       
   199 
       
   200         \deprecated P_ToolButton_frame
       
   201         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   202 
       
   203 
       
   204         \deprecated P_ToolButton_text
       
   205         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   206 
       
   207 
       
   208         \deprecated P_ToolButton_icon
       
   209         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   210 
       
   211 
       
   212         \deprecated P_Slider_thumb
       
   213         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   214 
       
   215 
       
   216         \deprecated P_SliderElement_text
       
   217         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   218 
       
   219 
       
   220         \deprecated P_SliderElement_icon
       
   221         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   222 
       
   223 
       
   224         \deprecated P_SliderElement_increase
       
   225         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   226 
       
   227 
       
   228         \deprecated P_SliderElement_decrease
       
   229         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   230 
       
   231 
       
   232         \deprecated P_Slider_groove
       
   233         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   234 
       
   235 
       
   236         \deprecated P_Slider_progressgroove
       
   237         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   238 
       
   239 
       
   240         \deprecated P_ItemViewItem_checkbox
       
   241         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   242 
       
   243 
       
   244         \deprecated P_ItemViewItem_radiobutton
       
   245         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   246 
       
   247 
       
   248         \deprecated P_ItemViewItem_selection
       
   249         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   250 
       
   251 
       
   252         \deprecated P_LineEdit_frame_normal
       
   253         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   254 
       
   255 
       
   256         \deprecated P_LineEdit_frame_highlight
       
   257         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   258 
       
   259 
       
   260         \deprecated P_TextEdit_frame_normal
       
   261         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   262 
       
   263 
       
   264         \deprecated P_TextEdit_frame_highlight
       
   265         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   266 
       
   267 
       
   268         \deprecated P_Edit_text
       
   269         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   270 
       
   271 
       
   272         \deprecated P_Label_text
       
   273         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   274 
       
   275 
       
   276         \deprecated P_Label_icon
       
   277         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   278 
       
   279 
       
   280         \deprecated P_MenuItem_frame
       
   281         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   282 
       
   283 
       
   284         \deprecated P_MenuItem_focus
       
   285         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   286 
       
   287 
       
   288         \deprecated P_MenuItem_text
       
   289         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   290 
       
   291 
       
   292         \deprecated P_MenuItem_submenuindicator
       
   293         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   294 
       
   295 
       
   296         \deprecated P_MenuItem_checkindicator
       
   297         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   298 
       
   299 
       
   300         \deprecated P_MenuItem_separator
       
   301         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   302 
       
   303 
       
   304         \deprecated P_ScrollBar_groove
       
   305         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   306 
       
   307 
       
   308         \deprecated P_ScrollBar_handle
       
   309         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   310 
       
   311 
       
   312         \deprecated P_ScrollBar_toucharea
       
   313         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   314 
       
   315 
       
   316         \deprecated P_Popu\deprecated P_background
       
   317         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   318 
       
   319 
       
   320         \deprecated P_Popu\deprecated P_background_weak
       
   321         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   322 
       
   323 
       
   324         \deprecated P_Popu\deprecated P_heading_frame
       
   325         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   326 
       
   327 
       
   328         \deprecated P_ToolTi\deprecated P_background
       
   329         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   330 
       
   331 
       
   332         \deprecated P_MessageBox_icon
       
   333         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   334 
       
   335 
       
   336         \deprecated P_ItemViewItem_background
       
   337         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   338 
       
   339 
       
   340         \deprecated P_ListViewItem_text
       
   341         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   342 
       
   343 
       
   344         \deprecated P_ListViewItem_richtext
       
   345         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   346 
       
   347 
       
   348         \deprecated P_ListViewItem_icon
       
   349         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   350 
       
   351         
       
   352         \deprecated P_ItemHighlight_background
       
   353         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   354 
       
   355 
       
   356         \deprecated P_ToolBarExtension_background
       
   357         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   358 
       
   359 
       
   360         \deprecated P_GridViewItem_text
       
   361         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   362 
       
   363 
       
   364         \deprecated P_GridViewItem_icon
       
   365         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   366 
       
   367 
       
   368         \deprecated P_CheckBox_text
       
   369         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   370 
       
   371 
       
   372         \deprecated P_CheckBox_icon
       
   373         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   374 
       
   375 
       
   376         \deprecated P_CheckBox_toucharea
       
   377         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   378 
       
   379 
       
   380         \deprecated P_Fade_background
       
   381         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   382 
       
   383 
       
   384         \deprecated P_TitlePane_background
       
   385         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   386 
       
   387 
       
   388         \deprecated P_TitlePane_text
       
   389         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   390 
       
   391 
       
   392         \deprecated P_TitlePane_icon
       
   393         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   394 
       
   395 
       
   396         \deprecated P_TitleBar_toucharea
       
   397         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   398 
       
   399 
       
   400         \deprecated P_IndicatorGrou\deprecated P_background
       
   401         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   402 
       
   403 
       
   404         \deprecated P_IndicatorGrou\deprecated P_signalicon
       
   405         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   406 
       
   407    
       
   408         \deprecated P_IndicatorGrou\deprecated P_batteryicon
       
   409         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   410 
       
   411   
       
   412         \deprecated P_SignalIndicator_icon
       
   413         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   414 
       
   415 
       
   416         \deprecated P_SignalLevel_background
       
   417         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   418 
       
   419 
       
   420         \deprecated P_SignalLevel_icon
       
   421         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   422 
       
   423 
       
   424         \deprecated P_BatteryIndicator_icon
       
   425         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   426 
       
   427 
       
   428         \deprecated P_BatteryLevel_background
       
   429         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   430 
       
   431 
       
   432         \deprecated P_BatteryLevel_icon
       
   433         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   434 
       
   435 
       
   436         \deprecated P_IndicatorGrou\deprecated P_icon1
       
   437         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   438 
       
   439 
       
   440         \deprecated P_IndicatorGrou\deprecated P_icon2
       
   441         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   442 
       
   443 
       
   444         \deprecated P_IndicatorGrou\deprecated P_icon3
       
   445         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   446 
       
   447 
       
   448         \deprecated P_IndicatorGrou\deprecated P_icon4
       
   449         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   450 
       
   451 
       
   452         \deprecated P_ProgressBar_frame
       
   453         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   454 
       
   455 
       
   456         \deprecated P_ProgressBar_track
       
   457         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   458 
       
   459 
       
   460         \deprecated P_ProgressBar_waittrack
       
   461         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   462 
       
   463        
       
   464         \deprecated P_ProgressBar_mintext
       
   465         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   466 
       
   467 
       
   468         \deprecated P_ProgressBar_maxtext
       
   469         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   470 
       
   471 
       
   472         \deprecated P_Softkey_background
       
   473         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   474 
       
   475  
       
   476         \deprecated P_NavigationButton_background
       
   477         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   478 
       
   479 
       
   480         \deprecated P_IndicatorButton_background
       
   481         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   482 
       
   483 
       
   484         \deprecated P_IndicatorButton_handleindication
       
   485         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   486 
       
   487 
       
   488         \deprecated P_ItemViewItem_frame
       
   489         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   490 
       
   491    
       
   492         \deprecated P_SelectionControl_selectionstart
       
   493         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   494 
       
   495 
       
   496         \deprecated P_SelectionControl_selectionend
       
   497         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   498 
       
   499 
       
   500         \deprecated P_TreeViewItem_expandicon
       
   501         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   502 
       
   503 
       
   504         \deprecated P_Label_richtext
       
   505         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   506 
       
   507 
       
   508         \deprecated P_RatingSlider_track
       
   509         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   510 
       
   511 
       
   512         \deprecated P_RatingSlider_frame
       
   513         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   514 
       
   515 
       
   516         \deprecated P_RatingSlider_toucharea
       
   517         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   518 
       
   519 
       
   520 				\deprecated P_ProgressSlider_frame
       
   521         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   522 
       
   523 
       
   524 				\deprecated P_ProgressSlider_track
       
   525         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   526 
       
   527 
       
   528         \deprecated P_ProgressSlider_slidertrack
       
   529         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   530 
       
   531 
       
   532         \deprecated P_ProgressSlider_toucharea
       
   533         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   534 
       
   535 
       
   536         \deprecated P_ProgressSliderHandle_background
       
   537         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   538 
       
   539  
       
   540         \deprecated P_ProgressSliderHandle_icon
       
   541         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   542 
       
   543 
       
   544         \deprecated P_ProgressSliderHandle_toucharea
       
   545         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   546 
       
   547 
       
   548         \deprecated P_RatingSlider_layout
       
   549         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   550 
       
   551 
       
   552         \deprecated P_ScrollArea_continuationbottom
       
   553         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   554 
       
   555 
       
   556         \deprecated P_ScrollArea_continuationtop
       
   557         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   558 
       
   559 
       
   560         \deprecated P_ScrollArea_continuationleft
       
   561         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   562 
       
   563 
       
   564         \deprecated P_ScrollArea_continuationright
       
   565         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   566 
       
   567 
       
   568         \deprecated P_ItemViewItem_focus
       
   569         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   570 
       
   571 
       
   572         \deprecated P_NotificationDialog_icon
       
   573         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   574 
       
   575 
       
   576         \deprecated P_NotificationDialog_text
       
   577         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   578 
       
   579 
       
   580         \deprecated P_NotificationDialog_title
       
   581         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   582 
       
   583 
       
   584         \deprecated P_NotificationDialog_frame
       
   585         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   586 
       
   587 
       
   588         \deprecated P_ComboBox_background
       
   589         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   590 
       
   591 
       
   592         \deprecated P_ComboBoxPopu\deprecated P_background
       
   593         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   594 
       
   595 
       
   596         \deprecated P_ComboBoxButton_toucharea
       
   597         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   598 
       
   599 
       
   600         \deprecated P_ComboBox_text
       
   601         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   602 
       
   603 
       
   604         \deprecated P_DataItem_background
       
   605         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   606 
       
   607 
       
   608         \deprecated P_DataItem_separator
       
   609         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   610 
       
   611 
       
   612         \deprecated P_ColorGridViewItem_colorIcon
       
   613         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   614 
       
   615 
       
   616         \deprecated P_ColorGridViewItem_borderIcon
       
   617         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   618 
       
   619 
       
   620         \deprecated P_ColorGridViewItem_checkIcon
       
   621         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   622 
       
   623 
       
   624         \deprecated P_ComboBox_button
       
   625         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   626 
       
   627 
       
   628         \deprecated P_ProgressDialog_icon
       
   629         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   630 
       
   631 
       
   632         \deprecated P_ProgressDialog_text
       
   633         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   634 
       
   635 
       
   636         \deprecated P_DataItem_label
       
   637         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   638 
       
   639 
       
   640         \deprecated P_DataItem_description
       
   641         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   642 
       
   643 
       
   644         \deprecated P_SliderElement_touchincrease
       
   645         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   646 
       
   647 
       
   648         \deprecated P_SliderElement_touchdecrease
       
   649         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   650 
       
   651 
       
   652         \deprecated P_SliderElement_touchhandle
       
   653         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   654 
       
   655 
       
   656         \deprecated P_SliderElement_touchgroove
       
   657         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   658 
       
   659 
       
   660         \deprecated P_SliderTickMark_majoricon
       
   661         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   662 
       
   663 
       
   664         \deprecated P_SliderTickMark_minoricon
       
   665         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   666 
       
   667 
       
   668         \deprecated P_SliderTickMark_majorlabel
       
   669         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   670 
       
   671 
       
   672         \deprecated P_SliderTickMark_minorlabel
       
   673         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   674 
       
   675 
       
   676         \deprecated P_QueryInputMode_image
       
   677         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   678 
       
   679 
       
   680         \deprecated P_GroupBoxHeading_icon
       
   681         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   682 
       
   683 
       
   684         \deprecated P_GroupBoxHeading_text
       
   685         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   686 
       
   687 
       
   688         \deprecated P_GroupBoxMarquee_text
       
   689         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   690 
       
   691 
       
   692         \deprecated P_GroupBoxHeading_background
       
   693         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   694 
       
   695 
       
   696         \deprecated P_GroupBoxContent_background
       
   697         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   698 
       
   699 
       
   700         \deprecated P_DataItem_icon
       
   701         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   702 
       
   703 
       
   704         \deprecated P_ItemViewItem_touchmultiselection
       
   705         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   706 
       
   707 
       
   708         \deprecated P_TumbleView_background
       
   709         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   710 
       
   711 
       
   712         \deprecated P_TumbleView_frame
       
   713         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   714 
       
   715 
       
   716         \deprecated P_TumbleView_highlight
       
   717         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   718 
       
   719 
       
   720         \deprecated P_DateTimePicker_background
       
   721         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   722 
       
   723 
       
   724         \deprecated P_DateTimePicker_frame
       
   725         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   726 
       
   727 
       
   728         \deprecated P_DateTimePicker_separator
       
   729         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   730 
       
   731 
       
   732         \deprecated P_IndexFeedback_popu\deprecated P_text
       
   733         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   734 
       
   735 
       
   736         \deprecated P_IndexFeedback_popu\deprecated P_background
       
   737         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   738 
       
   739 
       
   740         \deprecated P_SliderPopu\deprecated P_background
       
   741         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   742 
       
   743 
       
   744         \deprecated P_StatusBar_background
       
   745         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   746 
       
   747 
       
   748         \deprecated P_StatusBar_timetext
       
   749         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   750 
       
   751 
       
   752         \deprecated P_InputDialog_text
       
   753         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   754 
       
   755 
       
   756         \deprecated P_InputDialog_additionaltext
       
   757         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   758 
       
   759 
       
   760         \deprecated P_ProgressSlider_toucharea
       
   761         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   762 
       
   763 
       
   764         \deprecated P_ProgressSlider_track
       
   765         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   766 
       
   767 
       
   768         \deprecated P_ProgressSliderHandle_icon
       
   769         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   770 
       
   771 
       
   772         \deprecated P_InputDialog_additionaltext
       
   773         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   774 
       
   775 
       
   776         \deprecated P_MessageBox_text
       
   777         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   778 
       
   779 
       
   780         \deprecated P_ProgressSlider_handle
       
   781         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   782 
       
   783 
       
   784         \deprecated P_ProgressBar_text
       
   785         is deprecated. HbStyle::Primitive enums are deprecated. Primitives can be accessed by item names using HbWidget::primitive(const QString).
       
   786 */
   145 
   787 
   146 // TODO: margins should be defined in layout data once layout specification exists.
   788 // TODO: margins should be defined in layout data once layout specification exists.
   147 static const int ItemName = 0xfffe;
   789 static const int ItemName = 0xfffe;
   148 static const QString STYLE_LOCATION = QLatin1String(":/themes/style/hbdefault/rules/widgets/%w/%w");
   790 static const QString STYLE_LOCATION = QLatin1String(":/themes/style/hbdefault/rules/widgets/%w/%w");
   149 static const QString COLOR_STYLE_LOCATION = QLatin1String(":/themes/style/hbdefault/rules/widgets/%w/%w_color");
   791 static const QString COLOR_STYLE_LOCATION = QLatin1String(":/themes/style/hbdefault/rules/widgets/%w/%w_color");
   170 {
   812 {
   171     delete d_ptr;
   813     delete d_ptr;
   172 }
   814 }
   173 
   815 
   174 /*!
   816 /*!
       
   817     \deprecated HbStyle::registerPlugin(const QString&)
       
   818     is deprecated. Style plugins are not supported anymore.
       
   819 
   175     Registers the style plugin with the Style system. This method can be called by a custom widget
   820     Registers the style plugin with the Style system. This method can be called by a custom widget
   176     or application in order to register the style plugin that implements the custom graphics primitives.
   821     or application in order to register the style plugin that implements the custom graphics primitives.
   177     This method results in loading of the plugin, if the plugin is registered for the first time.
   822     This method results in loading of the plugin, if the plugin is registered for the first time.
   178     It returns the base ID for the primitives implemented by the style plugin. The custom widget
   823     It returns the base ID for the primitives implemented by the style plugin. The custom widget
   179     can use the range of integers from (BaseID) to (BaseID+count-1) to refer to the custom
   824     can use the range of integers from (BaseID) to (BaseID+count-1) to refer to the custom
   269     return pluginInfo->primitiveBaseId;
   914     return pluginInfo->primitiveBaseId;
   270 }
   915 }
   271 
   916 
   272 
   917 
   273 /*!
   918 /*!
       
   919     \deprecated HbStyle::unregisterPlugin(const QString&)
       
   920     is deprecated. Style plugins are not supported anymore.
       
   921 
   274     Un-registers the style plugin.
   922     Un-registers the style plugin.
   275     If the reference count becomes zero, the plugin is unloaded and the primitive IDs are de-registered
   923     If the reference count becomes zero, the plugin is unloaded and the primitive IDs are de-registered
   276     If a client has called registerPlugin() it must unregister the style plugin with this method.
   924     If a client has called registerPlugin() it must unregister the style plugin with this method.
   277 
   925 
   278     \param pluginName, name of the Plugin library
   926     \param pluginName, name of the Plugin library
   292             for (int i=info->primitiveBaseId; i< (info->primitiveBaseId+info->primitiveCount); i++) {
   940             for (int i=info->primitiveBaseId; i< (info->primitiveBaseId+info->primitiveCount); i++) {
   293                   d->customPrimitives.remove(i);
   941                   d->customPrimitives.remove(i);
   294             }
   942             }
   295             d->registeredPlugins.remove(pluginName);
   943             d->registeredPlugins.remove(pluginName);
   296 
   944 
   297 	        // unregister associated style files
   945             // unregister associated style files
   298             HbWidgetStyleLoader::instance()->removeFilePath(
   946             HbWidgetStyleLoader::instance()->removeFilePath(
   299                 d->pluginStylePaths.value(pluginName),
   947                 d->pluginStylePaths.value(pluginName),
   300                 HbLayeredStyleLoader::Concern_Layouts, 
   948                 HbLayeredStyleLoader::Concern_Layouts, 
   301                 HbLayeredStyleLoader::Priority_Core);
   949                 HbLayeredStyleLoader::Priority_Core);
   302             d->pluginStylePaths.remove(pluginName);
   950             d->pluginStylePaths.remove(pluginName);
   310     }
   958     }
   311 }
   959 }
   312 
   960 
   313 
   961 
   314 /*!
   962 /*!
       
   963 
       
   964   \deprecated HbStyle::createPrimitive(HbStyle::Primitive, QGraphicsItem*) 
       
   965   is deprecated. This method will be replaced with an altered version which will use new base primitive enumerations.
       
   966     
   315   Creates instances of primitive graphics items. This method should be used by all widgets that support styling.
   967   Creates instances of primitive graphics items. This method should be used by all widgets that support styling.
   316   When changing the style the returned primitives can be replaced with an altered version of the primitives, or with a completely
   968   When changing the style the returned primitives can be replaced with an altered version of the primitives, or with a completely
   317   different primitive, to create a custom appearance. This shouldn't cause changes to the widget if the functional design
   969   different primitive, to create a custom appearance. This shouldn't cause changes to the widget if the functional design
   318   remains the same.
   970   remains the same.
   319 
   971 
   324   \sa HbStyle::updatePrimitive method which is to be used in conjunction with this method
   976   \sa HbStyle::updatePrimitive method which is to be used in conjunction with this method
   325   \sa HbWidgetBase
   977   \sa HbWidgetBase
   326   \param primitive, to identify the primitive to create
   978   \param primitive, to identify the primitive to create
   327   \param parent of the item
   979   \param parent of the item
   328   \return HbWidgetBase is returned.
   980   \return HbWidgetBase is returned.
       
   981 
   329  */
   982  */
   330 QGraphicsItem *HbStyle::createPrimitive( HbStyle::Primitive primitive, QGraphicsItem *parent ) const
   983 QGraphicsItem *HbStyle::createPrimitive( HbStyle::Primitive primitive, QGraphicsItem *parent ) const
   331 {
   984 {
   332 
   985 
   333     Q_D( const HbStyle );
   986     Q_D( const HbStyle );
   360                 setItemName(item, QLatin1String("separator"));
  1013                 setItemName(item, QLatin1String("separator"));
   361                 return item;
  1014                 return item;
   362                 }
  1015                 }
   363             case P_ToolButton_icon:
  1016             case P_ToolButton_icon:
   364             case P_PushButton_icon:
  1017             case P_PushButton_icon:
   365 			case P_ProgressDialog_icon:
  1018             case P_ProgressDialog_icon: {
       
  1019                 HbIconItem *iconItem = new HbIconItem(HbIcon(),parent);
       
  1020                 setItemName(iconItem, QLatin1String("icon"));
       
  1021                 return iconItem; 
       
  1022                 }
       
  1023 
   366             case P_CheckBox_icon:
  1024             case P_CheckBox_icon:
   367             case P_GroupBoxHeading_icon:
  1025             case P_GroupBoxHeading_icon:
   368             case P_Label_icon:
  1026             case P_Label_icon:
   369             case P_GridViewItem_icon: {
  1027             case P_GridViewItem_icon: {
   370                 HbIconItem *item = new HbIconItem(HbIcon(),parent);
  1028                 HbIconItem *item = new HbIconItem(HbIcon(),parent);
   390                     return  textItem;
  1048                     return  textItem;
   391                 }
  1049                 }
   392             case P_ToolButton_text:
  1050             case P_ToolButton_text:
   393             case P_CheckBox_text:
  1051             case P_CheckBox_text:
   394             case P_ProgressDialog_text:
  1052             case P_ProgressDialog_text:
       
  1053                 {
       
  1054                     HbTextItem *textItem = new HbTextItem(parent);
       
  1055                     setItemName(textItem, QLatin1String("text"));
       
  1056                     return  textItem;
       
  1057                 }
   395             case P_PushButton_text:
  1058             case P_PushButton_text:
   396                 {
  1059                 {
   397                 HbTextItem *ti = new HbTextItem(parent);
  1060                 HbTextItem *ti = new HbTextItem(parent);
   398                 setItemName(ti, QLatin1String("text"));
  1061                 setItemName(ti, QLatin1String("text"));
   399                 return  ti;
  1062                 return  ti;
   427                 {
  1090                 {
   428                 HbTextItem *ti = new HbTextItem(parent);
  1091                 HbTextItem *ti = new HbTextItem(parent);
   429                 setItemName(ti, QLatin1String("additional-text"));
  1092                 setItemName(ti, QLatin1String("additional-text"));
   430                 return  ti;
  1093                 return  ti;
   431                 }
  1094                 }
   432              case P_ProgressBar_toucharea:
  1095             case P_ProgressSlider_toucharea:
   433                 {
       
   434                 HbTouchArea *ta = new HbTouchArea(parent);
       
   435                 ta->setFlag(QGraphicsItem::ItemIsFocusable);
       
   436                 setItemName(ta, QLatin1String("toucharea1"));
       
   437 				ta->setZValue(TOUCHAREA_ZVALUE);
       
   438                 return ta;
       
   439                 }
       
   440 			case P_ProgressSliderHandle_toucharea: 
       
   441                 {
  1096                 {
   442                 HbTouchArea *ta = new HbTouchArea(parent);
  1097                 HbTouchArea *ta = new HbTouchArea(parent);
   443                 ta->setFlag(QGraphicsItem::ItemIsFocusable);
  1098                 ta->setFlag(QGraphicsItem::ItemIsFocusable);
   444                 setItemName(ta, QLatin1String("toucharea"));
  1099                 setItemName(ta, QLatin1String("toucharea"));
   445 				ta->setZValue(TOUCHAREA_ZVALUE);
  1100                 ta->setZValue(TOUCHAREA_ZVALUE);
       
  1101                 return ta;
       
  1102                 }
       
  1103             case P_ProgressSliderHandle_toucharea: 
       
  1104                 {
       
  1105                 HbTouchArea *ta = new HbTouchArea(parent);
       
  1106                 ta->setFlag(QGraphicsItem::ItemIsFocusable);
       
  1107                 setItemName(ta, QLatin1String("toucharea"));
       
  1108                 ta->setZValue(TOUCHAREA_ZVALUE);
   446                 if(parent){
  1109                 if(parent){
   447                     parent->setHandlesChildEvents(true); 
  1110                     parent->setHandlesChildEvents(true); 
   448                 }
  1111                 }
   449                 return ta;
  1112                 return ta;
   450                 }
  1113                 }
   451 
  1114 
   452 			case P_ProgressSlider_handle:
  1115             case P_ProgressSliderHandle_icon:
   453 			    {
  1116                 {
   454                 HbIconItem *item = new HbIconItem(QLatin1String("qtg_graf_progslider_handle_normal"), parent);
  1117                 HbIconItem *item = new HbIconItem(QLatin1String("qtg_graf_progslider_handle_normal"), parent);
   455 				item->setAspectRatioMode(Qt::IgnoreAspectRatio);
  1118                 item->setAspectRatioMode(Qt::IgnoreAspectRatio);
   456                 return item;									 
       
   457 				}
       
   458             case P_ProgressSlider_handleicon:{
       
   459                 HbIconItem *item = new HbIconItem(QLatin1String("qtg_mono_play"), parent);
       
   460                 return item;
  1119                 return item;
   461                 }
  1120                 }
   462             case P_PushButton_toucharea: // Generic implementation, can add other cases here
  1121             case P_PushButton_toucharea: // Generic implementation, can add other cases here
   463             case P_CheckBox_toucharea:
  1122             case P_CheckBox_toucharea:
   464             case P_RatingSlider_toucharea:
  1123             case P_RatingSlider_toucharea:
   465 	        case P_SliderElement_touchhandle: 
  1124             case P_SliderElement_touchhandle: 
   466                 {
  1125                 {
   467                 HbTouchArea *ta = new HbTouchArea(parent);
  1126                 HbTouchArea *ta = new HbTouchArea(parent);
   468                 ta->setFlag(QGraphicsItem::ItemIsFocusable);
  1127                 ta->setFlag(QGraphicsItem::ItemIsFocusable);
   469                 setItemName(ta, QLatin1String("toucharea"));
  1128                 setItemName(ta, QLatin1String("toucharea"));
   470                 if(parent){
  1129                 if(parent){
   595 
  1254 
   596             case P_ComboBoxPopup_background:
  1255             case P_ComboBoxPopup_background:
   597             {
  1256             {
   598                 HbFrameItem *n = new HbFrameItem(parent);
  1257                 HbFrameItem *n = new HbFrameItem(parent);
   599                 n->setZValue(-1);
  1258                 n->setZValue(-1);
   600 				setItemName(n , "dropdown_background");
  1259                 setItemName(n , "dropdown_background");
   601                 return n;
  1260                 return n;
   602             }
  1261             }
   603 
  1262 
   604             case P_TumbleView_background:
  1263             case P_TumbleView_background:
   605             case P_TumbleView_frame:
  1264             case P_TumbleView_frame:
   608             {
  1267             {
   609                 HbFrameItem *n = new HbFrameItem(parent);
  1268                 HbFrameItem *n = new HbFrameItem(parent);
   610                 n->setZValue(-5);
  1269                 n->setZValue(-5);
   611                 return n;
  1270                 return n;
   612             }
  1271             }
   613             case P_TumbleView_highlight:{
  1272             case P_TumbleView_highlight:
   614                 //return new HbIconItem(parent);
  1273             {
   615                 return new HbFrameItem(parent);//TODO:make it icon once iconitem setGeomoetry works for tumbleview
  1274                 return new HbFrameItem(parent);//TODO:make it icon once iconitem setGeomoetry works for tumbleview
   616             }
  1275             }
       
  1276 
   617             case P_DateTimePicker_separator:{
  1277             case P_DateTimePicker_separator:{
   618                 //return new HbIconItem(parent);
       
   619                 HbFrameItem *frameItem= new HbFrameItem(parent);//TODO:make it icon once iconitem setGeomoetry works for tumbleview
  1278                 HbFrameItem *frameItem= new HbFrameItem(parent);//TODO:make it icon once iconitem setGeomoetry works for tumbleview
   620                 frameItem->frameDrawer().setFrameGraphicsName("qtg_graf_tumbler_devider");
       
   621                 frameItem->frameDrawer().setFrameType(HbFrameDrawer::OnePiece);
       
   622                 frameItem->setPreferredWidth(2);
       
   623                 return frameItem;
  1279                 return frameItem;
   624             }           
  1280             }           
   625             case P_DataGroup_background :
  1281             case P_DataGroup_background :
   626             {
  1282             {
   627                 HbFrameItem *n = new HbFrameItem(parent);
  1283                 HbFrameItem *n = new HbFrameItem(parent);
   663             {
  1319             {
   664                 HbProgressTrackItem *n = new HbProgressTrackItem(parent);
  1320                 HbProgressTrackItem *n = new HbProgressTrackItem(parent);
   665                 n->setZValue(-2);
  1321                 n->setZValue(-2);
   666                 return n;
  1322                 return n;
   667             }
  1323             }
   668             case P_ProgressBar_slidertrack:
  1324             case P_ProgressSlider_slidertrack:
   669             {
  1325             {
   670                 HbProgressTrackItem *n = new HbProgressTrackItem(parent);
  1326                 HbProgressTrackItem *n = new HbProgressTrackItem(parent);
   671                 n->setZValue(-1);
  1327                 n->setZValue(-1);
   672                 return n;
  1328                 return n;
   673             }        
  1329             }
   674             case P_Slider_progressgroove:
  1330             case P_Slider_progressgroove:
   675             {
  1331             {
   676                 HbSliderTrackItem *n=new HbSliderTrackItem(parent);
  1332                 HbSliderTrackItem *n=new HbSliderTrackItem(parent);
   677                 n->setZValue(0);
  1333                 n->setZValue(0);
   678                 return n;
  1334                 return n;
   794                 return n;
  1450                 return n;
   795             }
  1451             }
   796             case P_TitlePane_icon:
  1452             case P_TitlePane_icon:
   797             {
  1453             {
   798                 HbIconItem *n = new HbIconItem(parent);
  1454                 HbIconItem *n = new HbIconItem(parent);
       
  1455                 n->setFlags(HbIcon::Colorized);
   799                 setItemName(n, QLatin1String("icon"));
  1456                 setItemName(n, QLatin1String("icon"));
   800                 return n;
  1457                 return n;
   801             }
  1458             }
   802             case P_StatusBar_background:
  1459             case P_StatusBar_background:
   803             {
  1460             {
   804                 HbFrameItem *n = new HbFrameItem(parent);
  1461                 HbFrameItem *n = new HbFrameItem(parent);
   805                 n->setZValue(-1);
  1462                 n->setZValue(-1);
   806                 setItemName(n, QLatin1String("statusbar"));
  1463                 setItemName(n, QLatin1String("statusbar"));
   807                 return n;
  1464                 return n;
   808 			}
  1465             }
   809             case P_StatusBar_timetext:
  1466             case P_StatusBar_timetext:
   810             {
  1467             {
   811                 HbTextItem *textItem = new HbTextItem(parent);
  1468                 HbTextItem *textItem = new HbTextItem(parent);
   812                 setItemName(textItem, QLatin1String("timetext"));
  1469                 setItemName(textItem, QLatin1String("timetext"));
   813                 textItem->setAlignment(Qt::AlignCenter);
  1470                 textItem->setAlignment(Qt::AlignCenter);
   839                 HbTextItem *textItem = new HbTextItem(parent);
  1496                 HbTextItem *textItem = new HbTextItem(parent);
   840                 setItemName(textItem,QLatin1String("tickmark-minorlabel"));
  1497                 setItemName(textItem,QLatin1String("tickmark-minorlabel"));
   841                 return textItem;
  1498                 return textItem;
   842             }
  1499             }
   843 
  1500 
   844 
       
   845             case P_ProgressBar_waittrack:
  1501             case P_ProgressBar_waittrack:
   846                 return new HbRepeatIconItem(QLatin1String("qtg_fr_progbar_wait"), parent);
  1502                 return new HbRepeatIconItem(QLatin1String("qtg_graf_progbar_h_wait"), parent);
   847 
  1503 
   848             case P_RatingSlider_frame:
  1504             case P_RatingSlider_frame:
   849                 return  new HbRepeatItem(parent);
  1505                 return  new HbRepeatItem(parent);
   850 
  1506 
   851             case P_RatingSlider_track:
  1507             case P_RatingSlider_track:
   852                 return new HbRepeatMaskItem(parent);
  1508                 return new HbRepeatMaskItem(parent);
   853             
  1509             
   854 			case P_RatingSlider_layout:
  1510             case P_RatingSlider_layout: {
   855                 return new HbWidgetBase(parent);
  1511                 HbWidgetBase *layout = new HbWidgetBase(parent);
       
  1512                 setItemName(layout, "frame");
       
  1513                 return layout;
       
  1514             }
   856 
  1515 
   857             case P_ItemViewItem_checkbox: {
  1516             case P_ItemViewItem_checkbox: {
   858                 qDebug() << "Primitive P_ItemViewItem_checkbox is deprecated and will cease to exist in the near future.";
  1517                 qDebug() << "Primitive P_ItemViewItem_checkbox is deprecated and will cease to exist in the near future.";
   859                 HbIconItem *iconItem = new HbIconItem(parent);
  1518                 HbIconItem *iconItem = new HbIconItem(parent);
   860                 setItemName(iconItem, QLatin1String("checkbox-icon"));
  1519                 setItemName(iconItem, QLatin1String("checkbox-icon"));
   885             case P_NotificationDialog_icon:{
  1544             case P_NotificationDialog_icon:{
   886                 HbIconItem *n = new HbIconItem(QString(), parent);
  1545                 HbIconItem *n = new HbIconItem(QString(), parent);
   887                 setItemName(n, QLatin1String("icon"));
  1546                 setItemName(n, QLatin1String("icon"));
   888                 return n;
  1547                 return n;
   889             }
  1548             }
   890             case P_MessageBox_text:{
  1549             case P_MessageBox_text:{    //deprecated
   891                 HbTextItem *rti = new HbTextItem(parent);
  1550                 HbTextItem *rti = new HbTextItem(parent);
   892                 return rti;
  1551                 return rti;
   893             }
  1552             }
   894             case P_MessageBox_icon:{
  1553             case P_MessageBox_icon:{
   895                 HbIconItem *n = new HbIconItem(QString(), parent);
  1554                 HbIconItem *n = new HbIconItem(QString(), parent);
   933             case P_ColorGridViewItem_colorIcon:
  1592             case P_ColorGridViewItem_colorIcon:
   934                 return new HbIconItem("qtg_graf_colorpicker_mask", parent);
  1593                 return new HbIconItem("qtg_graf_colorpicker_mask", parent);
   935             case P_ColorGridViewItem_borderIcon:
  1594             case P_ColorGridViewItem_borderIcon:
   936                 return new HbIconItem("qtg_graf_colorpicker_filled", parent);
  1595                 return new HbIconItem("qtg_graf_colorpicker_filled", parent);
   937             case P_ColorGridViewItem_checkIcon:
  1596             case P_ColorGridViewItem_checkIcon:
   938                 return new HbIconItem("qtg_small_tick", parent); // TODO: likely wrong
  1597                 return new HbIconItem("qtg_small_tick", parent);
   939 
  1598 
   940             case P_TreeViewItem_expandicon: {
  1599             case P_TreeViewItem_expandicon: {
   941                 HbIconItem *iconItem = new HbIconItem(parent);
  1600                 HbIconItem *iconItem = new HbIconItem(parent);
   942                 setItemName(iconItem, QLatin1String("subitem-indicator"));
  1601                 setItemName(iconItem, QLatin1String("subitem-indicator"));
   943                 return iconItem;
  1602                 return iconItem;
  1039             {
  1698             {
  1040                 HbTextItem *n = new HbTextItem(parent);
  1699                 HbTextItem *n = new HbTextItem(parent);
  1041                 setItemName(n, QLatin1String("label-1"));
  1700                 setItemName(n, QLatin1String("label-1"));
  1042                 return n;
  1701                 return n;
  1043             }
  1702             }
  1044             case P_InputDialog_additional_text:
  1703             case P_InputDialog_additionaltext:
  1045             {
  1704             {
  1046                 HbTextItem *n = new HbTextItem(parent);
  1705                 HbTextItem *n = new HbTextItem(parent);
  1047                 setItemName(n, QLatin1String("label-2"));
  1706                 setItemName(n, QLatin1String("label-2"));
  1048                 return n;
  1707                 return n;
  1049             }
  1708             }
  1051                 return 0;
  1710                 return 0;
  1052         }
  1711         }
  1053 }
  1712 }
  1054 
  1713 
  1055 /*!
  1714 /*!
       
  1715 
       
  1716   \deprecated HbStyle::updatePrimitive(QGraphicsItem*, HbStyle::Primitive, const QStyleOption*)
       
  1717   is deprecated. This method will be made private and finally removed since primitive updating will be done in the widgets.
       
  1718 
  1056   Updates the state and content of widget's child primitives. Update for a styled primitive should happen always when
  1719   Updates the state and content of widget's child primitives. Update for a styled primitive should happen always when
  1057   a state change that affects drawing occurs. Such a situation can be for example pressing of a button (change background image), or 
  1720   a state change that affects drawing occurs. Such a situation can be for example pressing of a button (change background image), or 
  1058   changing a text for a widget having text content. The updatePrimitive() implementation for each primitive element can be considered 
  1721   changing a text for a widget having text content. The updatePrimitive() implementation for each primitive element can be considered 
  1059   as a part of widget's implementation. Note that it's up to the widget to decide what the styleoption contains and what the updatePrimitive() method 
  1722   as a part of widget's implementation. Note that it's up to the widget to decide what the styleoption contains and what the updatePrimitive() method 
  1060   uses the styleoption data for.
  1723   uses the styleoption data for.
  1158                         //default alignment will come from css,
  1821                         //default alignment will come from css,
  1159                         //if api flag is set ,then alignment from style is taken.
  1822                         //if api flag is set ,then alignment from style is taken.
  1160                         if (opt->hasTextAlignment) {
  1823                         if (opt->hasTextAlignment) {
  1161                             textItem->setAlignment( opt->textAlignment );                                           
  1824                             textItem->setAlignment( opt->textAlignment );                                           
  1162                         }                        
  1825                         }                        
  1163                         textItem->setTextWrapping(Hb::TextWrapAnywhere);
  1826                         textItem->setTextWrapping(Hb::TextWordWrap);
  1164                     }
  1827                     }
  1165                 }
  1828                 }
  1166                 break;
  1829                 break;
  1167             case P_ProgressDialog_text:
  1830             case P_ProgressDialog_text:
  1168                  {
  1831                 {
  1169                    if (const HbStyleOptionProgressDialog *opt = 
  1832                     if (const HbStyleOptionProgressDialog *opt = 
  1170 					   qstyleoption_cast<const HbStyleOptionProgressDialog*>(option)) {
  1833                         qstyleoption_cast<const HbStyleOptionProgressDialog*>(option)) {
  1171                         HbTextItem *textItem = static_cast<HbTextItem*>(item);
  1834                         HbTextItem *textItem = static_cast<HbTextItem*>(item);
  1172                         textItem->setAlignment( opt->textAlignment );
  1835                         textItem->setText(opt->text);                       
  1173 						if (opt->wrap) {
       
  1174 							textItem->setTextWrapping(Hb::TextWrapAnywhere);
       
  1175 						 } else {
       
  1176 							 textItem->setTextWrapping(Hb::TextNoWrap);
       
  1177 						}
       
  1178                         textItem->setText(opt->text);						
       
  1179                     }
  1836                     }
  1180                 break;
  1837                 break;
  1181                 }
  1838                 }
  1182             case P_PushButton_additionaltext:
  1839             case P_PushButton_additionaltext:
  1183                 {
  1840                 {
  1188                         //default alignment will come from css,
  1845                         //default alignment will come from css,
  1189                         //if api flag is set ,then alignment from style is taken.
  1846                         //if api flag is set ,then alignment from style is taken.
  1190                         if (opt->hasAdditionalTextAlignment) {
  1847                         if (opt->hasAdditionalTextAlignment) {
  1191                             additionalTextItem->setAlignment( opt->additionalTextAlignment );                       
  1848                             additionalTextItem->setAlignment( opt->additionalTextAlignment );                       
  1192                         }                       
  1849                         }                       
  1193                         additionalTextItem->setTextWrapping(Hb::TextWrapAnywhere);
  1850                         additionalTextItem->setTextWrapping(Hb::TextWordWrap);
  1194                     }                    
  1851                     }                    
  1195                 }
  1852                 }
  1196                 break;
  1853                 break;
  1197             case P_PushButton_toucharea:  // Generic implementation, can add other cases here
  1854             case P_PushButton_toucharea:  // Generic implementation, can add other cases here
  1198             case P_ComboBoxButton_toucharea:
  1855             case P_ComboBoxButton_toucharea:
  1217                     }
  1874                     }
  1218                 break;
  1875                 break;
  1219                 }
  1876                 }
  1220             case P_DataGroup_description:
  1877             case P_DataGroup_description:
  1221                 {
  1878                 {
  1222                    if (const HbStyleOptionDataGroup *opt = 
  1879                    if (const HbStyleOptionDataGroupHeadingWidget *opt = 
  1223                         qstyleoption_cast<const HbStyleOptionDataGroup*>(option)) {
  1880                         qstyleoption_cast<const HbStyleOptionDataGroupHeadingWidget*>(option)) {
  1224                         HbTextItem *textItem = static_cast<HbTextItem*>(item);
  1881                         HbTextItem *textItem = static_cast<HbTextItem*>(item);
  1225                         textItem->setText(opt->description);
  1882                         textItem->setText(opt->description);
  1226                     }
  1883                     }
  1227                 break;
  1884                 break;
  1228                 }
  1885                 }
  1263                 if (const HbStyleOptionToolButton *opt = qstyleoption_cast<const HbStyleOptionToolButton*>(option)) {
  1920                 if (const HbStyleOptionToolButton *opt = qstyleoption_cast<const HbStyleOptionToolButton*>(option)) {
  1264                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  1921                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  1265                     textItem->setText(opt->text);
  1922                     textItem->setText(opt->text);
  1266                 }
  1923                 }
  1267                 break;
  1924                 break;
  1268             case P_ProgressBar_text: {
  1925             case P_ProgressBar_text: {    
  1269                 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar*>(option)) {
  1926                   if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar*>(option)) {    
  1270                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  1927                       HbTextItem *textItem = static_cast<HbTextItem*>(item);    
  1271                     textItem->setAlignment(Qt::AlignCenter);
  1928                       textItem->setAlignment(Qt::AlignCenter);    
  1272                     textItem->setZValue(100);
  1929                       textItem->setZValue(100);    
  1273                     textItem->setText(opt->text);
  1930                       textItem->setText(opt->text);    
  1274                 }
  1931                   }    
  1275                 break;
  1932                   break;    
  1276             }
  1933               } 
  1277             case P_DataGroup_background: {
  1934             case P_DataGroup_background: {
  1278                 if (const HbStyleOptionDataGroupHeadingWidget *opt = 
  1935                 if (const HbStyleOptionDataGroupHeadingWidget *opt = 
  1279                     qstyleoption_cast<const HbStyleOptionDataGroupHeadingWidget *>(option)) {
  1936                     qstyleoption_cast<const HbStyleOptionDataGroupHeadingWidget *>(option)) {
  1280                     HbFrameItem *frameItem = static_cast<HbFrameItem*>( item );
  1937                     HbFrameItem *frameItem = static_cast<HbFrameItem*>( item );
  1281 	                if(!frameItem){
  1938                     if(!frameItem){
  1282 	                    return;
  1939                         return;
  1283 	                }
  1940                     }
  1284                     frameItem->setZValue(-1.0);
  1941                     frameItem->setZValue(-1.0);
  1285                     if(opt->pressed) {
  1942                     if(opt->pressed) {
  1286                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_pressed"));
  1943                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_pressed"));
  1287                     } else {
  1944                     } else {
  1288                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_parent_normal"));
  1945                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_list_parent_normal"));
  1449                     }
  2106                     }
  1450                     frameItem->frameDrawer().setFileNameSuffixList(QStringList() << QLatin1String("_cl") << QLatin1String("_c") << QLatin1String("_cr"));
  2107                     frameItem->frameDrawer().setFileNameSuffixList(QStringList() << QLatin1String("_cl") << QLatin1String("_c") << QLatin1String("_cr"));
  1451                 }
  2108                 }
  1452                 break;
  2109                 break;
  1453             }
  2110             }
  1454 			case P_StatusBar_background: {
  2111             case P_StatusBar_background: {
  1455                 const HbStyleOptionStatusBar *opt = qstyleoption_cast<const HbStyleOptionStatusBar *>(option);
  2112                 const HbStyleOptionStatusBar *opt = qstyleoption_cast<const HbStyleOptionStatusBar *>(option);
  1456                 if (opt) {
  2113                 if (opt) {
  1457 				    HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
  2114                     HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
  1458 				    frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  2115                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  1459                     if (opt->transparent) {
  2116                     if (opt->transparent) {
  1460                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_statusbar_trans"));
  2117                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_statusbar_trans"));
  1461                     } else {
  2118                     } else {
  1462                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_statusbar"));
  2119                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_statusbar"));
  1463                     }
  2120                     }
  1464                 }
  2121                 }
  1465                 break;
  2122                 break;
  1466             }
  2123             }
  1467 			case P_StatusBar_timetext: {
  2124             case P_StatusBar_timetext: {
  1468                 if (const HbStyleOptionStatusBar *opt = 
  2125                 if (const HbStyleOptionStatusBar *opt = 
  1469                     qstyleoption_cast<const HbStyleOptionStatusBar*>(option)) {
  2126                     qstyleoption_cast<const HbStyleOptionStatusBar*>(option)) {
  1470                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  2127                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  1471                     textItem->setText(opt->timeText);
  2128                     textItem->setText(opt->timeText);
  1472                     }
  2129                     }
  1473 				break;
  2130                 break;
  1474             }
  2131             }
  1475             case P_IndicatorGroup_background: { // deprecated
  2132             case P_IndicatorGroup_background: { // deprecated
  1476                 const HbStyleOptionIndicatorGroup *opt = qstyleoption_cast<const HbStyleOptionIndicatorGroup *>(option);
  2133                 const HbStyleOptionIndicatorGroup *opt = qstyleoption_cast<const HbStyleOptionIndicatorGroup *>(option);
  1477 
  2134 
  1478                 if (opt) {
  2135                 if (opt) {
  1562                             break;
  2219                             break;
  1563                         case 3:
  2220                         case 3:
  1564                             iconItem->setIconName("qtg_status_wcdma");
  2221                             iconItem->setIconName("qtg_status_wcdma");
  1565                             break;
  2222                             break;
  1566                         case 5:
  2223                         case 5:
  1567                             iconItem->setIconName("qtg_status_wlan");
  2224                             iconItem->setIconName("qtg_mono_wlan");
  1568                             break;
  2225                             break;
  1569                         default:
  2226                         default:
  1570                             iconItem->setIconName("qtg_mono_offline");
  2227                             iconItem->setIconName("qtg_mono_offline");
  1571                             break;
  2228                             break;
  1572                     }
  2229                     }
  1806 
  2463 
  1807             case P_TitlePane_icon: {
  2464             case P_TitlePane_icon: {
  1808                 const HbStyleOptionTitlePane *opt = qstyleoption_cast<const HbStyleOptionTitlePane *>(option);
  2465                 const HbStyleOptionTitlePane *opt = qstyleoption_cast<const HbStyleOptionTitlePane *>(option);
  1809                 if (opt) {
  2466                 if (opt) {
  1810                     HbIconItem *iconItem = static_cast<HbIconItem*>(item);
  2467                     HbIconItem *iconItem = static_cast<HbIconItem*>(item);
  1811                     iconItem->setIconName("qgn_indi_input_arrow_down");
  2468                     iconItem->setIconName("qtg_mono_options_menu");
  1812                 }
  2469                 }
  1813                 break;
  2470                 break;
  1814             }
  2471             }
  1815             case P_GroupBoxMarquee_text: {
  2472             case P_GroupBoxMarquee_text: {
  1816                 if (const HbStyleOptionGroupBox *opt = qstyleoption_cast<const HbStyleOptionGroupBox *>(option)) {
  2473                 if (const HbStyleOptionGroupBox *opt = qstyleoption_cast<const HbStyleOptionGroupBox *>(option)) {
  1853             }
  2510             }
  1854             case P_ToolButton_frame:{
  2511             case P_ToolButton_frame:{
  1855                 const HbStyleOptionToolButton *opt = qstyleoption_cast<const HbStyleOptionToolButton *>(option);
  2512                 const HbStyleOptionToolButton *opt = qstyleoption_cast<const HbStyleOptionToolButton *>(option);
  1856                 HbFrameItem *frameItem = static_cast<HbFrameItem*>( item );
  2513                 HbFrameItem *frameItem = static_cast<HbFrameItem*>( item );
  1857                 frameItem->frameDrawer().setFillWholeRect(true);
  2514                 frameItem->frameDrawer().setFillWholeRect(true);
  1858                 frameItem->setGeometry(opt->rect);
       
  1859                 if (opt->orientation == Qt::Vertical) {
  2515                 if (opt->orientation == Qt::Vertical) {
  1860                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  2516                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  1861                 } else {
  2517                 } else {
  1862                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
  2518                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
  1863                 }
  2519                 }
  1871                     QString customName = opt->customBackground.iconName(mode, state);
  2527                     QString customName = opt->customBackground.iconName(mode, state);
  1872                     frameItem->frameDrawer().setFrameGraphicsName(customName);
  2528                     frameItem->frameDrawer().setFrameGraphicsName(customName);
  1873                     break;
  2529                     break;
  1874                 }
  2530                 }
  1875 
  2531 
       
  2532                 QString frameGraphicsName;
       
  2533                 if(opt->isToolBarExtension) {
       
  2534                    if (mode == QIcon::Normal && state == QIcon::On) {
       
  2535                         if(!opt->isCheckable){
       
  2536                             frameGraphicsName = QLatin1String("qtg_fr_popup_grid_pressed");
       
  2537                         } else {
       
  2538                             frameGraphicsName = QLatin1String("qtg_fr_tb_ext");
       
  2539                         }
       
  2540                     }
       
  2541                     frameItem->frameDrawer().setFrameGraphicsName(frameGraphicsName);
       
  2542                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
       
  2543                     return;
       
  2544                 }
  1876                 if (!opt->toolBarPosition) {
  2545                 if (!opt->toolBarPosition) {
  1877                     QString frameGraphicsName;
       
  1878                     if (mode == QIcon::Disabled && state == QIcon::Off) {
  2546                     if (mode == QIcon::Disabled && state == QIcon::Off) {
  1879                         frameGraphicsName = QLatin1String("qtg_fr_btn_disabled");
  2547                         frameGraphicsName = QLatin1String("qtg_fr_btn_disabled");
  1880                     } else if (mode == QIcon::Normal && state == QIcon::On) {
  2548                     } else if (mode == QIcon::Normal && state == QIcon::On) {
  1881                         if(!opt->isCheckable){
  2549                         if(!opt->isCheckable){
  1882                             frameGraphicsName = QLatin1String("qtg_fr_btn_pressed");
  2550                             frameGraphicsName = QLatin1String("qtg_fr_btn_pressed");
  1894                 }
  2562                 }
  1895                 // For toolbar:
  2563                 // For toolbar:
  1896 
  2564 
  1897                 QString frameGraphicsHeader;
  2565                 QString frameGraphicsHeader;
  1898                 if (!opt->useSecondaryGraphics){
  2566                 if (!opt->useSecondaryGraphics){
  1899                     frameGraphicsHeader = opt->orientation == Qt::Vertical ? QLatin1String("qtg_fr_tb_h_"):
  2567                     if (opt->useTransparentGraphics) {
  1900                                                                              QLatin1String("qtg_fr_tb_v_");
  2568                         frameGraphicsHeader = opt->orientation == Qt::Vertical ?
       
  2569                                               QLatin1String("qtg_fr_tb_trans_h_"):
       
  2570                                               QLatin1String("qtg_fr_tb_trans_v_");
       
  2571                     } else {
       
  2572                         frameGraphicsHeader = opt->orientation == Qt::Vertical ?
       
  2573                                               QLatin1String("qtg_fr_tb_h_"):
       
  2574                                               QLatin1String("qtg_fr_tb_v_");
       
  2575                     }
  1901                 }else {
  2576                 }else {
  1902                     frameGraphicsHeader = QLatin1String("qtg_fr_popup_sk_");
  2577                     frameGraphicsHeader = QLatin1String("qtg_fr_popup_sk_");
  1903                     frameItem->frameDrawer().setMirroringMode(HbIcon::LayoutDirection);
  2578                     frameItem->frameDrawer().setMirroringMode(HbIcon::LayoutDirection);
  1904                 }
  2579                 }
  1905 
  2580 
  2154 
  2829 
  2155 
  2830 
  2156             case P_CheckBox_text:
  2831             case P_CheckBox_text:
  2157                 if (const HbStyleOptionCheckBox *opt = qstyleoption_cast<const HbStyleOptionCheckBox*>(option)) {
  2832                 if (const HbStyleOptionCheckBox *opt = qstyleoption_cast<const HbStyleOptionCheckBox*>(option)) {
  2158                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  2833                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  2159                     textItem->setTextWrapping(Hb::TextWrapAnywhere);
  2834                     textItem->setTextWrapping(Hb::TextWordWrap);
  2160                     textItem->setText(opt->text);
  2835                     textItem->setText(opt->text);
  2161                 }
  2836                 }
  2162                 break;
  2837                 break;
  2163 
  2838 
  2164             case P_CheckBox_icon: {
  2839             case P_CheckBox_icon: {
  2225                 }
  2900                 }
  2226             break;
  2901             break;
  2227             }
  2902             }
  2228 
  2903 
  2229             case P_LineEdit_frame_highlight:{
  2904             case P_LineEdit_frame_highlight:{
  2230                 if (HbFrameItem *frameItem = qgraphicsitem_cast<HbFrameItem*>( item ) ) {
  2905                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption *>(option)) {
  2231                     frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_lineedit_highlight"));
  2906                     if (HbFrameItem *frameItem = qgraphicsitem_cast<HbFrameItem*>( item ) ) {
  2232                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
  2907                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_lineedit_highlight"));
       
  2908                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
       
  2909                         frameItem->setGeometry(opt->boundingRect);
       
  2910                     }
  2233                 }
  2911                 }
  2234             break;
  2912             break;
  2235             }
  2913             }
  2236 
  2914 
  2237             case P_TextEdit_frame_normal:{
  2915             case P_TextEdit_frame_normal:{
  2241                 }
  2919                 }
  2242             break;
  2920             break;
  2243             }
  2921             }
  2244 
  2922 
  2245             case P_TextEdit_frame_highlight:{
  2923             case P_TextEdit_frame_highlight:{
  2246                 if (HbFrameItem *frameItem = qgraphicsitem_cast<HbFrameItem*>( item ) ) {
  2924                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption *>(option)) {
  2247                     frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_textedit_highlight"));
  2925                     if (HbFrameItem *frameItem = qgraphicsitem_cast<HbFrameItem*>( item ) ) {
  2248                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
  2926                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_textedit_highlight"));
       
  2927                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
       
  2928                         frameItem->setGeometry(opt->boundingRect);
       
  2929                     }
  2249                 }
  2930                 }
  2250             break;
  2931             break;
  2251             }
  2932             }
  2252 
  2933 
  2253             case P_ComboBox_background:{
  2934             case P_ComboBox_background:{
  2256                     QString frameGraphicsName;
  2937                     QString frameGraphicsName;
  2257                     if (opt->state & QStyle::State_Enabled) {
  2938                     if (opt->state & QStyle::State_Enabled) {
  2258                         if (opt->state & QStyle::State_Sunken) {
  2939                         if (opt->state & QStyle::State_Sunken) {
  2259                             frameGraphicsName = QLatin1String("qtg_fr_combobox_pressed");
  2940                             frameGraphicsName = QLatin1String("qtg_fr_combobox_pressed");
  2260                         } else {
  2941                         } else {
  2261                         	frameGraphicsName = QLatin1String("qtg_fr_combobox_normal");
  2942                             frameGraphicsName = QLatin1String("qtg_fr_combobox_normal");
  2262                         }
  2943                         }
  2263                     } else {                        
  2944                     } else {                        
  2264                         frameGraphicsName = QLatin1String("qtg_fr_combobox_disabled");
  2945                         frameGraphicsName = QLatin1String("qtg_fr_combobox_disabled");
  2265                     }
  2946                     }
  2266                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  2947                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  2539                 break;
  3220                 break;
  2540 
  3221 
  2541             case P_ProgressDialog_icon:
  3222             case P_ProgressDialog_icon:
  2542                 if (const HbStyleOptionProgressDialog *opt = static_cast<const HbStyleOptionProgressDialog *>(option)) {
  3223                 if (const HbStyleOptionProgressDialog *opt = static_cast<const HbStyleOptionProgressDialog *>(option)) {
  2543                     HbIconItem *icon = static_cast<HbIconItem*>(item);
  3224                     HbIconItem *icon = static_cast<HbIconItem*>(item);
  2544 
       
  2545                     icon->setIcon(opt->icon);
  3225                     icon->setIcon(opt->icon);
  2546                     icon->setAlignment(opt->iconAlignment);
  3226                 }
  2547                 }
  3227                 break;
  2548 
  3228 
  2549                 break;
  3229             case P_MessageBox_text:    //deprecated
  2550 
       
  2551             
       
  2552             case P_MessageBox_text:
       
  2553                 if (const HbStyleOptionMessageBox *opt = static_cast<const HbStyleOptionMessageBox *>(option)) {
  3230                 if (const HbStyleOptionMessageBox *opt = static_cast<const HbStyleOptionMessageBox *>(option)) {
  2554                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3231                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  2555                     textItem->setAlignment(opt->textAlignment);
  3232                     textItem->setAlignment(opt->textAlignment);
  2556 
  3233 
  2557                     if (opt->textWrapping) {
  3234                     if (opt->textWrapping) {
  2561                     }
  3238                     }
  2562                     textItem->setText(opt->text);
  3239                     textItem->setText(opt->text);
  2563                 }
  3240                 }
  2564                 break;
  3241                 break;
  2565             case P_MessageBox_icon:
  3242             case P_MessageBox_icon:
  2566 	              
       
  2567                 if (const HbStyleOptionMessageBox *opt = static_cast<const HbStyleOptionMessageBox *>(option)) {
  3243                 if (const HbStyleOptionMessageBox *opt = static_cast<const HbStyleOptionMessageBox *>(option)) {
  2568                         HbIconItem *icon = static_cast<HbIconItem*>(item);
  3244                     HbIconItem *icon = static_cast<HbIconItem*>(item);
  2569                         HbIcon noteIcon = opt->icon;
  3245                     HbIcon noteIcon = opt->icon;
  2570                         if(noteIcon.isNull()) {
  3246                     if(noteIcon.isNull()) {
  2571                             switch (opt->messageBoxType) {
  3247                         switch (opt->messageBoxType) {
  2572                                 case HbStyleOptionMessageBox::MessageTypeInformation:
  3248                         case HbStyleOptionMessageBox::MessageTypeInformation:
  2573                                     icon->setIcon(HbIcon(QLatin1String("note_info")));
  3249                             icon->setIcon(HbIcon(QLatin1String("qtg_large_info")));
  2574                                     break;
  3250                             break;
  2575                                 case HbStyleOptionMessageBox::MessageTypeQuestion:
  3251                         case HbStyleOptionMessageBox::MessageTypeQuestion:
  2576                                     icon->setIcon(HbIcon(QLatin1String("qtg_large_question_mark")));
  3252                             icon->setIcon(HbIcon(QLatin1String("qtg_large_help")));
  2577                                     break;
  3253                             break;
  2578                                 case HbStyleOptionMessageBox::MessageTypeWarning:
  3254                         case HbStyleOptionMessageBox::MessageTypeWarning:
  2579                                     icon->setIcon(HbIcon(QLatin1String("note_warning")));
  3255                             icon->setIcon(HbIcon(QLatin1String("qtg_large_warning")));
  2580                                     break;
  3256                             break;
  2581                                 default:
  3257                         default:
  2582                                     break;
  3258                             break;
  2583                             }
       
  2584 									                            
       
  2585                         }
  3259                         }
  2586 						else {                 
  3260                     } else {                 
  2587                             icon->setIcon(opt->icon);
  3261                         icon->setIcon(opt->icon);
  2588                         }
  3262                     }
  2589                         icon->setAlignment(opt->iconAlignment);
  3263                 }
  2590                 }
       
  2591                 break;
       
  2592             case P_ItemViewItem_background:
       
  2593                 if (const HbStyleOptionAbstractViewItem *opt = qstyleoption_cast<const HbStyleOptionAbstractViewItem *>(option)) {
       
  2594                     HbIconItem *iconItem = static_cast<HbIconItem*>(item);
       
  2595                     iconItem->setZValue(-3.0);
       
  2596 
       
  2597                     if (opt->background.canConvert<HbIcon>()){
       
  2598                         iconItem->setIcon(opt->background.value<HbIcon>());
       
  2599                     } else if (opt->background.canConvert<QBrush>()){
       
  2600                         iconItem->setBrush(opt->background.value<QBrush>());
       
  2601                     }
       
  2602                 }
       
  2603 
       
  2604                 break;
  3264                 break;
  2605             case P_ListViewItem_text:
  3265             case P_ListViewItem_text:
  2606                 if (const HbStyleOptionListViewItem *opt = qstyleoption_cast<const HbStyleOptionListViewItem *>(option)) {
  3266                 if (const HbStyleOptionListViewItem *opt = qstyleoption_cast<const HbStyleOptionListViewItem *>(option)) {
  2607                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3267                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  2608                     
  3268                     
  2700                     frameItem->setGeometry(opt->boundingRect);
  3360                     frameItem->setGeometry(opt->boundingRect);
  2701                 }
  3361                 }
  2702                 break;
  3362                 break;
  2703             case P_ToolBarExtension_background:
  3363             case P_ToolBarExtension_background:
  2704                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption *>(option)) {
  3364                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption *>(option)) {
       
  3365                     Q_UNUSED(opt);
  2705                     HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
  3366                     HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
  2706                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
  3367                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
  2707                     frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_tb_ext"));
  3368                     frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_popup_trans"));
  2708                     frameItem->setGeometry(opt->boundingRect);
       
  2709                 }
  3369                 }
  2710                 break;
  3370                 break;
  2711             case P_SliderPopup_background:
  3371             case P_SliderPopup_background:
  2712                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption *>(option)) {
  3372                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption *>(option)) {
  2713                     Q_UNUSED(opt)
  3373                     Q_UNUSED(opt)
  2717                 }
  3377                 }
  2718                 break;
  3378                 break;
  2719             case P_ProgressBar_frame:
  3379             case P_ProgressBar_frame:
  2720                 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {
  3380                 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {
  2721                     HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
  3381                     HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
  2722 
  3382                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  2723                     if(opt->isSlider) {
       
  2724                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::OnePiece);
       
  2725                         if(opt->orientation == Qt::Horizontal){
  3383                         if(opt->orientation == Qt::Horizontal){
  2726                             frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_graf_progslider_unrated"));
  3384                        
  2727                         }
  3385                                 frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_h_frame"));
  2728                         else{
  3386                          }
  2729                             frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_graf_vprogslider_unrated"));
  3387                       
  2730                         }
       
  2731                     } else {
       
  2732                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
       
  2733                         if(opt->orientation == Qt::Horizontal){
       
  2734                             frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_h_frame"));
       
  2735                         }
       
  2736                         else{
  3388                         else{
  2737                             frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
  3389                             frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
  2738                             // frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_vprogbar_frame"));
       
  2739                             frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_v_frame"));
  3390                             frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_v_frame"));
  2740                         }
  3391                         }
  2741                     }
       
  2742                     frameItem->frameDrawer().setFillWholeRect(true);
  3392                     frameItem->frameDrawer().setFillWholeRect(true);
  2743                     //frameItem->setZValue(-2.0);
       
  2744                 }
  3393                 }
  2745                 break;
  3394                 break;
  2746             case P_ProgressBar_track:
  3395             case P_ProgressBar_track:
  2747 
  3396 
  2748                 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {
  3397                 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {
  2749                     HbProgressTrackItem* frameItem = static_cast<HbProgressTrackItem*>(item);
  3398                     HbProgressTrackItem* frameItem = static_cast<HbProgressTrackItem*>(item);
  2750                     if(!frameItem->isVisible()) {
  3399                     if(!frameItem->isVisible()) {
  2751                         break;
  3400                         break;
  2752                     }
  3401                     }
  2753                     if(opt->isSlider) {
  3402                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  2754                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::OnePiece);
  3403                     if(opt->orientation == Qt::Horizontal){
  2755                         if(opt->orientation == Qt::Horizontal){
  3404                                frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_h_filled"));
  2756                             frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_graf_progslider_rated"));
  3405                      }
  2757                         }
  3406                      else{
  2758                         else{
  3407                                frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
  2759                             frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_graf_vprogslider_rated"));
  3408                                frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_v_filled"));
  2760                         }
  3409                      }
  2761                     } else {
  3410                     frameItem->frameDrawer().setFillWholeRect(true);
  2762                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  3411                     frameItem->setMaximum(opt->maximum);
  2763                         if(opt->secondoryType){
  3412                     frameItem->setMinimum(opt->minimum);
  2764                             if(opt->orientation == Qt::Horizontal){
  3413                     frameItem->setValue(opt->progressValue);
  2765                                 frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_down"));
  3414                     frameItem->setInverted(opt->inverted);
  2766 
  3415                     //frameItem->setGeometry(opt->rect);
  2767                             }
  3416                     frameItem->setOrientation(opt->orientation);
  2768                             else{
  3417                     frameItem->update();
  2769 
  3418                 }
  2770                                 frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
  3419                 break;
  2771                                 frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progress_v_frame_second"));
  3420             case P_ProgressBar_waittrack:
  2772                             }
  3421                 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {                   
  2773                             //frameItem->setZValue(-2.0);
  3422                     HbRepeatIconItem *iconItem = static_cast<HbRepeatIconItem*>(item);
  2774                         }
  3423                     iconItem->setOrientation(opt->orientation);
  2775                         else{
  3424                     if( !iconItem->isVisible() ) {
  2776                             if(opt->orientation == Qt::Horizontal){
  3425                         break;
  2777                                 frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_h_filled"));
  3426                     }
  2778                             }
  3427                     if(opt->orientation == Qt::Horizontal){
  2779                             else{
  3428                         iconItem->setName(QLatin1String("qtg_graf_progbar_h_wait"));
  2780                                 frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
  3429                     }
  2781                                 frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_v_filled"));
  3430                     else{
  2782                             }
  3431                         iconItem->setName(QLatin1String("qtg_graf_progbar_v_wait"));
  2783                         }
  3432                     }
  2784                     }
  3433                     if(opt->stopWaitAnimation){
       
  3434                         iconItem->stopAnimation();
       
  3435                     }
       
  3436                     }
       
  3437                     break;
       
  3438               
       
  3439             case P_ProgressSlider_frame:
       
  3440                 if (const HbStyleOptionProgressSlider *opt = qstyleoption_cast<const HbStyleOptionProgressSlider *>(option)) {
       
  3441                     HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
       
  3442                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
       
  3443                     if(opt->pressedState) {
       
  3444                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_frame_pressed"));
       
  3445                     }
       
  3446                     else {
       
  3447                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_frame_normal"));
       
  3448                     }
       
  3449                     frameItem->frameDrawer().setFillWholeRect(true);       
       
  3450                     frameItem->update();
       
  3451                     }
       
  3452                     break;
       
  3453             case P_ProgressSlider_track: // The ProgressValue Mask
       
  3454                 if (const HbStyleOptionProgressSlider *opt = qstyleoption_cast<const HbStyleOptionProgressSlider *>(option)) {
       
  3455                     HbProgressTrackItem* frameItem = static_cast<HbProgressTrackItem*>(item);
       
  3456                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
       
  3457                     frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_loaded"));
  2785                     frameItem->frameDrawer().setFillWholeRect(true);
  3458                     frameItem->frameDrawer().setFillWholeRect(true);
  2786                     frameItem->setMaximum(opt->maximum);
  3459                     frameItem->setMaximum(opt->maximum);
  2787                     frameItem->setMinimum(opt->minimum);
  3460                     frameItem->setMinimum(opt->minimum);
  2788                     frameItem->setValue(opt->progressValue);
  3461                     frameItem->setValue(opt->progressValue);
  2789                     frameItem->setInverted(opt->inverted);
  3462                     frameItem->setInverted(opt->inverted);
  2790                     frameItem->setOrientation(opt->orientation);
  3463                     frameItem->setOrientation(opt->orientation);
  2791                     frameItem->update();
  3464                     frameItem->update();
  2792                 }
  3465                     } 
  2793                 break;
  3466                     break;
  2794             case P_ProgressBar_waittrack:
  3467 
  2795                 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {                   
  3468             case P_ProgressSlider_slidertrack: // The Slider Position Mask
  2796                     HbRepeatIconItem *iconItem = static_cast<HbRepeatIconItem*>(item);
  3469                 if (const HbStyleOptionProgressSlider *opt = qstyleoption_cast<const HbStyleOptionProgressSlider *>(option)) {
  2797                     iconItem->setOrientation(opt->orientation);
       
  2798                     if( !iconItem->isVisible() ) {
       
  2799                         break;
       
  2800                     }
       
  2801                     if(opt->orientation == Qt::Horizontal){
       
  2802                         iconItem->setName(QLatin1String("qtg_graf_progbar_h_wait"));
       
  2803                     }
       
  2804                     else{
       
  2805                         iconItem->setName(QLatin1String("qtg_graf_progbar_v_wait"));
       
  2806                     }
       
  2807                     if(opt->stopWaitAnimation){
       
  2808                         iconItem->stopAnimation();
       
  2809                     }
       
  2810 
       
  2811                 /*    HbFrameDrawer drawer("qtg_fr_progbar_mask",HbFrameDrawer::ThreePiecesHorizontal);
       
  2812                     drawer.setFillWholeRect(true);
       
  2813                     QPixmap track(opt->frameRect.size().toSize());
       
  2814                     track.fill(Qt::black);
       
  2815                     QPainter p;
       
  2816                     p.begin(&track);
       
  2817                     drawer.paint(&p, opt->frameRect);
       
  2818                     p.end();
       
  2819                     iconItem->setIconHeight(opt->frameRect.height());//set height of the image drawer
       
  2820                     iconItem->setGeometry(opt->frameRect);//set geometry of QGI
       
  2821                     
       
  2822                     QImage i=track.toImage();
       
  2823                     i.invertPixels();
       
  2824                     iconItem->setMask(QPixmap::fromImage(i));*/
       
  2825                 }
       
  2826                 break;
       
  2827 
       
  2828             case P_ProgressBar_slidertrack:
       
  2829                 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {
       
  2830                     HbProgressTrackItem* frameItem = static_cast<HbProgressTrackItem*>(item);
  3470                     HbProgressTrackItem* frameItem = static_cast<HbProgressTrackItem*>(item);
  2831 
  3471                     frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  2832                     if(opt->orientation == Qt::Horizontal){
  3472                     frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progslider_played"));
  2833                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
       
  2834                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_h_filled"));
       
  2835                     }
       
  2836                     else{
       
  2837                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesVertical);
       
  2838                         frameItem->frameDrawer().setFrameGraphicsName(QLatin1String("qtg_fr_progbar_v_filled"));
       
  2839                     }
       
  2840                     frameItem->frameDrawer().setFillWholeRect(true);
  3473                     frameItem->frameDrawer().setFillWholeRect(true);
  2841                     frameItem->setMaximum(opt->maximum);
  3474                     frameItem->setMaximum(opt->maximum);
  2842                     frameItem->setMinimum(opt->minimum);
  3475                     frameItem->setMinimum(opt->minimum);
  2843                     frameItem->setValue(opt->sliderValue);
  3476                     frameItem->setValue(opt->progressSliderValue);
  2844                     frameItem->setInverted(opt->inverted);
  3477                     frameItem->setInverted(opt->inverted);
  2845                     frameItem->setMaskWidth(opt->maskWidth);//maskWidth != 0 when  progress handle's moving.
       
  2846                     frameItem->setOrientation(opt->orientation);
  3478                     frameItem->setOrientation(opt->orientation);
  2847                     frameItem->update();
  3479                     frameItem->update();
  2848                     //frameItem->setZValue(-1.0);
  3480                     } 
  2849                 }
  3481                     break;
  2850                 break;
       
  2851 
       
  2852             case P_ProgressBar_mintext: {
  3482             case P_ProgressBar_mintext: {
  2853                  if (const HbStyleOptionProgressBar *opt = 
  3483                  if (const HbStyleOptionProgressBar *opt = 
  2854                         qstyleoption_cast<const HbStyleOptionProgressBar*>(option)) {
  3484                         qstyleoption_cast<const HbStyleOptionProgressBar*>(option)) {
  2855                         HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3485                         HbTextItem *textItem = static_cast<HbTextItem*>(item);
  2856                         if(!item) {
  3486                         if(!item) {
  2857                             return;
  3487                             return;
  2858                         }
  3488                         }
  2859                         textItem->setTextWrapping(Hb::TextWrapAnywhere);
  3489                         textItem->setTextWrapping(Hb::TextWrapAnywhere);
  2860                         textItem->setText(opt->minText);                        	
  3490                         textItem->setText(opt->minText);                            
  2861                     }
  3491                     }
  2862                  break;
  3492                  break;
  2863             }
  3493             }
  2864 
  3494 
  2865             case P_ProgressBar_maxtext: {
  3495             case P_ProgressBar_maxtext: {
  2868                         HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3498                         HbTextItem *textItem = static_cast<HbTextItem*>(item);
  2869                         if(!item) {
  3499                         if(!item) {
  2870                             return;
  3500                             return;
  2871                         }
  3501                         }
  2872                         textItem->setTextWrapping(Hb::TextWrapAnywhere);
  3502                         textItem->setTextWrapping(Hb::TextWrapAnywhere);
  2873                         textItem->setText(opt->maxText);                        	
  3503                         textItem->setText(opt->maxText);                            
  2874                     }
  3504                     }
  2875                 break;
  3505                 break;
  2876             }
  3506             }
  2877 
  3507 
  2878             case P_RatingSlider_frame:{
  3508             case P_RatingSlider_frame:{
  2907                     repeatItem->setGeometry(opt->boundingRect);
  3537                     repeatItem->setGeometry(opt->boundingRect);
  2908                     repeatItem->update();
  3538                     repeatItem->update();
  2909                 }
  3539                 }
  2910                 break;
  3540                 break;
  2911             }
  3541             }
  2912 
  3542         case P_ProgressSliderHandle_icon:
  2913    		case P_ProgressSlider_handle:
  3543                     if (const HbStyleOptionProgressSliderHandle *opt = qstyleoption_cast<const HbStyleOptionProgressSliderHandle *>(option)) {
  2914 					 if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {
       
  2915                         HbIconItem *iconItem = static_cast<HbIconItem*>(item);
  3544                         HbIconItem *iconItem = static_cast<HbIconItem*>(item);
  2916 						iconItem->setIconName(QLatin1String("qtg_graf_progslider_handle_normal"));
  3545 
  2917                         Q_UNUSED(opt)
  3546                         if(!opt->handleIcon.isNull()) {
  2918 						}
  3547                             iconItem->setIconName(opt->handleIcon.iconName());
  2919 					    break;
       
  2920          case P_ProgressSlider_handleicon:
       
  2921                     if (const HbStyleOptionProgressBar *opt = qstyleoption_cast<const HbStyleOptionProgressBar *>(option)) {
       
  2922                         HbIconItem *iconItem = static_cast<HbIconItem*>(item);
       
  2923 
       
  2924                         if(!opt->thumbIcon.isNull()) {                           
       
  2925                             HbIcon icon(opt->thumbIcon.iconName());                       
       
  2926                             iconItem->setIconName(opt->thumbIcon.iconName());
       
  2927                         }
  3548                         }
  2928                         else {
  3549                         else {
  2929                             switch(opt->sliderState) {
  3550                             if(opt->pressedState) {
  2930                             case HbStyleOptionProgressBar::SliderStatePlayNormal:                            
  3551                                 iconItem->setIconName(QLatin1String("qtg_graf_progslider_handle_pressed"));
  2931                                 iconItem->setIconName(QLatin1String("qtg_mono_play"));
  3552                             }
  2932                                 break;
  3553                             else {
  2933                             case HbStyleOptionProgressBar::SliderStatePlayPressed:
  3554                                 iconItem->setIconName(QLatin1String("qtg_graf_progslider_handle_normal"));
  2934                                 iconItem->setIconName(QLatin1String("qtg_mono_play"));
       
  2935                                 break;
       
  2936                             case HbStyleOptionProgressBar::SliderStatePauseNormal:
       
  2937                                 iconItem->setIconName(QLatin1String("qtg_mono_pause"));
       
  2938                                 break;
       
  2939                             case HbStyleOptionProgressBar::SliderStatePausePressed:
       
  2940                                 iconItem->setIconName(QLatin1String("qtg_mono_pause"));
       
  2941                                 break;
       
  2942                             }
  3555                             }
  2943                         }
  3556                         }
  2944                     }
  3557                     }
  2945 
       
  2946                     break;
  3558                     break;
  2947             case P_QueryInputMode_image:
  3559             case P_QueryInputMode_image:
  2948 
  3560 
  2949              /*   if (const HbStyleOptionInputPopup *opt = qstyleoption_cast<const HbStyleOptionInputPopup *>(option)){
  3561              /*   if (const HbStyleOptionInputPopup *opt = qstyleoption_cast<const HbStyleOptionInputPopup *>(option)){
  2950                     if (HbIconItem *iconItem = static_cast<HbIconItem*>(item)) {
  3562                     if (HbIconItem *iconItem = static_cast<HbIconItem*>(item)) {
  2951                        iconItem->setIcon(*opt->modeIcon);
  3563                        iconItem->setIcon(*opt->modeIcon);
  2952                        iconItem->setPos(opt->editRect.width() - opt->modeIcon->width() - 6,opt->editRect.top()-3);
  3564                        iconItem->setPos(opt->editRect.width() - opt->modeIcon->width() - 6,opt->editRect.top()-3);
  2953                     }
  3565                     }
  2954                 }*/
  3566                 }*/
  2955                 break;
  3567                 break;
       
  3568             case P_ItemViewItem_background:
       
  3569                 if (const HbStyleOptionAbstractViewItem *opt = qstyleoption_cast<const HbStyleOptionAbstractViewItem *>(option)) {
       
  3570                     HbIconItem *iconItem = static_cast<HbIconItem*>(item);
       
  3571                     iconItem->setZValue(-3.0);
       
  3572                     iconItem->setGeometry(opt->boundingRect);
       
  3573                     if (opt->background.canConvert<HbIcon>()){
       
  3574                         iconItem->setIcon(opt->background.value<HbIcon>());
       
  3575                     } else if (opt->background.canConvert<QBrush>()){
       
  3576                         iconItem->setBrush(opt->background.value<QBrush>());
       
  3577                     }
       
  3578                 }
       
  3579 
       
  3580                 break;
  2956             case P_ItemViewItem_frame: 
  3581             case P_ItemViewItem_frame: 
  2957                 if (const HbStyleOptionAbstractViewItem *opt = qstyleoption_cast<const HbStyleOptionAbstractViewItem *>(option)) {
  3582                 if (const HbStyleOptionAbstractViewItem *opt = qstyleoption_cast<const HbStyleOptionAbstractViewItem *>(option)) {
  2958                     HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
  3583                     HbFrameItem *frameItem = static_cast<HbFrameItem*>(item);
  2959                     frameItem->setZValue(-4.0);
  3584                     frameItem->setZValue(-4.0);
       
  3585                     frameItem->setGeometry(opt->boundingRect);
  2960 
  3586 
  2961                     if (opt->background.canConvert<HbFrameBackground>()) {
  3587                     if (opt->background.canConvert<HbFrameBackground>()) {
  2962                         HbFrameBackground frame = opt->background.value<HbFrameBackground>();
  3588                         HbFrameBackground frame = opt->background.value<HbFrameBackground>();
  2963                         frameItem->frameDrawer().setFrameType(frame.frameType());
  3589                         frameItem->frameDrawer().setFrameType(frame.frameType());
  2964                         frameItem->frameDrawer().setFrameGraphicsName(frame.frameGraphicsName());
  3590                         frameItem->frameDrawer().setFrameGraphicsName(frame.frameGraphicsName());
  2984                             frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
  3610                             frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
  2985                             frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? 
  3611                             frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? 
  2986                                 QLatin1String("qtg_fr_popup_list_normal") : QLatin1String("qtg_fr_list_normal"));
  3612                                 QLatin1String("qtg_fr_popup_list_normal") : QLatin1String("qtg_fr_list_normal"));
  2987                         }
  3613                         }
  2988                     } else if (opt->viewItemType == Hb::ItemType_GridViewItem
  3614                     } else if (opt->viewItemType == Hb::ItemType_GridViewItem
  2989 								|| opt->viewItemType == HbPrivate::ItemType_ColorGridViewItem) {
  3615                                 || opt->viewItemType == HbPrivate::ItemType_ColorGridViewItem) {
  2990                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
  3616                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::NinePieces);
  2991                         frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? 
  3617                         frameItem->frameDrawer().setFrameGraphicsName( opt->insidePopup ? 
  2992                             QLatin1String("qtg_fr_popup_grid_normal") : QLatin1String("qtg_fr_grid_normal"));
  3618                             QLatin1String("qtg_fr_popup_grid_normal") : QLatin1String("qtg_fr_grid_normal"));
  2993                     }
  3619                     }
  2994                     else{
  3620                     else{
  3088                         //frameItem->setGeometry(opt->boundingRect);
  3714                         //frameItem->setGeometry(opt->boundingRect);
  3089                         Q_UNUSED(opt);
  3715                         Q_UNUSED(opt);
  3090                     }
  3716                     }
  3091                 }
  3717                 }
  3092                 break;
  3718                 break;
       
  3719 
  3093             case P_TumbleView_highlight:
  3720             case P_TumbleView_highlight:
  3094                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption*>(option)) {
  3721                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption*>(option)) {
  3095                     if(HbFrameItem *frameItem = qgraphicsitem_cast<HbFrameItem*>(item)) {
  3722                     if(HbFrameItem *frameItem = qgraphicsitem_cast<HbFrameItem*>(item)) {
  3096                         frameItem->frameDrawer().setFrameGraphicsName("qtg_graf_tumbler_highlight_sec");
  3723                         frameItem->frameDrawer().setFrameGraphicsName("qtg_fr_tumbler_highlight_pri");
  3097                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::OnePiece);
  3724                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::ThreePiecesHorizontal);
  3098                         frameItem->setZValue(2);
  3725                         frameItem->setZValue(3);
  3099                         //TODO:temp fix, issue with css rule picking in derived class
  3726                         //TODO:temp fix, issue with css rule picking in derived class
  3100                         
  3727                         
  3101                         //frameItem->setGeometry(0,(opt->boundingRect.height()-frameItem->boundingRect().height())/2,opt->boundingRect.width(),opt->boundingRect.height());
  3728                         //frameItem->setGeometry(0,(opt->boundingRect.height()-frameItem->boundingRect().height())/2,opt->boundingRect.width(),opt->boundingRect.height());
  3102                         Q_UNUSED(opt);
  3729                         Q_UNUSED(opt);
  3103                     }
  3730                     }
  3104                     
  3731                     
  3105                 }
  3732                 }
  3106                 break;            
  3733                 break;
       
  3734 
  3107             case P_IndexFeedback_popup_text:
  3735             case P_IndexFeedback_popup_text:
  3108                 if (const HbStyleOptionIndexFeedback *opt = qstyleoption_cast<const HbStyleOptionIndexFeedback *>(option)) {
  3736                 if (const HbStyleOptionIndexFeedback *opt = qstyleoption_cast<const HbStyleOptionIndexFeedback *>(option)) {
  3109                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3737                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3110                     textItem->setFontSpec(opt->fontSpec);
  3738                     textItem->setFontSpec(opt->fontSpec);
  3111                     textItem->setGeometry(opt->textRect);
  3739                     textItem->setGeometry(opt->textRect);
  3144                 }
  3772                 }
  3145                 break;
  3773                 break;
  3146             case P_DateTimePicker_separator:
  3774             case P_DateTimePicker_separator:
  3147                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption*>(option)) {
  3775                 if (const HbStyleOption *opt = qstyleoption_cast<const HbStyleOption*>(option)) {
  3148                     if(HbFrameItem *frameItem = qgraphicsitem_cast<HbFrameItem*>(item)) {
  3776                     if(HbFrameItem *frameItem = qgraphicsitem_cast<HbFrameItem*>(item)) {
  3149                         frameItem->frameDrawer().setFrameGraphicsName("qtg_graf_tumbler_highlight_pri");
  3777                         frameItem->frameDrawer().setFrameGraphicsName("qtg_graf_tumbler_divider");
  3150                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::OnePiece);
  3778                         frameItem->frameDrawer().setFrameType(HbFrameDrawer::OnePiece);
  3151                         frameItem->setZValue(0);
  3779                         frameItem->setZValue(2);
  3152                         //TODO:temp fix, issue with css rule picking in derived class
  3780                         //TODO:temp fix, issue with css rule picking in derived class
  3153 
  3781 
  3154                         //frameItem->setGeometry(0,(opt->boundingRect.height()-frameItem->boundingRect().height())/2,opt->boundingRect.width(),opt->boundingRect.height());
  3782                         //frameItem->setGeometry(0,(opt->boundingRect.height()-frameItem->boundingRect().height())/2,opt->boundingRect.width(),opt->boundingRect.height());
  3155                         Q_UNUSED(opt);
  3783                         Q_UNUSED(opt);
  3156                     }
  3784                     }
  3163                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3791                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3164                     if(!item) {
  3792                     if(!item) {
  3165                         return;
  3793                         return;
  3166                     }
  3794                     }
  3167                     textItem->setTextWrapping(Hb::TextWrapAnywhere);
  3795                     textItem->setTextWrapping(Hb::TextWrapAnywhere);
  3168                     textItem->setText(opt->text);                        	
  3796                     textItem->setText(opt->text);                           
  3169                 }
  3797                 }
  3170                 break;
  3798                 break;
  3171              case P_InputDialog_additional_text:
  3799              case P_InputDialog_additionaltext:
  3172                 if (const HbStyleOptionInputDialog *opt = 
  3800                 if (const HbStyleOptionInputDialog *opt = 
  3173                     qstyleoption_cast<const HbStyleOptionInputDialog*>(option)) {
  3801                     qstyleoption_cast<const HbStyleOptionInputDialog*>(option)) {
  3174                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3802                     HbTextItem *textItem = static_cast<HbTextItem*>(item);
  3175                     if(!item) {
  3803                     if(!item) {
  3176                         return;
  3804                         return;
  3177                     }
  3805                     }
  3178                     textItem->setTextWrapping(Hb::TextWrapAnywhere);
  3806                     textItem->setTextWrapping(Hb::TextWrapAnywhere);
  3179                     textItem->setText(opt->additionalText);                        	
  3807                     textItem->setText(opt->additionalText);                         
  3180                 } 
  3808                 } 
  3181                 break;
  3809                 break;
  3182              default:
  3810              default:
  3183                 return;
  3811                 return;
  3184     };
  3812     };
  3189   \internal
  3817   \internal
  3190 */
  3818 */
  3191 static HbVector<HbCss::Declaration> declarations(
  3819 static HbVector<HbCss::Declaration> declarations(
  3192     const HbVector<HbCss::StyleRule> &styleRules,
  3820     const HbVector<HbCss::StyleRule> &styleRules,
  3193     const QString &part,
  3821     const QString &part,
       
  3822     HbWidget* widget,
  3194     const HbDeviceProfile &profile)
  3823     const HbDeviceProfile &profile)
  3195 {
  3824 {
  3196     quint64 pseudoClass(0);
  3825     quint64 pseudoClass(0);
  3197 
  3826 
  3198     if ( profile.orientation() == Qt::Horizontal ) {
  3827     if ( profile.orientation() == Qt::Horizontal ) {
  3199         pseudoClass |= HbCss::PseudoClass_Landscape;
  3828         pseudoClass |= HbCss::PseudoClass_Landscape;
  3200     } else {
  3829     } else {
  3201         pseudoClass |= HbCss::PseudoClass_Portrait;
  3830         pseudoClass |= HbCss::PseudoClass_Portrait;
       
  3831     }
       
  3832 
       
  3833     HbMainWindow *mainWindow = 0;
       
  3834     if (widget) {
       
  3835         mainWindow = widget->mainWindow();
       
  3836     } else {
       
  3837         QList<HbMainWindow *> mainWindows = hbInstance->allMainWindows();
       
  3838         if (!mainWindows.isEmpty()) {
       
  3839             mainWindow = mainWindows.at(0);
       
  3840         }
       
  3841     }
       
  3842     if (mainWindow && mainWindow->isRightToLeft()) {
       
  3843         pseudoClass |= HbCss::PseudoClass_RightToLeft;
       
  3844     } else {
       
  3845         pseudoClass |= HbCss::PseudoClass_LeftToRight;
  3202     }
  3846     }
  3203 
  3847 
  3204     HbVector<HbCss::Declaration> decls;
  3848     HbVector<HbCss::Declaration> decls;
  3205     for (int i = 0; i < styleRules.count(); i++) {
  3849     for (int i = 0; i < styleRules.count(); i++) {
  3206         const HbCss::Selector& selector = styleRules.at(i).selectors.at(0);
  3850         const HbCss::Selector& selector = styleRules.at(i).selectors.at(0);
  3233     }
  3877     }
  3234 
  3878 
  3235 #ifdef HBSTYLE_DEBUG
  3879 #ifdef HBSTYLE_DEBUG
  3236     qDebug() << "HbStyle::polish : -- --";
  3880     qDebug() << "HbStyle::polish : -- --";
  3237     if ( widget == item ) {
  3881     if ( widget == item ) {
  3238         qDebug() << "HbStyle::polish : -- polishItem: " << widget->metaObject()->className();
  3882         qDebug() << "HbStyle::polishItem : -- item name: " << widget->metaObject()->className();
  3239     } else if ( item ) {
  3883     } else if ( item ) {
  3240         qDebug() << "HbStyle::polish : -- polishItem: " << name << "(existing item)";
  3884         qDebug() << "HbStyle::polishItem : -- item name: " << name << "(existing item)";
  3241     } else {
  3885     } else {
  3242         qDebug() << "HbStyle::polish : -- polishItem: " << name << "(missing item)";
  3886         qDebug() << "HbStyle::polishItem : -- item name: " << name << "(missing item)";
  3243     }
  3887     }
  3244 #endif
  3888 #endif
  3245 
  3889 
  3246     HbDeviceProfile profile(HbDeviceProfile::profile(widget));
  3890     HbDeviceProfile profile(HbDeviceProfile::profile(widget));
  3247 
  3891 
  3248     const HbVector<HbCss::Declaration> decl = declarations(styleRules, name, profile);
  3892     const HbVector<HbCss::Declaration> decl = declarations(styleRules, name, widget, profile);
  3249 #ifdef HBSTYLE_DEBUG
  3893 #ifdef HBSTYLE_DEBUG
  3250     qDebug() << "HbStyle::polish : -- Number of maching CSS declarations: " << decl.count();
  3894     qDebug() << "HbStyle::polishItem : -- Number of maching CSS declarations: " << decl.count();
  3251 #endif
  3895 #endif
  3252     HbCss::ValueExtractor extractor(decl, layoutParameters, profile);
  3896     HbCss::ValueExtractor extractor(decl, layoutParameters, profile);
  3253     HbCss::GeometryValues geomValues;
  3897     HbCss::GeometryValues geomValues;
  3254     HbCss::PositionValues posValues;
  3898     HbCss::PositionValues posValues;
  3255 
  3899 
  3257 #ifndef HBSTYLE_DEBUG
  3901 #ifndef HBSTYLE_DEBUG
  3258     Q_UNUSED(extracted);
  3902     Q_UNUSED(extracted);
  3259 #endif
  3903 #endif
  3260 #ifdef HBSTYLE_DEBUG
  3904 #ifdef HBSTYLE_DEBUG
  3261     if ( !extracted ) {
  3905     if ( !extracted ) {
  3262         qDebug() << "HbStyle::polish : -- No geometry information found";
  3906         qDebug() << "HbStyle::polishItem : -- No geometry overrides found";
  3263     }
  3907     }
  3264 #endif
  3908 #endif
  3265     extracted = extractor.extractPosition(posValues);
  3909     extracted = extractor.extractPosition(posValues);
  3266 #ifdef HBSTYLE_DEBUG
  3910 #ifdef HBSTYLE_DEBUG
  3267     if ( !extracted ) {
  3911     if ( !extracted ) {
  3268         qDebug() << "HbStyle::polish : -- No position information found";
  3912         qDebug() << "HbStyle::polishItem : -- No position overrides found";
  3269     }
  3913     }
  3270 #endif
  3914 #endif
  3271 
  3915 
  3272     if ( item ) {
  3916     if ( item ) {
  3273         if (posValues.mFlags & HbCss::ExtractedZValue) {
  3917         if (posValues.mFlags & HbCss::ExtractedZValue) {
  3274 #ifdef HBSTYLE_DEBUG
  3918 #ifdef HBSTYLE_DEBUG
  3275             qDebug() << "HbStyle::polish : -- Setting zvalue: " << posValues.mZ;
  3919             qDebug() << "HbStyle::polishItem : -- Setting zvalue: " << posValues.mZ;
  3276 #endif
  3920 #endif
  3277             item->setZValue(posValues.mZ);
  3921             item->setZValue(posValues.mZ);
  3278         }
  3922         }
  3279     }
  3923     }
  3280 
  3924 
  3281     QGraphicsWidget *gWidget = (item && item->isWidget())
  3925     QGraphicsWidget *gWidget = (item && item->isWidget())
  3282         ? static_cast<QGraphicsWidget*>(item)
  3926         ? static_cast<QGraphicsWidget*>(item)
  3283         : 0;
  3927         : 0;
  3284     if ( gWidget ) {
  3928     if ( gWidget ) {
  3285         if (posValues.mFlags & HbCss::ExtractedMirroring) {
  3929         if (posValues.mFlags & HbCss::ExtractedLayoutDirection) {
  3286 #ifdef HBSTYLE_DEBUG
  3930 #ifdef HBSTYLE_DEBUG
  3287             qDebug() << "HbStyle::polish : -- Setting mirroring: " << posValues.mMirroring;
  3931             qDebug() << "HbStyle::polishItem : -- Setting layout direction: " << posValues.mLayoutDirection;
  3288 #endif
  3932 #endif
  3289             if(posValues.mMirroring){
  3933             if (posValues.mLayoutDirection == HbCss::LayoutDirection_LeftToRight) {
       
  3934                 gWidget->setLayoutDirection(Qt::LeftToRight);
       
  3935             } else if (posValues.mLayoutDirection == HbCss::LayoutDirection_RightToLeft) {
       
  3936                 gWidget->setLayoutDirection(Qt::RightToLeft);
       
  3937             } else {
  3290                 gWidget->unsetLayoutDirection();
  3938                 gWidget->unsetLayoutDirection();
  3291             }else{
       
  3292                 gWidget->setLayoutDirection(Qt::LeftToRight);
       
  3293             }
  3939             }
  3294         }
  3940         }
  3295     }
  3941     }
  3296 
  3942 
  3297     HbWidgetBase *hbWidget = qobject_cast<HbWidgetBase*>(gWidget);
  3943     HbWidgetBase *hbWidget = qobject_cast<HbWidgetBase*>(gWidget);
  3298     if ( hbWidget ) {
  3944     if ( hbWidget ) {
       
  3945 #ifdef HBSTYLE_DEBUG_FONT
       
  3946         QString debugName;
       
  3947         bool isHbGroupBoxHeadingWidget(false);
       
  3948         if (!name.isEmpty()) {
       
  3949             QGraphicsItem* debugParent = hbWidget->parentItem();
       
  3950             if (debugParent->isWidget()) {
       
  3951                 debugName = static_cast<QGraphicsWidget*>(debugParent)->metaObject()->className();
       
  3952                 if (debugName == "HbGroupBoxHeadingWidget") {
       
  3953                     isHbGroupBoxHeadingWidget = true;
       
  3954                 }
       
  3955             }
       
  3956             debugName.append("::");
       
  3957             debugName.append(name);
       
  3958         } else {
       
  3959             debugName = widget->metaObject()->className();
       
  3960         }
       
  3961         if ( isHbGroupBoxHeadingWidget ) {
       
  3962             qDebug() << "HbStyle::polishItem :" << debugName;
       
  3963             qDebug() << "HbStyle::polishItem : -- Number of maching CSS declarations: " << decl.count();
       
  3964         }
       
  3965 
       
  3966 #endif
  3299         HbWidgetBasePrivate* hbWidget_p = HbWidgetBasePrivate::d_ptr(hbWidget);
  3967         HbWidgetBasePrivate* hbWidget_p = HbWidgetBasePrivate::d_ptr(hbWidget);
  3300         QFont font;
  3968         QFont font;
  3301         HbFontSpec fontSpec;
  3969         HbFontSpec fontSpec;
  3302         int dummy;
  3970         int dummy;
  3303         if (extractor.extractFont(&font, &fontSpec, &dummy)) {
  3971         if (extractor.extractFont(&font, &fontSpec, &dummy)) {
  3304             if ( !fontSpec.isNull() ) {
  3972             if ( !fontSpec.isNull() ) {
  3305                 if ( font == QFont() ) {
  3973                 if ( font == QFont() ) {
  3306 #ifdef HBSTYLE_DEBUG
  3974 #ifdef HBSTYLE_DEBUG_FONT
  3307                     qDebug() << "HbStyle::polish : -- Setting fontspec: " << fontSpec.role();
  3975                     if ( isHbGroupBoxHeadingWidget )
       
  3976                     qDebug() << "HbStyle::polishItem : -- Setting fontspec: " << fontSpec.role();
  3308 #endif
  3977 #endif
  3309                     hbWidget->setFontSpec(fontSpec);
  3978                     hbWidget->setFontSpec(fontSpec);
  3310                 } else {
  3979                 } else {
  3311 #ifdef HBSTYLE_DEBUG
  3980 #ifdef HBSTYLE_DEBUG_FONT
  3312                     qDebug() << "HbStyle::polish : -- Setting fontspec with overrides: "
  3981                     if ( isHbGroupBoxHeadingWidget )
       
  3982                     qDebug() << "HbStyle::polishItem : -- Setting fontspec with overrides: "
  3313                              << fontSpec.role() << font;
  3983                              << fontSpec.role() << font;
  3314 #endif
  3984 #endif
  3315                     hbWidget->setFont(fontSpec.font().resolve(font));
  3985                     hbWidget->setFont(fontSpec.font().resolve(font));
  3316                 }
  3986                 }
  3317             } else {
  3987             } else {
  3318 #ifdef HBSTYLE_DEBUG
  3988 #ifdef HBSTYLE_DEBUG_FONT
  3319                 qDebug() << "HbStyle::polish : -- Setting explicit font: " << font;
  3989                 if ( isHbGroupBoxHeadingWidget )
       
  3990                 qDebug() << "HbStyle::polishItem : -- Setting explicit font: " << font;
  3320 #endif
  3991 #endif
  3321                 hbWidget->setFont(font);
  3992                 hbWidget->setFont(font);
  3322             }
  3993             }
  3323         }
  3994         }
  3324 
  3995 
  3325         HbIconItem* icon = qobject_cast<HbIconItem*>(hbWidget);
  3996         HbIconItem* icon = qobject_cast<HbIconItem*>(hbWidget);
  3326         if (icon) {
  3997         if (icon) {
  3327             Qt::AspectRatioMode mode;
  3998             Qt::AspectRatioMode mode;
  3328             if (extractor.extractAspectRatioMode(&mode) 
  3999             if (extractor.extractAspectRatioMode(&mode) 
  3329 				&& !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_IconAspectRatioMode)) {
  4000                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_IconAspectRatioMode)) {
  3330 #ifdef HBSTYLE_DEBUG
  4001 #ifdef HBSTYLE_DEBUG
  3331                 qDebug() << "HbStyle::polish : -- Setting aspect ratio mode: " << mode;
  4002                 qDebug() << "HbStyle::polishItem : -- Setting aspect ratio mode: " << mode;
  3332 #endif
  4003 #endif
  3333                 icon->setAspectRatioMode(mode);
  4004                 icon->setAspectRatioMode(mode);
  3334                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconAspectRatioMode, false);
  4005                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconAspectRatioMode, false);
  3335             }
  4006             }
  3336             if(!hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_IconBrush)){
  4007             if(!hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_IconBrush)){
  3341                 HbCss::Attachment attachment = HbCss::Attachment_Scroll;
  4012                 HbCss::Attachment attachment = HbCss::Attachment_Scroll;
  3342                 HbCss::Origin origin = HbCss::Origin_Padding;
  4013                 HbCss::Origin origin = HbCss::Origin_Padding;
  3343                 HbCss::Origin clip = HbCss::Origin_Border;
  4014                 HbCss::Origin clip = HbCss::Origin_Border;
  3344                 if (extractor.extractBackground(&brush, &uri, &repeat, &alignment, &origin, &attachment, &clip)) {
  4015                 if (extractor.extractBackground(&brush, &uri, &repeat, &alignment, &origin, &attachment, &clip)) {
  3345 #ifdef HBSTYLE_DEBUG
  4016 #ifdef HBSTYLE_DEBUG
  3346                     qDebug() << "HbStyle::polish : -- Setting icon background: " << brush;
  4017                     qDebug() << "HbStyle::polishItem : -- Setting icon background: " << brush;
  3347 #endif
  4018 #endif
  3348                     icon->setBrush( brush );
  4019                     icon->setBrush( brush );
  3349                 } else {
  4020                 } else {
  3350 #ifdef HBSTYLE_DEBUG
  4021 #ifdef HBSTYLE_DEBUG
  3351                     qDebug() << "HbStyle::polish : -- Resetting icon background";
  4022                     qDebug() << "HbStyle::polishItem : -- Resetting icon background";
  3352 #endif
  4023 #endif
  3353                     icon->setBrush( QBrush() );
  4024                     icon->setBrush( QBrush() );
  3354                 }
  4025                 }
  3355                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconBrush, false);
  4026                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_IconBrush, false);
  3356             }
  4027             }
  3361             HbCss::TextValues textValues;
  4032             HbCss::TextValues textValues;
  3362             if ( extractor.extractTextValues( textValues ) ) {
  4033             if ( extractor.extractTextValues( textValues ) ) {
  3363                 if ( textValues.mFlags & HbCss::ExtractedLineCountMin
  4034                 if ( textValues.mFlags & HbCss::ExtractedLineCountMin
  3364                     && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) {
  4035                     && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) {
  3365 #ifdef HBSTYLE_DEBUG
  4036 #ifdef HBSTYLE_DEBUG
  3366                     qDebug() << "HbStyle::polish : -- Setting text min lines: " << textValues.mLineCountMin;
  4037                     qDebug() << "HbStyle::polishItem : -- Setting text min lines: " << textValues.mLineCountMin;
  3367 #endif
  4038 #endif
  3368                     text->setMinimumLines( textValues.mLineCountMin );
  4039                     text->setMinimumLines( textValues.mLineCountMin );
  3369                     hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, false);
  4040                     hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, false);
  3370                 }
  4041                 }
  3371                 if ( textValues.mFlags & HbCss::ExtractedLineCountMax
  4042                 if ( textValues.mFlags & HbCss::ExtractedLineCountMax
  3372                     && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax)) {
  4043                     && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax)) {
  3373 #ifdef HBSTYLE_DEBUG
  4044 #ifdef HBSTYLE_DEBUG
  3374                     qDebug() << "HbStyle::polish : -- Setting text max lines: " << textValues.mLineCountMax;
  4045                     qDebug() << "HbStyle::polishItem : -- Setting text max lines: " << textValues.mLineCountMax;
  3375 #endif
  4046 #endif
  3376                     text->setMaximumLines( textValues.mLineCountMax );
  4047                     text->setMaximumLines( textValues.mLineCountMax );
  3377                     hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, false);
  4048                     hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, false);
  3378                 }
  4049                 }
  3379             }
  4050             }
  3380             if ( posValues.mFlags & HbCss::ExtractedTextAlign 
  4051             if ( posValues.mFlags & HbCss::ExtractedTextAlign 
  3381                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign)) {
  4052                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign)) {
  3382 #ifdef HBSTYLE_DEBUG
  4053 #ifdef HBSTYLE_DEBUG
  3383                 qDebug() << "HbStyle::polish : -- Setting text alignment: " << posValues.mTextAlignment;
  4054                 qDebug() << "HbStyle::polishItem : -- Setting text alignment: " << posValues.mTextAlignment;
  3384 #endif
  4055 #endif
  3385                 text->setAlignment( posValues.mTextAlignment );
  4056                 text->setAlignment( posValues.mTextAlignment );
  3386                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign, false);
  4057                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign, false);
  3387             }
  4058             }
  3388             if ( posValues.mFlags & HbCss::ExtractedWrapMode 
  4059             if ( posValues.mFlags & HbCss::ExtractedWrapMode 
  3389                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode)) {
  4060                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode)) {
  3390 #ifdef HBSTYLE_DEBUG
  4061 #ifdef HBSTYLE_DEBUG
  3391                 qDebug() << "HbStyle::polish : -- Setting wrap mode : " << posValues.mTextWrapMode;
  4062                 qDebug() << "HbStyle::polishItem : -- Setting wrap mode : " << posValues.mTextWrapMode;
  3392 #endif
  4063 #endif
  3393                 text->setTextWrapping( posValues.mTextWrapMode );
  4064                 text->setTextWrapping( posValues.mTextWrapMode );
  3394                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode, false);
  4065                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode, false);
  3395             }
  4066             }
  3396         }
  4067         }
  3398         HbRichTextItem* richtext = qobject_cast<HbRichTextItem*>(hbWidget);
  4069         HbRichTextItem* richtext = qobject_cast<HbRichTextItem*>(hbWidget);
  3399         if (richtext) {
  4070         if (richtext) {
  3400             if ( posValues.mFlags & HbCss::ExtractedTextAlign
  4071             if ( posValues.mFlags & HbCss::ExtractedTextAlign
  3401                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign)) {
  4072                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign)) {
  3402 #ifdef HBSTYLE_DEBUG
  4073 #ifdef HBSTYLE_DEBUG
  3403                 qDebug() << "HbStyle::polish : -- Setting text alignment: " << posValues.mTextAlignment;
  4074                 qDebug() << "HbStyle::polishItem : -- Setting text alignment: " << posValues.mTextAlignment;
  3404 #endif
  4075 #endif
  3405                 richtext->setAlignment( posValues.mTextAlignment );
  4076                 richtext->setAlignment( posValues.mTextAlignment );
  3406                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign, false);
  4077                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextAlign, false);
  3407             }
  4078             }
  3408             if ( posValues.mFlags & HbCss::ExtractedWrapMode 
  4079             if ( posValues.mFlags & HbCss::ExtractedWrapMode 
  3409                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode)) {
  4080                 && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode)) {
  3410 #ifdef HBSTYLE_DEBUG
  4081 #ifdef HBSTYLE_DEBUG
  3411                 qDebug() << "HbStyle::polish : -- Setting wrap mode : " << posValues.mTextWrapMode;
  4082                 qDebug() << "HbStyle::polishItem : -- Setting wrap mode : " << posValues.mTextWrapMode;
  3412 #endif
  4083 #endif
  3413                 richtext->setTextWrapping( posValues.mTextWrapMode );
  4084                 richtext->setTextWrapping( posValues.mTextWrapMode );
  3414                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode, false);
  4085                 hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextWrapMode, false);
  3415             }
  4086             }
  3416         }
  4087         }
  3422             HbCss::BorderStyle borderStyles[HbCss::NumEdges];
  4093             HbCss::BorderStyle borderStyles[HbCss::NumEdges];
  3423             QSize borderRadii[4];
  4094             QSize borderRadii[4];
  3424 
  4095 
  3425             if (extractor.extractBorder(borderWidths,borderColors,borderStyles,borderRadii)) {
  4096             if (extractor.extractBorder(borderWidths,borderColors,borderStyles,borderRadii)) {
  3426 #ifdef HBSTYLE_DEBUG
  4097 #ifdef HBSTYLE_DEBUG
  3427                 qDebug() << "HbStyle::polish : -- Setting border widths (l,t,r,b):"
  4098                 qDebug() << "HbStyle::polishItem : -- Setting border widths (l,t,r,b):"
  3428                     << borderWidths[HbCss::LeftEdge]
  4099                     << borderWidths[HbCss::LeftEdge]
  3429                     << borderWidths[HbCss::TopEdge]
  4100                     << borderWidths[HbCss::TopEdge]
  3430                     << borderWidths[HbCss::RightEdge]
  4101                     << borderWidths[HbCss::RightEdge]
  3431                     << borderWidths[HbCss::BottomEdge];
  4102                     << borderWidths[HbCss::BottomEdge];
  3432 #endif
  4103 #endif
  3442             HbCss::TextValues textValues;
  4113             HbCss::TextValues textValues;
  3443             if ( extractor.extractTextValues( textValues ) ) {
  4114             if ( extractor.extractTextValues( textValues ) ) {
  3444                 if ( textValues.mFlags & HbCss::ExtractedLineCountMin
  4115                 if ( textValues.mFlags & HbCss::ExtractedLineCountMin
  3445                     && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) {
  4116                     && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) {
  3446 #ifdef HBSTYLE_DEBUG
  4117 #ifdef HBSTYLE_DEBUG
  3447                     qDebug() << "HbStyle::polish : -- Setting text min lines: " << textValues.mLineCountMin;
  4118                     qDebug() << "HbStyle::polishItem : -- Setting text min lines: " << textValues.mLineCountMin;
  3448 #endif
  4119 #endif
  3449                     hbWidget->setProperty( "minRows", textValues.mLineCountMin );
  4120                     hbWidget->setProperty( "minRows", textValues.mLineCountMin );
  3450                     hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, false);
  4121                     hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin, false);
  3451                 }
  4122                 }
  3452                 if ( textValues.mFlags & HbCss::ExtractedLineCountMax
  4123                 if ( textValues.mFlags & HbCss::ExtractedLineCountMax
  3453                     && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) {
  4124                     && !hbWidget_p->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMin)) {
  3454 #ifdef HBSTYLE_DEBUG
  4125 #ifdef HBSTYLE_DEBUG
  3455                     qDebug() << "HbStyle::polish : -- Setting text max lines: " << textValues.mLineCountMax;
  4126                     qDebug() << "HbStyle::polishItem : -- Setting text max lines: " << textValues.mLineCountMax;
  3456 #endif
  4127 #endif
  3457                     hbWidget->setProperty( "maxRows", textValues.mLineCountMax );
  4128                     hbWidget->setProperty( "maxRows", textValues.mLineCountMax );
  3458                     hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, false);
  4129                     hbWidget_p->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextLinesMax, false);
  3459                 }
  4130                 }
  3460             }
  4131             }
  3470         }
  4141         }
  3471     }
  4142     }
  3472     if ( lItem ) {
  4143     if ( lItem ) {
  3473         if ( geomValues.mFlags & HbCss::ExtractedMinW ) {
  4144         if ( geomValues.mFlags & HbCss::ExtractedMinW ) {
  3474 #ifdef HBSTYLE_DEBUG
  4145 #ifdef HBSTYLE_DEBUG
  3475             qDebug() << "HbStyle::polish : -- Setting minimum width: " << geomValues.mMinW;
  4146             qDebug() << "HbStyle::polishItem : -- Setting minimum width: " << geomValues.mMinW;
  3476 #endif
  4147 #endif
  3477             lItem->setMinimumWidth( geomValues.mMinW );
  4148             lItem->setMinimumWidth( geomValues.mMinW );
  3478         }
  4149         }
  3479         if ( geomValues.mFlags & HbCss::ExtractedMinH ) {
  4150         if ( geomValues.mFlags & HbCss::ExtractedMinH ) {
  3480 #ifdef HBSTYLE_DEBUG
  4151 #ifdef HBSTYLE_DEBUG
  3481             qDebug() << "HbStyle::polish : -- Setting minimum height: " << geomValues.mMinH;
  4152             qDebug() << "HbStyle::polishItem : -- Setting minimum height: " << geomValues.mMinH;
  3482 #endif
  4153 #endif
  3483             lItem->setMinimumHeight( geomValues.mMinH );
  4154             lItem->setMinimumHeight( geomValues.mMinH );
  3484         }
  4155         }
  3485         if ( geomValues.mFlags & HbCss::ExtractedPrefW ) {
  4156         if ( geomValues.mFlags & HbCss::ExtractedPrefW ) {
  3486 #ifdef HBSTYLE_DEBUG
  4157 #ifdef HBSTYLE_DEBUG
  3487             qDebug() << "HbStyle::polish : -- Setting preferred width: " << geomValues.mPrefW;
  4158             qDebug() << "HbStyle::polishItem : -- Setting preferred width: " << geomValues.mPrefW;
  3488 #endif
  4159 #endif
  3489             lItem->setPreferredWidth( geomValues.mPrefW );
  4160             lItem->setPreferredWidth( geomValues.mPrefW );
  3490         }
  4161         }
  3491         if ( geomValues.mFlags & HbCss::ExtractedPrefH ) {
  4162         if ( geomValues.mFlags & HbCss::ExtractedPrefH ) {
  3492 #ifdef HBSTYLE_DEBUG
  4163 #ifdef HBSTYLE_DEBUG
  3493             qDebug() << "HbStyle::polish : -- Setting preferred height: " << geomValues.mPrefH;
  4164             qDebug() << "HbStyle::polishItem : -- Setting preferred height: " << geomValues.mPrefH;
  3494 #endif
  4165 #endif
  3495             lItem->setPreferredHeight( geomValues.mPrefH );
  4166             lItem->setPreferredHeight( geomValues.mPrefH );
  3496         }
  4167         }
  3497         if ( geomValues.mFlags & HbCss::ExtractedMaxW ) {
  4168         if ( geomValues.mFlags & HbCss::ExtractedMaxW ) {
  3498 #ifdef HBSTYLE_DEBUG
  4169 #ifdef HBSTYLE_DEBUG
  3499             qDebug() << "HbStyle::polish : -- Setting maximum width: " << geomValues.mMaxW;
  4170             qDebug() << "HbStyle::polishItem : -- Setting maximum width: " << geomValues.mMaxW;
  3500 #endif
  4171 #endif
  3501             lItem->setMaximumWidth( geomValues.mMaxW );
  4172             lItem->setMaximumWidth( geomValues.mMaxW );
  3502         }
  4173         }
  3503         if ( geomValues.mFlags & HbCss::ExtractedMaxH ) {
  4174         if ( geomValues.mFlags & HbCss::ExtractedMaxH ) {
  3504 #ifdef HBSTYLE_DEBUG
  4175 #ifdef HBSTYLE_DEBUG
  3505             qDebug() << "HbStyle::polish : -- Setting maximum height: " << geomValues.mMaxH;
  4176             qDebug() << "HbStyle::polishItem : -- Setting maximum height: " << geomValues.mMaxH;
  3506 #endif
  4177 #endif
  3507             lItem->setMaximumHeight( geomValues.mMaxH );
  4178             lItem->setMaximumHeight( geomValues.mMaxH );
  3508         }
  4179         }
  3509         QSizePolicy itemPol = lItem->sizePolicy();
  4180         QSizePolicy itemPol = lItem->sizePolicy();
  3510         if ( geomValues.mFlags & HbCss::ExtractedPolHor ) {
  4181         if ( geomValues.mFlags & HbCss::ExtractedPolHor ) {
  3511 #ifdef HBSTYLE_DEBUG
  4182 #ifdef HBSTYLE_DEBUG
  3512             qDebug() << "HbStyle::polish : -- Setting horizontal size policy: " << geomValues.mSizePolicy.horizontalPolicy();
  4183             qDebug() << "HbStyle::polishItem : -- Setting horizontal size policy: " << geomValues.mSizePolicy.horizontalPolicy();
  3513 #endif
  4184 #endif
  3514             itemPol.setHorizontalPolicy(geomValues.mSizePolicy.horizontalPolicy());
  4185             itemPol.setHorizontalPolicy(geomValues.mSizePolicy.horizontalPolicy());
  3515         }
  4186         }
  3516         if ( geomValues.mFlags & HbCss::ExtractedPolVer ) {
  4187         if ( geomValues.mFlags & HbCss::ExtractedPolVer ) {
  3517 #ifdef HBSTYLE_DEBUG
  4188 #ifdef HBSTYLE_DEBUG
  3518             qDebug() << "HbStyle::polish : -- Setting vertical size policy: " << geomValues.mSizePolicy.verticalPolicy();
  4189             qDebug() << "HbStyle::polishItem : -- Setting vertical size policy: " << geomValues.mSizePolicy.verticalPolicy();
  3519 #endif
  4190 #endif
  3520             itemPol.setVerticalPolicy(geomValues.mSizePolicy.verticalPolicy());
  4191             itemPol.setVerticalPolicy(geomValues.mSizePolicy.verticalPolicy());
  3521         }
  4192         }
  3522         lItem->setSizePolicy(itemPol);
  4193         lItem->setSizePolicy(itemPol);
  3523     }
  4194     }
  3525     if (layoutDefined) {
  4196     if (layoutDefined) {
  3526         HbMeshLayout *layout = static_cast<HbMeshLayout*>(widget->layout());
  4197         HbMeshLayout *layout = static_cast<HbMeshLayout*>(widget->layout());
  3527         if ( layout ) {
  4198         if ( layout ) {
  3528             if (posValues.mFlags & HbCss::ExtractedLeft) {
  4199             if (posValues.mFlags & HbCss::ExtractedLeft) {
  3529 #ifdef HBSTYLE_DEBUG
  4200 #ifdef HBSTYLE_DEBUG
  3530                 qDebug() << "HbStyle::polish : -- Setting left override: " << posValues.mLeft;
  4201                 qDebug() << "HbStyle::polishItem : -- Setting left override: " << posValues.mLeft;
  3531 #endif
  4202 #endif
  3532                 layout->overrideSpacing(name, Hb::LeftEdge, posValues.mLeft);
  4203                 layout->overrideSpacing(name, Hb::LeftEdge, posValues.mLeft);
  3533             }
  4204             }
  3534             if (posValues.mFlags & HbCss::ExtractedRight) {
  4205             if (posValues.mFlags & HbCss::ExtractedRight) {
  3535 #ifdef HBSTYLE_DEBUG
  4206 #ifdef HBSTYLE_DEBUG
  3536                 qDebug() << "HbStyle::polish : -- Setting right override: " << posValues.mRight;
  4207                 qDebug() << "HbStyle::polishItem : -- Setting right override: " << posValues.mRight;
  3537 #endif
  4208 #endif
  3538                 layout->overrideSpacing(name, Hb::RightEdge, posValues.mRight);
  4209                 layout->overrideSpacing(name, Hb::RightEdge, posValues.mRight);
  3539             }
  4210             }
  3540             if (posValues.mFlags & HbCss::ExtractedTop) {
  4211             if (posValues.mFlags & HbCss::ExtractedTop) {
  3541 #ifdef HBSTYLE_DEBUG
  4212 #ifdef HBSTYLE_DEBUG
  3542                 qDebug() << "HbStyle::polish : -- Setting top override: " << posValues.mTop;
  4213                 qDebug() << "HbStyle::polishItem : -- Setting top override: " << posValues.mTop;
  3543 #endif
  4214 #endif
  3544                 layout->overrideSpacing(name, Hb::TopEdge, posValues.mTop);
  4215                 layout->overrideSpacing(name, Hb::TopEdge, posValues.mTop);
  3545             }
  4216             }
  3546             if (posValues.mFlags & HbCss::ExtractedBottom) {
  4217             if (posValues.mFlags & HbCss::ExtractedBottom) {
  3547 #ifdef HBSTYLE_DEBUG
  4218 #ifdef HBSTYLE_DEBUG
  3548                 qDebug() << "HbStyle::polish : -- Setting bottom override: " << posValues.mBottom;
  4219                 qDebug() << "HbStyle::polishItem : -- Setting bottom override: " << posValues.mBottom;
  3549 #endif
  4220 #endif
  3550                 layout->overrideSpacing(name, Hb::BottomEdge, posValues.mBottom);
  4221                 layout->overrideSpacing(name, Hb::BottomEdge, posValues.mBottom);
  3551             }
  4222             }
  3552             if (posValues.mFlags & HbCss::ExtractedCenterH) {
  4223             if (posValues.mFlags & HbCss::ExtractedCenterH) {
  3553 #ifdef HBSTYLE_DEBUG
  4224 #ifdef HBSTYLE_DEBUG
  3554                 qDebug() << "HbStyle::polish : -- Setting centerh override: " << posValues.mCenterH;
  4225                 qDebug() << "HbStyle::polishItem : -- Setting centerh override: " << posValues.mCenterH;
  3555 #endif
  4226 #endif
  3556                 layout->overrideSpacing(name, Hb::CenterHEdge, posValues.mCenterH);
  4227                 layout->overrideSpacing(name, Hb::CenterHEdge, posValues.mCenterH);
  3557             }
  4228             }
  3558             if (posValues.mFlags & HbCss::ExtractedCenterV) {
  4229             if (posValues.mFlags & HbCss::ExtractedCenterV) {
  3559 #ifdef HBSTYLE_DEBUG
  4230 #ifdef HBSTYLE_DEBUG
  3560                 qDebug() << "HbStyle::polish : -- Setting centerv override: " << posValues.mCenterV;
  4231                 qDebug() << "HbStyle::polishItem : -- Setting centerv override: " << posValues.mCenterV;
  3561 #endif
  4232 #endif
  3562                 layout->overrideSpacing(name, Hb::CenterVEdge, posValues.mCenterV);
  4233                 layout->overrideSpacing(name, Hb::CenterVEdge, posValues.mCenterV);
  3563             }
  4234             }
  3564         }
  4235         }
  3565     }
  4236     }
  3594         return;
  4265         return;
  3595     }
  4266     }
  3596 #ifdef HBSTYLE_DEBUG
  4267 #ifdef HBSTYLE_DEBUG
  3597     qDebug() << "HbStyle::polish : Polishing" << widget->metaObject()->className();
  4268     qDebug() << "HbStyle::polish : Polishing" << widget->metaObject()->className();
  3598 #endif
  4269 #endif
       
  4270 #ifdef HBSTYLE_DEBUG_FONT
       
  4271     bool isHbGroupBoxHeadingWidget(false);
       
  4272     if (QString(widget->metaObject()->className()) == "HbGroupBoxHeadingWidget") {
       
  4273         isHbGroupBoxHeadingWidget = true;
       
  4274         QVariant gbtype = widget->property( "groupBoxType" );
       
  4275         qDebug() << "HbStyle::polish : Polishing HbGroupBoxHeadingWidget, type" << gbtype.toInt();
       
  4276     }
       
  4277 #endif
  3599 
  4278 
  3600     HbLayeredStyleLoader *styleLoader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Layouts);
  4279     HbLayeredStyleLoader *styleLoader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Layouts);
  3601     if(!styleLoader){
  4280     if(!styleLoader){
       
  4281 #ifdef HBSTYLE_DEBUG_FONT
       
  4282     if (isHbGroupBoxHeadingWidget) {
       
  4283         qDebug() << "HbStyle::polish : HbLayeredStyleLoader returned a null pointer.";
       
  4284     }
       
  4285 #endif
  3602 #ifdef HBSTYLE_DEBUG
  4286 #ifdef HBSTYLE_DEBUG
  3603         qDebug() << "HbStyle::polish : HbLayeredStyleLoader returned a null pointer.";
  4287         qDebug() << "HbStyle::polish : HbLayeredStyleLoader returned a null pointer.";
  3604 #endif
  4288 #endif
  3605         return;
  4289         return;
  3606     }
  4290     }
  3620         }
  4304         }
  3621     } else {
  4305     } else {
  3622         styleRules = styleLoader->styleRulesForNode(n, profile.orientation());
  4306         styleRules = styleLoader->styleRulesForNode(n, profile.orientation());
  3623     }
  4307     }
  3624 
  4308 
       
  4309 #ifdef HBSTYLE_DEBUG_FONT
       
  4310     if (isHbGroupBoxHeadingWidget) {
       
  4311         qDebug() << "HbStyle::polish : Number of style rules:" << styleRules.count();
       
  4312     }
       
  4313 #endif
  3625     if (!styleRules.count()) {
  4314     if (!styleRules.count()) {
  3626 #ifdef HBSTYLE_DEBUG
  4315 #ifdef HBSTYLE_DEBUG
  3627         qDebug() << "HbStyle::polish : No style rules found.";
  4316         qDebug() << "HbStyle::polish : No style rules found.";
  3628 #endif
  4317 #endif
  3629         return;
  4318         return;
  3630     }
  4319     }
  3631     const HbVector<HbCss::Declaration> decl = declarations(styleRules, "", profile);
  4320     const HbVector<HbCss::Declaration> decl = declarations(styleRules, "", widget, profile);
       
  4321 #ifdef HBSTYLE_DEBUG_FONT
       
  4322     if (isHbGroupBoxHeadingWidget) {
       
  4323         qDebug() << "HbStyle::polish : Number of maching CSS declarations: " << decl.count();
       
  4324     }
       
  4325 #endif
  3632 #ifdef HBSTYLE_DEBUG
  4326 #ifdef HBSTYLE_DEBUG
  3633     qDebug() << "HbStyle::polish : Number of maching CSS declarations: " << decl.count();
  4327     qDebug() << "HbStyle::polish : Number of maching CSS declarations: " << decl.count();
  3634 #endif
  4328 #endif
  3635     d->ensureLayoutParameters(profile);
  4329     d->ensureLayoutParameters(profile);
  3636 
  4330 
  3644 #endif
  4338 #endif
  3645         extractor.extractParameters( params.params(), params.values() );
  4339         extractor.extractParameters( params.params(), params.values() );
  3646     }
  4340     }
  3647 
  4341 
  3648     bool layoutDefined = extractor.extractLayout(&layoutName, &sectionName);
  4342     bool layoutDefined = extractor.extractLayout(&layoutName, &sectionName);
       
  4343 #ifdef HBSTYLE_DEBUG_FONT
       
  4344     if (isHbGroupBoxHeadingWidget) {
       
  4345         if (!layoutDefined) {
       
  4346             qDebug() << "HbStyle::polish : Couldn't find layout name for the widget.";
       
  4347         } else {
       
  4348             qDebug() << "HbStyle::polish : Layout name: " << layoutName;
       
  4349         }
       
  4350     }
       
  4351 #endif
  3649 #ifdef HBSTYLE_DEBUG
  4352 #ifdef HBSTYLE_DEBUG
  3650     if (!layoutDefined) {
  4353     if (!layoutDefined) {
  3651         qDebug() << "HbStyle::polish : Couldn't find layout name for the widget.";
  4354         qDebug() << "HbStyle::polish : Couldn't find layout name for the widget.";
  3652     } else {
  4355     } else {
  3653         qDebug() << "HbStyle::polish : Layout name: " << layoutName;
  4356         qDebug() << "HbStyle::polish : Layout name: " << layoutName;
  3656 
  4359 
  3657     QStringList meshIds;
  4360     QStringList meshIds;
  3658     HbMeshLayout *meshLayout(0);
  4361     HbMeshLayout *meshLayout(0);
  3659     if (layoutDefined) {
  4362     if (layoutDefined) {
  3660 
  4363 
  3661         QString cachedLayoutName = d->widgetLayoutNames[widget];
  4364         QString cachedLayoutName = widgetLayoutNames[widget];
  3662         bool cached = (cachedLayoutName == layoutName );
  4365         bool cached = (cachedLayoutName == layoutName );
  3663         if ( !cached ) {
  4366         if ( !cached ) {
  3664 #ifdef HBSTYLE_DEBUG
  4367 #ifdef HBSTYLE_DEBUG
  3665             qDebug() << "LayoutName cache miss.";
  4368             qDebug() << "LayoutName cache miss.";
  3666 #endif
  4369 #endif
  3667             HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance();
  4370             HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance();
  3668             if ( !loader->loadWidgetML(widget, layoutName, sectionName)) {
  4371             if ( !loader->loadWidgetML(widget, layoutName, sectionName)) {
       
  4372 #ifdef HBSTYLE_DEBUG_FONT
       
  4373                 if (isHbGroupBoxHeadingWidget) {
       
  4374                     qDebug() << "HbStyle::polish : Failed to load WidgetML";
       
  4375                 }
       
  4376 #endif
  3669 #ifdef HBSTYLE_DEBUG
  4377 #ifdef HBSTYLE_DEBUG
  3670                 qDebug() << "HbStyle::polish : Failed to load WidgetML";
  4378                 qDebug() << "HbStyle::polish : Failed to load WidgetML";
  3671 #endif
  4379 #endif
  3672                 return;       
  4380                 return;       
  3673             }
  4381             }
  3674             d->widgetLayoutNames[widget] = layoutName;
  4382             widgetLayoutNames[widget] = layoutName;
  3675             if (cachedLayoutName.isNull()) {
  4383             if (cachedLayoutName.isNull()) {
  3676                 // Cached for the first time. Connect to destroyed signal.
  4384                 // Cached for the first time. Connect to destroyed signal.
  3677                 QObject::connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(widgetDestroyed(QObject*)));
  4385                 QObject::connect(widget, SIGNAL(destroyed(QObject*)), this, SLOT(widgetDestroyed(QObject*)));
  3678 #ifdef HBSTYLE_DEBUG
  4386 #ifdef HBSTYLE_DEBUG
  3679                 qDebug() << "Cached first time. Connected to destroy signal.";
  4387                 qDebug() << "Cached first time. Connected to destroy signal.";
  3731     QGraphicsItem *item ) const
  4439     QGraphicsItem *item ) const
  3732 {
  4440 {
  3733     
  4441     
  3734     QString name = HbStyle::itemName(item);
  4442     QString name = HbStyle::itemName(item);
  3735     if (name.isEmpty() ) {
  4443     if (name.isEmpty() ) {
  3736         return ;
  4444         return;
  3737     }
  4445     }
  3738   
  4446   
  3739     HbTextItem* text = qgraphicsitem_cast<HbTextItem*>( item );
  4447     HbTextItem* text = qgraphicsitem_cast<HbTextItem*>( item );
  3740     HbIconItem* iconItem = qgraphicsitem_cast<HbIconItem*>( item );
  4448     HbIconItem* iconItem = qgraphicsitem_cast<HbIconItem*>( item );
  3741     HbMarqueeItem* marqueeItem = qgraphicsitem_cast<HbMarqueeItem*>( item );
  4449     HbMarqueeItem* marqueeItem = qgraphicsitem_cast<HbMarqueeItem*>( item );
  3742     if(! (text || iconItem || marqueeItem ) ){
  4450     if(! (text || iconItem || marqueeItem ) ){
  3743         return;
  4451         return;
  3744     }
  4452     }
  3745     
  4453     
  3746     HbDeviceProfile profile;
  4454     HbDeviceProfile profile;
  3747     const HbVector<HbCss::Declaration> decl = declarations(styleRules, name, profile);
  4455     const HbVector<HbCss::Declaration> decl = declarations(styleRules, name, 0, profile);
  3748 
  4456 
  3749 #ifdef HBSTYLE_DEBUG
  4457 #ifdef HBSTYLE_DEBUG
  3750    qDebug() << "HbStyle::updateThemedItems : -- Number of maching CSS declarations: " << decl.count();
  4458    qDebug() << "HbStyle::updateThemedItems : -- Number of maching CSS declarations: " << decl.count();
  3751 #endif
  4459 #endif
  3752    ensureColorParameters();
  4460    ensureColorParameters();
  3753    HbCss::ValueExtractor extractor(decl, colorParameters, profile);
  4461    HbCss::ValueExtractor extractor(decl, colorParameters, profile);
  3754    
  4462    
  3755    QColor col;
  4463     QColor col;
  3756    bool extracted = extractor.extractColor( &col );
  4464     bool extracted = extractor.extractColor( &col );
       
  4465     if (!extracted || !col.isValid()) {
       
  4466         // Setting non black or white default color to make it visisble in black or white theme
       
  4467         col.setRgb(255,0,255);
       
  4468     }
  3757    //apply the themed color to text-item
  4469    //apply the themed color to text-item
  3758    if(text) {   
  4470     if(text) {   
  3759 #ifdef HBSTYLE_DEBUG
  4471 #ifdef HBSTYLE_DEBUG
  3760        if ( !extracted ) {
  4472         if ( !extracted ) {
  3761             qDebug() << "HbStyle::getColor : -- No color information found";
  4473             qDebug() << "HbStyle::getColor : -- No color information found";
  3762        }
  4474         }
  3763 #endif    
  4475 #endif    
  3764        if( extracted && col.isValid() && !HbWidgetBasePrivate::d_ptr(text)->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor)){
  4476         if ( !HbWidgetBasePrivate::d_ptr(text)->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor ) ){
  3765            text->setTextColor(col);
  4477             text->setTextColor(col);
  3766            HbWidgetBasePrivate::d_ptr(text)->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor, false);
  4478             HbWidgetBasePrivate::d_ptr(text)->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor, false);
  3767        }
  4479         }
  3768    }   
  4480     }   
  3769    if(iconItem){
  4481     if(iconItem){
  3770        //applying color to mono-colorised icons from theme
  4482         //applying color to mono-colorised icons from theme
  3771        if( extracted && col.isValid()) {
  4483         iconItem->setColor( col );
  3772            iconItem->setColor( col ); 
  4484     }
  3773        }
  4485     if(marqueeItem){
  3774    }
  4486         //applying color to the marquee-item from theme
  3775    if(marqueeItem){
  4487         if(!HbWidgetBasePrivate::d_ptr(marqueeItem)->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor)) {
  3776        //applying color to the marquee-item from theme
  4488             marqueeItem->setTextColor( col ); 
  3777        if(extracted && col.isValid() && !HbWidgetBasePrivate::d_ptr(marqueeItem)->testApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor)) {
  4489             HbWidgetBasePrivate::d_ptr(marqueeItem)->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor, false);
  3778            marqueeItem->setTextColor( col ); 
  4490         }
  3779            HbWidgetBasePrivate::d_ptr(marqueeItem)->setApiProtectionFlag(HbWidgetBasePrivate::AC_TextColor, false);
  4491     }
  3780        }
  4492 }
  3781    }
       
  3782 } 
       
  3783  
  4493  
  3784 /*!
  4494 /*!
  3785     HbStyle::updateThemedParams()
  4495     HbStyle::updateThemedParams()
  3786 
  4496 
  3787     Updates the themable parameters of widget (specially those which are specified in css files)
  4497     Updates the themable parameters of widget (specially those which are specified in css files)
  3843 /*!
  4553 /*!
  3844     For clearing caches.
  4554     For clearing caches.
  3845 */
  4555 */
  3846 void HbStyle::widgetDestroyed(QObject* obj)
  4556 void HbStyle::widgetDestroyed(QObject* obj)
  3847 {
  4557 {
  3848     Q_D( HbStyle );
  4558     widgetLayoutNames.remove((const QGraphicsWidget *)obj);
  3849     d->widgetLayoutNames.remove((const QGraphicsWidget *)obj);
       
  3850 }
  4559 }
  3851 
  4560 
  3852 /*!
  4561 /*!
  3853 
  4562 
  3854     Sets the item name of a graphics item. Item name is not the same as object name.
  4563     Sets the item name of a graphics item. Item name is not the same as object name.
  3864     \param item, graphics item
  4573     \param item, graphics item
  3865     \param name, name to be set
  4574     \param name, name to be set
  3866 */
  4575 */
  3867 void HbStyle::setItemName( QGraphicsItem *item, const QString &name )
  4576 void HbStyle::setItemName( QGraphicsItem *item, const QString &name )
  3868 {
  4577 {
  3869     if (item) {
  4578     if (item && itemName(item) != name) {
  3870         item->setData( ItemName, name );
  4579         item->setData( ItemName, name );
       
  4580         QGraphicsItem* parent = item->parentItem();
       
  4581         QGraphicsLayoutItem* lItem = (item->isWidget()) ? (QGraphicsLayoutItem*)static_cast<QGraphicsWidget*>(item) : 0;
       
  4582         if (lItem && parent && parent->isWidget()) {
       
  4583             QGraphicsWidget* parentW = static_cast<QGraphicsWidget*>(parent);
       
  4584             if ( parentW->layout() && widgetLayoutNames.contains(parentW) ) {
       
  4585                 HbMeshLayout* layout = static_cast<HbMeshLayout*>(parentW->layout());
       
  4586                 if ( layout->indexOf(lItem) != -1 ) {
       
  4587                     layout->setItemId(lItem, name.isEmpty() ? QString() : name);
       
  4588                 }
       
  4589             }
       
  4590         }
  3871     }
  4591     }
  3872 }
  4592 }
  3873 
  4593 
  3874 /*!
  4594 /*!
  3875 
  4595 
  3950 
  4670 
  3951     Q_D( const HbStyle );
  4671     Q_D( const HbStyle );
  3952     d->ensureLayoutParameters(effectiveProfile);
  4672     d->ensureLayoutParameters(effectiveProfile);
  3953     HbCss::ValueExtractor valueExtractor(d->layoutParameters, true, effectiveProfile);
  4673     HbCss::ValueExtractor valueExtractor(d->layoutParameters, true, effectiveProfile);
  3954     qreal value = 0;
  4674     qreal value = 0;
  3955     for (int i = 0; i < d->layoutParameters.count(); i++) {
  4675     QHash<QString, HbCss::Declaration>::const_iterator i = d->layoutParameters.constBegin();
  3956         if (valueExtractor.extractValue(d->layoutParameters[i].property, value))
  4676     while (i != d->layoutParameters.constEnd()) {
  3957             parameters.addParameter(d->layoutParameters[i].property, value);
  4677         if (valueExtractor.extractValue(i.key(), value)) {
       
  4678             parameters.addParameter(i.key(), value);
       
  4679         }
       
  4680         ++i;
  3958     }
  4681     }
  3959 }
  4682 }
  3960 
  4683 
  3961 
  4684 
  3962 /*!
  4685 /*!
  3978 \internal
  4701 \internal
  3979 */
  4702 */
  3980 HbStylePrivate::~HbStylePrivate()
  4703 HbStylePrivate::~HbStylePrivate()
  3981 {
  4704 {
  3982     layoutParameters.clear();
  4705     layoutParameters.clear();
  3983 	colorParameters.clear();
  4706     colorParameters.clear();
  3984 
  4707 
  3985     HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance();
  4708     HbWidgetStyleLoader *loader = HbWidgetStyleLoader::instance();
  3986     if(loader){
  4709     if(loader){
  3987         loader->removeFilePath(STYLE_LOCATION, HbLayeredStyleLoader::Concern_Layouts, 
  4710         loader->removeFilePath(STYLE_LOCATION, HbLayeredStyleLoader::Concern_Layouts, 
  3988                 HbLayeredStyleLoader::Priority_Core);
  4711                 HbLayeredStyleLoader::Priority_Core);
  4084         HbCss::StyleSheet *styleSheet = new(HbCss::StyleSheet);
  4807         HbCss::StyleSheet *styleSheet = new(HbCss::StyleSheet);
  4085         parser.parse(styleSheet);
  4808         parser.parse(styleSheet);
  4086 
  4809 
  4087         HbStyleSelector selector;
  4810         HbStyleSelector selector;
  4088         selector.styleSheets.append(styleSheet);
  4811         selector.styleSheets.append(styleSheet);
  4089         layoutParameters = selector.variableRuleSets();
  4812         selector.variableRuleSets(&layoutParameters);
  4090     }
  4813     }
  4091     if (!firstParse && (layoutParametersProfileName != profile.name())) {
  4814     if (!firstParse && (layoutParametersProfileName != profile.name())) {
  4092         layoutParameters.remove(layoutParameters.count()-4, 4);
       
  4093         addSpecialParams = true;
  4815         addSpecialParams = true;
  4094     }
  4816     }
  4095     if (addSpecialParams) {
  4817     if (addSpecialParams) {
  4096         layoutParametersProfileName = profile.name();
  4818         layoutParametersProfileName = profile.name();
  4097         QSizeF pSize = profile.logicalSize();
  4819         QSizeF pSize = profile.logicalSize();
  4102             decl.propertyId = HbCss::UnknownProperty;
  4824             decl.propertyId = HbCss::UnknownProperty;
  4103             HbCss::Value val;
  4825             HbCss::Value val;
  4104             val.type = HbCss::Value::Number;
  4826             val.type = HbCss::Value::Number;
  4105             val.variant = HbVariant((double)pSize.width(),HbMemoryManager::HeapMemory);
  4827             val.variant = HbVariant((double)pSize.width(),HbMemoryManager::HeapMemory);
  4106             decl.values.append(val);
  4828             decl.values.append(val);
  4107             layoutParameters.append(decl);
  4829             layoutParameters.insert(decl.property, decl);
  4108         }
  4830         }
  4109         {
  4831         {
  4110             HbCss::Declaration decl;
  4832             HbCss::Declaration decl;
  4111             decl.property = "hb-param-screen-height";
  4833             decl.property = "hb-param-screen-height";
  4112             decl.propertyId = HbCss::UnknownProperty;
  4834             decl.propertyId = HbCss::UnknownProperty;
  4113             HbCss::Value val;
  4835             HbCss::Value val;
  4114             val.type = HbCss::Value::Number;
  4836             val.type = HbCss::Value::Number;
  4115             val.variant = HbVariant((double)pSize.height(),HbMemoryManager::HeapMemory);
  4837             val.variant = HbVariant((double)pSize.height(),HbMemoryManager::HeapMemory);
  4116             decl.values.append(val);
  4838             decl.values.append(val);
  4117             layoutParameters.append(decl);
  4839             layoutParameters.insert(decl.property, decl);
  4118         }
  4840         }
  4119         {
  4841         {
  4120             HbCss::Declaration decl;
  4842             HbCss::Declaration decl;
  4121             decl.property = "hb-param-screen-short-edge";
  4843             decl.property = "hb-param-screen-short-edge";
  4122             decl.propertyId = HbCss::UnknownProperty;
  4844             decl.propertyId = HbCss::UnknownProperty;
  4123             HbCss::Value val;
  4845             HbCss::Value val;
  4124             val.type = HbCss::Value::Number;
  4846             val.type = HbCss::Value::Number;
  4125             val.variant = HbVariant((double)qMin(pSize.height(),pSize.width()),HbMemoryManager::HeapMemory);
  4847             val.variant = HbVariant((double)qMin(pSize.height(),pSize.width()),HbMemoryManager::HeapMemory);
  4126             decl.values.append(val);
  4848             decl.values.append(val);
  4127             layoutParameters.append(decl);
  4849             layoutParameters.insert(decl.property, decl);
  4128         }
  4850         }
  4129         {
  4851         {
  4130             HbCss::Declaration decl;
  4852             HbCss::Declaration decl;
  4131             decl.property = "hb-param-screen-long-edge";
  4853             decl.property = "hb-param-screen-long-edge";
  4132             decl.propertyId = HbCss::UnknownProperty;
  4854             decl.propertyId = HbCss::UnknownProperty;
  4133             HbCss::Value val;
  4855             HbCss::Value val;
  4134             val.type = HbCss::Value::Number;
  4856             val.type = HbCss::Value::Number;
  4135             val.variant = HbVariant((double)qMax(pSize.height(),pSize.width()),HbMemoryManager::HeapMemory);
  4857             val.variant = HbVariant((double)qMax(pSize.height(),pSize.width()),HbMemoryManager::HeapMemory);
  4136             decl.values.append(val);
  4858             decl.values.append(val);
  4137             layoutParameters.append(decl);
  4859             layoutParameters.insert(decl.property, decl);
  4138         }
  4860         }
  4139     }
  4861     }
  4140 
       
  4141 }
  4862 }
  4142 
  4863 
  4143 void HbStylePrivate::ensureColorParameters() const
  4864 void HbStylePrivate::ensureColorParameters() const
  4144 {
  4865 {
  4145     if (colorParameters.isEmpty()) {
  4866     if (colorParameters.isEmpty()) {
  4146         HbLayeredStyleLoader *styleLoader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors);
  4867         HbLayeredStyleLoader *styleLoader = HbLayeredStyleLoader::getStack(HbLayeredStyleLoader::Concern_Colors);
  4147         colorParameters = styleLoader->variableRuleSets();
  4868         styleLoader->variableRuleSets(&colorParameters);
  4148     }
  4869     }
  4149 }
  4870 }
  4150 
  4871 
  4151 /*!
  4872 /*!
  4152 \internal
  4873 \internal