|
1 /* |
|
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
|
3 * All rights reserved. |
|
4 * This component and the accompanying materials are made available |
|
5 * under the terms of "Eclipse Public License v1.0" |
|
6 * which accompanies this distribution, and is available |
|
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
|
8 * |
|
9 * Initial Contributors: |
|
10 * Nokia Corporation - initial contribution. |
|
11 * |
|
12 * Contributors: |
|
13 * |
|
14 * Description: ?Description |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 |
|
20 |
|
21 #ifndef GLXGRIDVIEW_H |
|
22 #define GLXGRIDVIEW_H |
|
23 |
|
24 #include "glxview.h" |
|
25 |
|
26 //Qt/Orbit forward declarations |
|
27 class HbGridView; |
|
28 class HbMainWindow; |
|
29 class HbDocumentLoader; |
|
30 class QAbstractItemModel; |
|
31 class HbAbstractViewItem; |
|
32 |
|
33 #define NBR_ROW 5 |
|
34 #define NBR_COL 3 |
|
35 #define NBR_PAGE NBR_ROW * NBR_COL |
|
36 |
|
37 class GlxGridView : public GlxView |
|
38 { |
|
39 Q_OBJECT |
|
40 |
|
41 public : |
|
42 GlxGridView(HbMainWindow *window); |
|
43 ~GlxGridView(); |
|
44 void activate() ; |
|
45 void deActivate(); |
|
46 void setModel(QAbstractItemModel *model); |
|
47 void addToolBar( HbToolBar *toolBar ); |
|
48 void enableMarking() ; |
|
49 void disableMarking() ; |
|
50 void handleUserAction(qint32 commandId); |
|
51 QItemSelectionModel * getSelectionModel() ; |
|
52 QGraphicsItem * getAnimationItem(GlxEffect transitionEffect); |
|
53 |
|
54 public slots: |
|
55 void itemSelected(const QModelIndex & index); |
|
56 void setVisvalWindowIndex(); |
|
57 void scrollPositionChange (QPointF newPosition, Qt::Orientations importantDimensions); |
|
58 /* |
|
59 * This loads the docml and retrives the widgets from the |
|
60 * docml corresponding to the present orentation |
|
61 */ |
|
62 void loadGridView(Qt::Orientation orient); |
|
63 void itemDestroyed(); |
|
64 |
|
65 protected : |
|
66 QVariant itemChange (GraphicsItemChange change, const QVariant &value) ; |
|
67 |
|
68 private slots: |
|
69 void indicateLongPress( HbAbstractViewItem *item, QPointF coords ); |
|
70 |
|
71 private: |
|
72 void addViewConnection(); |
|
73 void removeViewConnection(); |
|
74 |
|
75 private: |
|
76 HbGridView *mGridView; |
|
77 HbView *mView; |
|
78 HbMainWindow *mWindow; //no ownership |
|
79 QAbstractItemModel *mModel ; |
|
80 int mVisualIndex; //first item index of the page //To:Do remove later |
|
81 HbAbstractViewItem *mItem; |
|
82 HbDocumentLoader *mDocLoader; //Docml loader to load the widgets from docml |
|
83 }; |
|
84 |
|
85 #endif /* GLXGRIDVIEW_H_ */ |