PECengine/StorageManager2/ServerSrc/MPEngStorageServer.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:  Storage Server Abstract interface
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __MPENGSTORAGESERVER_H__
       
    21 #define __MPENGSTORAGESERVER_H__
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 #include <e32def.h>
       
    26 #include <bamdesca.h>
       
    27 #include "TPEngStorageServerMessages.h"
       
    28 
       
    29 // FORWARD DECLARATIONS
       
    30 class CPEngStorageFolder;
       
    31 class RPEngMessage;
       
    32 
       
    33 
       
    34 /**
       
    35 *  Storage Server Abstract interface
       
    36 *
       
    37 *  @since 3.0
       
    38 */
       
    39 class MPEngStorageServer
       
    40     {
       
    41     public: // New functions
       
    42 
       
    43         /**
       
    44          *  Add subsession to the container
       
    45          *
       
    46          *  @since 3.0
       
    47          *  @param aSubSession sub session instance
       
    48          */
       
    49         virtual void AddSubSessionL( CObject& aSubSession ) = 0;
       
    50 
       
    51         /**
       
    52          *  Remove subsession from the container
       
    53          *
       
    54          *  @since 3.0
       
    55          *  @param aSubSession subsession instance
       
    56          */
       
    57         virtual void RemoveSubSessionL( CObject& aSubSession ) = 0;
       
    58 
       
    59         /**
       
    60          *	Start Listening of the Global events
       
    61          *	Content of the client message is defined in the
       
    62          *	<TPEngStorageServerMessages.h>
       
    63          *
       
    64          *  @since 3.0
       
    65          *  @param aMessage message from the client
       
    66          *	@param aSessionId Id of the session request came from
       
    67          */
       
    68         virtual void RegisterGlobEventListenerL( const RPEngMessage& aMessage,
       
    69                                                  TUint32 aSessionId ) = 0;
       
    70 
       
    71         /**
       
    72          *	Cancel specified asynchronous request of the client
       
    73          *	Content of the client message is defined in the
       
    74          *	<TPEngStorageServerMessages.h>
       
    75          *
       
    76          *  @since 3.0
       
    77          *  @param aMessage message from the client
       
    78          *	@param aSessionId Id of the session request came from
       
    79          */
       
    80         virtual void CancelRequestL( const RPEngMessage& aMessage,
       
    81                                      TUint32 aSessionId ) = 0;
       
    82 
       
    83         /**
       
    84          *  Cancel all session's asynchronous request
       
    85          *
       
    86          *  @since 3.0
       
    87          *	@param aSessionId Id of the session request came from
       
    88          */
       
    89         virtual void CancelAllSessionRequests( TUint32 aSessionId ) = 0;
       
    90 
       
    91         /**
       
    92          *	Reload Asynchronous scout of the async observer
       
    93          *	Content of the client message is defined in the
       
    94          *	<TPEngStorageServerMessages.h>
       
    95          *
       
    96          *  @since 3.0
       
    97          *  @param aMessage message from the client
       
    98          *	@param aSessionId Id of the session request came from
       
    99          */
       
   100         virtual void ReloadAsynchronousScoutL( const RPEngMessage& aMessage,
       
   101                                                TUint32 aSessionId ) = 0;
       
   102 
       
   103         /**
       
   104          *	Create Session slot Folder
       
   105          *	If session Slot folder exists, new Application ID is just
       
   106          *	registered there.
       
   107          *	Content of the client message is defined in the
       
   108          *	<TPEngStorageServerMessages.h>
       
   109          *
       
   110          *  @since 3.0
       
   111          *  @param aMessage message from the client
       
   112          *	@param aSessionId Id of the session request came from
       
   113          */
       
   114         virtual void CreateSessionFolderL(
       
   115             const RPEngMessage& aMessage ) = 0;
       
   116 
       
   117         /**
       
   118          *	Remove Session slot Folder
       
   119          *	If session Slot folder has registered more Application Ids
       
   120          *	it stays in the storage, till last one is unregistered
       
   121          *	Content of the client message is defined in the
       
   122          *	<TPEngStorageServerMessages.h>
       
   123          *
       
   124          *  @since 3.0
       
   125          *  @param aMessage message from the client
       
   126          *	@param aSessionId Id of the session request came from
       
   127          */
       
   128         virtual void RemoveSessionFolderL(
       
   129             const RPEngMessage& aMessage ) = 0;
       
   130 
       
   131         /**
       
   132          *	Get session slot state
       
   133          *	Returns to the client buffer with the session slot state
       
   134          *	Content of the client message is defined in the
       
   135          *	<TPEngStorageServerMessages.h>
       
   136          *
       
   137          *  @since 3.0
       
   138          *  @param aMessage message from the client
       
   139          */
       
   140         virtual void SessionStateL( const RPEngMessage& aMessage ) = 0;
       
   141 
       
   142         /**
       
   143          *	Get All Session slots states
       
   144          *	Returns to the client buffer with all session slot states
       
   145          *	Content of the client message is defined in the
       
   146          *	<TPEngStorageServerMessages.h>
       
   147          *
       
   148          *  @since 3.0
       
   149          *  @param aMessage message from the client
       
   150          */
       
   151         virtual void AllSessionStatesL( const RPEngMessage& aMessage ) = 0;
       
   152 
       
   153         /**
       
   154          *	Get Storage Folder Instance and return its pointer
       
   155          *	Content of the client message is defined in the
       
   156          *	<TPEngStorageServerMessages.h>
       
   157          *
       
   158          *  @since 3.0
       
   159          *  @param aMessage message from the client
       
   160          */
       
   161         virtual CPEngStorageFolder* StorageFolderL(
       
   162             const RPEngMessage& aMessage ) = 0;
       
   163 
       
   164         /**
       
   165          *	Notify new global event to the listeners
       
   166          *
       
   167          *  @since 3.0
       
   168          *  @param aGlobalEvent global event des buffer
       
   169          */
       
   170         virtual void NotifyGlobalEvent( const TDesC8& aGlobalEvent ) = 0;
       
   171 
       
   172         /**
       
   173          *  Notify Error to the listeners of new events
       
   174          *
       
   175          *  @since 3.0
       
   176          *  @param aError error code
       
   177          */
       
   178         virtual void NotifyError( TInt aError ) = 0;
       
   179 
       
   180         /**
       
   181          *	Check if passed Application Id is registered for
       
   182          *	defined session slot
       
   183          *	Content of the client message is defined in the
       
   184          *	<TPEngStorageServerMessages.h>
       
   185          *
       
   186          *  @since 3.0
       
   187          *  @param aMessage message from the client
       
   188          */
       
   189         virtual void IsAppIdRegisteredL( const RPEngMessage& aMessage ) = 0;
       
   190 
       
   191         /**
       
   192          *	Is back up operation active
       
   193          *
       
   194          *  @since 3.0
       
   195          *  @return ETrue if back up is active
       
   196          */
       
   197         virtual TBool BackUpActive() = 0;
       
   198 
       
   199 
       
   200     public: // testing support
       
   201 
       
   202         /**
       
   203          *  Wipe Session Slot folder
       
   204          *	Nothing is checked, folder is wipe out with force
       
   205          *
       
   206          *  @since 3.0
       
   207          *  @param aMessage message from the client
       
   208          */
       
   209         virtual void WipeSessionSlotFolderL(
       
   210             const RPEngMessage& aMessage ) = 0;
       
   211 
       
   212     public: // Reference counted access related functions
       
   213 
       
   214         /**
       
   215          *	Session has been created
       
   216          *	More in the file <MPEngStorageServer.h>
       
   217          *
       
   218          *	@since 3.0
       
   219          */
       
   220         virtual void SessionCreated() = 0;
       
   221 
       
   222         /**
       
   223          *	Session is dying, check if server is needed
       
   224          *	More in the file <MPEngStorageServer.h>
       
   225          *
       
   226          *	@since 3.0
       
   227          */
       
   228         virtual void SessionDied() = 0;
       
   229 
       
   230     public: // used by server timer
       
   231 
       
   232         /**
       
   233          *  Timer expired
       
   234          *
       
   235          *	@since 3.0
       
   236          */
       
   237         virtual void TimeExpired() = 0;
       
   238 
       
   239     protected:  //Destructor
       
   240 
       
   241         /**
       
   242           * Virtual inline destructor.
       
   243           *
       
   244           * Server cannot be destroyed through this interface
       
   245           * destroyed using this interface.
       
   246           */
       
   247         virtual ~MPEngStorageServer() {};
       
   248 
       
   249     };
       
   250 
       
   251 #endif      // __MPENGSTORAGESERVER_H__
       
   252 
       
   253 // End of File