smf/smfservermodule/smfclient/common/smfprovider.h
changeset 14 a469c0e6e7fb
parent 10 77a56c951f86
equal deleted inserted replaced
13:b5d63d5fc252 14:a469c0e6e7fb
    11  *
    11  *
    12  * Contributors:
    12  * Contributors:
    13  * Manasij Roy, Nalina Hariharan
    13  * Manasij Roy, Nalina Hariharan
    14  * 
    14  * 
    15  * Description:
    15  * Description:
    16  * The SmfEvent class represents an event
    16  * Interface for a base service provider
    17  *
    17  *
    18  */
    18  */
    19 
    19 
    20 #ifndef SMFPROVIDER_H
    20 #ifndef SMFPROVIDER_H
    21 #define SMFPROVIDER_H
    21 #define SMFPROVIDER_H
    25 #include <QUrl>
    25 #include <QUrl>
    26 #include <QStringList>
    26 #include <QStringList>
    27 #include <QMetaType>
    27 #include <QMetaType>
    28 
    28 
    29 #include "smfclientglobal.h"
    29 #include "smfclientglobal.h"
    30 
       
    31 /**
    30 /**
    32  * @ingroup smf_client_group 
    31  * @ingroup smf_client_group 
    33  * Interface for a base service provider. Other service provider classes contains 
    32  * Interface for a base service provider. Other service provider classes contains 
    34  * implementation of this base class so that each has access to service provider 
    33  * implementation of this base class so that each has access to service provider 
    35  * information.
    34  * information.
    36  * All of the functionality described here should be implemented by a service
    35  * All of the functionality described here should be implemented by a service
    37  * specific plug-in object.
    36  * specific plug-in object.
    38  */
    37  */
    39 //TODO:- put SMFCLIENT_EXPORT
    38 class SMFCLIENT_EXPORT SmfProvider
    40 //TODO:- QList<SmfProvider> gives error if its derived from QObject
       
    41 class SMFCLIENT_EXPORT SmfProvider //: public QObject
       
    42 {
    39 {
    43   //Q_OBJECT
       
    44 
    40 
    45 public:
    41 public:
    46   /**
    42 	
    47    *  Seeing as this is a plug-in implementation, these will realistically be generated by SMF factory of some kind
    43 	/**
    48    */
    44 	 * Constructor
    49    
    45 	 */
    50   SmfProvider(QObject* parent = 0);
    46 	SmfProvider();
    51   ~SmfProvider();
    47 	/**
       
    48 	 * Destructor
       
    49 	 */
       
    50 	~SmfProvider();
    52 
    51 
    53 public:
    52 public:
    54   /**
    53   /**
    55    * Localizable name of the service 
    54    * Localizable name of the service 
    56    * @return service name
    55    * @return service name
    78    * URL of the application providing this service
    77    * URL of the application providing this service
    79    */
    78    */
    80   QUrl applicationUrl() const; //
    79   QUrl applicationUrl() const; //
    81   
    80   
    82   /**
    81   /**
    83    * service types - list of interfaces that this provider support
    82    * List of interfaces that this provider support
    84    */
    83    */
    85   QList<QString> serviceTypes() const;
    84   QList<QString> supportedInterfaces() const;
    86   
    85   
    87   /////////////////////////////////////////set APIs
       
    88   /**
    86   /**
    89    * Localizable name of the service 
    87    * List of languages supported by this service provider
       
    88    * @return a QStringList of languages supported by this service 
       
    89    * provider in 2 letter ISO 639-1 format.
       
    90    */
       
    91   QStringList supportedLanguages() const;
       
    92   
       
    93   /**
       
    94    * Sets Localizable name of the service 
    90    * 
    95    * 
    91    */
    96    */
    92   void serviceName(QString& name); 
    97   void setServiceName(QString& name); 
    93   
    98   
    94   /**
    99   /**
    95    * Logo of the service
   100    * Sets Logo of the service
    96    * 
   101    * 
    97    */
   102    */
    98   void serviceIcon(QImage& image) ; 
   103   void setServiceIcon(QImage& image) ; 
    99   
   104   
   100   /**
   105   /**
   101    * Readable service description
   106    * Sets Readable service description
   102    * 
   107    * 
   103    */
   108    */
   104   void description(QString& desc) ; 
   109   void setDescription(QString& desc) ; 
   105   
   110   
   106   /*
   111   /*
   107    * Website of the service
   112    * Sets Website of the service
   108    */
   113    */
   109   void serviceUrl(QUrl& url) ;
   114   void setServiceUrl(QUrl& url) ;
   110   
   115   
   111   /**
   116   /**
   112    * URL of the application providing this service
   117    * Sets URL of the application providing this service
   113    */
   118    */
   114   void applicationUrl(QUrl& url) ; 
   119   void setApplicationUrl(QUrl& url) ; 
   115   
   120   
   116   /**
   121   /**
   117    * service types - list of interfaces that this provider support
   122    * Sets list of interfaces that this provider supports
   118    */
   123    */
   119  void serviceTypes( QStringList& types);
   124  void setSupportedInterfaces( QStringList& types);
   120  //TODO:- making data mems public just for testing, later provide set apis
   125  
   121 //private:
   126  /**
   122 public:
   127   * Sets the list of languages supported by this service provider
       
   128   * @param lang A QStringList of languages supported by this service 
       
   129   * provider in 2 letter ISO 639-1 format.
       
   130   */
       
   131  void setSupportedLanguages( QStringList& lang );
       
   132  
       
   133 private:
   123   QString m_serviceName;
   134   QString m_serviceName;
   124   QImage m_serviceIcon;
   135   QImage m_serviceIcon;
   125   QString m_description;
   136   QString m_description;
   126   QUrl m_serviceUrl;
   137   QUrl m_serviceUrl;
   127   QUrl m_appUrl;
   138   QUrl m_appUrl;
   128   QStringList m_serviceTypes;
   139   QStringList m_serviceTypes;
       
   140   QStringList m_supportedLanguages;
   129   friend QDataStream &operator<<(QDataStream &, const SmfProvider&);
   141   friend QDataStream &operator<<(QDataStream &, const SmfProvider&);
   130   friend QDataStream &operator>>(QDataStream &, SmfProvider&);
   142   friend QDataStream &operator>>(QDataStream &, SmfProvider&);
   131 };
   143 };
   132 /**
   144 /**
   133 * Externalization
   145 * Externalization