smf/inc/smfplugins/base/smfproviderbase.h
changeset 3 0446eb7b28aa
child 5 edb9dc8273d9
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 Provider Base class is the class that has to be contained as a member 
       
    17  * in all Plug-in Interfaces.
       
    18  *
       
    19  */
       
    20 
       
    21 #ifndef SMFPROVIDERBASE_H_
       
    22 #define SMFPROVIDERBASE_H_
       
    23 
       
    24 #include <QImage>
       
    25 #include <QUrl>
       
    26 #include <QBuffer>
       
    27 #include <smfglobal.h>
       
    28 #include <qdatastream.h>
       
    29 #include <QSharedData>
       
    30 
       
    31 class SmfProviderBasePrivate;
       
    32 
       
    33 /**
       
    34  * @ingroup smf_plugin_group
       
    35  * The Provider Base class is the class that has to be contained as a member 
       
    36  * in all Plug-in Interfaces.
       
    37  * 
       
    38  * All of plug-ins should contain this class as a member and should also 
       
    39  * contain a public method to get instance of this class. 
       
    40  */
       
    41 class SmfProviderBase : public QObject
       
    42 	{
       
    43 	Q_OBJECT
       
    44 
       
    45 public:
       
    46 	/**
       
    47 	 * Constructor with default argument
       
    48 	 * @param aParent The parent object
       
    49 	 */
       
    50 	SmfProviderBase( QObject* aParent = 0 );
       
    51 	
       
    52 	/**
       
    53 	 * Copy Constructor
       
    54 	 * @param aOther The reference object
       
    55 	 */
       
    56 	SmfProviderBase( const SmfProviderBase &aOther );
       
    57 	
       
    58 	/**
       
    59 	 * Destructor
       
    60 	 */
       
    61 	~SmfProviderBase( );
       
    62 
       
    63 	/**
       
    64 	 * Method to get the Localisable name of the service.
       
    65 	 * @return The Localisable name of the service.
       
    66 	 */
       
    67 	QString serviceName( ) const;
       
    68 	
       
    69 	/**
       
    70 	 * Method to get the Logo of the service
       
    71 	 * @return The Logo of the service
       
    72 	 */
       
    73 	QImage serviceIcon( ) const;
       
    74 	
       
    75 	/**
       
    76 	 * Method to get the Readable service description
       
    77 	 * @return The Readable service description
       
    78 	 */
       
    79 	QString description( ) const;
       
    80 	
       
    81 	/**
       
    82 	 * Method to get the Website of the service
       
    83 	 * @return The Website of the service
       
    84 	 */
       
    85 	QUrl serviceUrl( ) const;
       
    86 	
       
    87 	/**
       
    88 	 * Method to get the URL of the Application providing this service
       
    89 	 * @return The URL of the Application providing this service
       
    90 	 */
       
    91 	QUrl applicationUrl( ) const;
       
    92 	
       
    93 	/**
       
    94 	 * Method to get the Icon of the application
       
    95 	 * @return The Icon of the application
       
    96 	 */
       
    97 	QImage applicationIcon( ) const;
       
    98 	
       
    99 	/**
       
   100 	 * Method to get the Plugin specific ID
       
   101 	 * @return The Plugin specific ID
       
   102 	 */
       
   103 	QString pluginId( ) const;
       
   104 	
       
   105 	/**
       
   106 	 * Method to get the ID of the authentication application 
       
   107 	 * for this service
       
   108 	 * @param aProgram The authentication application name
       
   109 	 * @param aArguments List of arguments required for authentication app
       
   110 	 * @param aMode Strting mode for authentication application
       
   111 	 * @return The ID of the authentication application 
       
   112 	 */
       
   113 	QString authenticationApp( QString &aProgram, QStringList & aArguments, 
       
   114 			QIODevice::OpenModeFlag aMode = QIODevice::ReadWrite ) const;
       
   115 	
       
   116 	/**
       
   117 	 * Method to get the unique registration ID provided by the 
       
   118 	 * Smf for authorised plugins
       
   119 	 * @return The unique registration ID/token provided by the Smf for 
       
   120 	 * authorised plugins
       
   121 	 */
       
   122 	QString smfRegistrationId( ) const;
       
   123 	
       
   124 	/**
       
   125 	 * Method to get the data usage of each plugin
       
   126 	 * @return The data usage structure
       
   127 	 */
       
   128 	SmfPluginDataUsage getDataUsage( ) const;
       
   129 	
       
   130 private:
       
   131 	QSharedDataPointer<SmfProviderBasePrivate> d;
       
   132 
       
   133 	friend QDataStream &operator<<( QDataStream &aDataStream, 
       
   134 			const SmfProviderBase &aProviderBase );
       
   135 
       
   136 	friend QDataStream &operator>>( QDataStream &aDataStream, 
       
   137 			SmfProviderBase &aProviderBase );
       
   138 	
       
   139 	};
       
   140 
       
   141 
       
   142 /**
       
   143  * Method for Externalization. Writes the SmfProviderBase object to 
       
   144  * the stream and returns a reference to the stream.
       
   145  * @param aDataStream Stream to be written
       
   146  * @param aProviderBase The SmfProviderBase object to be externalized
       
   147  * @return reference to the written stream
       
   148  */
       
   149 QDataStream &operator<<( QDataStream &aDataStream, 
       
   150 		const SmfProviderBase &aProviderBase );
       
   151 
       
   152 /**
       
   153  * Method for Internalization. Reads a SmfProviderBase object from 
       
   154  * the stream and returns a reference to the stream.
       
   155  * @param aDataStream Stream to be read
       
   156  * @param aProviderBase The SmfProviderBase object to be internalized
       
   157  * @return reference to the stream
       
   158  */
       
   159 QDataStream &operator>>( QDataStream &aDataStream, 
       
   160 		SmfProviderBase &aProviderBase);
       
   161 
       
   162 #endif /* SMFPROVIDERBASE_H_ */