|
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 |
|
27 #include <sqldb.h> |
|
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 */ |
|
50 UnifiedViewer(const qint32 messageId, |
|
51 QGraphicsItem *parent = 0); |
|
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: |
|
72 /** |
|
73 * Check if this message can be forwarded |
|
74 * @return true, if possible to forward |
|
75 */ |
|
76 bool isForwardOk(); |
|
77 |
|
78 /** |
|
79 * Creates tool bar actions |
|
80 * @see HbView |
|
81 */ |
|
82 void createToolBar(); |
|
83 |
|
84 /** |
|
85 * Launch Editor for forward, reply, replyall actions |
|
86 * @param operation, Editor operation e.g. forward, reply etc |
|
87 */ |
|
88 void launchEditor(MsgBaseView::UniEditorOperation operation); |
|
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(); |
|
104 |
|
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. |
|
114 * @param val selected action value. |
|
115 */ |
|
116 void onDialogDeleteMsg(int val); |
|
117 |
|
118 /** |
|
119 * Handle reply |
|
120 */ |
|
121 void handleReplyAction(); |
|
122 |
|
123 /** |
|
124 * Handle reply-all |
|
125 */ |
|
126 void handleReplyAllAction(); |
|
127 |
|
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 |