ganeswidgets/inc/hgindexfeedback.h
author hgs
Fri, 17 Sep 2010 15:55:58 +0300
changeset 17 a10844a9914d
parent 14 645b870db620
permissions -rw-r--r--
201037

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

#ifndef HGINDEXFEEDBACK_H
#define HGINDEXFEEDBACK_H

#include <HbGlobal>
#include <HbWidget>
#include <hgwidgets/hgwidgets.h>

class HbScrollBar;
class HgIndexFeedbackPrivate;
class HbStyleOptionIndexFeedback;
class HgWidget;

QT_BEGIN_NAMESPACE
class QGraphicsItem;
QT_END_NAMESPACE

class HgIndexFeedback : public HbWidget
{
    Q_OBJECT

public:

    explicit HgIndexFeedback(QGraphicsItem *parent=0);
    virtual ~HgIndexFeedback();

    enum { Type = Hb::ItemType_IndexFeedback };
    int type() const { return Type; }
    
    void setIndexFeedbackPolicy( HgWidget::IndexFeedbackPolicy policy);
    HgWidget::IndexFeedbackPolicy indexFeedbackPolicy() const;

    void setWidget(HgWidget *itemView);
    HgWidget* widget() const;

protected:
    virtual void polish( HbStyleParameters& params);
    virtual bool sceneEventFilter(QGraphicsItem* watched, QEvent* event);
    virtual bool eventFilter(QObject *obj, QEvent *event);
    HgIndexFeedbackPrivate * const p_ptr;

private:
    Q_DECLARE_PRIVATE_D(p_ptr, HgIndexFeedback)
    Q_DISABLE_COPY(HgIndexFeedback)

    Q_PRIVATE_SLOT(d_func(), void _q_hideIndexFeedback())
    Q_PRIVATE_SLOT(d_func(), void _q_itemViewDestroyed())
    Q_PRIVATE_SLOT(d_func(), void _q_hideIndexFeedbackNow())
    Q_PRIVATE_SLOT(d_func(), void _q_currentModelIndexChanged(QModelIndex, QModelIndex))
};

#endif // HGINDEXFEEDBACK_H