|
1 /* |
|
2 * Copyright (c) 2006 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: ImumDaMailboxUtilitiesImpl.h |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef C_IMUMDAMAIBOXUTILITIESIMPL_H |
|
20 #define C_IMUMDAMAIBOXUTILITIESIMPL_H |
|
21 |
|
22 #include "ImumDaMailboxUtilities.h" |
|
23 #include "ImumInternalApi.h" |
|
24 #include "ImumInHealthServices.h" |
|
25 |
|
26 class MImumInMailboxUtilities; |
|
27 |
|
28 NONSHARABLE_CLASS( CImumDaMailboxUtilitiesImpl ): public MImumDaMailboxUtilities |
|
29 { |
|
30 public: // Constructors and destructor |
|
31 |
|
32 /** |
|
33 * Create object from CImumDaMailboxUtilitiesImpl |
|
34 * |
|
35 * @since S60 3.2 |
|
36 * @param aMailboxApi, Reference to internal api. |
|
37 * @return, Constructed object |
|
38 */ |
|
39 static CImumDaMailboxUtilitiesImpl* NewL( CImumInternalApi& aMailboxApi ); |
|
40 |
|
41 /** |
|
42 * Creates object from CImumDaMailboxUtilitiesImpl and leaves it to cleanup stack |
|
43 * |
|
44 * @since S60 3.2 |
|
45 * @param aMailboxApi, Reference to internal api. |
|
46 * @return, Constructed object |
|
47 */ |
|
48 static CImumDaMailboxUtilitiesImpl* NewLC( CImumInternalApi& aMailboxApi ); |
|
49 |
|
50 /** |
|
51 * Destructor |
|
52 * @since S60 3.2 |
|
53 */ |
|
54 virtual ~CImumDaMailboxUtilitiesImpl(); |
|
55 |
|
56 protected: // Constructors |
|
57 |
|
58 /** |
|
59 * Default constructor for CImumDaMailboxUtilitiesImpl |
|
60 * |
|
61 * @since S60 3.2 |
|
62 * @param aMailboxApi, Reference to internal api. |
|
63 * @return, Constructed object |
|
64 */ |
|
65 CImumDaMailboxUtilitiesImpl( CImumInternalApi& aMailboxApi ); |
|
66 |
|
67 /** |
|
68 * Symbian 2-phase constructor |
|
69 * @since S60 3.2 |
|
70 */ |
|
71 void ConstructL(); |
|
72 |
|
73 public: //From class MImumDaMailboxUtilities |
|
74 |
|
75 /** |
|
76 * Retrieves the id (sending) of the default mailbox in the system. |
|
77 * |
|
78 * @since S60 v3.2 |
|
79 * @return Id of the default mailbox |
|
80 */ |
|
81 TMsvId DefaultMailboxId() const; |
|
82 |
|
83 /** |
|
84 * Checks if the provided mtm belongs to supported email mtm. |
|
85 * |
|
86 * @since S60 v3.2 |
|
87 * @param aMtm, MTM type to be tested. |
|
88 * @param aAllowExtended, includes additional protocols. |
|
89 * @return |
|
90 */ |
|
91 TBool IsMailMtm( |
|
92 const TUid& aMtm, |
|
93 const TBool& aAllowExtended = EFalse ) const; |
|
94 |
|
95 /** |
|
96 * Checks if the provided id/entry is mailbox. |
|
97 * |
|
98 * @since S60 v3.2 |
|
99 * @param aMailboxId, Id to be tested. |
|
100 * @param aMailbox, Entry to be tested. |
|
101 * @return ETrue, if the entry belongs to mailbox. |
|
102 * @return EFalse, in failures or if the entry doesn't belong to mailbox. |
|
103 */ |
|
104 TBool IsMailbox( |
|
105 const TMsvId aMailboxId ) const; |
|
106 |
|
107 TBool IsMailbox( |
|
108 const TMsvEntry& aMailbox ) const; |
|
109 |
|
110 /** |
|
111 * Gets the entry of the id and and checks that it is mailbox entry. |
|
112 * |
|
113 * @since S60 v3.2 |
|
114 * @param aMailboxId, Id of the mailbox. |
|
115 * @param aType, Type of entry to be retrieved. |
|
116 * @return Entry of the mailbox. |
|
117 * @leave EEntryNotFound, if entry does not exist. |
|
118 * @leave EEntryNotMailbox, if the entry does not belong to mailbox. |
|
119 */ |
|
120 TMsvEntry GetMailboxEntryL( |
|
121 const TMsvId aMailboxId, |
|
122 const TImumDaMboxRequestType& aType = EValueRequestCurrent ) const; |
|
123 |
|
124 /** |
|
125 * Gets all the entries related to mailbox. |
|
126 * |
|
127 * @since S60 v3.2 |
|
128 * @param aMailboxId, Id of the mailbox. |
|
129 * @return Mtm of the receiving entry. |
|
130 */ |
|
131 const TUid& GetMailboxEntriesL( |
|
132 const TMsvId aMailboxId, |
|
133 RMsvEntryArray& aEntries, |
|
134 const TBool aResetArray = ETrue ) const; |
|
135 |
|
136 /** |
|
137 * Checks, if the mailbox of specific id is functional. |
|
138 * |
|
139 * @since S60 v3.2 |
|
140 * @param aMailboxId, Id of the mailbox to be checkd |
|
141 * @return ETrue, when mailbox is functional. |
|
142 * @return EFalse, when mailbox is faulty. |
|
143 */ |
|
144 virtual TBool IsMailboxHealthy( const TMsvId aMailboxId ) const; |
|
145 |
|
146 /** |
|
147 * Returns an array of availble mailboxes in the system. |
|
148 * *** NOTE: Client is responsible to clean the array after usage! *** |
|
149 * |
|
150 * @since S60 v3.2 |
|
151 * @param aTypes, Type of the mailboxes |
|
152 * @return Array of id's of required mailboxes. |
|
153 */ |
|
154 RMailboxIdArray GetMailboxesL( |
|
155 const TInt64 aFlags = |
|
156 MImumInHealthServices::EFlagGetHealthy ) const; |
|
157 |
|
158 private: |
|
159 |
|
160 //Reference to internal Api |
|
161 CImumInternalApi &iMailboxApi; |
|
162 //not owned : shortcut to utilities |
|
163 MImumInMailboxUtilities *iUtils; |
|
164 }; |
|
165 |
|
166 #endif /* C_IMUMDAMAIBOXUTILITIESIMPL_H */ |