author | hgs |
Sat, 04 Sep 2010 11:36:24 +0530 | |
changeset 62 | 36d93b4dc635 |
parent 52 | a3a4c0de738e |
permissions | -rw-r--r-- |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
1 |
/* |
62 | 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 |
||
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
18 |
#ifndef GLXDETAILSVIEW_H |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
19 |
#define GLXDETAILSVIEW_H |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
20 |
|
62 | 21 |
//Includes |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
22 |
#include <glxview.h> |
62 | 23 |
#include <QAbstractItemModel> |
44 | 24 |
|
62 | 25 |
//Orbit/Qt forward declartion |
26 |
class HbIcon; |
|
44 | 27 |
class HbLabel; |
62 | 28 |
class HbIconItem; |
29 |
class HbListView; |
|
44 | 30 |
class HbPushButton; |
62 | 31 |
|
32 |
//User Defined forward declartion |
|
33 |
class GlxDetailsIcon; |
|
34 |
class GlxFavMediaModel; |
|
52 | 35 |
class GlxDetailsTextEdit; |
44 | 36 |
class GlxDetailsViewDocLoader; |
62 | 37 |
class GlxDetailsViewModelWrapper; |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
38 |
|
62 | 39 |
/** |
40 |
* Class Description |
|
41 |
* This is Details view class .The functionality of details view is to show the detail of the image like |
|
42 |
* Name of the image ,Date the image was created , time the image was modified , size of the image |
|
43 |
* and show the description of the image.here in this view , the name of the image and description can be changed. |
|
44 |
*/ |
|
45 |
class GlxDetailsView : public GlxView |
|
46 |
{ |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
47 |
|
62 | 48 |
Q_OBJECT |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
49 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
50 |
public: |
62 | 51 |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
52 |
/* |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
53 |
* class constructor. |
62 | 54 |
* @param - HbMainWindow object |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
55 |
*/ |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
56 |
GlxDetailsView(HbMainWindow *window); |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
57 |
/* |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
58 |
* class Destructor. |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
59 |
*/ |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
60 |
~GlxDetailsView(); |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
61 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
62 |
/* |
62 | 63 |
* From GlxView |
64 |
* This is called from the view manager before the view is going to Activated. |
|
65 |
*/ |
|
66 |
void initializeView(QAbstractItemModel *model, GlxView *preView); |
|
67 |
||
68 |
/** |
|
69 |
* From GlxView |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
70 |
* This is called from the view manager when the view is going to be activated. |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
71 |
*/ |
62 | 72 |
void activate(); |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
73 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
74 |
/* |
62 | 75 |
* From GlxView |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
76 |
* This is called from the view manager before the view is going to de-activated. |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
77 |
*/ |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
78 |
void resetView(); |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
79 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
80 |
/* |
62 | 81 |
* From GlxView |
82 |
* This is called from the view manager when the view is going to be de-activated. |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
83 |
*/ |
62 | 84 |
void deActivate(); |
85 |
||
44 | 86 |
/* |
62 | 87 |
* From GlxView |
88 |
* Sets the model corresponding to this view. |
|
89 |
* This is called from the view manager before the view is going to Activated. |
|
90 |
* @Param - model is of type GlxMediaModel |
|
91 |
*/ |
|
92 |
void setModel(QAbstractItemModel *model); |
|
93 |
||
94 |
/* |
|
95 |
* //From GlxView |
|
96 |
* This is called from the view manager before the view is going to Activated. |
|
44 | 97 |
* return the view item for animation |
62 | 98 |
*/ |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
99 |
QGraphicsItem * getAnimationItem(GlxEffect transtionEffect); |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
100 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
101 |
private: |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
102 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
103 |
/* |
62 | 104 |
* cleanUp() |
105 |
* cleans up the resources used. |
|
106 |
*/ |
|
107 |
void cleanUp(); |
|
108 |
||
109 |
/* |
|
110 |
* showImage() |
|
111 |
* Retrieves the image from the model and displays the image |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
112 |
*/ |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
113 |
void showImage(); |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
114 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
115 |
/* |
62 | 116 |
* setFavModel |
117 |
* This Function creates the favourite model, to determine if the image is added to favourite. |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
118 |
*/ |
62 | 119 |
void setFavModel(); |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
120 |
|
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
121 |
/* |
62 | 122 |
* initializeNewModel() |
123 |
* Add all the model related connection and data |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
124 |
*/ |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
125 |
void initializeNewModel(); |
62 | 126 |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
127 |
/* |
62 | 128 |
* clearCurrentModel() |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
129 |
* clear all the model releted connection and data |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
130 |
*/ |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
131 |
void clearCurrentModel(); |
44 | 132 |
|
40 | 133 |
/* |
62 | 134 |
* setConnections() |
44 | 135 |
* connects the items to slot to respective signals |
40 | 136 |
*/ |
44 | 137 |
void setConnections(); |
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
138 |
|
44 | 139 |
/* |
62 | 140 |
* clearConnections() |
44 | 141 |
* clear the connections |
142 |
*/ |
|
143 |
void clearConnections(); |
|
62 | 144 |
|
145 |
/** |
|
146 |
* getSubState() |
|
147 |
* This Function retrieves the state of the details view, whether it launched from the Photos app |
|
148 |
* or whether it was launched from other app like File Manager, MMS , Camera ... |
|
149 |
*/ |
|
50 | 150 |
int getSubState(); |
62 | 151 |
|
152 |
private slots: |
|
153 |
||
154 |
/** |
|
155 |
* updateLayout() |
|
156 |
* This Loads the View/Section corresponding to the Orientation. |
|
157 |
* @Param - Orientation , specifies the current Orientation. |
|
158 |
*/ |
|
159 |
void updateLayout(Qt::Orientation); |
|
160 |
||
161 |
/** |
|
162 |
* rowsRemoved() |
|
163 |
* This Slot is called when the item is removed from the model. |
|
164 |
* @Param - parent is of type QModelIndex. |
|
165 |
* @Param - start, this specifies the starting index of the item being removed. |
|
166 |
* @Param - end ,this specifies the ending index of the item being removed. |
|
167 |
*/ |
|
168 |
void rowsRemoved(const QModelIndex &parent, int start, int end); |
|
169 |
||
170 |
/** |
|
171 |
* modelDestroyed() |
|
172 |
* This Slot is called whenever the model is deleted. |
|
173 |
*/ |
|
174 |
void modelDestroyed(); |
|
175 |
||
176 |
/** |
|
177 |
* dataChanged() |
|
178 |
* This Slot is called whenever the data in an existing item changes. |
|
179 |
* @Param - startIndex, this specifies the starting index of the affected items. |
|
180 |
* @Param - endIndex ,this specifies the ending index of the affected items . |
|
181 |
*/ |
|
182 |
void dataChanged(QModelIndex startIndex, QModelIndex endIndex); |
|
183 |
||
184 |
/** |
|
185 |
* refreshDetailsview() |
|
186 |
* This Slot is called when the data shown in details view has to be refreshed. |
|
187 |
*/ |
|
188 |
void refreshDetailsview(); |
|
189 |
||
190 |
/** |
|
191 |
* triggerTheCommand() |
|
192 |
* This Slot is called when the file details has to be changed like file name and description |
|
193 |
* @param - row, The Row specifies the row index of the widget in the list widget of details view. |
|
194 |
*/ |
|
195 |
void triggerTheCommand(int row); |
|
196 |
||
197 |
/** |
|
198 |
* updateFavourites() |
|
199 |
* This Slot is called whenever the image is added to Favourites |
|
200 |
*/ |
|
201 |
void updateFavourites(); |
|
202 |
||
203 |
/** |
|
204 |
* launchShareDialog() |
|
205 |
* This Slot is called when the image has to be sent via services like MMS, Bluetooth,Email... |
|
206 |
*/ |
|
207 |
void launchShareDialog(); |
|
208 |
||
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
209 |
private: |
62 | 210 |
|
211 |
//Contains the thumbnail shown in teh details view. |
|
212 |
HbLabel *mImageBackGround; |
|
213 |
||
40 | 214 |
//Contains the thumbnail shown in teh details view. |
44 | 215 |
HbLabel *mDetailsIcon; |
62 | 216 |
|
217 |
//contains the view instance |
|
218 |
HbView *mView; |
|
40 | 219 |
|
220 |
//Contains the favourite icon which adds or removes the image to favourite folder |
|
52 | 221 |
GlxDetailsIcon *mFavIcon; |
62 | 222 |
|
40 | 223 |
//The media Model to acess the attributes; not owned,dont delete. |
62 | 224 |
QAbstractItemModel *mModel; |
225 |
||
40 | 226 |
//The media Model to acess the attributes whether image is in favourite folder or not;owned by this view |
62 | 227 |
GlxFavMediaModel *mFavModel; |
228 |
||
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
229 |
//The reference to the Main Window |
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
230 |
HbMainWindow *mWindow; |
62 | 231 |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
232 |
int mSelIndex; |
62 | 233 |
|
234 |
//custom Document Loader to load the details view |
|
44 | 235 |
GlxDetailsViewDocLoader *mDocLoader; |
62 | 236 |
|
237 |
//Contains the disabled favourite icon |
|
52 | 238 |
HbIcon mFavIconEnabled; |
62 | 239 |
|
240 |
//Contains the enabled favourite icon |
|
52 | 241 |
HbIcon mFavIconDisabled; |
62 | 242 |
|
243 |
//Contains the List view |
|
244 |
HbListView *mListView; |
|
245 |
||
246 |
//Contains the List model |
|
247 |
GlxDetailsViewModelWrapper *mListModel; |
|
248 |
||
249 |
//holds the share button |
|
250 |
HbPushButton *mShareButton; |
|
251 |
}; |
|
23
74c9f037fd5d
Revision: 201007
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
diff
changeset
|
252 |
#endif //GLXDETAILSVIEW_H |