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: Email message API
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
#ifndef _M_EMAILFOLDER
|
|
19 |
#define _M_EMAILFOLDER
|
|
20 |
|
|
21 |
#include <emailapidefs.h>
|
|
22 |
#include <emailsorting.h>
|
|
23 |
|
|
24 |
namespace EmailInterface {
|
|
25 |
|
|
26 |
class MEmailFolder;
|
|
27 |
class MMessageIterator;
|
|
28 |
|
|
29 |
typedef RPointerArray<MEmailFolder> RFolderArray;
|
|
30 |
|
|
31 |
/**
|
|
32 |
* folder types
|
|
33 |
*/
|
|
34 |
enum TFolderType
|
|
35 |
{
|
|
36 |
EInbox,
|
|
37 |
EOutbox,
|
|
38 |
EDrafts,
|
|
39 |
EDeleted,
|
|
40 |
ESent,
|
|
41 |
EOther
|
|
42 |
};
|
|
43 |
|
|
44 |
/**
|
|
45 |
* Email folder interface
|
|
46 |
* This is used for accessing folder information and included messages.
|
|
47 |
* Operations affecting folder itself are not provided.
|
|
48 |
*
|
|
49 |
* Use case: for accessing messages in specific folder use MEmailMessageQuery
|
|
50 |
* and set folder id with MEmailMessageQuery::SetFolderIdL()
|
|
51 |
*
|
|
52 |
* @since S60 v5.0
|
|
53 |
*/
|
|
54 |
class MEmailFolder : public MEmailInterface
|
|
55 |
{
|
|
56 |
public:
|
|
57 |
/**
|
|
58 |
* Returns folder id.
|
|
59 |
* @return folder type
|
|
60 |
*/
|
|
61 |
virtual TFolderId FolderId() const = 0;
|
|
62 |
|
|
63 |
/**
|
|
64 |
* Returns parent folder id.
|
|
65 |
* @return parent folder id
|
|
66 |
*/
|
|
67 |
virtual TFolderId ParentFolderId() const = 0;
|
|
68 |
|
|
69 |
/**
|
|
70 |
* Returns folder type.
|
|
71 |
* @return folder type
|
|
72 |
*/
|
|
73 |
virtual TFolderType FolderType() const = 0;
|
|
74 |
|
|
75 |
/**
|
|
76 |
* Returns folder name.
|
|
77 |
* @return folder name pointer descriptor
|
|
78 |
*/
|
|
79 |
virtual TPtrC Name() const = 0;
|
|
80 |
|
|
81 |
/**
|
|
82 |
* Returns direct children of this folder, i.e. this is not recursive.
|
|
83 |
* @return number of subfolders or an error code
|
|
84 |
*/
|
|
85 |
virtual TInt GetSubfoldersL(
|
|
86 |
RFolderArray& aSubfolders ) const = 0;
|
|
87 |
|
|
88 |
/**
|
|
89 |
* Returns message iterator for iterating messages in the folder
|
|
90 |
* @param aSortCriteria sort criteria
|
|
91 |
* @return message iterator
|
|
92 |
*/
|
|
93 |
virtual EmailInterface::MMessageIterator* MessagesL(
|
|
94 |
const RSortCriteriaArray& aCriteria ) = 0;
|
|
95 |
|
|
96 |
/**
|
|
97 |
* Deletes messages in this folder
|
|
98 |
* @param aMessageIds messages to delete. This method is no-op if
|
|
99 |
* array is empty. It is expected that messages in the array are
|
|
100 |
* located in same folder or KErrArgument exception is raised.
|
|
101 |
*/
|
|
102 |
virtual void DeleteMessagesL( const REmailMessageIdArray& aMessageIds ) = 0;
|
|
103 |
};
|
|
104 |
|
|
105 |
} // namespace EmailInterface
|
|
106 |
|
|
107 |
#endif // _M_EMAILFOLDER
|