PECengine/PluginServer2/SrvSrc/CPEngPlgSrv.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2002 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:  See class description below.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CPENGPLGSRV_H__
       
    20 #define __CPENGPLGSRV_H__
       
    21 
       
    22 //  INCLUDES
       
    23 #include "PEngPlgSrvCommon.h"
       
    24 #include <e32def.h>
       
    25 #include <s32std.h>
       
    26 #include <s32btree.h>
       
    27 #include <e32svr.h>
       
    28 #include <f32file.h>
       
    29 #include <badesca.h>
       
    30 #include "MPEngPlgSrv.h"
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class TPEngServerParams;
       
    34 class CPEngPluginHolder;
       
    35 
       
    36 //  CLASS DEFINITION
       
    37 /*
       
    38 -----------------------------------------------------------------------------
       
    39 
       
    40     DESCRIPTION
       
    41 
       
    42     Cache server class. Server class is responsible to create and free
       
    43 	cached entries. Entries are stored in B-tree to ensure fast read and write
       
    44 	operations.
       
    45 
       
    46 -----------------------------------------------------------------------------
       
    47 */
       
    48 
       
    49 
       
    50 class CPEngPlgSrv : public CPolicyServer,
       
    51             public MPEngPlgSrv
       
    52     {
       
    53 
       
    54     public:		// Constructors and destructors
       
    55 
       
    56         static CPEngPlgSrv* NewLC( const TDesC& aServerName, TInt aPriority );	// Static constructor
       
    57         virtual ~CPEngPlgSrv();				// Destructor (virtual)
       
    58 
       
    59     protected:	// Constructors and destructors
       
    60 
       
    61         CPEngPlgSrv( TInt aPriority );						// Default constructor, protected to allow derivation
       
    62         void ConstructL( const TDesC& aServerName );		// Second phase construct
       
    63 
       
    64     public:		// New methods
       
    65 
       
    66         /*
       
    67          * Starts the server, called from clients Connect() method or from WinsMain()
       
    68          */
       
    69         static TInt ExecuteServerL( TPEngServerParams& aParams );
       
    70         /*
       
    71          *	Stops the server, actually just calls CActiveScheduler::Stop();
       
    72          */
       
    73         void StopServer();
       
    74 
       
    75         /*
       
    76          * Starts the server
       
    77          */
       
    78         static void RunServerL( TPEngServerParams& aParams );
       
    79 
       
    80     public: //new methods
       
    81 
       
    82         void SetStateL( TPEngPlgOnlineState aNewState );
       
    83 
       
    84         void LoadByTypeL( const TDesC8& aPluginType );
       
    85         void UnloadOnlinePluginsL();
       
    86         void UnloadAllL();
       
    87 
       
    88         TInt PluginCount() const;
       
    89         TInt Plugin( TInt aIndex ) const;
       
    90 
       
    91     protected: //new methods
       
    92 
       
    93         /*
       
    94          *	Calls CActiveScheduler::Start()
       
    95          */
       
    96         void StartServer();
       
    97 
       
    98     public:		// Methods derived from CPolicyServer
       
    99 
       
   100         /*
       
   101          *	Called when new client is connecting, version number of the client is checked here.
       
   102          */
       
   103         CSession2* NewSessionL( const TVersion& aVersion, const RMessage2& aMessage ) const;
       
   104 
       
   105     private:	// Methods not implemented
       
   106 
       
   107         CPEngPlgSrv( const CPEngPlgSrv& );		// Copy constructor
       
   108         CPEngPlgSrv& operator=( const CPEngPlgSrv& );	// Assigment operator
       
   109 
       
   110     private:	// Data
       
   111 
       
   112         // array of plugins, OWNED
       
   113         RPointerArray<CPEngPluginHolder> iPlugins;
       
   114 
       
   115         // server name holder
       
   116         TFullName iServerName;
       
   117 
       
   118         // online state of the server
       
   119         TPEngPlgOnlineState iOnlineState;
       
   120     };
       
   121 
       
   122 #endif      //  __CPENGPLGSRV_H__
       
   123