smf/smfservermodule/smfclient/common/smfprovider.h
changeset 10 1d94eb8df9c2
parent 9 b85b0c039c14
equal deleted inserted replaced
9:b85b0c039c14 10:1d94eb8df9c2
     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 SmfEvent class represents an event
       
    17  *
       
    18  */
       
    19 
       
    20 #ifndef SMFPROVIDER_H
       
    21 #define SMFPROVIDER_H
       
    22 
       
    23 #include <QObject>
       
    24 #include <QImage>
       
    25 #include <QUrl>
       
    26 #include <QStringList>
       
    27 #include <QMetaType>
       
    28 
       
    29 #include "SmfClientGlobal.h"
       
    30 /**
       
    31  * @ingroup smf_client_group 
       
    32  * Interface for a base service provider. Other service provider classes contains 
       
    33  * implementation of this base class so that each has access to service provider 
       
    34  * information.
       
    35  * All of the functionality described here should be implemented by a service
       
    36  * specific plug-in object.
       
    37  */
       
    38 //TODO:- put SMFCLIENT_EXPORT
       
    39 //TODO:- QList<SmfProvider> gives error if its derived from QObject
       
    40 class SMFCLIENT_EXPORT SmfProvider //: public QObject
       
    41 {
       
    42   //Q_OBJECT
       
    43 
       
    44 public:
       
    45   /**
       
    46    *  Seeing as this is a plug-in implementation, these will realistically be generated by SMF factory of some kind
       
    47    */
       
    48    
       
    49   SmfProvider(QObject* parent = 0);
       
    50   ~SmfProvider();
       
    51 
       
    52 public:
       
    53   /**
       
    54    * Localizable name of the service 
       
    55    * @return service name
       
    56    */
       
    57   QString serviceName() const; 
       
    58   
       
    59   /**
       
    60    * Logo of the service
       
    61    * @return logo image of the service
       
    62    */
       
    63   QImage serviceIcon() const; 
       
    64   
       
    65   /**
       
    66    * Readable service description
       
    67    * @return service description
       
    68    */
       
    69   QString description() const; 
       
    70   
       
    71   /*
       
    72    * Website of the service
       
    73    */
       
    74   QUrl serviceUrl() const;
       
    75   
       
    76   /**
       
    77    * URL of the application providing this service
       
    78    */
       
    79   QUrl applicationUrl() const; //
       
    80   
       
    81   /**
       
    82    * service types - list of interfaces that this provider support
       
    83    */
       
    84   QList<QString> serviceTypes() const;
       
    85   
       
    86   /////////////////////////////////////////set APIs
       
    87   /**
       
    88    * Localizable name of the service 
       
    89    * 
       
    90    */
       
    91   void serviceName(QString& name); 
       
    92   
       
    93   /**
       
    94    * Logo of the service
       
    95    * 
       
    96    */
       
    97   void serviceIcon(QImage& image) ; 
       
    98   
       
    99   /**
       
   100    * Readable service description
       
   101    * 
       
   102    */
       
   103   void description(QString& desc) ; 
       
   104   
       
   105   /*
       
   106    * Website of the service
       
   107    */
       
   108   void serviceUrl(QUrl& url) ;
       
   109   
       
   110   /**
       
   111    * URL of the application providing this service
       
   112    */
       
   113   void applicationUrl(QUrl& url) ; 
       
   114   
       
   115   /**
       
   116    * service types - list of interfaces that this provider support
       
   117    */
       
   118  void serviceTypes( QStringList& types);
       
   119  //TODO:- making data mems public just for testing, later provide set apis
       
   120 //private:
       
   121 public:
       
   122   QString m_serviceName;
       
   123   QImage m_serviceIcon;
       
   124   QString m_description;
       
   125   QUrl m_serviceUrl;
       
   126   QUrl m_appUrl;
       
   127   QStringList m_serviceTypes;
       
   128   friend QDataStream &operator<<(QDataStream &, const SmfProvider&);
       
   129   friend QDataStream &operator>>(QDataStream &, SmfProvider&);
       
   130 };
       
   131 /**
       
   132 * Externalization
       
   133 */
       
   134 SMFCLIENT_EXPORT QDataStream &operator<<(QDataStream &, const SmfProvider&);
       
   135 /**
       
   136  * Internalization
       
   137  */
       
   138 SMFCLIENT_EXPORT QDataStream &operator>>(QDataStream &, SmfProvider&);
       
   139 
       
   140 typedef QList<SmfProvider> SmfProviderList;
       
   141 
       
   142 // Make the class SmfProvider known to QMetaType, so that as to register it.
       
   143 Q_DECLARE_METATYPE(SmfProvider)
       
   144 Q_DECLARE_METATYPE(QList<SmfProvider>)
       
   145 
       
   146 #endif // SMFPROVIDER_H