contacts_plat/contacts_services_api/inc/cntservicescontact.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 06 Jul 2010 14:05:47 +0300
changeset 47 7cbcb2896f0e
parent 27 de1630741fbe
child 50 77bc263e1626
child 59 a642906a277a
permissions -rw-r--r--
Revision: 201025 Kit: 2010127

/*
* Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
* All rights reserved.
* This component and the accompanying materials are made available
* under the terms of "Eclipse Public License v1.0"
* which accompanies this distribution, and is available
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
*
* Initial Contributors:
* Nokia Corporation - initial contribution.
*
* Contributors:
*
* Description:
*
*/

#ifndef CNTSERVICESCONTACT_H_
#define CNTSERVICESCONTACT_H_

#include <QList>
#include <QString>
#include <xqserviceipcmarshal.h>

/*Supported actions*/
const QString KCntActionAll("all");
const QString KCntActionCall("call");
const QString KCntActionSms("sms");
const QString KCntActionEmail("email");

/*Supported filters*/
const QString KCntFilterDisplayAll("all");
const QString KCntFilterDisplayFavorites("favorites");

/*Supported Fetch Selection Modes*/
const QString KCntNoSelectionMode("No Selection");
const QString KCntSingleSelectionMode("SingleSelect");
const QString KCntMultiSelectionMode("MultiSelect");

class CntServicesContact
{
public:
    CntServicesContact() : mContactId(-1) {};
    virtual ~CntServicesContact() {};

    QString mDisplayName;
    QString mPhoneNumber;
    QString mEmailAddress;
    int mContactId; //should be changed to QContactUniqueId

    template <typename Stream> void serialize(Stream &stream) const;
    template <typename Stream> void deserialize(Stream &stream);
};

template <typename Stream> inline void CntServicesContact::serialize(Stream &s) const
{
    s << mDisplayName;
    s << mPhoneNumber;
    s << mEmailAddress;
    s << mContactId;
}

template <typename Stream> inline void CntServicesContact::deserialize(Stream &s)
{
    s >> mDisplayName;
    s >> mPhoneNumber;
    s >> mEmailAddress;
    s >> mContactId;
}

typedef QList<CntServicesContact> CntServicesContactList;

Q_DECLARE_USER_METATYPE(CntServicesContact)
Q_DECLARE_USER_METATYPE_NO_OPERATORS(CntServicesContactList)

#endif /* CNTSERVICESCONTACT_H_ */