47
|
1 |
/*
|
|
2 |
* Copyright (c) 2010 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 |
* Email message related operations
|
|
16 |
*/
|
|
17 |
#include <nmapimessagemanager.h>
|
|
18 |
#include <nmapifolder.h>
|
|
19 |
#include <nmapiprivateclasses.h>
|
|
20 |
#include "nmapimessagemanager_p.h"
|
|
21 |
|
|
22 |
|
|
23 |
/*!
|
|
24 |
\class NmApiMessageManager
|
|
25 |
\brief A class for performing various operations on messages.
|
|
26 |
*/
|
|
27 |
|
|
28 |
|
|
29 |
namespace EmailClientApi
|
|
30 |
{
|
|
31 |
|
|
32 |
NmApiMessageManager::NmApiMessageManager(quint64 mailboxId,QObject *parent)
|
|
33 |
:QObject(parent)
|
|
34 |
{
|
|
35 |
d = new NmApiMessageManagerPrivate(mailboxId,this);
|
|
36 |
connect(d, SIGNAL(messagesCopied(int)),this,SIGNAL(messagesCopied(int)));
|
|
37 |
connect(d, SIGNAL(messagesCreated(int)),this,SIGNAL(messagesCreated(int)));
|
|
38 |
connect(d, SIGNAL(messagesMoved(int)),this,SIGNAL(messagesMoved(int)));
|
|
39 |
connect(d, SIGNAL(messagesDeleted(int)),this,SIGNAL(messagesDeleted(int)));
|
|
40 |
}
|
|
41 |
|
|
42 |
NmApiMessageManager::~NmApiMessageManager()
|
|
43 |
{
|
|
44 |
delete d;
|
|
45 |
}
|
|
46 |
|
|
47 |
|
|
48 |
// creates a new email message
|
|
49 |
// signaled with draftMessageCreated(NmApiMessage *message,int result)
|
|
50 |
// * ownership transferred
|
|
51 |
bool NmApiMessageManager::createDraftMessage(const QVariant *initData)
|
|
52 |
{
|
|
53 |
NM_FUNCTION;
|
|
54 |
Q_UNUSED(initData);
|
|
55 |
return false;
|
|
56 |
}
|
|
57 |
|
|
58 |
// creates fw message
|
|
59 |
// signaled with forwardMessageCreated(NmApiMessage *message,int result)
|
|
60 |
// * ownership transferred
|
|
61 |
bool NmApiMessageManager::createForwardMessage(const QVariant *initData)
|
|
62 |
{
|
|
63 |
NM_FUNCTION;
|
|
64 |
Q_UNUSED(initData);
|
|
65 |
return false;
|
|
66 |
}
|
|
67 |
|
|
68 |
// creates reply message
|
|
69 |
// signaled with replyMessageCreated(NmApiMessage *message,int result)
|
|
70 |
// * ownership transferred
|
|
71 |
bool NmApiMessageManager::createReplyMessage(const QVariant *initData,
|
|
72 |
bool replyAll)
|
|
73 |
{
|
|
74 |
NM_FUNCTION;
|
|
75 |
Q_UNUSED(initData);
|
|
76 |
Q_UNUSED(replyAll);
|
|
77 |
return false;
|
|
78 |
}
|
|
79 |
|
|
80 |
/*!
|
|
81 |
\fn moveMessages
|
|
82 |
\param messageIds Id list of source messages.
|
|
83 |
\param sourceFolderId Id of the source folder.
|
|
84 |
\param targetFolderId Id of the target folder.
|
|
85 |
\return true if operation was successfully started.
|
|
86 |
|
|
87 |
Starts async move operation for given messages.
|
|
88 |
Completion signalled with messagesMoved(int result).
|
|
89 |
*/
|
|
90 |
bool NmApiMessageManager::moveMessages(const QList<quint64> messageIds,
|
|
91 |
quint64 sourceFolderId,
|
|
92 |
quint64 targetFolderId)
|
|
93 |
{
|
|
94 |
return d->moveMessages(messageIds,sourceFolderId,targetFolderId);
|
|
95 |
}
|
|
96 |
|
|
97 |
/*!
|
|
98 |
\fn copyMessages
|
|
99 |
\param messageIds Id list of source messages.
|
|
100 |
\param sourceFolder Id of the source folder.
|
|
101 |
\param targetFolder Id of the target folder.
|
|
102 |
\return true if operation was successfully started.
|
|
103 |
|
|
104 |
Starts async copy operation for given messages.
|
|
105 |
Completion signalled with messagesCopied(int result).
|
|
106 |
*/
|
|
107 |
bool NmApiMessageManager::copyMessages(const QList<quint64> messageIds,
|
|
108 |
quint64 sourceFolder,
|
|
109 |
quint64 targetFolder)
|
|
110 |
{
|
|
111 |
return d->copyMessages(messageIds, sourceFolder, targetFolder);
|
|
112 |
}
|
|
113 |
|
|
114 |
// signaled with messageSaved(quint64 messageId, int result)
|
|
115 |
bool NmApiMessageManager::saveMessage(const NmApiMessage &message)
|
|
116 |
{
|
|
117 |
Q_UNUSED(message);
|
|
118 |
return false;
|
|
119 |
}
|
|
120 |
|
|
121 |
// deletes message
|
|
122 |
// signaled with messagesDeleted(int result)
|
|
123 |
bool NmApiMessageManager::deleteMessages(const QList<quint64> messageIds)
|
|
124 |
{
|
|
125 |
Q_UNUSED(messageIds);
|
|
126 |
return false;
|
|
127 |
}
|
|
128 |
|
|
129 |
// starts fetching rest of message body from server
|
|
130 |
// signaled with messageFetched(quint64 messageId, int result)
|
|
131 |
bool NmApiMessageManager::fetch(const NmApiMessage &message)
|
|
132 |
{
|
|
133 |
Q_UNUSED(message);
|
|
134 |
return false;
|
|
135 |
}
|
|
136 |
|
|
137 |
// moves message to outbox. Actual sending time may be immediate or scheduled
|
|
138 |
// signaled with messageSent(quint64 messageId, int result)
|
|
139 |
bool NmApiMessageManager::send(const NmApiMessage &message)
|
|
140 |
{
|
|
141 |
Q_UNUSED(message);
|
|
142 |
return false;
|
|
143 |
}
|
|
144 |
|
|
145 |
// creates new attachment for a message. Currently attachment can be specified as file name (attachmentSpec is QString)
|
|
146 |
// signaled with attachmentCreated(quint64 attachemntId)
|
|
147 |
// *
|
|
148 |
bool NmApiMessageManager::createAttachment(NmApiEmailMessage &message,
|
|
149 |
const QVariant &attachmenSpec)
|
|
150 |
{
|
|
151 |
Q_UNUSED(message);
|
|
152 |
Q_UNUSED(attachmenSpec);
|
|
153 |
return false;
|
|
154 |
}
|
|
155 |
|
|
156 |
// removes attachment from a message
|
|
157 |
// signaled with attachmentRemoved(int result)
|
|
158 |
bool NmApiMessageManager::removeAttachment(NmApiEmailMessage &message,
|
|
159 |
quint64 /*attachmentId*/)
|
|
160 |
{
|
|
161 |
Q_UNUSED(message);
|
|
162 |
return false;
|
|
163 |
}
|
|
164 |
|
|
165 |
} // namespace EmailClientApi
|
|
166 |
|
|
167 |
|