smf/smfservermodule/smfclient/client/smfclient_p.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 
       
    16 #ifndef SMFCLIENT_P_H_
       
    17 #define SMFCLIENT_P_H_
       
    18 
       
    19 #include "smfprovider.h"
       
    20 #include "SmfObserver.h"
       
    21 #include <QObject>
       
    22 #include <QDateTime>
       
    23 #include <QStringList>
       
    24 #include "smfclient.h"
       
    25 #include "smfclientglobal.h"
       
    26 #include "smfglobal.h"
       
    27 #ifdef Q_OS_SYMBIAN
       
    28 #include "smfclientsymbian.h"
       
    29 #else
       
    30 class SmfClientQt;
       
    31 #endif
       
    32 
       
    33 /**
       
    34  * Private Qt wrapper
       
    35  * Provided to accomodate diff facilities in diff platforms.
       
    36  * Uses Symbian client-server for Symbian
       
    37  * QDbus for linux
       
    38  * QLocalserver for rest of the platforms
       
    39  * Note:- only symbian client-server impl is provided at the moment
       
    40  */
       
    41 class SmfClientPrivate : public smfObserver
       
    42 {
       
    43   Q_OBJECT
       
    44 
       
    45 public:
       
    46 
       
    47   /**
       
    48    * Constructs SmfClientPrivate
       
    49    * @param client SmfClient instance, so that it can directly emit SmfClient's signal
       
    50    */
       
    51   SmfClientPrivate(SmfClient* client=0);
       
    52   ~SmfClientPrivate(){};
       
    53 public:
       
    54   /**
       
    55    * Corresponds to SmfClient::GetServices(const QString )
       
    56    */
       
    57   QList<SmfProvider>* GetServices(const QString serviceName);
       
    58    /**
       
    59     * From smfobserver.
       
    60     * This callback is invoked when requested result is available from
       
    61     * other components of Smf (specially from plugin manager).
       
    62     * @param result Parsed and serialized result.
       
    63     * @param opcode Request code.
       
    64     * @param error Error
       
    65     */
       
    66    void resultsAvailable(QByteArray result,SmfRequestTypeID opcode,SmfError error);
       
    67 private:
       
    68   QList<SmfProvider>* m_baseProvider;
       
    69   //serialized byte array of provider
       
    70   QByteArray m_providerSerialized;
       
    71 #ifdef Q_OS_SYMBIAN
       
    72   CSmfClientSymbian* m_SmfClientPrivate;
       
    73   friend class CSmfClientSymbian;
       
    74 #else
       
    75   SmfClientQt* m_SmfClientPrivate;
       
    76   friend class SmfClientQt;
       
    77 #endif
       
    78   bool m_connected;
       
    79   SmfClient* m_client;
       
    80   //debugging only
       
    81   void writeLog(QString log) const;
       
    82 
       
    83 };
       
    84 
       
    85 #endif /* SMFCLIENT_P_H_ */