--- a/src/hbwidgets/itemviews/hbabstractviewitem_p.h Fri Sep 17 08:32:10 2010 +0300
+++ b/src/hbwidgets/itemviews/hbabstractviewitem_p.h Mon Oct 04 00:38:12 2010 +0300
@@ -33,16 +33,17 @@
#include <hbnamespace.h>
#include <hboogmwatcher_p.h>
#include <hbabstractitemview.h>
-#include <hbstyleoptionabstractviewitem_p.h>
+#include <hbstyle.h>
#include <QObject>
+#include <QGraphicsItem>
#include <QPersistentModelIndex>
#include <QPointer>
#include <QExplicitlySharedDataPointer>
#include <QSharedData>
#include <QPainter>
-class QGraphicsItem;
+class QGraphicsObject;
class QTimer;
class QGestureEvent;
@@ -143,28 +144,30 @@
mItemType("viewitem"),
mPressStateChangeTimer(0),
mPressedItem(0),
- mLowGraphicsMemory(false),
- mStyleOption(0)
+ mLowGraphicsMemory(false)
{
HbOogmWatcher *watcher = HbOogmWatcher::instance();
connect(watcher, SIGNAL(graphicsMemoryLow()), this, SLOT(disablePixmapCaches()));
connect(watcher, SIGNAL(graphicsMemoryGood()), this, SLOT(enablePixmapCaches()));
-
- mStyleOption = new HbStyleOptionAbstractViewItem;
}
virtual ~HbAbstractViewItemShared()
{
- delete mStyleOption;
}
+ void updateIconItemsAsyncMode();
+
+ void setItemView(HbAbstractItemView *view);
+
public slots:
void pressStateChangeTimerTriggered();
void disablePixmapCaches();
void enablePixmapCaches();
+ void scrollingStarted();
+
public:
HbAbstractViewItem *mPrototype;
@@ -181,8 +184,6 @@
bool mAnimatePress;
bool mLowGraphicsMemory;
-
- HbStyleOptionAbstractViewItem *mStyleOption;
};
class HbAbstractViewItemPrivate : public HbWidgetPrivate
@@ -267,6 +268,11 @@
void init();
+ static HbAbstractViewItemPrivate *d_ptr(HbAbstractViewItem *item) {
+ Q_ASSERT(item);
+ return item->d_func();
+ }
+
inline bool isPrototype() const
{
Q_Q(const HbAbstractViewItem);
@@ -277,6 +283,7 @@
virtual int modelItemType() const;
void _q_animationFinished(const HbEffect::EffectStatus &status);
+ void _q_childrenChanged();
void repolishCloneItems();
void updateCloneItems(bool updateChildItems);
@@ -290,8 +297,11 @@
void setPressed(bool pressed, bool animate);
void paintItems(QPainter *painter, QStyleOptionGraphicsItem *option, QGraphicsItem *startItem, QGraphicsItem *endItem);
- void paintChildItemsRecursively(QGraphicsItem *child, QPainter *painter,QStyleOptionGraphicsItem *option);
-
+ void paintChildItemsRecursively(QGraphicsItem *child, QPainter *painter,QStyleOptionGraphicsItem *option, const QPointF &translatePosition);
+ void drawSubPixmap(QPixmap *pixmap,
+ QPainter *painter,
+ const QTransform &itemToPixmapTransform,
+ const QStyleOptionGraphicsItem *option);
void setChildFlags(QGraphicsItem *child, bool pixmapCacheEnabled);
void setChildFlagRecursively(bool pixmapCacheEnabled);
@@ -306,16 +316,23 @@
void releasePixmaps();
+ static bool iconLoadedCallback(HbIconItem *target, void *param);
+
+ bool iconLoaded(HbIconItem *target);
+
+ void updateIconItemsAsyncMode(QGraphicsItem *item);
+
+ inline void repolishItem();
public:
QPersistentModelIndex mIndex;
- QGraphicsItem *mBackgroundItem;
+ QGraphicsObject *mBackgroundItem;
QVariant mBackground;
- QGraphicsItem *mFrame;
+ QGraphicsObject *mFrame;
Qt::CheckState mCheckState;
- QGraphicsItem *mSelectionItem;
+ QGraphicsObject *mSelectionItem;
int mModelItemType;
bool mRepolishRequested;
@@ -326,20 +343,24 @@
bool mItemsChanged;
bool mPressed;
- QGraphicsItem *mFocusItem;
+ QGraphicsObject *mFocusItem;
- QGraphicsItem *mMultiSelectionTouchArea;
+ QGraphicsObject *mMultiSelectionTouchArea;
QExplicitlySharedDataPointer<HbAbstractViewItemShared> mSharedData;
HbViewItemPixmapPainter *mBackPixmapPainter;
HbViewItemPixmapPainter *mFrontPixmapPainter;
+ QVector<QGraphicsItem*> mUpdateItems;
+
bool mInPaintItems;
QGraphicsItem *mNonCachableItem;
bool mResetPixmapCache;
+ QList<QGraphicsItem *> mChildren;
+
friend class HbAbstractViewItemShared;
};
@@ -352,4 +373,10 @@
}
}
+void HbAbstractViewItemPrivate::repolishItem()
+{
+ Q_Q(HbAbstractViewItem);
+ q->repolish();
+}
+
#endif /*HBABSTRACTVIEWITEM_P_H*/