inc/unidatamodelplugininterface.inl
branchRCL_3
changeset 26 ebe688cedc25
equal deleted inserted replaced
25:fa1df4b99609 26:ebe688cedc25
       
     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: This is the domain header API for general message data model
       
    15  *              plugin behavior
       
    16  */
       
    17 //----------------------------------------------------------------
       
    18 // UniMessageInfo::UniMessageInfo
       
    19 // @see header
       
    20 //----------------------------------------------------------------
       
    21 UniMessageInfo::UniMessageInfo(const QString& filepath, const int size, const QString& mimetype) :
       
    22     mPath(filepath), mMimeType(mimetype), mSize(size), mProtected(false), mCorrupt(false)
       
    23     {
       
    24     
       
    25     
       
    26     }
       
    27 
       
    28 //----------------------------------------------------------------
       
    29 // UniMessageInfo::~UniMessageInfo
       
    30 // @see header
       
    31 //----------------------------------------------------------------
       
    32  UniMessageInfo::~UniMessageInfo()
       
    33     {
       
    34     }
       
    35 
       
    36 //----------------------------------------------------------------
       
    37 // UniMessageInfo::setPath
       
    38 // @see header
       
    39 //----------------------------------------------------------------
       
    40 inline void UniMessageInfo::setPath( const QString& filepath )
       
    41     {
       
    42     mPath = filepath;
       
    43     }
       
    44 
       
    45 //----------------------------------------------------------------
       
    46 // UniMessageInfo::setSize
       
    47 // @see header
       
    48 //----------------------------------------------------------------
       
    49 /*inline void UniMessageInfo::setSize( const int filesize )
       
    50     {
       
    51     mSize = filesize;
       
    52     }
       
    53 */
       
    54 //----------------------------------------------------------------
       
    55 // UniMessageInfo::setMimeType
       
    56 // @see header
       
    57 //----------------------------------------------------------------
       
    58 inline void UniMessageInfo::setMimeType( const QString& mimetype )
       
    59     {
       
    60     mMimeType = mimetype;
       
    61     }
       
    62 
       
    63 //----------------------------------------------------------------
       
    64 // UniMessageInfo::path
       
    65 // @see header
       
    66 //----------------------------------------------------------------
       
    67 inline const QString& UniMessageInfo::path()
       
    68     {
       
    69     return mPath;
       
    70     }
       
    71 
       
    72 //----------------------------------------------------------------
       
    73 // UniMessageInfo::size
       
    74 // @see header
       
    75 //----------------------------------------------------------------
       
    76 inline const int UniMessageInfo::size()
       
    77     {
       
    78     return mSize;
       
    79     }
       
    80 
       
    81 //----------------------------------------------------------------
       
    82 // UniMessageInfo::mimetype
       
    83 // @see header
       
    84 //----------------------------------------------------------------
       
    85 inline const QString& UniMessageInfo::mimetype()
       
    86     {
       
    87     return mMimeType;
       
    88     }
       
    89 
       
    90 //----------------------------------------------------------------
       
    91 // UniMessageInfo::isProtected
       
    92 // @see header
       
    93 //----------------------------------------------------------------
       
    94 inline bool UniMessageInfo::isProtected() const
       
    95     {
       
    96     return mProtected;
       
    97     }
       
    98 
       
    99 //----------------------------------------------------------------
       
   100 // UniMessageInfo::setProtected
       
   101 // @see header
       
   102 //----------------------------------------------------------------
       
   103 inline void UniMessageInfo::setProtected(bool isProtected)
       
   104    {
       
   105    mProtected = isProtected;
       
   106    }
       
   107 
       
   108 //----------------------------------------------------------------
       
   109 // UniMessageInfo::isCorrupted
       
   110 // @see header
       
   111 //----------------------------------------------------------------
       
   112 inline bool UniMessageInfo::isCorrupted() const
       
   113     {
       
   114     return mCorrupt;
       
   115     }
       
   116 
       
   117 //----------------------------------------------------------------
       
   118 // UniMessageInfo::setCorrupted
       
   119 // @see header
       
   120 //----------------------------------------------------------------
       
   121 inline void UniMessageInfo::setCorrupted(bool corrupted)
       
   122     {
       
   123     mCorrupt = corrupted;
       
   124     }
       
   125 
       
   126 //----------------------------------------------------------------
       
   127 // UniMessageInfo::serialize
       
   128 // @see header
       
   129 //----------------------------------------------------------------
       
   130 inline void UniMessageInfo::serialize(
       
   131 		QDataStream &stream) const
       
   132     {
       
   133     stream << mPath;
       
   134     //stream << mSize;
       
   135     stream << mMimeType;
       
   136     }
       
   137 
       
   138 //----------------------------------------------------------------
       
   139 // UniMessageInfo::deserialize
       
   140 // @see header
       
   141 //----------------------------------------------------------------
       
   142 inline void UniMessageInfo::deserialize(
       
   143 		QDataStream &stream)
       
   144     {
       
   145     stream >> mPath;
       
   146     //TODO resolve the problem
       
   147     //stream >> mSize;
       
   148     stream >> mMimeType;
       
   149     }
       
   150 
       
   151 
       
   152 
       
   153