32 /** |
32 /** |
33 * Utility class for FS mailbox |
33 * Utility class for FS mailbox |
34 */ |
34 */ |
35 NONSHARABLE_CLASS( CESMRFsMailboxUtils ): public CBase |
35 NONSHARABLE_CLASS( CESMRFsMailboxUtils ): public CBase |
36 { |
36 { |
37 |
37 public: |
|
38 |
|
39 /** |
|
40 * Enumeration for mailbox capabilities |
|
41 */ |
|
42 enum TMRMailboxCapability |
|
43 { |
|
44 EMRCapabilityAttachment |
|
45 }; |
|
46 |
38 public: // Constructors and destructors |
47 public: // Constructors and destructors |
39 |
48 |
40 /** |
49 /** |
41 * Constructs CESMRFsMailboxUtils object. |
50 * Constructs CESMRFsMailboxUtils object. |
42 * |
51 * |
43 * @param aMailboxUtils Reference to S60 mailbox utils |
52 * @param aMailboxUtils Reference to S60 mailbox utils |
44 * @return instantiated object, ownership transferred |
53 * @return instantiated object, ownership transferred |
45 */ |
54 */ |
46 static CESMRFsMailboxUtils* NewL( |
55 IMPORT_C static CESMRFsMailboxUtils* NewL( |
47 CMRMailboxUtils& aMailboxUtils ); |
56 CMRMailboxUtils& aMailboxUtils ); |
48 |
57 |
49 /** |
58 /** |
50 * C++ Destructor. |
59 * C++ Destructor. |
51 */ |
60 */ |
52 ~CESMRFsMailboxUtils(); |
61 IMPORT_C ~CESMRFsMailboxUtils(); |
53 |
62 |
54 public: // New functions |
63 public: // New functions |
55 |
64 |
56 /** |
65 /** |
57 * If phone owner field hasn't been set so far, this method compares |
66 * If phone owner field hasn't been set so far, this method compares |
64 * |
73 * |
65 * @param aCalEntry entry to modify |
74 * @param aCalEntry entry to modify |
66 * @param aPrimaryBox primary mailbox for matching, if applicable |
75 * @param aPrimaryBox primary mailbox for matching, if applicable |
67 * @return KErrNone or a system wide error code |
76 * @return KErrNone or a system wide error code |
68 */ |
77 */ |
69 TInt SetPhoneOwnerL( |
78 IMPORT_C TInt SetPhoneOwnerL( |
70 CCalEntry& aCalEntry, |
79 CCalEntry& aCalEntry, |
71 TMsvId aPrimaryBox = KMsvNullIndexEntryId ); |
80 TMsvId aPrimaryBox = KMsvNullIndexEntryId ); |
72 |
81 |
73 /** |
82 /** |
74 * If phone owner field hasn't been set so far, this method compares |
83 * If phone owner field hasn't been set so far, this method compares |
75 * mailboxowner's email address to organizer field and if no match |
84 * mailboxowner's email address to organizer field and if no match |
76 * was found compares each attendee to the mailboxowner's email address. |
85 * was found compares each attendee to the mailboxowner's email address. |
77 * If match was found, phone owner field is set, otherwise KErrNotFound |
86 * If match was found, phone owner field is set, otherwise KErrNotFound |
78 * is returned. |
87 * is returned. |
79 * |
88 * |
80 * @param aCalEntry entry to modify |
89 * @param aCalEntry entry to modify |
81 * @param aPrimaryBox primary mailbox for matching, if applicable |
90 * @param aPrimaryBox primary mailbox for matching, if applicable |
82 * @return KErrNone or a system wide error code |
91 * @return KErrNone or a system wide error code |
83 */ |
92 */ |
84 TInt SetPhoneOwnerL( |
93 IMPORT_C TInt SetPhoneOwnerL( |
85 CCalEntry& aCalEntry, |
94 CCalEntry& aCalEntry, |
86 CFSMailClient& aMailClient, |
95 CFSMailClient& aMailClient, |
87 CFSMailMessage& aMailMessage ); |
96 CFSMailMessage& aMailMessage ); |
88 |
97 |
89 /** |
98 /** |
90 * Resolves the plugin to be used to current calendar entry. |
99 * Resolves the plugin to be used to current calendar entry. |
91 * Method retrieves phone owner from calendar entry and loops all |
100 * Method retrieves phone owner from calendar entry and loops all |
92 * FS Email mailboxes. |
101 * FS Email mailboxes. |
93 * @param aEntry Reference to calendar entry. |
102 * @param aEntry Reference to calendar entry. |
94 * @return Plugin ID for FS Email mailbox |
103 * @return Plugin ID for FS Email mailbox |
95 */ |
104 */ |
96 TESMRMailPlugin FSEmailPluginForEntryL( const CCalEntry& aEntry ); |
105 IMPORT_C TESMRMailPlugin FSEmailPluginForEntryL( |
|
106 const CCalEntry& aEntry ); |
97 |
107 |
98 /** |
108 /** |
99 * Resolves the mail box for current calendar entry. |
109 * Tests if default mailbox supports certain capability. |
100 * Method retrieves phone owner from calendar entry and loops all |
110 * @param aCapability Capability to be tested |
101 * FS Email mailboxes. |
111 * @return ETrue if success, EFalse otherwise |
102 * @param aEntry Reference to calendar entry. |
|
103 * @return ID of the FS Email mailbox |
|
104 */ |
112 */ |
105 TFSMailMsgId FSEmailMailBoxForEntryL( const CCalEntry& aEntry ); |
113 IMPORT_C TBool DefaultMailboxSupportCapabilityL( |
|
114 TMRMailboxCapability aCapability ); |
106 |
115 |
107 private: // Implementation |
116 private: // Implementation |
108 CESMRFsMailboxUtils( |
117 CESMRFsMailboxUtils( |
109 CMRMailboxUtils& aMailboxUtils ); |
118 CMRMailboxUtils& aMailboxUtils ); |
110 void ConstructL(); |
119 void ConstructL(); |
114 TInt& aMatchIndex ); |
123 TInt& aMatchIndex ); |
115 TBool IsPhoneOwnerL( |
124 TBool IsPhoneOwnerL( |
116 const CCalUser& aUser, |
125 const CCalUser& aUser, |
117 const RPointerArray<CFSMailBox>& aMailBoxes, |
126 const RPointerArray<CFSMailBox>& aMailBoxes, |
118 TInt& aMatchIndex ); |
127 TInt& aMatchIndex ); |
|
128 |
|
129 CFSMailClient& MailClientL(); |
|
130 CFSMailBox* DefaultMailboxL(); |
119 |
131 |
120 CFSMailClient& MailClientL(); |
|
121 |
|
122 private: // Data |
132 private: // Data |
123 /// Ref: Reference to S60 mailbox utilities |
133 /// Ref: Reference to S60 mailbox utilities |
124 CMRMailboxUtils& iMRMailboxUtils; |
134 CMRMailboxUtils& iMRMailboxUtils; |
125 /// Own: Mail client object |
135 /// Own: Mail client object |
126 CFSMailClient* iMailClient; |
136 CFSMailClient* iMailClient; |