emailuis/nmailui/inc/nmattachmentlist.h
branchRCL_3
changeset 63 d189ee25cf9d
equal deleted inserted replaced
61:dcf0eedfc1a3 63:d189ee25cf9d
       
     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: Class for handling the attachment list
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef NMATTACHMENTLIST_H
       
    19 #define NMATTACHMENTLIST_H
       
    20 
       
    21 #include <QObject>
       
    22 #include <QStringList>
       
    23 
       
    24 class NmAttachmentListWidget;
       
    25 class NmId;
       
    26 
       
    27 class NmAttachmentList : public QObject
       
    28 {
       
    29     Q_OBJECT
       
    30 public:
       
    31     NmAttachmentList(NmAttachmentListWidget &listWidget);
       
    32     ~NmAttachmentList();
       
    33     int insertAttachment(const QString &fullFileName,
       
    34                          const QString &fileSize,
       
    35                          const NmId &attachmentPartId);
       
    36     void setAttachmentPartId(const QString fullFileName, const NmId &attachmentPartId);
       
    37     void setAttachmentSize(const NmId &attachmentPartId, const QString &size);
       
    38     void removeAttachment(int arrayIndex);
       
    39     void removeAttachment(const QString &fullFileName);
       
    40     void removeAttachment(const NmId &attachmentPartId);
       
    41     NmAttachmentListWidget &listWidget();
       
    42     void clearList();
       
    43     int count();
       
    44     NmId nmIdByIndex(int listIndex);
       
    45     int indexByNmId(const NmId &id);
       
    46     QString getFullFileNameByIndex(int arrayIndex);
       
    47 
       
    48 private:
       
    49     QString fullNameToDisplayName(const QString &fullName);
       
    50     
       
    51 signals:
       
    52     void attachmentListLayoutChanged();
       
    53     
       
    54 private:
       
    55     NmAttachmentListWidget &mListWidget; // Not owned
       
    56     QStringList mFullFileName;
       
    57     QStringList mDisplayFileName;
       
    58     QStringList mFileSize;
       
    59     QList<NmId> mAttachmentPartId;
       
    60 };
       
    61 
       
    62 #endif // NMATTACHMENTLIST_H