example/clientapi/smf/smfrelationmgr.h
changeset 1 4b1e636e8a71
parent 0 5d2360e70d9f
child 2 86af6c333601
equal deleted inserted replaced
0:5d2360e70d9f 1:4b1e636e8a71
     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 "{License}"
       
     6 * which accompanies  this distribution, and is available
       
     7 * at the URL "{LicenseUrl}".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Chandradeep Gandhi, Sasken Communication Technologies Ltd - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:
       
    15 * Interface spefication for managing associations between various social contacts
       
    16 *
       
    17 */
       
    18 
       
    19 #ifndef SMFRELATIONMGR_H
       
    20 #define SMFRELATIONMGR_H
       
    21 
       
    22 class SmfProvider;
       
    23 class SmfContact;
       
    24 class SmfRelationId; //persistent Id of a relation
       
    25 
       
    26 class SmfRelationItem : public SmfContact
       
    27 {
       
    28 	private:
       
    29 	//SmfProvider* provider;
       
    30 
       
    31 	public:
       
    32 	virtual SmfProvider* provider getProvider()=0;
       
    33 	virtual SmfProvider* provider setProvider(SmfProvider* provider)=0;
       
    34 };
       
    35 
       
    36 /**
       
    37  * Interface for a base service provider. Other service provider classes o derive from
       
    38  * this base class so that each has access to service provider information
       
    39  *
       
    40  * All of the functionality described here should be implemented by a service
       
    41  * specific plug-in object.
       
    42  */
       
    43 class SmfRelationMgr : public QObject
       
    44 {
       
    45   Q_OBJECT;
       
    46 
       
    47 public:
       
    48   // Seeing as this is a plug-in implementation, these will realistically
       
    49   // be generated by SMF factory of some kind
       
    50   SmfRelationMgr(QObject* parent = 0);
       
    51   ~SmfRelationMgr();
       
    52 
       
    53 public:
       
    54   //create a relation with first contact (id optional)
       
    55   virtual SmfRelationId create(SmfProvider provider, SmfContact conact, uint id) = 0;
       
    56   // assign contact to a relation
       
    57   virtual bool associate(SmfRelationId relation, SmfProvider provider, SmfContact conact) = 0;
       
    58   //returns first contact in the relation when exists
       
    59   virtual SmfContact searchById(SmfRelationId relation)=0;
       
    60   //number of contacts in a relation
       
    61   virtual uint count(SmfRelationId relation) = 0;
       
    62 
       
    63 slots:
       
    64   virtual QList<SmfRelationItem> get(SmfRelationId relation)=0;//list of contacts and their provider
       
    65   virtual QList<SmfRelationId> getAll()=0;//list of all relations
       
    66 
       
    67 signals:
       
    68   //None at the moment
       
    69 };
       
    70 
       
    71 #endif // SMFRELATIONMGR_H