|
1 /**************************************************************************** |
|
2 ** |
|
3 ** Copyright (C) 2008-2010 Nokia Corporation and/or its subsidiary(-ies). |
|
4 ** All rights reserved. |
|
5 ** Contact: Nokia Corporation (developer.feedback@nokia.com) |
|
6 ** |
|
7 ** This file is part of the HbWidgets module of the UI Extensions for Mobile. |
|
8 ** |
|
9 ** GNU Lesser General Public License Usage |
|
10 ** This file may be used under the terms of the GNU Lesser General Public |
|
11 ** License version 2.1 as published by the Free Software Foundation and |
|
12 ** appearing in the file LICENSE.LGPL included in the packaging of this file. |
|
13 ** Please review the following information to ensure the GNU Lesser General |
|
14 ** Public License version 2.1 requirements will be met: |
|
15 ** http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html. |
|
16 ** |
|
17 ** In addition, as a special exception, Nokia gives you certain additional |
|
18 ** rights. These rights are described in the Nokia Qt LGPL Exception |
|
19 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package. |
|
20 ** |
|
21 ** If you have questions regarding the use of this file, please contact |
|
22 ** Nokia at developer.feedback@nokia.com. |
|
23 ** |
|
24 ****************************************************************************/ |
|
25 |
|
26 #ifndef HBTREEVIEWITEM_H |
|
27 #define HBTREEVIEWITEM_H |
|
28 |
|
29 #include <hblistviewitem.h> |
|
30 #include <hbglobal.h> |
|
31 #include <hbnamespace.h> |
|
32 #include <hbstyle.h> |
|
33 |
|
34 class HbTreeViewItemPrivate; |
|
35 class HbStyleOptionTreeViewItem; |
|
36 |
|
37 QT_BEGIN_NAMESPACE |
|
38 class QPointF; |
|
39 class QGraphicsItem; |
|
40 QT_END_NAMESPACE |
|
41 |
|
42 class HB_WIDGETS_EXPORT HbTreeViewItem : public HbListViewItem |
|
43 { |
|
44 Q_OBJECT |
|
45 |
|
46 Q_PROPERTY(bool expanded READ isExpanded WRITE setExpanded) |
|
47 |
|
48 public: |
|
49 |
|
50 enum StateKey |
|
51 { |
|
52 ExpansionKey = 10 |
|
53 }; |
|
54 |
|
55 explicit HbTreeViewItem(QGraphicsItem *parent=0); |
|
56 virtual ~HbTreeViewItem(); |
|
57 |
|
58 enum { Type = Hb::ItemType_TreeViewItem }; |
|
59 virtual int type() const; |
|
60 |
|
61 virtual HbAbstractViewItem *createItem(); |
|
62 |
|
63 virtual void updateChildItems(); |
|
64 |
|
65 virtual QMap<int,QVariant> state() const; |
|
66 virtual void setState(const QMap<int,QVariant> &state); |
|
67 |
|
68 void setExpanded(bool expanded); |
|
69 bool isExpanded() const; |
|
70 |
|
71 virtual QGraphicsItem *primitive(HbStyle::Primitive primitive) const; |
|
72 |
|
73 public slots: |
|
74 void updatePrimitives(); |
|
75 |
|
76 protected: |
|
77 |
|
78 HbTreeViewItem(const HbTreeViewItem &source); |
|
79 HbTreeViewItem &operator=(const HbTreeViewItem &source); |
|
80 |
|
81 HbTreeViewItem(HbTreeViewItemPrivate &dd, QGraphicsItem * parent); |
|
82 |
|
83 void initStyleOption(HbStyleOptionTreeViewItem *option) const; |
|
84 |
|
85 private: |
|
86 |
|
87 Q_DECLARE_PRIVATE_D(d_ptr, HbTreeViewItem) |
|
88 }; |
|
89 |
|
90 #endif // HBTREEVIEWITEM_H |