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: Services like send, image picker |
|
15 * and contacts fetching functionality handler. |
|
16 * |
|
17 */ |
|
18 |
|
19 #include "msguiutilsmanager.h" |
|
20 #include "msgsendutil.h" |
|
21 #include "msgimagefetcherutil.h" |
|
22 #include "msgaudiofetcherutil.h" |
|
23 #include "msgcontactsutil.h" |
|
24 |
|
25 // System includes |
|
26 #include "debugtraces.h" |
|
27 |
|
28 |
|
29 //--------------------------------------------------------------- |
|
30 // MsgUiUtilsManagerManager::MsgUiUtilsManager |
|
31 // Constructor |
|
32 //-------------------------------------------------------------- |
|
33 MsgUiUtilsManager::MsgUiUtilsManager(QObject* parent): |
|
34 QObject(parent), |
|
35 mSendUtil(NULL), |
|
36 mImageUtil(NULL), |
|
37 mAudioUtil(NULL), |
|
38 mContactsUtil(NULL), |
|
39 mInputBlocker(NULL) |
|
40 { |
|
41 } |
|
42 |
|
43 //--------------------------------------------------------------- |
|
44 // MsgUiUtilsManager::~MsgUiUtilsManager |
|
45 // Desctructor |
|
46 //-------------------------------------------------------------- |
|
47 MsgUiUtilsManager::~MsgUiUtilsManager() |
|
48 { |
|
49 deactivateInputBlocker(); |
|
50 } |
|
51 |
|
52 //--------------------------------------------------------------- |
|
53 // MsgUiUtilsManager::send |
|
54 // @see header file |
|
55 //-------------------------------------------------------------- |
|
56 int MsgUiUtilsManager::send(ConvergedMessage& msg) |
|
57 { |
|
58 if(!mSendUtil) |
|
59 { |
|
60 mSendUtil = new MsgSendUtil(this); |
|
61 } |
|
62 return mSendUtil->send(msg); |
|
63 } |
|
64 |
|
65 //--------------------------------------------------------------- |
|
66 // MsgUiUtilsManager::saveToDrafts |
|
67 // @see header file |
|
68 //-------------------------------------------------------------- |
|
69 TMsvId MsgUiUtilsManager::saveToDrafts(ConvergedMessage& msg) |
|
70 { |
|
71 if(!mSendUtil) |
|
72 { |
|
73 mSendUtil = new MsgSendUtil(this); |
|
74 } |
|
75 return mSendUtil->saveToDrafts(msg); |
|
76 } |
|
77 |
|
78 //--------------------------------------------------------------- |
|
79 // MsgUiUtilsManager::send |
|
80 // @see header file |
|
81 //-------------------------------------------------------------- |
|
82 void MsgUiUtilsManager::fetchImages() |
|
83 { |
|
84 if(!mImageUtil) |
|
85 { |
|
86 mImageUtil = new MsgImageFetcherUtil(this); |
|
87 } |
|
88 mImageUtil->fetchImages(); |
|
89 } |
|
90 |
|
91 |
|
92 //--------------------------------------------------------------- |
|
93 // MsgUiUtilsManager::fetchContacts |
|
94 // @see header file |
|
95 //-------------------------------------------------------------- |
|
96 void MsgUiUtilsManager::fetchContacts() |
|
97 { |
|
98 if(!mContactsUtil) |
|
99 { |
|
100 mContactsUtil = new MsgContactsUtil(this); |
|
101 } |
|
102 mContactsUtil->fetchContacts(); |
|
103 } |
|
104 |
|
105 //--------------------------------------------------------------- |
|
106 // MsgUiUtilsManager::fetchVideo |
|
107 // @see header file |
|
108 //-------------------------------------------------------------- |
|
109 void MsgUiUtilsManager::fetchVideo() |
|
110 { |
|
111 |
|
112 } |
|
113 |
|
114 //--------------------------------------------------------------- |
|
115 // MsgUiUtilsManager::fetchAudio |
|
116 // @see header file |
|
117 //-------------------------------------------------------------- |
|
118 void MsgUiUtilsManager::fetchAudio() |
|
119 { |
|
120 if(!mAudioUtil) |
|
121 { |
|
122 mAudioUtil = new MsgAudioFetcherUtil(this); |
|
123 } |
|
124 mAudioUtil->fetchAudio(); |
|
125 } |
|
126 |
|
127 //--------------------------------------------------------------- |
|
128 // MsgUiUtilsManager::fetchOther |
|
129 // @see header file |
|
130 //-------------------------------------------------------------- |
|
131 void MsgUiUtilsManager::fetchOther() |
|
132 { |
|
133 |
|
134 } |
|
135 |
|
136 //--------------------------------------------------------------- |
|
137 // MsgUiUtilsManager::openContactDetail |
|
138 // @see header file |
|
139 //-------------------------------------------------------------- |
|
140 void MsgUiUtilsManager::openContactDetails(qint32 contactId) |
|
141 { |
|
142 if(!mContactsUtil) |
|
143 { |
|
144 mContactsUtil = new MsgContactsUtil(this); |
|
145 } |
|
146 mContactsUtil->openContactDetails(contactId); |
|
147 } |
|
148 |
|
149 //--------------------------------------------------------------- |
|
150 // MsgUiUtilsManager::activateInputBlocker |
|
151 // @see header file |
|
152 //-------------------------------------------------------------- |
|
153 void MsgUiUtilsManager::activateInputBlocker(QGraphicsWidget* parent) |
|
154 { |
|
155 if(!mInputBlocker) |
|
156 { |
|
157 mInputBlocker = parent; |
|
158 mInputBlocker->grabMouse(); |
|
159 mInputBlocker->grabKeyboard(); |
|
160 } |
|
161 } |
|
162 |
|
163 //--------------------------------------------------------------- |
|
164 // MsgUiUtilsManager::deactivateInputBlocker |
|
165 // @see header file |
|
166 //-------------------------------------------------------------- |
|
167 void MsgUiUtilsManager::deactivateInputBlocker() |
|
168 { |
|
169 if(mInputBlocker) |
|
170 { |
|
171 mInputBlocker->ungrabKeyboard(); |
|
172 mInputBlocker->ungrabMouse(); |
|
173 mInputBlocker = NULL; |
|
174 } |
|
175 } |
|
176 |
|
177 // EOF |
|