smf/smfservermodule/smfclient/common/smfpluginutil.h
changeset 14 a469c0e6e7fb
parent 7 be09cf1f39dd
equal deleted inserted replaced
13:b5d63d5fc252 14:a469c0e6e7fb
    21 #ifndef SMFPLUGINUTIL_H_
    21 #ifndef SMFPLUGINUTIL_H_
    22 #define SMFPLUGINUTIL_H_
    22 #define SMFPLUGINUTIL_H_
    23 
    23 
    24 #include <QNetworkAccessManager>
    24 #include <QNetworkAccessManager>
    25 #include <QMap>
    25 #include <QMap>
       
    26 #include <QVariant>
    26 #include <parser.h>
    27 #include <parser.h>
    27 #include <smfclientglobal.h>
    28 #include <smfclientglobal.h>
    28 
    29 
    29 enum SmfSignatureMethod
    30 enum SmfSignatureMethod
    30 	{
    31 	{
    58 	 * Destructor
    59 	 * Destructor
    59 	 */
    60 	 */
    60 	~SmfPluginUtil ( );
    61 	~SmfPluginUtil ( );
    61 	
    62 	
    62 	/**
    63 	/**
    63 	 * Method called by plugins to get the handle to QJson library 
    64     * Read JSON string from the I/O Device and converts it to a QVariant object
    64 	 * @return The QJson handle
    65     * @param io Input output device
       
    66     * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true.
       
    67     * @returns a QVariant object generated from the JSON string
    65 	 */
    68 	 */
    66 	QJson::Parser* getJsonHandle( void );
    69     QVariant parse ( QIODevice* io, bool* ok = 0 );
       
    70 
       
    71     /**
       
    72     * This is a method provided for convenience.
       
    73     * @param jsonData data containing the JSON object representation
       
    74     * @param ok if a conversion error occurs, *ok is set to false; otherwise *ok is set to true.
       
    75     * @returns a QVariant object generated from the JSON string
       
    76     * @sa errorString
       
    77     * @sa errorLine
       
    78     */
       
    79     QVariant parse ( const QByteArray& jsonData, bool* ok = 0 );
       
    80     
       
    81     /**
       
    82     * This method returns the error message tha ocuured during last parsing
       
    83     * @returns a QString object containing the error message of the last parse operation
       
    84     */
       
    85     QString errorString ( ) const;
       
    86 
       
    87     /**
       
    88     * This method returns line number where the last QJson parsing error occurred
       
    89     * @returns the line number where the error occurred
       
    90     */
       
    91     int errorLine ( ) const;
    67 	
    92 	
    68 	/**
    93 	/**
    69 	 * Method called by plugins to get the OAuth Keys. The PM sends the 
    94 	 * Method called by plugins to get the OAuth Keys. The PM sends the 
    70 	 * keys only if the pluginID is that of a currently loaded plugin
    95 	 * keys only if the pluginID is that of a currently loaded plugin
    71 	 * @param aKeys [out] The OAuth keys
    96 	 * @param aKeys [out] The OAuth keys