|
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 HbMainWindow; |
|
28 class QAbstractItemModel; |
|
29 class HgGrid; |
|
30 class GlxModelWrapper; |
|
31 class HbPushButton; |
|
32 class HbIconItem; |
|
33 class HbCheckBox; |
|
34 class HbLabel; |
|
35 class GlxSettingInterface; |
|
36 class HbGroupBox; |
|
37 class QGraphicsLinearLayout; |
|
38 |
|
39 class GlxGridView : public GlxView |
|
40 { |
|
41 Q_OBJECT |
|
42 |
|
43 public : |
|
44 GlxGridView(HbMainWindow *window); |
|
45 ~GlxGridView(); |
|
46 void activate() ; |
|
47 void deActivate(); |
|
48 void initializeView( QAbstractItemModel *model, GlxView *preView ); |
|
49 void setModel(QAbstractItemModel *model); |
|
50 void addToolBar( HbToolBar *toolBar ); |
|
51 void enableMarking() ; |
|
52 void disableMarking() ; |
|
53 void handleUserAction(qint32 commandId); |
|
54 QItemSelectionModel * getSelectionModel() ; |
|
55 QGraphicsItem * getAnimationItem(GlxEffect transitionEffect); |
|
56 |
|
57 public slots: |
|
58 void itemSelected(const QModelIndex & index); |
|
59 void scrollingEnded(); |
|
60 void scrollingStarted(); |
|
61 void orientationchanged(Qt::Orientation orient); |
|
62 void visibleIndexChanged(const QModelIndex& current, const QModelIndex& previous); |
|
63 void stateChanged(int state); |
|
64 //show the marked item count |
|
65 void showMarkedItemCount(); |
|
66 //show item count in the grid |
|
67 void showItemCount(); |
|
68 //clear all the model connection |
|
69 void clearCurrentModel(); |
|
70 //add the connection to the model |
|
71 void initializeNewModel(); |
|
72 void showAlbumTitle(QString aTitle); |
|
73 void populated(); |
|
74 |
|
75 protected : |
|
76 |
|
77 |
|
78 private slots: |
|
79 void indicateLongPress(const QModelIndex& index, QPointF coords); |
|
80 void uiButtonClicked(bool checked); |
|
81 void cameraButtonClicked(bool checked); |
|
82 |
|
83 private: |
|
84 void addViewConnection(); |
|
85 void removeViewConnection(); |
|
86 void hideorshowitems(Qt::Orientation orient); |
|
87 void scrolltofocus(); |
|
88 void loadGridView(); |
|
89 void showHbItems(); |
|
90 int getSubState(); |
|
91 void showNoImageString(); |
|
92 |
|
93 //It is used to hide and show the toolbar |
|
94 //In album grid it is not required to show the tool bar |
|
95 void updateToolBar(); |
|
96 |
|
97 HbMainWindow *mWindow; // no ownership |
|
98 QAbstractItemModel *mModel ; |
|
99 HgGrid *mWidget; // HG Grid Widget |
|
100 QItemSelectionModel *mSelectionModel; // Selected items model |
|
101 GlxModelWrapper *mModelWrapper; // Temp Model Wrapper, so That Role Change not a problem |
|
102 HbPushButton *mUiOnButton; |
|
103 bool mScrolling; |
|
104 HbIconItem *mIconItem; |
|
105 HbCheckBox *mMarkCheckBox; // Mark All checkbox |
|
106 HbGroupBox *mTotalImagesCount; // Item count of the grid |
|
107 HbGroupBox *mMarkSelectHeading; |
|
108 HbLabel *mMarkCountLabel; // Marked item count |
|
109 HbLabel *mZeroItemLabel; // zero itemcount |
|
110 HbGroupBox *mAlbumNameHeading; |
|
111 QGraphicsLinearLayout *mMarkContainer; |
|
112 GlxSettingInterface *mSettings; |
|
113 HbWidget *mMarkingWidget; |
|
114 }; |
|
115 |
|
116 #endif /* GLXGRIDVIEW_H_ */ |