common/radionotificationdata.h
branchRCL_3
changeset 19 cce62ebc198e
equal deleted inserted replaced
18:1a6714c53019 19:cce62ebc198e
       
     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 RADIONOTIFICATIONDATA_H
       
    19 #define RADIONOTIFICATIONDATA_H
       
    20 
       
    21 // System includes
       
    22 #include <QVariant>
       
    23 
       
    24 class RadioNotificationData
       
    25 {
       
    26 public:
       
    27 
       
    28     RadioNotificationData() : mType( 0 ) {}
       
    29     RadioNotificationData( int type, const QVariant& data ) :
       
    30         mType( type ),
       
    31         mData( data )
       
    32     {}
       
    33 
       
    34     virtual ~RadioNotificationData() {}
       
    35 
       
    36     #ifndef BUILD_WIN32
       
    37     template <typename Stream> void serialize( Stream& stream ) const;
       
    38     template <typename Stream> void deserialize( Stream& stream );
       
    39     #endif // BUILD_WIN32
       
    40 
       
    41     int         mType;
       
    42     QVariant    mData;
       
    43 
       
    44 };
       
    45 
       
    46 #ifndef BUILD_WIN32
       
    47 
       
    48 Q_DECLARE_USER_METATYPE(RadioNotificationData)
       
    49 
       
    50 template <typename Stream> void RadioNotificationData::serialize( Stream& stream ) const
       
    51 {
       
    52     stream << mType;
       
    53     stream << mData;
       
    54 }
       
    55 
       
    56 template <typename Stream> void RadioNotificationData::deserialize( Stream& stream )
       
    57 {
       
    58     stream >> mType;
       
    59     stream >> mData;
       
    60 }
       
    61 
       
    62 Q_IMPLEMENT_USER_METATYPE(RadioNotificationData)
       
    63 
       
    64 #else
       
    65 
       
    66 Q_DECLARE_METATYPE( RadioNotificationData )
       
    67 
       
    68 #endif // BUILD_WIN32
       
    69 #endif // RADIONOTIFICATIONDATA_H