56
|
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 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef NMAPISETTINGSMANAGER_P_H_
|
|
19 |
#define NMAPISETTINGSMANAGER_P_H_
|
|
20 |
|
|
21 |
|
|
22 |
namespace EmailClientApi
|
|
23 |
{
|
|
24 |
|
|
25 |
class NmApiSettingsManagerPrivate
|
|
26 |
{
|
74
|
27 |
private:
|
|
28 |
class AccountDataCleanUpItem
|
|
29 |
{
|
|
30 |
public:
|
|
31 |
/* CleanupItem class for making sure that all allocated members
|
|
32 |
will be deleted and set to null when load or save function execution
|
|
33 |
stops.
|
|
34 |
*/
|
|
35 |
AccountDataCleanUpItem(CEmailAccounts *&account,
|
|
36 |
CImPop3Settings *&pop3Settings,
|
|
37 |
CImImap4Settings *&imap4Settings,
|
|
38 |
CImSmtpSettings *&smtpSettings,
|
|
39 |
XQSettingsManager *&qSettingsManager
|
|
40 |
)
|
|
41 |
:
|
|
42 |
mAccount(account),
|
|
43 |
mPop3Settings(pop3Settings),
|
|
44 |
mImap4Settings(imap4Settings),
|
|
45 |
mSmtpSettings(smtpSettings),
|
|
46 |
mQSettingsManager(qSettingsManager)
|
|
47 |
{
|
|
48 |
}
|
|
49 |
|
|
50 |
~AccountDataCleanUpItem()
|
|
51 |
{
|
|
52 |
delete mAccount;
|
|
53 |
mAccount = NULL;
|
|
54 |
delete mPop3Settings;
|
|
55 |
mPop3Settings = NULL;
|
|
56 |
delete mImap4Settings;
|
|
57 |
mImap4Settings = NULL;
|
|
58 |
delete mSmtpSettings;
|
|
59 |
mSmtpSettings = NULL;
|
|
60 |
delete mQSettingsManager;
|
|
61 |
mQSettingsManager = NULL;
|
|
62 |
}
|
|
63 |
|
|
64 |
public:
|
|
65 |
CEmailAccounts *&mAccount;
|
|
66 |
CImPop3Settings *&mPop3Settings;
|
|
67 |
CImImap4Settings *&mImap4Settings;
|
|
68 |
CImSmtpSettings *&mSmtpSettings;
|
|
69 |
XQSettingsManager *&mQSettingsManager;
|
|
70 |
};
|
|
71 |
|
56
|
72 |
public:
|
74
|
73 |
NmApiSettingsManagerPrivate();
|
56
|
74 |
~NmApiSettingsManagerPrivate();
|
|
75 |
|
|
76 |
bool load(quint64 mailboxId, NmApiMailboxSettingsData &data);
|
74
|
77 |
bool save(quint64 mailboxId, const NmApiMailboxSettingsData &data);
|
56
|
78 |
|
|
79 |
private:
|
74
|
80 |
|
|
81 |
void fillImapSettingDataL(const NmApiMailboxSettingsData &data);
|
|
82 |
void fillPopSettingDataL(const NmApiMailboxSettingsData &data);
|
|
83 |
void fillSmtpSettingDataL(const NmApiMailboxSettingsData &data,
|
|
84 |
const QVariant settingValue, const int key);
|
|
85 |
|
|
86 |
void writeSettingL(const NmApiMailboxSettingsData &data);
|
|
87 |
void readSettings(NmApiMailboxSettingsData &data);
|
|
88 |
bool readCenRepSettings(NmApiMailboxSettingsData &data);
|
56
|
89 |
QVariant readFromCenRep(quint32 key) const;
|
74
|
90 |
QVariant readFromCenRep(quint32 key, bool &success) const;
|
56
|
91 |
bool writeSettingToCenRep(const NmApiMailboxSettingsData &data);
|
|
92 |
bool writeToCenRep(quint32 key, const QVariant &value) const;
|
74
|
93 |
void setSecurity(CImBaseEmailSettings &settings, QString securityType);
|
|
94 |
|
|
95 |
QString security(CImBaseEmailSettings &settings) const;
|
|
96 |
QString alwaysOnlineState(bool &success) const;
|
|
97 |
bool setAlwaysOnlineState(const QVariant &state);
|
|
98 |
bool calculateMailboxOffset();
|
|
99 |
bool calculateActiveProfileOffset();
|
|
100 |
bool checkAccountTypeL();
|
56
|
101 |
void initAccountL();
|
|
102 |
|
|
103 |
private:
|
|
104 |
|
|
105 |
CEmailAccounts *mAccount;
|
|
106 |
CImPop3Settings *mPop3Settings;
|
|
107 |
CImImap4Settings *mImap4Settings;
|
|
108 |
CImSmtpSettings *mSmtpSettings;
|
74
|
109 |
XQSettingsManager *mQSettingsManager;
|
56
|
110 |
|
|
111 |
TSmtpAccount mSmtpAccount;
|
|
112 |
TImapAccount mImap4Account;
|
|
113 |
TPopAccount mPop3Account;
|
|
114 |
|
|
115 |
QString mMailboxType;
|
|
116 |
qint32 mMailboxOffset;
|
|
117 |
qint32 mActiveProfileOffset;
|
74
|
118 |
|
56
|
119 |
|
|
120 |
quint32 mMailboxId;
|
|
121 |
};
|
|
122 |
|
|
123 |
} //namespace EmailClientApi
|
|
124 |
|
|
125 |
#endif // NMAPISETTINGSMANAGER_P_H_
|