ganeswidgets/inc/hgindexfeedback.h
changeset 0 89c329efa980
child 6 1cdcc61142d2
equal deleted inserted replaced
-1:000000000000 0:89c329efa980
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef HGINDEXFEEDBACK_H
       
    19 #define HGINDEXFEEDBACK_H
       
    20 
       
    21 #include <hbglobal.h>
       
    22 #include <hbwidget.h>
       
    23 #include <hgwidgets/hgwidgets.h>
       
    24 
       
    25 class HbScrollBar;
       
    26 class HgIndexFeedbackPrivate;
       
    27 class HbStyleOptionIndexFeedback;
       
    28 class HgWidget;
       
    29 
       
    30 QT_BEGIN_NAMESPACE
       
    31 class QGraphicsItem;
       
    32 QT_END_NAMESPACE
       
    33 
       
    34 class HgIndexFeedback : public HbWidget
       
    35 {
       
    36     Q_OBJECT
       
    37 
       
    38 public:
       
    39 
       
    40     explicit HgIndexFeedback(QGraphicsItem *parent=0);
       
    41     virtual ~HgIndexFeedback();
       
    42 
       
    43     enum { Type = Hb::ItemType_IndexFeedback };
       
    44     int type() const { return Type; }
       
    45     
       
    46     void setIndexFeedbackPolicy( HgWidget::IndexFeedbackPolicy policy);
       
    47     HgWidget::IndexFeedbackPolicy indexFeedbackPolicy() const;
       
    48 
       
    49     void setWidget(HgWidget *itemView);
       
    50     HgWidget* widget() const;
       
    51 
       
    52     virtual QGraphicsItem *primitive(HbStyle::Primitive primitive) const;
       
    53 
       
    54 protected:
       
    55     virtual void polish( HbStyleParameters& params);
       
    56     virtual bool sceneEventFilter(QGraphicsItem* watched, QEvent* event);
       
    57     virtual bool eventFilter(QObject *obj, QEvent *event);
       
    58     void initStyleOption(HbStyleOptionIndexFeedback *option) const;
       
    59 
       
    60 private:
       
    61     Q_DECLARE_PRIVATE_D(d_ptr, HgIndexFeedback)
       
    62     Q_DISABLE_COPY(HgIndexFeedback)
       
    63 
       
    64     Q_PRIVATE_SLOT(d_func(), void _q_scrollPositionChanged(qreal, Qt::Orientation))
       
    65     Q_PRIVATE_SLOT(d_func(), void _q_hideIndexFeedback())
       
    66     Q_PRIVATE_SLOT(d_func(), void _q_itemViewDestroyed())
       
    67     Q_PRIVATE_SLOT(d_func(), void _q_hideIndexFeedbackNow())
       
    68     Q_PRIVATE_SLOT(d_func(), void _q_currentModelIndexChanged(QModelIndex, QModelIndex))
       
    69 };
       
    70 
       
    71 #endif // HGINDEXFEEDBACK_H