author | Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com> |
Wed, 18 Aug 2010 09:45:25 +0300 | |
changeset 52 | 12db4185673b |
parent 34 | 84197e66a4bd |
child 70 | a15d9966050f |
permissions | -rw-r--r-- |
31 | 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: Main view of unified viewer |
|
15 |
* |
|
16 |
*/ |
|
17 |
||
18 |
#ifndef UNIFIED_VIEWER_H |
|
19 |
#define UNIFIED_VIEWER_H |
|
20 |
||
21 |
#ifdef BUILD_UNI_VIEWER_DLL |
|
22 |
#define UNI_VIEWER_DLL Q_DECL_EXPORT |
|
23 |
#else |
|
24 |
#define UNI_VIEWER_DLL Q_DECL_IMPORT |
|
25 |
#endif |
|
26 |
||
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
27 |
#include <sqldb.h> |
31 | 28 |
#include "msgbaseview.h" |
29 |
||
30 |
#include "convergedmessage.h" |
|
31 |
||
32 |
class UniViewerFeeder; |
|
33 |
class ConvergedMessage; |
|
34 |
class HbScrollArea; |
|
35 |
class UniScrollArea; |
|
36 |
class UniContentsWidget; |
|
37 |
class MessageDeleteAction; |
|
38 |
class HbAction; |
|
39 |
/** |
|
40 |
* Main view of unified viewer. |
|
41 |
*/ |
|
42 |
class UNI_VIEWER_DLL UnifiedViewer : public MsgBaseView |
|
43 |
{ |
|
44 |
Q_OBJECT |
|
45 |
||
46 |
public: |
|
47 |
/** |
|
48 |
* Constructor |
|
49 |
*/ |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
50 |
UnifiedViewer(const qint32 messageId, |
34
84197e66a4bd
Revision: 201021
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
31
diff
changeset
|
51 |
QGraphicsItem *parent = 0); |
31 | 52 |
|
53 |
/** |
|
54 |
* Destructor |
|
55 |
*/ |
|
56 |
~UnifiedViewer(); |
|
57 |
||
58 |
/** |
|
59 |
* Populates the content on the widget |
|
60 |
*/ |
|
61 |
void populateContent(const qint32 messageId, bool update, int msgCount); |
|
62 |
||
63 |
protected: |
|
64 |
||
65 |
/** |
|
66 |
* reimplemented from base class to provide proper geometry for scrolling. |
|
67 |
* @see HbWidget |
|
68 |
*/ |
|
69 |
void resizeEvent(QGraphicsSceneResizeEvent * event); |
|
70 |
||
71 |
private: |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
72 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
73 |
* Check if this message can be forwarded |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
74 |
* @return true, if possible to forward |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
75 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
76 |
bool isForwardOk(); |
31 | 77 |
|
78 |
/** |
|
79 |
* Creates tool bar actions |
|
80 |
* @see HbView |
|
81 |
*/ |
|
82 |
void createToolBar(); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
83 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
84 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
85 |
* Launch Editor for forward, reply, replyall actions |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
86 |
* @param operation, Editor operation e.g. forward, reply etc |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
87 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
88 |
void launchEditor(MsgBaseView::UniEditorOperation operation); |
31 | 89 |
|
90 |
public slots: |
|
91 |
||
92 |
/** |
|
93 |
* Clears the content on the widget |
|
94 |
*/ |
|
95 |
void clearContent(); |
|
96 |
||
97 |
// Used for internal testing will be removed |
|
98 |
void handleFwdAction(); |
|
99 |
||
100 |
/** |
|
101 |
* Handle delete |
|
102 |
*/ |
|
103 |
void handleDeleteAction(); |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
104 |
|
31 | 105 |
private slots: |
106 |
/** |
|
107 |
* This slot is called when sendMessage signal is emitted for a highlighted |
|
108 |
* phone number, from body widget. |
|
109 |
*/ |
|
110 |
void sendMessage(const QString& phoneNumber, const QString& alias = QString()); |
|
111 |
||
112 |
/** |
|
113 |
* This slot is called when delete message dialog is launched. |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
114 |
* @param val selected action value. |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
115 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
116 |
void onDialogDeleteMsg(int val); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
117 |
|
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
118 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
119 |
* Handle reply |
31 | 120 |
*/ |
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
121 |
void handleReplyAction(); |
31 | 122 |
|
52
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
123 |
/** |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
124 |
* Handle reply-all |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
125 |
*/ |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
126 |
void handleReplyAllAction(); |
12db4185673b
Revision: 201031
Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
parents:
34
diff
changeset
|
127 |
|
31 | 128 |
private: |
129 |
||
130 |
/** |
|
131 |
* Feeder object |
|
132 |
* Owned |
|
133 |
*/ |
|
134 |
UniViewerFeeder *mViewFeeder; |
|
135 |
||
136 |
/** |
|
137 |
* HbScrollArea object |
|
138 |
* Owned |
|
139 |
*/ |
|
140 |
UniScrollArea* mScrollArea; |
|
141 |
||
142 |
/** |
|
143 |
* UniContentsWidget object |
|
144 |
* Owned |
|
145 |
*/ |
|
146 |
UniContentsWidget* mContentsWidget; |
|
147 |
||
148 |
/** |
|
149 |
* Contact id |
|
150 |
*/ |
|
151 |
qint32 mContactId; |
|
152 |
||
153 |
/** |
|
154 |
* Message id |
|
155 |
*/ |
|
156 |
qint32 mMessageId; |
|
157 |
||
158 |
/** |
|
159 |
* Message count |
|
160 |
*/ |
|
161 |
int mMsgCount; |
|
162 |
}; |
|
163 |
||
164 |
#endif |
|
165 |
// EOF |