PECengine/PluginServer2/ClntSrc/PEngPluginClient.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 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:  PEngPluginServer - object factory
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 // INCLUDE FILES
       
    21 #include <e32base.h>
       
    22 
       
    23 #include "PEngPluginClient.h"
       
    24 #include "RPEngPluginClient.h"
       
    25 
       
    26 //MACROS
       
    27 #define RETURN_IF_ERROR( aErrorCode )\
       
    28     TInt eC(  aErrorCode );\
       
    29     if ( eC != KErrNone )\
       
    30         {\
       
    31         return eC;\
       
    32         }
       
    33 
       
    34 // ============================ MEMBER FUNCTIONS ===============================
       
    35 
       
    36 EXPORT_C TInt PEngPluginClient2::LaunchPluginServer()
       
    37     {
       
    38     // open plugin client and connect to server
       
    39     RPEngPluginClient client;
       
    40     RETURN_IF_ERROR( client.Connect() );
       
    41 
       
    42     return client.SetOnlineState( EFalse );
       
    43     }
       
    44 
       
    45 EXPORT_C TInt PEngPluginClient2::OpenFirstSession()
       
    46     {
       
    47     RPEngPluginClient client;
       
    48     RETURN_IF_ERROR( client.Connect() );
       
    49 
       
    50     return client.SetOnlineState( ETrue );
       
    51     }
       
    52 
       
    53 EXPORT_C TInt PEngPluginClient2::CloseLastSession()
       
    54     {
       
    55     RPEngPluginClient client;
       
    56     RETURN_IF_ERROR( client.Connect() );
       
    57 
       
    58     return client.SetOnlineState( EFalse );
       
    59     }
       
    60 
       
    61 EXPORT_C TInt PEngPluginClient2::ShutdownPluginServer()
       
    62     {
       
    63     // open plugin client and unload all plugins
       
    64     RPEngPluginClient client;
       
    65 
       
    66     // do not start server if it is not running
       
    67     RETURN_IF_ERROR( client.ConnectWithoutStarting() );
       
    68 
       
    69     // shutdown the plugin server
       
    70     return client.ShutdownServer();
       
    71     }
       
    72 
       
    73 // End of file
       
    74