ganeswidgets/inc/hgwidgets_p.h
changeset 1 e48454f237ca
parent 0 89c329efa980
child 2 49c70dcc3f17
equal deleted inserted replaced
0:89c329efa980 1:e48454f237ca
    17 
    17 
    18 #ifndef HGWIDGET_P_H
    18 #ifndef HGWIDGET_P_H
    19 #define HGWIDGET_P_H
    19 #define HGWIDGET_P_H
    20 
    20 
    21 #include <hgwidgets/hgwidgets.h>
    21 #include <hgwidgets/hgwidgets.h>
    22 #include <hbwidget_p.h>
       
    23 #include <QTimer>
    22 #include <QTimer>
    24 #include <QTime>
    23 #include <QTime>
    25 
    24 
    26 class QAbstractItemModel;
    25 class QAbstractItemModel;
    27 class HgContainer;
    26 class HgContainer;
    28 class HgScrollBufferManager;
    27 class HgScrollBufferManager;
    29 class QGraphicsLinearLayout;
    28 class QGraphicsLinearLayout;
    30 class HgIndexFeedback;
    29 class HgIndexFeedback;
    31 
    30 
    32 class HgWidgetPrivate : public HbWidgetPrivate
    31 class HgWidgetPrivate
    33 {
    32 {
    34     Q_DECLARE_PUBLIC(HgWidget)
    33     Q_DECLARE_PUBLIC(HgWidget)
    35 
    34 
    36 public:
    35 public:
    37 
    36 
    63     QList<QModelIndex> getVisibleItemIndices() const;
    62     QList<QModelIndex> getVisibleItemIndices() const;
    64     Qt::Orientation scrollDirection() const;
    63     Qt::Orientation scrollDirection() const;
    65 
    64 
    66     void setIndexFeedbackPolicy( HgWidget::IndexFeedbackPolicy policy);
    65     void setIndexFeedbackPolicy( HgWidget::IndexFeedbackPolicy policy);
    67     HgWidget::IndexFeedbackPolicy indexFeedbackPolicy() const;
    66     HgWidget::IndexFeedbackPolicy indexFeedbackPolicy() const;
       
    67     void setDefaultImage(QImage defaultImage);
       
    68     
       
    69     void setItemSizePolicy(HgWidget::ItemSizePolicy policy);
       
    70     HgWidget::ItemSizePolicy itemSizePolicy() const;
       
    71 
       
    72     void setItemSize(const QSizeF& size);
       
    73     QSizeF itemSize() const;
       
    74     
       
    75     void setItemSpacing(const QSizeF& size);
       
    76     QSizeF itemSpacing() const;
       
    77     
       
    78     HgWidget *q_ptr;
    68     
    79     
    69 private:
    80 private:
    70 
    81 
    71     void clearCurrentModel();
    82     void clearCurrentModel();
    72     void initializeNewModel();
    83     void initializeNewModel();
    97     void _q_insertRows(const QModelIndex &parent, int start, int end);
   108     void _q_insertRows(const QModelIndex &parent, int start, int end);
    98     void _q_removeRows(const QModelIndex &parent, int start, int end);
   109     void _q_removeRows(const QModelIndex &parent, int start, int end);
    99     void _q_moveRows(const QModelIndex &sourceParent, int sourceStart,
   110     void _q_moveRows(const QModelIndex &sourceParent, int sourceStart,
   100                      int sourceEnd, const QModelIndex &destinationParent,
   111                      int sourceEnd, const QModelIndex &destinationParent,
   101                      int destinationRow);
   112                      int destinationRow);
       
   113     void _q_modelReset();
   102     void _q_groovePressed(qreal value, Qt::Orientation orientation);
   114     void _q_groovePressed(qreal value, Qt::Orientation orientation);
   103 
   115 
       
   116     void dataChanged(const QModelIndex &topLeft, const QModelIndex &bottomRight);
       
   117 
       
   118     void initBufferManager(int itemCount);
       
   119     
   104 protected:
   120 protected:
   105 
   121 
   106     QGraphicsLinearLayout *mLayout;
   122     QGraphicsLinearLayout *mLayout;
   107 
   123 
   108     HgContainer *mContainer;
   124     HgContainer *mContainer;
   113     QItemSelectionModel *mDefaultSelectionModel;
   129     QItemSelectionModel *mDefaultSelectionModel;
   114 
   130 
   115     HbScrollBar *mScrollBar;
   131     HbScrollBar *mScrollBar;
   116     HgWidget::ScrollBarPolicy mScrollBarPolicy;
   132     HgWidget::ScrollBarPolicy mScrollBarPolicy;
   117     bool mAbleToScroll;
   133     bool mAbleToScroll;
   118     QTimer mScrollBarHideTimer;
   134     QTimer* mScrollBarHideTimer;
   119 
   135 
   120     bool mHandleLongPress;
   136     bool mHandleLongPress;
   121     bool mForeground;
   137     bool mForeground;
   122     int mBufferSize;
   138     int mBufferSize;
   123     HgIndexFeedback *mIndexFeedback;
   139     HgIndexFeedback *mIndexFeedback;
       
   140     bool mStaticScrollDirection;
   124 };
   141 };
   125 
   142 
   126 #endif  //HGWIDGET_p_H
   143 #endif  //HGWIDGET_p_H
   127 
   144