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:Message send functionality handler. |
|
15 * |
|
16 */ |
|
17 |
|
18 #ifndef MSGUI_UTILS_MANAGER_H |
|
19 #define MSGUI_UTILS_MANAGER_H |
|
20 |
|
21 #include <QObject> |
|
22 |
|
23 #ifdef BUILD_MSGUI_UTILS_DLL |
|
24 #define MSGUI_UTILS_DLL_EXPORT Q_DECL_EXPORT |
|
25 #else |
|
26 #define MSGUI_UTILS_DLL_EXPORT Q_DECL_IMPORT |
|
27 #endif |
|
28 |
|
29 #include <msvstd.h> |
|
30 #include <QGraphicsWidget> |
|
31 #include "convergedmessageaddress.h" |
|
32 |
|
33 class ConvergedMessage; |
|
34 class MsgSendUtil; |
|
35 class MsgImageFetcherUtil; |
|
36 class MsgAudioFetcherUtil; |
|
37 class MsgContactsUtil; |
|
38 |
|
39 /** |
|
40 * This class manages the msgui services like send, image picker |
|
41 * and contacts functionality. |
|
42 * |
|
43 */ |
|
44 class MSGUI_UTILS_DLL_EXPORT MsgUiUtilsManager : public QObject |
|
45 { |
|
46 Q_OBJECT |
|
47 |
|
48 public: |
|
49 /** |
|
50 * Constructor |
|
51 */ |
|
52 MsgUiUtilsManager(QObject* parent =0); |
|
53 |
|
54 /** |
|
55 * Destructor |
|
56 */ |
|
57 ~MsgUiUtilsManager(); |
|
58 |
|
59 |
|
60 public slots: |
|
61 /** |
|
62 * Send message |
|
63 * @param msg Message to be sent |
|
64 * @return KErrNone if send is successful, |
|
65 * KErrNotFound if settings are not available, |
|
66 * KErrGeneral for other cases |
|
67 */ |
|
68 int send(ConvergedMessage& msg); |
|
69 |
|
70 /** |
|
71 * Save message to drafts |
|
72 * @param msg Message to be sent |
|
73 * @return true if message is saved to drafts |
|
74 */ |
|
75 TMsvId saveToDrafts(ConvergedMessage& msg); |
|
76 |
|
77 /** |
|
78 * Fetch images |
|
79 */ |
|
80 void fetchImages(); |
|
81 |
|
82 /** |
|
83 * Fectch conatcts |
|
84 */ |
|
85 void fetchContacts(); |
|
86 |
|
87 /** |
|
88 * Fectch videos |
|
89 */ |
|
90 void fetchVideo(); |
|
91 |
|
92 /** |
|
93 * Fectch audio |
|
94 */ |
|
95 void fetchAudio(); |
|
96 |
|
97 /** |
|
98 * Fectch others |
|
99 */ |
|
100 void fetchOther(); |
|
101 |
|
102 /* |
|
103 * Open Contact Details |
|
104 * @param contactId Conatct Id |
|
105 */ |
|
106 void openContactDetails(qint32 contactId); |
|
107 |
|
108 /** |
|
109 * Activate Input Blocker |
|
110 * @param parent User should ensure that parent is of non-input |
|
111 * type e.g. view |
|
112 */ |
|
113 void activateInputBlocker(QGraphicsWidget* parent); |
|
114 |
|
115 /** |
|
116 * Deactivate Input Blocker |
|
117 */ |
|
118 void deactivateInputBlocker(); |
|
119 |
|
120 signals: |
|
121 |
|
122 /** |
|
123 * Signal emitted when images are fetched from gallary |
|
124 * @param images |
|
125 */ |
|
126 |
|
127 void imagesFetched(const QVariant& images); |
|
128 |
|
129 /** |
|
130 * Signal emitted when audios are fetched from gallary |
|
131 * @param audio files |
|
132 */ |
|
133 void audiosFetched(const QVariant& audios); |
|
134 |
|
135 /** |
|
136 * Signal emitted when contacts are fetched from phonebook. |
|
137 * @param contacts The list of contacts. |
|
138 */ |
|
139 |
|
140 void contactsFetched(const QVariant& contacts); |
|
141 /** |
|
142 * Signal emitted when an error is generated. |
|
143 * @param error The error as a string to be displayed on the screen. |
|
144 */ |
|
145 |
|
146 void serviceError(const QString& error); |
|
147 |
|
148 private: |
|
149 |
|
150 /** |
|
151 * Send Utility |
|
152 * Own |
|
153 */ |
|
154 MsgSendUtil* mSendUtil; |
|
155 |
|
156 /** |
|
157 * Image Fetcher |
|
158 * Own |
|
159 */ |
|
160 MsgImageFetcherUtil* mImageUtil; |
|
161 |
|
162 /** |
|
163 * Image Fetcher |
|
164 * Own |
|
165 */ |
|
166 MsgAudioFetcherUtil* mAudioUtil; |
|
167 |
|
168 /** |
|
169 * Conatcts Fetcher |
|
170 * Own |
|
171 */ |
|
172 MsgContactsUtil* mContactsUtil; |
|
173 |
|
174 /** |
|
175 * Input Blocker |
|
176 * Not owned |
|
177 */ |
|
178 QGraphicsWidget* mInputBlocker; |
|
179 |
|
180 }; |
|
181 |
|
182 #endif // MSGUI_UTILS_MANAGER_H |
|
183 |
|
184 // EOF |
|