email_plat/nmail_client_api/nmapifolder.h
changeset 18 578830873419
child 20 ecc8def7944a
equal deleted inserted replaced
4:e7aa27f58ae1 18:578830873419
       
     1 /*
       
     2  * Copyright (c) 2009 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:
       
    15  *
       
    16  */
       
    17 
       
    18 #ifndef NMAPIFOLDERINFO_H
       
    19 #define NMAPIFOLDERINFO_H
       
    20 
       
    21 #include <QString>
       
    22 #include <QExplicitlySharedDataPointer>
       
    23 #include <QList>
       
    24 #include "nmenginedef.h"
       
    25 
       
    26 /**
       
    27  * Mailbox metadata class
       
    28  */
       
    29 namespace EmailClientApi
       
    30 {
       
    31 
       
    32 enum EmailFolderType
       
    33 {
       
    34     Inbox, Drafts, Outbox, Sent, Deleted, EOther
       
    35 };
       
    36 
       
    37 enum
       
    38 {
       
    39     GeneralError = -1, NotSupportedError
       
    40 };
       
    41 
       
    42 class NmFolderPrivate : public QSharedData
       
    43 {
       
    44 public:
       
    45     NmFolderPrivate();
       
    46     virtual ~NmFolderPrivate();
       
    47 
       
    48     quint64 id;
       
    49     QString name;
       
    50     EmailFolderType folderType;
       
    51     quint64 parentId;
       
    52     QList<quint64> childFolderIds;
       
    53 };
       
    54 
       
    55 class NMENGINE_EXPORT NmFolder
       
    56 {
       
    57 public:
       
    58     /*
       
    59      * constructor for NmFolder class
       
    60      */
       
    61     NmFolder();
       
    62     /*
       
    63      * destructor for NmFolder class
       
    64      */
       
    65     ~NmFolder();
       
    66 
       
    67     /*
       
    68      * getter for id
       
    69      */
       
    70     quint64 id() const;
       
    71 
       
    72     /*
       
    73      * getter for name 
       
    74      */
       
    75     QString name() const;
       
    76 
       
    77     /*
       
    78      * getter for foldertype
       
    79      */
       
    80     EmailFolderType folderType() const;
       
    81 
       
    82     /*
       
    83      * setter for id
       
    84      */
       
    85     void setId(quint64 id);
       
    86 
       
    87     /*
       
    88      * setter for name
       
    89      */
       
    90     void setName(const QString& name);
       
    91 
       
    92     /*
       
    93      * setter for foldertype
       
    94      */
       
    95     void setFolderType(EmailFolderType folderType);
       
    96 
       
    97     /*
       
    98      * seter for childfolder ids
       
    99      */
       
   100     void setChildFolderIds(QList<quint64> &childFolderIds);
       
   101 
       
   102     /*
       
   103      * seter for childfolder ids
       
   104      */
       
   105     void setParentFolderId(quint64 parentId);
       
   106 
       
   107     /*
       
   108      * returns child folder ids.
       
   109      * to be implemented later when nmail functionality is available
       
   110      */
       
   111     void childFolderIds(QList<quint64> &childFolderIds);
       
   112 
       
   113     /*
       
   114      * returns parent folder id.
       
   115      * 
       
   116      */
       
   117     quint64 parentFolderId() const;
       
   118 
       
   119 private:
       
   120     QExplicitlySharedDataPointer<NmFolderPrivate> d;
       
   121 };
       
   122 
       
   123 }
       
   124 #endif