src/hbwidgets/sliders/hbslidercontrol_p_p.h
changeset 0 16d8024aca5e
child 3 11d3954df52a
equal deleted inserted replaced
-1:000000000000 0:16d8024aca5e
       
     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 HbWidgets 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 HBSLIDERCONTROL_P_P_H
       
    27 #define HBSLIDERCONTROL_P_P_H
       
    28 
       
    29 #include "hbslidercontrol_p.h"
       
    30 #include "hbabstractslidercontrol_p.h"
       
    31 #include "hbslidertickmarks_p.h"
       
    32 
       
    33 #include <QString>
       
    34 
       
    35 class HbSliderHandle;
       
    36 class HbToolTip;
       
    37 class QGraphicsItem;
       
    38 class HbSliderTickmarksLabel;
       
    39 
       
    40 class HbSliderControlPrivate : public HbAbstractSliderControlPrivate
       
    41 {
       
    42     Q_DECLARE_PUBLIC(HbSliderControl)
       
    43 
       
    44 public:
       
    45     HbSliderControlPrivate();
       
    46     virtual ~HbSliderControlPrivate();
       
    47 
       
    48     void init();
       
    49     void adjustHandle();
       
    50     bool onHandle(QPointF pos);
       
    51     int getNearbyTick();
       
    52     void updateTickAndLabel();
       
    53     void deleteTickAndLabel();
       
    54 
       
    55     virtual HbSliderHandle *createHandle();
       
    56     virtual QGraphicsItem *createGroove();
       
    57     virtual QGraphicsItem *createProgressGroove();
       
    58     void createSliderTicks( );
       
    59     void positionTickMarks( );
       
    60     void createSliderTickLabels( );
       
    61     void positionTickMarksLabel ( );
       
    62 
       
    63     HbSliderHandle *handle;
       
    64     Hb::SliderTickPositions tickPosition;
       
    65     HbSliderControl::SnappingMode  snappingMode;
       
    66     int majorTickInterval;
       
    67     int minorTickInterval;
       
    68     QGraphicsItem *groove;
       
    69     QGraphicsItem *progressGroove;
       
    70     HbSliderTickmarks *tickmarksLeft;
       
    71     HbSliderTickmarks *tickmarksRight;
       
    72     HbSliderTickmarksLabel *tickmarkslabelLeft;
       
    73     HbSliderTickmarksLabel *tickmarkslabelRight;
       
    74     bool displayCurrValueToolTip;
       
    75     QPointF oldPos;
       
    76     Qt::Alignment toolTipAlignment;
       
    77     QString handleIcon;
       
    78     bool groovePressed;
       
    79     // These two variable are volume slider specific
       
    80     // in volume slider if volume is mute then on track press 
       
    81     // slider should go to previousValue
       
    82     bool setDefault;
       
    83     int previousValue;
       
    84     bool trackHandlingEnable;
       
    85     bool handleMoving;
       
    86     QStringList majorLabel;
       
    87     QStringList minorLabel;
       
    88     QGraphicsItem *grooveTouchArea;
       
    89     bool enableProgressTrack;
       
    90     bool userDefinedTooltipAlign;
       
    91 
       
    92 
       
    93 private:
       
    94     // not to pollute HbSliderControl (which may become public in the future)
       
    95     // with friend class declarations
       
    96     static HbSliderControlPrivate *d_ptr(HbSliderControl *sliderControl) {
       
    97         Q_ASSERT(sliderControl);
       
    98         return sliderControl->d_func();
       
    99     }
       
   100     friend class HbSlider;
       
   101 
       
   102 };
       
   103 #endif // HBSLIDERCONTROL_P_P_H
       
   104