connectivitymodules/SeCon/catalogspcconnectivityplugin/inc/catalogspcconnectivityclient.h
branchRCL_3
changeset 20 4a793f564d72
parent 0 d0791faffa3f
equal deleted inserted replaced
19:0aa8cc770c8a 20:4a793f564d72
       
     1 /*
       
     2 * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:  This is a client which communicate with the server 
       
    15 *                CatalogsEnginePCClientFrontEnd 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef R_CATALOGSPCCONNECTIVITYCLIENT_H
       
    21 #define R_CATALOGSPCCONNECTIVITYCLIENT_H
       
    22 
       
    23 #include <e32base.h>
       
    24 #include <apmstd.h>
       
    25 
       
    26 /**
       
    27  *  This client communicate with the server CatalogsEnginePCClientFrontEnd
       
    28  *
       
    29  *  This class get requests from CatalogsPCConnectivityPlugin. 
       
    30  *  Class itself is client in client-server solution. When request 
       
    31  *  is received it will start the server (CatalogsEnginePCClientFrontEnd). 
       
    32  *  This client class is dummy, the server have all the functionality.
       
    33  *
       
    34  *  @lib catalogspcconnectivityplugin
       
    35  *  @since S60 v3.1
       
    36  */
       
    37 class RCatalogsPCConnectivityClient : public RSessionBase
       
    38     {
       
    39 public:
       
    40 
       
    41     /**
       
    42      * Constructor
       
    43      *
       
    44      * @since S60 v3.1
       
    45      */
       
    46     RCatalogsPCConnectivityClient();
       
    47 
       
    48     /**
       
    49      * Destructor
       
    50      *
       
    51      * @since S60 v3.1
       
    52      */
       
    53     ~RCatalogsPCConnectivityClient();
       
    54 
       
    55     /**
       
    56      * A connection is formed to the Catalogs engine pc client front-end.
       
    57      * This will start up the front-end server and connect to it 
       
    58      *
       
    59      * @since S60 v3.1
       
    60      * @return TInt Standard error code, KErrNone if connection is formed
       
    61      *         or the connection was formed already     
       
    62      */
       
    63     TInt Connect();
       
    64 
       
    65     /**
       
    66      * The connection to the Catalogs engine front-end is closed
       
    67      *
       
    68      * @since S60 v3.1
       
    69      */
       
    70     void Close();
       
    71 
       
    72     /**
       
    73      * All MIME types supported by this component can be asked using this method
       
    74      *
       
    75      * @since S60 v3.1
       
    76      * @return RPointerArray< TDataType > contain all supported MIME types
       
    77      *         RPointerArray TDataTypes have allocated using new, caller
       
    78      *         have to remember to delete them properly
       
    79      * @exeption Leaves with standard error codes
       
    80      */
       
    81     RPointerArray<TDataType> SupportedMimeTypesL();
       
    82 
       
    83     /**
       
    84      * A data packet of max length 65535 (0xFFFF) bytes is synchronously
       
    85      * sent to the Catalogs engine front-end
       
    86      * Usage: After PutDataL have been called, you have to call GetDataL
       
    87      *        before you can call PutDataL again
       
    88      *
       
    89      * @since S60 v3.1
       
    90      * @param aMimeType data packet MIME type
       
    91      * @param aData data buffer to read from
       
    92      * @exeption Leaves with standard error codes
       
    93      */
       
    94     void PutDataL( const TDataType& aMimeType, 
       
    95         const CBufFlat& aData );
       
    96 
       
    97     /**
       
    98      * A data packet is synchronously transfered from the Catalogs front-end
       
    99      * and returned to caller 
       
   100      * Usage: Everytime before calling GetDataL, you have to call PutDataL.
       
   101      *        So you can't call GetData in sequentially.
       
   102      *
       
   103      * @since S60 v3.1
       
   104      * @param aMimeType data packet MIME type
       
   105      * @param aData data buffer to write to. Will call ExpandL function
       
   106      *        for aData, but never more than max length 65535 (OxFFFF)
       
   107      * @return nothing, but parameter aData work as return buffer
       
   108      * @exeption Leaves with standard error codes
       
   109      */                                                          
       
   110     void GetDataL( TDataType& aMimeType, CBufFlat& aData );
       
   111 
       
   112     
       
   113 private:
       
   114 
       
   115 // private functions
       
   116 
       
   117     /**
       
   118      * Returns the earliest version number of the server that we can talk to
       
   119      *
       
   120      * @since S60 v3.1
       
   121      * @return TVersion Earliest version number we can talk to
       
   122      */
       
   123     TVersion Version() const;
       
   124 
       
   125     /**
       
   126      * Start server if it isn't running already
       
   127      *
       
   128      * @since S60 v3.1
       
   129      * @return TInt Standard error code, KErrNone if server was running
       
   130      *         already or start was succesfull     
       
   131      */
       
   132     TInt StartServer();
       
   133 
       
   134     /**
       
   135      * Create server process
       
   136      *
       
   137      * @since S60 v3.1
       
   138      * @return TInt standard error code, KErrNone when creation was success
       
   139      */
       
   140     TInt CreateServerProcess();
       
   141 
       
   142     };
       
   143 
       
   144 #endif // R_CATALOGSPCCONNECTIVITYCLIENT_H
       
   145