calendarui/views/dayview/tsrc/unittests/unittest_calendayutils/hbstyle.h
changeset 55 2c54b51f39c4
child 57 bb2d3e476f29
equal deleted inserted replaced
51:0b38fc5b94c6 55:2c54b51f39c4
       
     1 /****************************************************************************
       
     2  **
       
     3  ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies).
       
     4  ** All rights reserved.
       
     5  ** Contact: Nokia Corporation (developer.feedback@nokia.com)
       
     6  **
       
     7  ** This file is part of the HbCore module of the UI Extensions for Mobile.
       
     8  **
       
     9  ** GNU Lesser General Public License Usage
       
    10  ** This file may be used under the terms of the GNU Lesser General Public
       
    11  ** License version 2.1 as published by the Free Software Foundation and
       
    12  ** appearing in the file LICENSE.LGPL included in the packaging of this file.
       
    13  ** Please review the following information to ensure the GNU Lesser General
       
    14  ** Public License version 2.1 requirements will be met:
       
    15  ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    16  **
       
    17  ** In addition, as a special exception, Nokia gives you certain additional
       
    18  ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    19  ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    20  **
       
    21  ** If you have questions regarding the use of this file, please contact
       
    22  ** Nokia at developer.feedback@nokia.com.
       
    23  **
       
    24  ****************************************************************************/
       
    25 
       
    26 #ifndef HBSTYLE_H
       
    27 #define HBSTYLE_H
       
    28 
       
    29 #include <hbglobal.h>
       
    30 #include <QWindowsStyle>
       
    31 #include <QGraphicsItem>
       
    32 #include <QStyleOptionGraphicsItem>
       
    33 #include <hbicon.h>
       
    34 #include <hbdeviceprofile.h>
       
    35 
       
    36 class HbStylePrivate;
       
    37 class HbStyleParameters;
       
    38 class HbStyleOption;
       
    39 class HbWidgetBase;
       
    40 class HbWidget;
       
    41 class HbStyleParameters;
       
    42 
       
    43 extern qreal param_value;
       
    44 
       
    45 class HbStyle : public QObject
       
    46 	{
       
    47 Q_OBJECT
       
    48 public:
       
    49 	HbStyle();
       
    50 	~HbStyle();
       
    51 
       
    52 	// HbStyle::Primitive enums are DEPRECATED
       
    53 	enum Primitive
       
    54 		{
       
    55 		P_None,
       
    56 		P_PushButton_icon,
       
    57 		P_PushButton_text,
       
    58 		P_PushButton_additionaltext,
       
    59 		P_PushButton_background,
       
    60 		P_PushButton_toucharea,
       
    61 		P_PushButton_focus,
       
    62 		P_DataGroup_background,
       
    63 		P_DataGroupComboBackground,
       
    64 		P_DataGroup_heading,
       
    65 		P_DataGroup_description,
       
    66 		P_DataForm_heading,
       
    67 		P_DataForm_heading_background,
       
    68 		P_DataForm_description,
       
    69 		P_DataGroup_icon,
       
    70 		P_ToolButton_frame,
       
    71 		P_ToolButton_text,
       
    72 		P_ToolButton_icon,
       
    73 		P_Slider_thumb,
       
    74 		P_SliderElement_text,
       
    75 		P_SliderElement_icon,
       
    76 		P_SliderElement_increase,
       
    77 		P_SliderElement_decrease,
       
    78 		P_Slider_groove,
       
    79 		P_Slider_progressgroove,
       
    80 		P_ItemViewItem_checkbox,
       
    81 		P_ItemViewItem_radiobutton,
       
    82 		P_ItemViewItem_selection,
       
    83 		P_LineEdit_frame_normal,
       
    84 		P_LineEdit_frame_highlight,
       
    85 		P_TextEdit_frame_normal,
       
    86 		P_TextEdit_frame_highlight,
       
    87 		P_Edit_text,
       
    88 		P_Label_text,
       
    89 		P_Label_icon,
       
    90 		P_MenuItem_frame,
       
    91 		P_MenuItem_focus,
       
    92 		P_MenuItem_text,
       
    93 		P_MenuItem_submenuindicator,
       
    94 		P_MenuItem_checkindicator,
       
    95 		P_MenuItem_separator,
       
    96 		P_ScrollBar_groove,
       
    97 		P_ScrollBar_handle,
       
    98 		P_ScrollBar_toucharea,
       
    99 		P_Popup_background,
       
   100 		P_Popup_background_weak,
       
   101 		P_Popup_heading_frame,
       
   102 		P_ToolTip_background,
       
   103 		P_MessageBox_icon,
       
   104 		P_ItemViewItem_background,
       
   105 		P_ListViewItem_text,
       
   106 		P_ListViewItem_richtext,
       
   107 		P_ListViewItem_icon,
       
   108 		P_ItemHighlight_background,
       
   109 		P_ToolBarExtension_background,
       
   110 		P_GridViewItem_text,
       
   111 		P_GridViewItem_icon,
       
   112 		P_CheckBox_text,
       
   113 		P_CheckBox_icon,
       
   114 		P_CheckBox_toucharea,
       
   115 		P_Fade_background,
       
   116 		P_TitlePane_background,
       
   117 		P_TitlePane_text,
       
   118 		P_TitlePane_icon,
       
   119 		P_TitleBar_toucharea,
       
   120 		P_SignalIndicator_icon,
       
   121 		P_SignalLevel_background,
       
   122 		P_SignalLevel_icon,
       
   123 		P_BatteryIndicator_icon,
       
   124 		P_BatteryLevel_background,
       
   125 		P_BatteryLevel_icon,
       
   126 		P_IndicatorGroup_icon1,
       
   127 		P_IndicatorGroup_icon2,
       
   128 		P_IndicatorGroup_icon3,
       
   129 		P_IndicatorGroup_icon4,
       
   130 		P_ProgressBar_frame,
       
   131 		P_ProgressBar_track,
       
   132 		P_ProgressBar_waittrack,
       
   133 		P_ProgressBar_mintext,
       
   134 		P_ProgressBar_maxtext,
       
   135 		P_NavigationButton_background,
       
   136 		P_IndicatorButton_background,
       
   137 		P_IndicatorButton_handleindication,
       
   138 		P_ItemViewItem_frame,
       
   139 		P_SelectionControl_selectionstart,
       
   140 		P_SelectionControl_selectionend,
       
   141 		P_TreeViewItem_expandicon,
       
   142 		P_Label_richtext,
       
   143 		P_RatingSlider_track,
       
   144 		P_RatingSlider_frame,
       
   145 		P_RatingSlider_toucharea,
       
   146 		P_ProgressSlider_frame,
       
   147 		P_ProgressSlider_track,
       
   148 		P_ProgressSlider_slidertrack,
       
   149 		P_ProgressSlider_toucharea,
       
   150 		P_ProgressSliderHandle_background, // deprecated
       
   151 		P_ProgressSliderHandle_icon,
       
   152 		P_ProgressSliderHandle_toucharea,
       
   153 		P_RatingSlider_layout,
       
   154 		P_ScrollArea_continuationbottom,
       
   155 		P_ScrollArea_continuationtop,
       
   156 		P_ScrollArea_continuationleft,
       
   157 		P_ScrollArea_continuationright,
       
   158 		P_ItemViewItem_focus,
       
   159 		P_NotificationDialog_icon,
       
   160 		P_NotificationDialog_text,
       
   161 		P_NotificationDialog_title,
       
   162 		P_NotificationDialog_frame,
       
   163 		P_ComboBox_background,
       
   164 		P_ComboBoxPopup_background,
       
   165 		P_ComboBoxButton_toucharea,
       
   166 		P_ComboBox_text,
       
   167 		P_DataItem_background,
       
   168 		P_DataItem_separator,
       
   169 		P_ColorGridViewItem_colorIcon,
       
   170 		P_ColorGridViewItem_borderIcon,
       
   171 		P_ColorGridViewItem_checkIcon,
       
   172 		P_ComboBox_button,
       
   173 		P_ProgressDialog_icon,
       
   174 		P_ProgressDialog_text,
       
   175 		P_DataItem_label,
       
   176 		P_DataItem_description,
       
   177 		P_SliderElement_touchincrease,
       
   178 		P_SliderElement_touchdecrease,
       
   179 		P_SliderElement_touchhandle,
       
   180 		P_SliderElement_touchgroove,
       
   181 		P_SliderTickMark_majoricon,
       
   182 		P_SliderTickMark_minoricon,
       
   183 		P_SliderTickMark_majorlabel,
       
   184 		P_SliderTickMark_minorlabel,
       
   185 		P_QueryInputMode_image,
       
   186 		P_GroupBoxHeading_icon,
       
   187 		P_GroupBoxHeading_text,
       
   188 		P_GroupBoxMarquee_text,
       
   189 		P_GroupBoxHeading_background,
       
   190 		P_GroupBoxContent_background,
       
   191 		P_DataItem_icon,
       
   192 		P_ItemViewItem_touchmultiselection,
       
   193 		P_TumbleView_background,
       
   194 		P_TumbleView_frame,
       
   195 		P_TumbleView_highlight,
       
   196 		P_DateTimePicker_background,
       
   197 		P_DateTimePicker_frame,
       
   198 		P_DateTimePicker_separator,
       
   199 		P_IndexFeedback_popup_text,
       
   200 		P_IndexFeedback_popup_background,
       
   201 		P_SliderPopup_background,
       
   202 		P_StatusBar_background,
       
   203 		P_StatusBar_timetext,
       
   204 		P_InputDialog_text,
       
   205 		P_InputDialog_additionaltext,
       
   206 		P_Last, // Keep this always as the LAST item in the active primitives list!
       
   207 
       
   208 		P_Deprecated = 0x000f0000,
       
   209 		// Deprecated enumerations
       
   210 		// These are DEPRECATED, replace or remove from widget/app sources !!
       
   211 		P_ProgressBar_toucharea = P_ProgressSlider_toucharea, // DEPRECATED
       
   212 		P_ProgressBar_slidertrack = P_ProgressSlider_track, // DEPRECATED        
       
   213 		P_ProgressSlider_handleicon = P_ProgressSliderHandle_icon, // DEPRECATED     
       
   214 		P_InputDialog_additional_text = P_InputDialog_additionaltext, //deprecated
       
   215 
       
   216 		P_NotUsed = 0x00f00000,
       
   217 		P_MessageBox_text, //deprecated ,not used.
       
   218 		P_ProgressSlider_handle, // DEPRECATED, NOT USED
       
   219 		P_ProgressBar_text, // DEPRECATED, NOT USED
       
   220 
       
   221 		P_CustomBase = 0x0f000000
       
   222 		};
       
   223 
       
   224 	virtual QGraphicsItem *createPrimitive(HbStyle::Primitive primitive,
       
   225 			QGraphicsItem *parent = 0) const
       
   226 		{
       
   227 			Q_UNUSED(primitive);
       
   228 			Q_UNUSED(parent);
       
   229 			return 0;
       
   230 		}
       
   231 	virtual void updatePrimitive(QGraphicsItem *item,
       
   232 			HbStyle::Primitive primitive, const QStyleOption *option) const
       
   233 		{
       
   234 			Q_UNUSED(item);
       
   235 			Q_UNUSED(primitive);
       
   236 			Q_UNUSED(option);
       
   237 		}
       
   238 
       
   239 	int registerPlugin(const QString &pluginName)
       
   240 		{
       
   241 			Q_UNUSED(pluginName);
       
   242 			return 0;
       
   243 		}
       
   244 	void unregisterPlugin(const QString &pluginName)
       
   245 		{
       
   246 			Q_UNUSED(pluginName);
       
   247 		}
       
   248 
       
   249 	static void setItemName(QGraphicsItem *item, const QString &name)
       
   250 		{
       
   251 			Q_UNUSED(item);
       
   252 			Q_UNUSED(name);			
       
   253 		}
       
   254 	static QString itemName(const QGraphicsItem *item)
       
   255 		{
       
   256 			Q_UNUSED(item);
       
   257 			return "";
       
   258 		}
       
   259 
       
   260 	bool parameter(const QString &param, qreal &value,
       
   261 			const HbDeviceProfile &profile = HbDeviceProfile()) const
       
   262 		{
       
   263 			Q_UNUSED(param);
       
   264 			Q_UNUSED(value);
       
   265 			Q_UNUSED(profile);
       
   266 			value = param_value;
       
   267 			return false;
       
   268 		}
       
   269 	void parameters(HbStyleParameters &params, 
       
   270 			const HbDeviceProfile &profile = HbDeviceProfile()) const
       
   271 		{
       
   272 			Q_UNUSED(params);
       
   273 			Q_UNUSED(profile);
       
   274 		}
       
   275 
       
   276 	void widgetParameters(HbStyleParameters &params, HbWidget* widget) const
       
   277 		{
       
   278 			Q_UNUSED(params);
       
   279 			Q_UNUSED(widget);
       
   280 		}
       
   281 
       
   282 protected:
       
   283 
       
   284 	virtual void polish(HbWidget *widget, HbStyleParameters &params)
       
   285 		{
       
   286 			Q_UNUSED(params);
       
   287 			Q_UNUSED(widget);
       
   288 		}
       
   289 	virtual void updateThemedParams(HbWidget *widget)
       
   290 		{
       
   291 			Q_UNUSED(widget);
       
   292 		}
       
   293 	virtual bool hasOrientationSpecificStyleRules(HbWidget *widget)
       
   294 		{
       
   295 			Q_UNUSED(widget);
       
   296 			return false;
       
   297 		}
       
   298 
       
   299 	HbStyle(HbStylePrivate &dd, QStyle *parent)
       
   300 		{
       
   301 			Q_UNUSED(dd);
       
   302 			Q_UNUSED(parent);
       
   303 		}
       
   304 
       
   305 	};
       
   306 
       
   307 #endif // HBSTYLE_H