qtinternetradio/irqcommon/inc/irservicedata.h
branchGCC_SURGE
changeset 13 c9471d26c7f2
parent 12 608f67c22514
equal deleted inserted replaced
9:bfc95e24a059 13:c9471d26c7f2
       
     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 IRSERVICEDATA_H
       
    19 #define IRSERVICEDATA_H
       
    20 
       
    21 #include <QVariant>
       
    22 #include <xqserviceipcmarshal.h>
       
    23 
       
    24 class IrServiceData
       
    25 {
       
    26 public:
       
    27 
       
    28     IrServiceData() : mType(-1) {}
       
    29     IrServiceData(int aType, const QVariant &aData) :
       
    30         mType(aType),
       
    31         mData(aData)
       
    32     {}
       
    33 
       
    34     virtual ~IrServiceData() {}
       
    35 
       
    36     int        mType;
       
    37     QVariant   mData;
       
    38     
       
    39     template <typename Stream> void serialize(Stream &aStream) const;
       
    40     template <typename Stream> void deserialize(Stream &aStream);
       
    41 };
       
    42 
       
    43 template <typename Stream> inline void IrServiceData::serialize(Stream &aStream) const
       
    44 {
       
    45     aStream << mType;
       
    46     aStream << mData;
       
    47 }
       
    48 
       
    49 template <typename Stream> inline void IrServiceData::deserialize(Stream &aStream)
       
    50 {
       
    51     aStream >> mType;
       
    52     aStream >> mData;
       
    53 }
       
    54 
       
    55 
       
    56 typedef QList<IrServiceData> IrServiceDataList;
       
    57 
       
    58 Q_DECLARE_USER_METATYPE(IrServiceData)
       
    59 Q_DECLARE_USER_METATYPE_NO_OPERATORS(IrServiceDataList)
       
    60 
       
    61 
       
    62 #endif // IRSERVICEDATA_H