|
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: |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef CNTIMAGEEDITORVIEW_H |
|
19 #define CNTIMAGEEDITORVIEW_H |
|
20 |
|
21 #include <QObject> |
|
22 #include <cntdocumentloader.h> |
|
23 #include <xqappmgr.h> |
|
24 |
|
25 #include <cntabstractview.h> |
|
26 |
|
27 class CntImageLabel; |
|
28 class HbListView; |
|
29 class XQAiwRequest; |
|
30 class HbAction; |
|
31 class QStandardItemModel; |
|
32 class QModelIndex; |
|
33 class CntSaveManager; |
|
34 |
|
35 QTM_BEGIN_NAMESPACE |
|
36 class QContact; |
|
37 class QContactAvatar; |
|
38 QTM_END_NAMESPACE |
|
39 |
|
40 QTM_USE_NAMESPACE |
|
41 |
|
42 class CntImageEditorView : public QObject, public CntAbstractView |
|
43 { |
|
44 Q_OBJECT |
|
45 |
|
46 public: |
|
47 CntImageEditorView(); |
|
48 ~CntImageEditorView(); |
|
49 |
|
50 public: // From CntAbstractView |
|
51 void activate( const CntViewParameters aArgs ); |
|
52 void deactivate(); |
|
53 bool isDefault() const { return false; } |
|
54 HbView* view() const { return mView; } |
|
55 int viewId() const { return imageEditorView; } |
|
56 inline void setEngine( CntAbstractEngine& aEngine ){ mEngine = &aEngine; } |
|
57 #ifdef PBK_UNIT_TEST |
|
58 public: |
|
59 #else |
|
60 private: |
|
61 #endif |
|
62 void populateModel(QStandardItemModel *model); |
|
63 void openCamera(); |
|
64 void openGallery(); |
|
65 |
|
66 #ifdef PBK_UNIT_TEST |
|
67 public slots: |
|
68 #else |
|
69 private slots: |
|
70 #endif |
|
71 void showPreviousView(); |
|
72 void removeImage(); |
|
73 void handleImageChange(const QVariant &value); |
|
74 void thumbnailReady( const QPixmap& pixmap, void *data, int id, int error ); |
|
75 void setOrientation(Qt::Orientation orientation); |
|
76 void listViewActivated(const QModelIndex &index); |
|
77 void handleError(int errorCode, const QString& errorMessage); |
|
78 void saveContact(); |
|
79 |
|
80 |
|
81 #ifdef PBK_UNIT_TEST |
|
82 public: |
|
83 #else |
|
84 private: |
|
85 #endif |
|
86 QContact *mContact; // own |
|
87 QContactAvatar *mAvatar; // own |
|
88 CntImageLabel *mImageLabel; // owned by layout |
|
89 XQAiwRequest *mRequest; // own |
|
90 XQApplicationManager mAppManager; |
|
91 CntThumbnailManager *mThumbnailManager; // own |
|
92 HbView *mView; // own |
|
93 HbAction *mSoftkey; // owned by view |
|
94 HbAction *mRemoveImage; // own |
|
95 CntAbstractViewManager *mViewManager; |
|
96 CntDocumentLoader mDocumentLoader; |
|
97 HbListView *mListView; // owned by layout |
|
98 QStandardItemModel *mModel; // own |
|
99 CntSaveManager *mSaveManager; // own |
|
100 |
|
101 CntViewParameters mArgs; |
|
102 CntAbstractEngine* mEngine; |
|
103 }; |
|
104 |
|
105 #endif // CNTIMAGEEDITORVIEW_H |