qtmobility/src/messaging/qmessagecontentcontainer_symbian_p.h
changeset 1 2b40d63a9c3d
child 11 06b8e2af4411
equal deleted inserted replaced
0:cfcbf08528c4 1:2b40d63a9c3d
       
     1 /****************************************************************************
       
     2 **
       
     3 ** Copyright (C) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     4 ** All rights reserved.
       
     5 ** Contact: Nokia Corporation (qt-info@nokia.com)
       
     6 **
       
     7 ** This file is part of the Qt Mobility Components.
       
     8 **
       
     9 ** $QT_BEGIN_LICENSE:LGPL$
       
    10 ** No Commercial Usage
       
    11 ** This file contains pre-release code and may not be distributed.
       
    12 ** You may use this file in accordance with the terms and conditions
       
    13 ** contained in the Technology Preview License Agreement accompanying
       
    14 ** this package.
       
    15 **
       
    16 ** GNU Lesser General Public License Usage
       
    17 ** Alternatively, this file may be used under the terms of the GNU Lesser
       
    18 ** General Public License version 2.1 as published by the Free Software
       
    19 ** Foundation and appearing in the file LICENSE.LGPL included in the
       
    20 ** packaging of this file.  Please review the following information to
       
    21 ** ensure the GNU Lesser General Public License version 2.1 requirements
       
    22 ** will be met: http://www.gnu.org/licenses/old-licenses/lgpl-2.1.html.
       
    23 **
       
    24 ** In addition, as a special exception, Nokia gives you certain additional
       
    25 ** rights.  These rights are described in the Nokia Qt LGPL Exception
       
    26 ** version 1.1, included in the file LGPL_EXCEPTION.txt in this package.
       
    27 **
       
    28 ** If you have questions regarding the use of this file, please contact
       
    29 ** Nokia at qt-info@nokia.com.
       
    30 **
       
    31 **
       
    32 **
       
    33 **
       
    34 **
       
    35 **
       
    36 **
       
    37 **
       
    38 ** $QT_END_LICENSE$
       
    39 **
       
    40 ****************************************************************************/
       
    41 #ifndef QMESSAGECONTENTCONTAINER_P_H
       
    42 #define QMESSAGECONTENTCONTAINER_P_H
       
    43 
       
    44 #include "qmessagecontentcontainer.h"
       
    45 #include "qmessage.h"
       
    46 
       
    47 #include <QSharedData>
       
    48 #include <QList>
       
    49 #include <QMultiMap>
       
    50 #include <QDebug>
       
    51 #include <QFile>
       
    52 #include <QFileInfo>
       
    53 #include <eikenv.h>
       
    54 #include <apgcli.h>		// for RApaLsSession
       
    55 #include <utf.h>       	// CnvUtfConverter
       
    56 #include <apmrec.h>		// TDataRecognitionResult
       
    57 
       
    58 QTM_BEGIN_NAMESPACE
       
    59 class QMessageContentContainerPrivate
       
    60 {
       
    61     Q_DECLARE_PUBLIC(QMessageContentContainer)
       
    62 
       
    63 public:
       
    64     
       
    65 
       
    66     QMessageContentContainer *q_ptr;
       
    67     QMessage *_message;
       
    68 
       
    69     bool _available;
       
    70     int _size;
       
    71     QByteArray _type;
       
    72     QByteArray _subType;
       
    73     QByteArray _charset;
       
    74     QByteArray _name;
       
    75     QByteArray _content;
       
    76     QString _textContent;
       
    77     QByteArray _filename;
       
    78     QMessageId _messageId;
       
    79     QMessageContentContainerId _id;
       
    80     QList<QMessageContentContainer> _attachments;
       
    81     QMultiMap<QByteArray, QString>  _header;
       
    82     
       
    83     long int _containingMessageId;
       
    84     unsigned int _attachmentId;
       
    85     
       
    86     QMessageContentContainerPrivate(QMessageContentContainer *contentContainer)
       
    87             :
       
    88             q_ptr(contentContainer), _message(0), _available(false), _size(0),
       
    89             _containingMessageId(0), _attachmentId(0)
       
    90 
       
    91     {
       
    92     }
       
    93 
       
    94     QMessageContentContainerPrivate(const QMessageContentContainerPrivate& other)
       
    95     	: 
       
    96     	q_ptr(other.q_ptr), _message(other._message), _available(other._available),
       
    97     	_size(other._size), _type(other._type), _subType(other._subType),
       
    98     	_charset(other._charset), _name(other._name), _content(other._content),
       
    99     	_textContent(other._textContent), _filename(other._filename), _messageId(other._messageId),
       
   100     	_id(other._id),  _attachments(other._attachments), _header(other._header),
       
   101         _containingMessageId(other._containingMessageId), _attachmentId(other._attachmentId)
       
   102     {
       
   103     }
       
   104 
       
   105     QMessageContentContainerPrivate& operator=(const QMessageContentContainerPrivate &other);
       
   106     
       
   107     bool isMessage() const;
       
   108 
       
   109     void setDerivedMessage(QMessage *derived);
       
   110 
       
   111     void clearContents();
       
   112     
       
   113     QMessageContentContainer* attachment(const QMessageContentContainerId &id);
       
   114     
       
   115     const QMessageContentContainer* attachment(const QMessageContentContainerId &id) const;
       
   116     
       
   117     void setContentType(const QByteArray &type, const QByteArray &subType, const QByteArray &charset);
       
   118 
       
   119     void setContent(const QString &content, const QByteArray &type, const QByteArray &subType, const QByteArray &charset);
       
   120 
       
   121     void setContent(const QByteArray &content, const QByteArray &type, const QByteArray &subType, const QByteArray &charset);
       
   122 
       
   123     void setHeaderField(const QByteArray &name, const QByteArray &value);
       
   124 
       
   125     bool createAttachment(const QString& attachmentPath);
       
   126 
       
   127     QMessageContentContainerId appendContent(QMessageContentContainer& container);
       
   128 
       
   129     QMessageContentContainerId prependContent(QMessageContentContainer& container);
       
   130 
       
   131     static QMessageContentContainerId bodyContentId();
       
   132     
       
   133     static QByteArray attachmentFilename(const QMessageContentContainer& container);
       
   134     
       
   135     static QMessageContentContainer from(long int messageId, unsigned int attachmentId, QByteArray &name,
       
   136                                          QByteArray &mimeType, QByteArray &mimeSubType, int size);
       
   137     
       
   138     static QMessageContentContainerPrivate* implementation(const QMessageContentContainer &container);
       
   139 };
       
   140 
       
   141 QTM_END_NAMESPACE
       
   142 
       
   143 #endif