example/clientapi/smf/inc/common/smfcontacts/smfgroup.h
changeset 2 86af6c333601
parent 1 4b1e636e8a71
equal deleted inserted replaced
1:4b1e636e8a71 2:86af6c333601
     1 /**
     1 /**
     2 * Copyright (c) 2010 Sasken Communication Technologies Ltd.
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
     3 * All rights reserved.
     3  * All rights reserved.
     4 * This component and the accompanying materials are made available
     4  * This component and the accompanying materials are made available
     5 * under the terms of the "{License}"
     5  * under the terms of the "Eclipse Public License v1.0" 
     6 * which accompanies  this distribution, and is available
     6  * which accompanies  this distribution, and is available
     7 * at the URL "{LicenseUrl}".
     7  * at the URL "http://www.eclipse.org/legal/epl-v10.html"
     8 *
     8  *
     9 * Initial Contributors:
     9  * Initial Contributors:
    10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
    10  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
    11 *
    11  *
    12 * Contributors:
    12  * Contributors:
    13 * Manasij Roy
    13  * Manasij Roy, Nalina Hariharan
    14 * Description:
    14  * 
    15 * Interface spefication for smf service provider
    15  * Description:
    16 *
    16  * The group class represents an instance of a group as per SN site terminolgy
    17 */
    17  *
       
    18  */
    18 
    19 
    19 #ifndef SMFGROUP_H_
    20 #ifndef SMFGROUP_H_
    20 #define SMFGROUP_H_
    21 #define SMFGROUP_H_
    21 
    22 
    22 #include "SmfClientGlobal.h"
    23 #include <smfcontact.h>
    23 class SmfContact;
    24 #include <qdatastream.h>
    24 //List of SmfContacts
    25 #include <QSharedData>
    25 typedef QList<SmfContact> SmfContactList;
    26 #include <smfclientglobal.h>
       
    27 
       
    28 class SmfGroupPrivate;
       
    29 
       
    30 
    26 /**
    31 /**
    27  * class for a group in social network 
    32  * @ingroup smf_common_group
       
    33  * The group class represents an instance of a group as per SN site terminolgy
    28  */
    34  */
    29 class SMFCLIENT_EXPORT SmfGroup : public QObject
    35 class SMFCLIENT_EXPORT SmfGroup : public QObject
    30 	{
    36 	{
    31 	Q_OBJECT
    37 	Q_OBJECT
    32 public:
    38 public:
       
    39 	/**
       
    40 	 * Constructor with default argument
       
    41 	 * @param list The list of members in the group
       
    42 	 */
       
    43 	SmfGroup( QList<SmfContact>* list = 0 );
    33 	
    44 	
    34 	/**
    45 	/**
    35 	 * Constructs a group with list of contacts
    46 	 * Copy Constructor
       
    47 	 * @param aOther The reference object
    36 	 */
    48 	 */
    37 	SmfGroup(SmfContactList* list=0);
    49 	SmfGroup( const SmfGroup &aOther );
    38 	/**
       
    39 	 *Returns list of members in the group
       
    40 	 *@return list of members 
       
    41 	 */
       
    42 	SmfContactList* members()
       
    43 		{
       
    44 		return m_members;
       
    45 		}
       
    46 	
    50 	
    47 	/**
    51 	/**
    48 	 * Sets the group members
    52 	 * Destructor
    49 	 * @param members list of members to be added to the group 
       
    50 	 */
    53 	 */
    51 	void setMembers(SmfContactList& members);
    54 	~SmfGroup( );
       
    55 	
       
    56 public slots:
       
    57 	/**
       
    58 	 * Method to get the list of members in the group
       
    59 	 * @return The list of members in the group
       
    60 	 */
       
    61 	QList<SmfContact> members( ) const;
       
    62 	
       
    63 	/**
       
    64 	 * Method to get the name of the group
       
    65 	 * @return The name of the group
       
    66 	 */
       
    67 	QString name( ) const;
       
    68 	
       
    69 	/**
       
    70 	 * Method to get the id of the group
       
    71 	 * @return The ID value 
       
    72 	 */
       
    73 	QString id( ) const;
       
    74 	
    52 private:
    75 private:
    53 	SmfContactList* m_members;
    76 	QSharedDataPointer<SmfGroupPrivate> d;
       
    77 	
       
    78 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
    79 			const SmfGroup &aGroup );
       
    80 
       
    81 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
    82 			SmfGroup &aGroup );
       
    83 	
    54 	};
    84 	};
       
    85 
       
    86 
    55 /**
    87 /**
    56  * Externalization
    88  * Method for Externalization. Writes the SmfGroup object to 
       
    89  * the stream and returns a reference to the stream.
       
    90  * @param aDataStream Stream to be written
       
    91  * @param aGroup The SmfGroup object to be externalized
       
    92  * @return reference to the written stream
    57  */
    93  */
    58 QDataStream &operator<<(QDataStream &, const SmfGroup &);
    94 QDataStream &operator<<( QDataStream &aDataStream, 
       
    95 		const SmfGroup &aGroup );
       
    96 
    59 /**
    97 /**
    60  * Internalization
    98  * Method for Internalization. Reads a SmfGroup object from 
       
    99  * the stream and returns a reference to the stream.
       
   100  * @param aDataStream Stream to be read
       
   101  * @param aGroup The SmfGroup object to be internalized
       
   102  * @return reference to the stream
    61  */
   103  */
    62 QDataStream &operator>>(QDataStream &, SmfGroup &);
   104 QDataStream &operator>>( QDataStream &aDataStream, 
       
   105 		SmfGroup &aGroup);
       
   106 
    63 #endif /* SMFGROUP_H_ */
   107 #endif /* SMFGROUP_H_ */