util/s60pixelmetrics/pixel_metrics.h
changeset 0 1918ee327afb
child 4 3b1da2848fc7
child 7 f7bc934e204c
equal deleted inserted replaced
-1:000000000000 0:1918ee327afb
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the utility applications of the Qt Toolkit.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 
       
    42 #ifndef PIXELMETRICS_H
       
    43 #define PIXELMETRICS_H
       
    44 
       
    45 #include <e32base.h>
       
    46 #define S60_Rnd_Env
       
    47 
       
    48 #ifdef S60_Rnd_Env
       
    49 #pragma message ("Building in supported environment")
       
    50 
       
    51 const TInt KUnknownBase = -5000;
       
    52 
       
    53 NONSHARABLE_CLASS( QStyle )
       
    54     {
       
    55     public:
       
    56         enum PixelMetric {
       
    57             PM_ButtonMargin,
       
    58             PM_ButtonDefaultIndicator,
       
    59             PM_MenuButtonIndicator,
       
    60             PM_ButtonShiftHorizontal,
       
    61             PM_ButtonShiftVertical,
       
    62 
       
    63             PM_DefaultFrameWidth,
       
    64             PM_SpinBoxFrameWidth,
       
    65             PM_ComboBoxFrameWidth,
       
    66 
       
    67             PM_MaximumDragDistance,
       
    68 
       
    69             PM_ScrollBarExtent,
       
    70             PM_ScrollBarSliderMin,
       
    71 
       
    72             PM_SliderThickness,             // total slider thickness
       
    73             PM_SliderControlThickness,      // thickness of the business part
       
    74             PM_SliderLength,                // total length of slider
       
    75             PM_SliderTickmarkOffset,        //
       
    76             PM_SliderSpaceAvailable,        // available space for slider to move
       
    77 
       
    78             PM_DockWidgetSeparatorExtent,
       
    79             PM_DockWidgetHandleExtent,
       
    80             PM_DockWidgetFrameWidth,
       
    81 
       
    82             PM_TabBarTabOverlap,
       
    83             PM_TabBarTabHSpace,
       
    84             PM_TabBarTabVSpace,
       
    85             PM_TabBarBaseHeight,
       
    86             PM_TabBarBaseOverlap,
       
    87 
       
    88             PM_ProgressBarChunkWidth,
       
    89 
       
    90             PM_SplitterWidth,
       
    91             PM_TitleBarHeight,
       
    92 
       
    93             PM_MenuScrollerHeight,
       
    94             PM_MenuHMargin,
       
    95             PM_MenuVMargin,
       
    96             PM_MenuPanelWidth,
       
    97             PM_MenuTearoffHeight,
       
    98             PM_MenuDesktopFrameWidth,
       
    99 
       
   100             PM_MenuBarPanelWidth,
       
   101             PM_MenuBarItemSpacing,
       
   102             PM_MenuBarVMargin,
       
   103             PM_MenuBarHMargin,
       
   104 
       
   105             PM_IndicatorWidth,
       
   106             PM_IndicatorHeight,
       
   107             PM_ExclusiveIndicatorWidth,
       
   108             PM_ExclusiveIndicatorHeight,
       
   109             PM_CheckListButtonSize,
       
   110             PM_CheckListControllerSize,
       
   111 
       
   112             PM_DialogButtonsSeparator,
       
   113             PM_DialogButtonsButtonWidth,
       
   114             PM_DialogButtonsButtonHeight,
       
   115 
       
   116             PM_MdiSubWindowFrameWidth,
       
   117             PM_MDIFrameWidth = PM_MdiSubWindowFrameWidth,            //obsolete
       
   118             PM_MdiSubWindowMinimizedWidth,
       
   119             PM_MDIMinimizedWidth = PM_MdiSubWindowMinimizedWidth,    //obsolete
       
   120 
       
   121             PM_HeaderMargin,
       
   122             PM_HeaderMarkSize,
       
   123             PM_HeaderGripMargin,
       
   124             PM_TabBarTabShiftHorizontal,
       
   125             PM_TabBarTabShiftVertical,
       
   126             PM_TabBarScrollButtonWidth,
       
   127 
       
   128             PM_ToolBarFrameWidth,
       
   129             PM_ToolBarHandleExtent,
       
   130             PM_ToolBarItemSpacing,
       
   131             PM_ToolBarItemMargin,
       
   132             PM_ToolBarSeparatorExtent,
       
   133             PM_ToolBarExtensionExtent,
       
   134 
       
   135             PM_SpinBoxSliderHeight,
       
   136 
       
   137             PM_DefaultTopLevelMargin,
       
   138             PM_DefaultChildMargin,
       
   139             PM_DefaultLayoutSpacing,
       
   140 
       
   141             PM_ToolBarIconSize,
       
   142             PM_ListViewIconSize,
       
   143             PM_IconViewIconSize,
       
   144             PM_SmallIconSize,
       
   145             PM_LargeIconSize,
       
   146 
       
   147             PM_FocusFrameVMargin,
       
   148             PM_FocusFrameHMargin,
       
   149 
       
   150             PM_ToolTipLabelFrameWidth,
       
   151             PM_CheckBoxLabelSpacing,
       
   152             PM_TabBarIconSize,
       
   153             PM_SizeGripSize,
       
   154             PM_DockWidgetTitleMargin,
       
   155             PM_MessageBoxIconSize,
       
   156             PM_ButtonIconSize,
       
   157 
       
   158             PM_DockWidgetTitleBarButtonMargin,
       
   159 
       
   160             PM_RadioButtonLabelSpacing,
       
   161             PM_LayoutLeftMargin,
       
   162             PM_LayoutTopMargin,
       
   163             PM_LayoutRightMargin,
       
   164             PM_LayoutBottomMargin,
       
   165             PM_LayoutHorizontalSpacing,
       
   166             PM_LayoutVerticalSpacing,
       
   167             PM_TabBar_ScrollButtonOverlap,
       
   168 
       
   169             PM_TextCursorWidth,
       
   170 
       
   171             PM_TabCloseIndicatorWidth,
       
   172             PM_TabCloseIndicatorHeight,
       
   173 
       
   174             PM_ScrollView_ScrollBarSpacing,
       
   175             PM_SubMenuOverlap,
       
   176 
       
   177             // do not add any values below/greater than this
       
   178             PM_CustomBase = 0xf0000000,
       
   179 
       
   180             // The following are custom values needed to draw the S60Style according scalable UIs.
       
   181             // Width of 9-part frame-corner
       
   182             PM_Custom_FrameCornerWidth,
       
   183             // Height of 9-part frame corner
       
   184             PM_Custom_FrameCornerHeight,
       
   185             // Bold line width
       
   186             PM_Custom_BoldLineWidth,
       
   187             // Thin line width
       
   188             PM_Custom_ThinLineWidth
       
   189         };
       
   190 
       
   191     };
       
   192 #else
       
   193 #pragma message ("Building in non-supported environment, this probably fails")
       
   194 #endif
       
   195 
       
   196 
       
   197 // Pixel metrics version information.
       
   198 class TPixelMetricsVersion
       
   199     {
       
   200     public:
       
   201         TInt majorVersion;
       
   202         TInt minorVersion;
       
   203     };
       
   204 
       
   205 NONSHARABLE_CLASS(PixelMetrics)
       
   206 {
       
   207     public:
       
   208         static TPixelMetricsVersion Version();
       
   209         static TInt PixelMetricValue(QStyle::PixelMetric);
       
   210 
       
   211     private:
       
   212         static TInt PixelMetricMenuValue( QStyle::PixelMetric menuValue, TRect mainPaneRect );
       
   213         static TInt PixelMetricTabValue( QStyle::PixelMetric tabValue, TRect appWindow, TBool landscape );
       
   214 };
       
   215 
       
   216 #endif // PIXELMETRICS_H