PECengine/StorageManager2/ClientInc/PEngStorageManager.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:  Static interface of the storage manager
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __PENGSTORAGEMANAGER_H__
       
    20 #define __PENGSTORAGEMANAGER_H__
       
    21 
       
    22 //  INCLUDES
       
    23 #include	<e32base.h>
       
    24 #include	"RObjectArray.h"
       
    25 
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MPEngStorageManager;
       
    29 class MPEngStorageManagerWatcher;
       
    30 class CPEngSessionSlotId;
       
    31 class MPEngGlobalEventObserver;
       
    32 class CPEngSessionSlotState;
       
    33 
       
    34 //  Local Data Structures
       
    35 
       
    36 /**
       
    37  *  Presence Server notify factory to register observers for listening
       
    38  *	of new events, SIDs changes or notifying about SID  change
       
    39  *	when ever there is any observer, SAP settings store is always observer
       
    40  *	and active folder in the storage manager is changed
       
    41  *	does not matter on the nature of the observer, SID, Event, Stolid
       
    42  *
       
    43  *  @lib PEngClient
       
    44  *  @since 3.0
       
    45  */
       
    46 class PEngStorageManager
       
    47     {
       
    48 
       
    49     public: // New functions
       
    50 
       
    51         /**
       
    52          *	Retrieves Storage Manager instance
       
    53          *	Ownership is passed to the caller
       
    54          *	To get Storage manager which has handle to the correct
       
    55          *	sub-folder of the Storage, Server address and user name
       
    56          *	has to be specified
       
    57          *
       
    58          *	@since 3.0
       
    59          *	@param aSessionSlot session slot Class which caries
       
    60          *				unique information about the session
       
    61          *	@return MPEngStorageManager type pointer, ownership is
       
    62          *						passed to the caller
       
    63           */
       
    64         IMPORT_C static MPEngStorageManager* GetStorageManagerL(
       
    65             const CPEngSessionSlotId& aSessionSlot );
       
    66 
       
    67 
       
    68         /**
       
    69          *	Retrieves Storage Manager Watcher reference
       
    70          *	When this method is called, Reference counter is increased
       
    71          *	and when user does not need watcher, close shall be called
       
    72 
       
    73          *	To get Storage manager Watcher which has handle to the
       
    74          *	correct sub-folder of the Storage, Server address
       
    75          *	and user name has to be specified
       
    76          *
       
    77          *	@since 3.0
       
    78          *	@param aSessionSlot session slot Class which caries
       
    79          *				unique information about the session
       
    80          *	@return MPEngStorageManagerWatcher type pointer,
       
    81          *						ownership is passed to the caller
       
    82           */
       
    83         IMPORT_C static MPEngStorageManagerWatcher* GetStorageManagerWatcherL(
       
    84             const CPEngSessionSlotId& aSessionSlot );
       
    85 
       
    86 
       
    87         /**
       
    88          *	Create Session folder in the storage
       
    89          *	This will ensure existence of the session slot folder till the
       
    90          *	moment calling application will not unregister from the
       
    91          *	session slot folder ( RemoveSessionFolderL)
       
    92          *
       
    93          *	@since 3.0
       
    94          *	@param aSessionSlot session slot Class which caries
       
    95          *				unique information about the session
       
    96          *	@param aApplicationId calling application Id
       
    97          */
       
    98         IMPORT_C static void CreateSessionFolderL(
       
    99             const CPEngSessionSlotId& aSessionSlot,
       
   100             const TDesC& aApplicationId );
       
   101 
       
   102         /**
       
   103          *	Remove Session folder from the storage, with the session folder
       
   104          *	Session is deleted from the storage, only if the calling
       
   105          *	application was the last one registered (CreateSessionFolderL())
       
   106          *
       
   107          *	@since 3.0
       
   108          *	@param aSessionSlot session slot Class which caries
       
   109          *				unique information about the session
       
   110          *	@param aApplicationId calling application Id
       
   111          */
       
   112         IMPORT_C static void RemoveSessionFolderL(
       
   113             const CPEngSessionSlotId& aSessionSlot,
       
   114             const TDesC& aApplicationId );
       
   115 
       
   116         /**
       
   117          *	Get Session slot state.
       
   118          *
       
   119          *	@since 3.0
       
   120          *	@param aSessionSlot session slot Class which caries
       
   121          *				unique information about the session
       
   122          *  @param aSessionSlotState will be filled on return with the
       
   123          *			    state of the session slot
       
   124          */
       
   125         IMPORT_C static void SessionSlotStateL(
       
   126             const CPEngSessionSlotId& aSessionSlot,
       
   127             CPEngSessionSlotState& aSessionSlotState );
       
   128 
       
   129         /**
       
   130          *	Get list of existing Session slots
       
   131          *	Returns array of all existing session slots, no matter if
       
   132          *	session is opened or closed.
       
   133          *
       
   134          *	@since 3.0
       
   135          *	@param aSessionSlots array where session slots states will be
       
   136          *			stored
       
   137          */
       
   138         IMPORT_C static void AllSessionSlotsStatesL(
       
   139             RObjectArray<CPEngSessionSlotState>& aSessionSlots );
       
   140 
       
   141 
       
   142         /**
       
   143          *	Register Global event observer
       
   144          *	Global event observer will be notified about all events
       
   145          *	of the PEC engine
       
   146          *
       
   147          *	@since 3.0
       
   148          *	@param aGlobalObserver call back interface implemented by the
       
   149          *				observer
       
   150          *		Function leaves with KErrAlreadyExists
       
   151          *		, if same observer is already registered
       
   152          */
       
   153         IMPORT_C static void RegisterGlobalEventObserverL(
       
   154             MPEngGlobalEventObserver& aGlobalObserver );
       
   155 
       
   156         /**
       
   157          *	Unregister Global event observer
       
   158          *	Global observer is unregistered, if observer is not found
       
   159          *	among the registered observers, function is ignored
       
   160          *
       
   161          *	@since 3.0
       
   162          *	@param aGlobalObserver call back interface implemented by the
       
   163          *				observer
       
   164          */
       
   165         IMPORT_C static void UnregisterGlobalObserver(
       
   166             MPEngGlobalEventObserver& aGlobalObserver );
       
   167 
       
   168 
       
   169     protected: // Constructors and destructor
       
   170 
       
   171         /**
       
   172          * C++ default constructor.
       
   173          */
       
   174         PEngStorageManager();
       
   175 
       
   176         /**
       
   177          * Destructor.
       
   178          */
       
   179         virtual ~PEngStorageManager();
       
   180 
       
   181         // Prohibit copy constructor if not deriving from CBase.
       
   182         PEngStorageManager( const PEngStorageManager& );
       
   183 
       
   184         // Prohibit assignments operator if not deriving from CBase.
       
   185         PEngStorageManager& operator=( const PEngStorageManager& );
       
   186 
       
   187     };
       
   188 
       
   189 
       
   190 #endif      // __PENGSTORAGEMANAGER_H__
       
   191 
       
   192 // End of File