src/hbwidgets/itemviews/hbabstractviewitem_p.h
changeset 1 f7ac710697a9
parent 0 16d8024aca5e
child 2 06ff229162e9
equal deleted inserted replaced
0:16d8024aca5e 1:f7ac710697a9
    28 #include "hbabstractviewitem.h"
    28 #include "hbabstractviewitem.h"
    29 
    29 
    30 #include <hbwidget_p.h>
    30 #include <hbwidget_p.h>
    31 #include <hbeffect.h>
    31 #include <hbeffect.h>
    32 #include <hbframebackground.h>
    32 #include <hbframebackground.h>
       
    33 #include <hbnamespace.h>
    33 
    34 
    34 #include <QPersistentModelIndex>
    35 #include <QPersistentModelIndex>
    35 #include <QPointer>
    36 #include <QPointer>
    36 #include <QExplicitlySharedDataPointer>
    37 #include <QExplicitlySharedDataPointer>
    37 #include <QSharedData>
    38 #include <QSharedData>
    38 
    39 
    39 class HbAbstractItemView;
    40 class HbAbstractItemView;
    40 class QGraphicsItem;
    41 class QGraphicsItem;
       
    42 
       
    43 class QGestureEvent;
    41 
    44 
    42 #define HB_SD(Class) Class##Shared * sd = (Class##Shared *)(d->mSharedData.data())
    45 #define HB_SD(Class) Class##Shared * sd = (Class##Shared *)(d->mSharedData.data())
    43 #define HB_SDD(Class) Q_D(Class); Class##Shared * sd = (Class##Shared *)(d->mSharedData.data())
    46 #define HB_SDD(Class) Q_D(Class); Class##Shared * sd = (Class##Shared *)(d->mSharedData.data())
    44 
    47 
    45 class HbAbstractViewItemShared : public QSharedData
    48 class HbAbstractViewItemShared : public QSharedData
    47     public:
    50     public:
    48 
    51 
    49         HbAbstractViewItemShared() :
    52         HbAbstractViewItemShared() :
    50           mPrototype(0),
    53           mPrototype(0),
    51           mItemView(0),
    54           mItemView(0),
    52           mDefaultFrame("", HbFrameDrawer::Undefined),
    55           mDefaultFrame(),
    53           mItemType("viewitem")
    56           mItemType("viewitem")
    54         {
    57         {
    55         }
    58         }
    56 
    59 
    57         HbAbstractViewItem *mPrototype;
    60         HbAbstractViewItem *mPrototype;
    62 
    65 
    63         QString mItemType;
    66         QString mItemType;
    64         static const int ViewItemDeferredDeleteEvent;
    67         static const int ViewItemDeferredDeleteEvent;
    65 };
    68 };
    66 
    69 
    67 class HbAbstractViewItemPrivate : public HbWidgetPrivate
    70 // Note! Temporary HB_AUTOTEST_EXPORT. Removed when QMAP_INT__ITEM_STATE_DEPRECATED when QMap<int,QVariant> based state item system is removed 
       
    71 //#define QMAP_INT__ITEM_STATE_DEPRECATED
       
    72 class HB_AUTOTEST_EXPORT HbAbstractViewItemPrivate : public HbWidgetPrivate
    68 {
    73 {
    69     Q_DECLARE_PUBLIC( HbAbstractViewItem )
    74     Q_DECLARE_PUBLIC( HbAbstractViewItem )
    70 
    75 
    71     public:
    76     public:
    72 
    77 
    82           mContentChangedSupported(false),
    87           mContentChangedSupported(false),
    83           mItemsChanged(false),
    88           mItemsChanged(false),
    84           mSizeHintPolish(false),
    89           mSizeHintPolish(false),
    85           mPressed(false),
    90           mPressed(false),
    86           mFocusItem(0),
    91           mFocusItem(0),
    87           mMultiSelectionTouchArea(0),
    92           mMultiSelectionTouchArea(0),                    
    88           mSharedData(shared)
    93           mSharedData(shared)
    89         {
    94         {
    90             if (!mSharedData) {
    95             if (!mSharedData) {
    91                 mSharedData = new HbAbstractViewItemShared;
    96                 mSharedData = new HbAbstractViewItemShared;
    92             }
    97             }
   147         virtual int modelItemType() const;
   152         virtual int modelItemType() const;
   148 
   153 
   149         void _q_animationFinished(const HbEffect::EffectStatus &status);
   154         void _q_animationFinished(const HbEffect::EffectStatus &status);
   150 
   155 
   151         void repolishCloneItems();
   156         void repolishCloneItems();
   152         void updateCloneItems();
   157         void updateCloneItems(bool updateChildItems);
   153 
   158 
   154         virtual void setInsidePopup(bool insidePopup);
   159         virtual void setInsidePopup(bool insidePopup);
   155 
   160 
       
   161         virtual void tapTriggered(QGestureEvent *event);
       
   162 
       
   163         void revealItem();
       
   164 public:
   156         QPersistentModelIndex mIndex;
   165         QPersistentModelIndex mIndex;
   157         bool mFocused;
   166         bool mFocused;
   158         
   167         
   159         QGraphicsItem *mBackgroundItem;
   168         QGraphicsItem *mBackgroundItem;
   160         QVariant mBackground;
   169         QVariant mBackground;