emailservices/emailcommon/inc/CFSMailFolderBase.h
changeset 20 ecc8def7944a
parent 18 578830873419
equal deleted inserted replaced
18:578830873419 20:ecc8def7944a
     1 /*
     1 /*
     2 * Copyright (c) 2007-2008 Nokia Corporation and/or its subsidiary(-ies). 
     2 * Copyright (c) 2007-2009 Nokia Corporation and/or its subsidiary(-ies). 
     3 * All rights reserved.
     3 * All rights reserved.
     4 * This component and the accompanying materials are made available
     4 * This component and the accompanying materials are made available
     5 * under the terms of "Eclipse Public License v1.0"
     5 * under the terms of "Eclipse Public License v1.0"
     6 * which accompanies this distribution, and is available
     6 * which accompanies this distribution, and is available
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
    17 
    17 
    18 
    18 
    19 #ifndef __FSMAILFOLDERBASE_H
    19 #ifndef __FSMAILFOLDERBASE_H
    20 #define __FSMAILFOLDERBASE_H
    20 #define __FSMAILFOLDERBASE_H
    21 
    21 
    22 
       
    23 #include "CFSMailMessage.h"
    22 #include "CFSMailMessage.h"
       
    23 #include "cemailextensionbase.h"
    24 
    24 
    25 // <qmail>
    25 // <qmail>
    26 class NmFolder;
    26 class NmFolder;
    27 class NmFolderPrivate;
    27 class NmFolderPrivate;
    28 // </qmail>
    28 // </qmail>
    31  *  class for handling mailbox folder data
    31  *  class for handling mailbox folder data
    32  *
    32  *
    33  *  @lib FSFWCommonLib
    33  *  @lib FSFWCommonLib
    34  *  @since S60 S60 v3.1
    34  *  @since S60 S60 v3.1
    35  */
    35  */
    36 NONSHARABLE_CLASS ( CFSMailFolderBase ) : public CBase
    36 NONSHARABLE_CLASS ( CFSMailFolderBase ) : public CExtendableEmail
    37 {
    37 {
    38  public:
    38  public:
    39     
    39     
    40     /**
    40     /**
    41      * Two-phased constructor.
    41      * Two-phased constructor.
    42      *
    42      *
    43      * @param aFolderId folder id in plugin containing folder
    43      * @param aFolderId folder id in plugin containing folder
    44      */
    44      */
    45     IMPORT_C static CFSMailFolderBase* NewL( const TFSMailMsgId aFolderId );
    45      IMPORT_C static CFSMailFolderBase* NewL(const TFSMailMsgId aFolderId);
    46     
    46     
    47     /**
    47     /**
    48      * Two-phased constructor.
    48      * Two-phased constructor.
    49      *
    49      *
    50      * @param aFolderId folder id in plugin containing folder
    50      * @param aFolderId folder id in plugin containing folder
    51      */
    51      */
    52     IMPORT_C static CFSMailFolderBase* NewLC( const TFSMailMsgId aFolderId );
    52      IMPORT_C static CFSMailFolderBase* NewLC(const TFSMailMsgId aFolderId);
    53 
    53 
    54     /**
    54     /**
    55      * Destructor.
    55      * Destructor.
    56      *
    56      *
    57      */  
    57      */  
    58     IMPORT_C virtual ~CFSMailFolderBase();
    58      IMPORT_C virtual ~CFSMailFolderBase();
    59 
    59 
    60     /**
    60     /**
    61      * folder id accessor
    61      * folder id accessor
    62      *
    62      *
    63      * @return folder id
    63      * @return folder id
    64      */
    64      */
    65     IMPORT_C TFSMailMsgId GetFolderId() const;
    65      IMPORT_C TFSMailMsgId GetFolderId() const;
    66 
    66 
    67     /**
    67     /**
    68      * parent folder id accessor
    68      * parent folder id accessor
    69      *
    69      *
    70      * @return parent folder id
    70      * @return parent folder id
    71      */
    71      */
    72     IMPORT_C TFSMailMsgId GetParentFolderId() const;
    72      IMPORT_C TFSMailMsgId GetParentFolderId() const;
    73 
    73 
    74     /**
    74     /**
    75      * parent folder id mutator
    75      * parent folder id mutator
    76      *
    76      *
    77      * @param aFolderId parent folder id to be set
    77      * @param aFolderId parent folder id to be set
    78      */
    78      */
    79     IMPORT_C void SetParentFolderId( const TFSMailMsgId aFolderId );
    79      IMPORT_C void SetParentFolderId( const TFSMailMsgId aFolderId );
    80 
    80 
    81     /**
    81     /**
    82      * folder name accessor
    82      * folder name accessor
    83      *
    83      *
    84      * @return folder name
    84      * @return folder name
    85      */
    85      */
    86     IMPORT_C TDesC& GetFolderName() const;
    86      IMPORT_C TDesC& GetFolderName() const;
    87 
    87 
    88     /**
    88     /**
    89      * Folder name mutator. Note ! Some clients may ignore names set for
    89      * Folder name mutator. Note ! Some clients may ignore names set for
    90      * standard folders (TFSFolderType being EFSInbox, EFSOutbox, EFSDraftsFolder,
    90      * standard folders (TFSFolderType being EFSInbox, EFSOutbox, EFSDraftsFolder,
    91      * EFSSentFolder, or EFSDeleted) and display own localized names for them.
    91      * EFSSentFolder, or EFSDeleted) and display own localized names for them.
    92      * E.g. Email UI behaves this way.
    92      * E.g. Email UI behaves this way.
    93      *
    93      *
    94      * @param aFolderName folder name to be set
    94      * @param aFolderName folder name to be set
    95      */
    95      */
    96     IMPORT_C void SetFolderName( const TDesC& aFolderName );
    96      IMPORT_C void SetFolderName(const TDesC& aFolderName);
    97 
    97 
    98     /**
    98     /**
    99      * folder type accessor
    99      * folder type accessor
   100      *
   100      *
   101      * @return folder type
   101      * @return folder type
   102      */
   102      */
   103     IMPORT_C TFSFolderType GetFolderType() const;
   103      IMPORT_C TFSFolderType GetFolderType() const;
   104 
   104 
   105     /**
   105     /**
   106      * folder type mutator
   106      * folder type mutator
   107      *
   107      *
   108      * @param aFolderType folder type to be set
   108      * @param aFolderType folder type to be set
   109      */
   109      */
   110     IMPORT_C void SetFolderType( const TFSFolderType aFolderType );
   110      IMPORT_C void SetFolderType( const TFSFolderType aFolderType );
   111 
   111 
   112     /**
   112     /**
   113      * returns id of mailbox containing this folder
   113      * returns id of mailbox containing this folder
   114      *
   114      *
   115      * @return mailbox id
   115      * @return mailbox id
   116      */
   116      */
   117     IMPORT_C TFSMailMsgId GetMailBoxId() const;
   117      IMPORT_C TFSMailMsgId GetMailBoxId() const;
   118 
   118 
   119     /**
   119     /**
   120      * folder mailbox id mutator
   120      * folder mailbox id mutator
   121      *
   121      *
   122      * @param aMailBoxId mailbox id to be set
   122      * @param aMailBoxId mailbox id to be set
   123      */
   123      */
   124     IMPORT_C void SetMailBoxId( const TFSMailMsgId aMailBoxId );
   124      IMPORT_C void SetMailBoxId( const TFSMailMsgId aMailBoxId );
   125 
   125 
   126     /**
   126     /**
   127      * returns message count contained by this folder
   127      * returns message count contained by this folder
   128      *
   128      *
   129      * @return message count
   129      * @return message count
   130      */
   130      */
   131     IMPORT_C TUint GetMessageCount() const;
   131      IMPORT_C TUint GetMessageCount() const;
   132 
   132 
   133     /**
   133     /**
   134      * returns unread message count contained by this folder
   134      * returns unread message count contained by this folder
   135      *
   135      *
   136      * @return unread message count
   136      * @return unread message count
   137      */
   137      */
   138     IMPORT_C TUint GetUnreadCount() const;
   138      IMPORT_C TUint GetUnreadCount() const;
   139 
   139 
   140     /**
   140     /**
   141      * returns unseen message count contained by this folder
   141      * returns unseen message count contained by this folder
   142      *
   142      *
   143      * @return unseen message count
   143      * @return unseen message count
   144      */
   144      */
   145     IMPORT_C TUint GetUnseenCount() const;
   145      IMPORT_C TUint GetUnseenCount() const;
   146 
   146 
   147     /**
   147     /**
   148      * returns subfolder count contained by this folder
   148      * returns subfolder count contained by this folder
   149      *
   149      *
   150      * @return subfolder count
   150      * @return subfolder count
   151      */
   151      */
   152     IMPORT_C TUint GetSubFolderCount() const;
   152      IMPORT_C TUint GetSubFolderCount() const;
   153 
   153 
   154     /**
   154     /**
   155      * set message count contained by this folder
   155      * set message count contained by this folder
   156      *
   156      *
   157      * @param aMessageCount message count
   157      * @param aMessageCount message count
   158      */
   158      */
   159     IMPORT_C void SetMessageCount( const TUint aMessageCount );
   159      IMPORT_C void SetMessageCount( const TUint aMessageCount );
   160 
   160 
   161     /**
   161     /**
   162      * set unread message count contained by this folder
   162      * set unread message count contained by this folder
   163      *
   163      *
   164      * @param aMessageCount unread message count
   164      * @param aMessageCount unread message count
   165      */
   165      */
   166     IMPORT_C void SetUnreadCount( const TUint aMessageCount );
   166      IMPORT_C void SetUnreadCount( const TUint aMessageCount );
   167 
   167 
   168     /**
   168     /**
   169      * set unseen message count contained by this folder
   169      * set unseen message count contained by this folder
   170      *
   170      *
   171      * @param aMessageCount unseen message count
   171      * @param aMessageCount unseen message count
   172      */
   172      */
   173     IMPORT_C void SetUnseenCount( const TUint aMessageCount );
   173      IMPORT_C void SetUnseenCount( const TUint aMessageCount );
   174 
   174 
   175     /**
   175     /**
   176      * set subfolder count contained by this folder
   176      * set subfolder count contained by this folder
   177      *
   177      *
   178      * @param subfolder count
   178      * @param subfolder count
   179      */
   179      */
   180     IMPORT_C void SetSubFolderCount( const TUint aMessageCount );
   180      IMPORT_C void SetSubFolderCount( const TUint aMessageCount );
   181 
   181 
   182     /**
   182     /**
   183      * blocks copying to this folder from given folder types
   183      * blocks copying to this folder from given folder types
   184      *
   184      *
   185      * @param aFolderTypes blocked folder types
   185      * @param aFolderTypes blocked folder types
   186      * @param aMailBoxStatus mailbox status (online / offline) when
   186      * @param aMailBoxStatus mailbox status (online / offline) when
   187      * blocking is done
   187      * blocking is done
   188      */
   188      */
   189     IMPORT_C void BlockCopyFromL( RArray<TFSFolderType> aFolderTypes, 
   189      IMPORT_C void BlockCopyFromL( RArray<TFSFolderType> aFolderTypes, 
   190                   TFSMailBoxStatus aMailBoxStatus );
   190                                     TFSMailBoxStatus aMailBoxStatus );
   191     /**
   191     /**
   192      * blocks moving to this folder from given folder types
   192      * blocks moving to this folder from given folder types
   193      *
   193      *
   194      * @param aFolderTypes blocked folder types
   194      * @param aFolderTypes blocked folder types
   195      * @param aMailBoxStatus mailbox status (online / offline) when
   195      * @param aMailBoxStatus mailbox status (online / offline) when
   196      * blocking is done
   196      * blocking is done
   197      */
   197      */
   198     IMPORT_C void BlockMoveFromL( RArray<TFSFolderType> aFolderTypes, 
   198      IMPORT_C void BlockMoveFromL( RArray<TFSFolderType> aFolderTypes, 
   199                   TFSMailBoxStatus aMailBoxStatus );
   199                                     TFSMailBoxStatus aMailBoxStatus );
   200 
   200 
   201     // <qmail>
   201     // <qmail>
   202     /**
   202     /**
   203      * returns nmfolder constructed with shared data,
   203      * returns nmfolder constructed with shared data,
   204      * ownership is transferred to caller
   204      * ownership is transferred to caller
   211     /**
   211     /**
   212      * C++ default constructor.
   212      * C++ default constructor.
   213      */
   213      */
   214      CFSMailFolderBase();
   214      CFSMailFolderBase();
   215 
   215 
       
   216 // <qmail>
   216      /**
   217      /**
   217       * Two-phased constructor
   218       * Two-phased constructor
   218       */
   219       */
   219     IMPORT_C void ConstructL( const TFSMailMsgId aFolderId );     
   220     IMPORT_C void ConstructL( const TFSMailMsgId aFolderId );
   220 
   221 // </qmail>  
   221     /**
   222 
   222      * folder id
   223 // <qmail> unnecessary iFolderId member removed </qmail>
   223      */
       
   224     TFSMailMsgId             iFolderId;
       
   225 
   224 
   226     /**
   225     /**
   227      * blocked folders in copying
   226      * blocked folders in copying
   228      */
   227      */
   229     RArray<TFSFolderType>    iCopyOfflineBlocked;
   228      RArray<TFSFolderType>    iCopyOfflineBlocked;
   230     RArray<TFSFolderType>    iCopyOnlineBlocked;
   229      RArray<TFSFolderType>    iCopyOnlineBlocked;
   231 
   230 
   232     /**
   231     /**
   233      * blocked folders in moving
   232      * blocked folders in moving
   234      */
   233      */
   235     RArray<TFSFolderType>    iMoveOfflineBlocked;
   234      RArray<TFSFolderType>    iMoveOfflineBlocked;
   236     RArray<TFSFolderType>    iMoveOnlineBlocked;
   235      RArray<TFSFolderType>    iMoveOnlineBlocked;
   237 
   236 
   238 
   237 
   239 private: // data
   238 private: // data
   240 
   239 
   241     // <qmail>
   240     // <qmail>