browserutilities/favouritesengine/ClientServer/srvinc/FavouritesSrv.h
changeset 0 dd21522fd290
equal deleted inserted replaced
-1:000000000000 0:dd21522fd290
       
     1 /*
       
     2 * Copyright (c) 2004 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 the License "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: 
       
    15 *      Declaration of class FavouritesSrv and CFavouritesSrv
       
    16 *      
       
    17 *
       
    18 */
       
    19 
       
    20 
       
    21 #ifndef FAVOURITES_SRV_H
       
    22 #define FAVOURITES_SRV_H
       
    23 
       
    24 //  INCLUDES
       
    25 
       
    26 #include <e32base.h>
       
    27 
       
    28 // FORWARD DECLARATION
       
    29 
       
    30 class CTimeout;
       
    31 class CBackupObserver;
       
    32 
       
    33 // CLASS DECLARATION
       
    34 
       
    35 /**
       
    36 * Static methods to launch the Favourites Engine Server.
       
    37 */
       
    38 class FavouritesSrv
       
    39     {
       
    40     public:     // New methods
       
    41 
       
    42         /**
       
    43         * Start the FavouritesEngine Server thread / process.
       
    44         * @return Error code.
       
    45         */
       
    46         static TInt Start();
       
    47 
       
    48         /**
       
    49         * Run the FavouritesEngine Server (entry function).
       
    50         * @return Error code.
       
    51         */
       
    52         IMPORT_C static TInt Run();
       
    53 
       
    54     };
       
    55 
       
    56 /**
       
    57 * Favourites Engine Server.
       
    58 */
       
    59 NONSHARABLE_CLASS(CFavouritesSrv) : public CPolicyServer
       
    60     {
       
    61     public:     // Constructor
       
    62 
       
    63         /**
       
    64         * Two-phased constructor. Leaves on failure.
       
    65         * @return The constructed server.
       
    66         */
       
    67         static CFavouritesSrv* NewL();
       
    68 
       
    69         /**
       
    70         * Destructor.
       
    71         */
       
    72         virtual ~CFavouritesSrv();
       
    73 
       
    74     public:     // New methods
       
    75 
       
    76         /**
       
    77         * A session is closed.
       
    78         */
       
    79         void SessionClosed();
       
    80 
       
    81         /**
       
    82         * Access received message.
       
    83         * @return Received message.
       
    84         */
       
    85         inline const RMessage2& ReceivedMessage() const;
       
    86 
       
    87         /**
       
    88         * Set received message.
       
    89         * @param aMessage Received message.
       
    90         */
       
    91         inline void ReceivedMessage( const RMessage2& aMessage );
       
    92 
       
    93         /**
       
    94         * Panic client.
       
    95         * @param aCode Panic code.
       
    96         */
       
    97         void PanicClient( TInt aCode );
       
    98 
       
    99     private:    // Constructors and destructor
       
   100 
       
   101         /**
       
   102         * Constructor.
       
   103         */
       
   104         CFavouritesSrv();
       
   105 
       
   106         /**
       
   107         * Second-phase constructor.
       
   108         */
       
   109         void ConstructL();
       
   110 
       
   111     private:    // From CServer2
       
   112 
       
   113         /**
       
   114         * Create new session.
       
   115         * @param aVersion Version.
       
   116         * @param aMessage Message (unused).
       
   117         * @return New session.
       
   118         */
       
   119         CSession2* NewSessionL
       
   120             ( const TVersion& aVersion, const RMessage2& aMessage ) const;
       
   121         
       
   122         /** 
       
   123         * Performs a custom security check.
       
   124         * @param	aMsg The message to check.
       
   125 		* @param	aAction A reference to the action to take if the security
       
   126 		*   check fails.
       
   127 		* @param 	aMissing A reference to the list of security attributes missing
       
   128 		*	from the checked process.
       
   129 		* @return A value from TCustomResult.
       
   130 		*/
       
   131         TCustomResult CustomSecurityCheckL(const RMessage2& aMsg, 
       
   132         	TInt& aAction, TSecurityInfo& aMissing);
       
   133 
       
   134     private:    // Data
       
   135 
       
   136         RMessage2           iReceivedMessage; ///< Received message.
       
   137         CTimeout*           iExitTimer;       ///< Exit timer. Owned.
       
   138         CBackupObserver*    iBackupObserver;
       
   139 };
       
   140 
       
   141 #include "FavouritesSrv.inl"
       
   142 
       
   143 #endif
       
   144 
       
   145 // End of File