example/clientapi/smf/inc/common/smfcontacts/smfgroup.h
changeset 3 0446eb7b28aa
parent 2 86af6c333601
child 4 969092730d34
equal deleted inserted replaced
2:86af6c333601 3:0446eb7b28aa
     1 /**
       
     2  * Copyright (c) 2010 Sasken Communication Technologies Ltd.
       
     3  * All rights reserved.
       
     4  * This component and the accompanying materials are made available
       
     5  * under the terms of the "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  * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11  *
       
    12  * Contributors:
       
    13  * Manasij Roy, Nalina Hariharan
       
    14  * 
       
    15  * Description:
       
    16  * The group class represents an instance of a group as per SN site terminolgy
       
    17  *
       
    18  */
       
    19 
       
    20 #ifndef SMFGROUP_H_
       
    21 #define SMFGROUP_H_
       
    22 
       
    23 #include <smfcontact.h>
       
    24 #include <qdatastream.h>
       
    25 #include <QSharedData>
       
    26 #include <smfclientglobal.h>
       
    27 
       
    28 class SmfGroupPrivate;
       
    29 
       
    30 
       
    31 /**
       
    32  * @ingroup smf_common_group
       
    33  * The group class represents an instance of a group as per SN site terminolgy
       
    34  */
       
    35 class SMFCLIENT_EXPORT SmfGroup : public QObject
       
    36 	{
       
    37 	Q_OBJECT
       
    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 );
       
    44 	
       
    45 	/**
       
    46 	 * Copy Constructor
       
    47 	 * @param aOther The reference object
       
    48 	 */
       
    49 	SmfGroup( const SmfGroup &aOther );
       
    50 	
       
    51 	/**
       
    52 	 * Destructor
       
    53 	 */
       
    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 	
       
    75 private:
       
    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 	
       
    84 	};
       
    85 
       
    86 
       
    87 /**
       
    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
       
    93  */
       
    94 QDataStream &operator<<( QDataStream &aDataStream, 
       
    95 		const SmfGroup &aGroup );
       
    96 
       
    97 /**
       
    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
       
   103  */
       
   104 QDataStream &operator>>( QDataStream &aDataStream, 
       
   105 		SmfGroup &aGroup);
       
   106 
       
   107 #endif /* SMFGROUP_H_ */