emailservices/emailclientapi/inc/emailfolder.h
changeset 47 f83bd4ae1fe3
child 62 a8c646b56683
equal deleted inserted replaced
45:780f926bc26c 47:f83bd4ae1fe3
       
     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: CEmailMailbox.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CEMAILFOLDER_H
       
    19 #define CEMAILFOLDER_H
       
    20 
       
    21 #include <emailapidefs.h>
       
    22 #include "cfsmailcommon.h"
       
    23 #include <memailfolder.h>
       
    24 #include "mfsmaileventobserver.h"
       
    25 
       
    26 using namespace EmailInterface;
       
    27 
       
    28 class CFSMailPlugin;
       
    29 class CPluginData;
       
    30 class CFSMailFolder;
       
    31 class EmailInterface::MMessageIterator;
       
    32 
       
    33 NONSHARABLE_CLASS( CEmailFolder ) : 
       
    34     public CBase, 
       
    35     public MEmailFolder
       
    36 {
       
    37 public:
       
    38     
       
    39     static CEmailFolder* NewLC( 
       
    40         CPluginData& aPluginData,
       
    41         const TFolderId& aFolderId,
       
    42         CFSMailFolder *aFolder );
       
    43     
       
    44     static CEmailFolder* NewL( 
       
    45         CPluginData& aPluginData,
       
    46         const TFolderId& aFolderId,
       
    47         CFSMailFolder *aFolder );
       
    48 
       
    49     ~CEmailFolder();           
       
    50 
       
    51 public: // from MEmailInterface
       
    52     TEmailTypeId InterfaceId() const;
       
    53     
       
    54     void Release();
       
    55     
       
    56 public:    // from MEmailFolder
       
    57     TFolderId FolderId() const;
       
    58     
       
    59     TFolderId ParentFolderId() const;
       
    60     
       
    61     TFolderType FolderType() const;    
       
    62 
       
    63     TPtrC Name() const;
       
    64 
       
    65     /**
       
    66     * Returns direct childs of this folder, i.e. this is not recursive.
       
    67     * @return number of subfolders or an error code
       
    68     */    
       
    69     TInt GetSubfoldersL( 
       
    70         RFolderArray& aSubfolders ) const;
       
    71 
       
    72     EmailInterface::MMessageIterator* MessagesL( 
       
    73         const RSortCriteriaArray& aCriteria );
       
    74     
       
    75     void DeleteMessagesL( const REmailMessageIdArray& aMessageIds );
       
    76     
       
    77 private: // constructors
       
    78     CEmailFolder( CPluginData& aPluginData, const TFolderId& aFolderId, CFSMailFolder *aFolder );
       
    79     
       
    80     void ConstructL();
       
    81 
       
    82 private: // Internal methods
       
    83     static void ToFsSortCriteriaL( 
       
    84         const RSortCriteriaArray& aSortCriteria, 
       
    85         RArray<TFSMailSortCriteria>& aFsCriteria );
       
    86 
       
    87 private:
       
    88     CPluginData&    iPluginData;
       
    89     
       
    90     CFSMailPlugin*  iPlugin;
       
    91 
       
    92     TFolderType     iFolderType;
       
    93        
       
    94     TFolderId       iFolderId;
       
    95     
       
    96     TFolderId       iParentId;
       
    97     
       
    98     CFSMailFolder   *iFolder;
       
    99 };
       
   100     
       
   101 #endif // CEMAILFOLDER_H
       
   102 
       
   103 // End of file