|
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: ECom interface for Email Client API |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MEMAILCLIENTAPI_H |
|
20 #define MEMAILCLIENTAPI_H |
|
21 |
|
22 #include <emailapidefs.h> |
|
23 |
|
24 namespace EmailInterface { |
|
25 |
|
26 class MEmailMailbox; |
|
27 |
|
28 |
|
29 typedef RPointerArray<MEmailMailbox> RMailboxPtrArray; |
|
30 |
|
31 /** |
|
32 * Email client main interface for accessing mailboxes and launching |
|
33 * email editor and viewer. |
|
34 * Use CEmailInterfaceFactory::InterfaceL( KEmailClientApiInterface ) |
|
35 * to get instance. Use Release() (from MEmailInterface) when the instance |
|
36 * is no more needed. |
|
37 * |
|
38 */ |
|
39 class MEmailClientApi : public MEmailInterface |
|
40 { |
|
41 public: |
|
42 |
|
43 /** returns mailbox by id, ownership transferred */ |
|
44 virtual MEmailMailbox* MailboxL( const TMailboxId& aId ) = 0; |
|
45 |
|
46 /** |
|
47 * Conveninence method for accessing mailbox by own addresss. |
|
48 */ |
|
49 virtual MEmailMailbox* MailboxL( const TPtrC& aAddress ) = 0; |
|
50 |
|
51 /** |
|
52 * Gets all mailboxes in pointer array. It is recommended to free other |
|
53 * mailboxes besides needed one to optimise memory usage. |
|
54 */ |
|
55 virtual TInt GetMailboxesL( RMailboxPtrArray& aMailboxes ) = 0; |
|
56 |
|
57 /** |
|
58 * Launch policy defines behavior when launching email application |
|
59 */ |
|
60 enum TLaunchPolicy { |
|
61 // Launch email application as from menu application by the user |
|
62 EDefault, |
|
63 // Shows inbox with unseen messages. If there are no unseen messages |
|
64 // behavior is same as EDefault. This one is not currently supported. |
|
65 EShowLastUnseenMailbox |
|
66 }; |
|
67 /** |
|
68 * Launches Email application with defined launch behavior |
|
69 * The method follows "fire and forget" pattern, returns immediately. |
|
70 * @param aPolicy defines behavior for app launch |
|
71 */ |
|
72 virtual void LaunchEmailL( const TLaunchPolicy aPolicy ) = 0; |
|
73 |
|
74 }; |
|
75 |
|
76 } // namespace EmailInterface |
|
77 |
|
78 #endif // MEMAILCLIENTAPI_H |