PECengine/StorageManager2/ClientInc/MPEngStorageManagerWatcher.h
branchRCL_3
changeset 17 a941bc465d9f
parent 0 094583676ce7
equal deleted inserted replaced
16:6ca72c0fe49a 17:a941bc465d9f
       
     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:  It is used to liste Storage Ids and session state
       
    15 *				 changes
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef __MPENGSTORAGEMANAGERWATCHER_H__
       
    21 #define __MPENGSTORAGEMANAGERWATCHER_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include    <e32base.h>
       
    25 #include    <bamdesca.h>
       
    26 
       
    27 
       
    28 // PEC Engine constants
       
    29 #include    "PEngPresenceEngineConsts2.h"
       
    30 
       
    31 
       
    32 // FORWARD DECLARATIONS
       
    33 class MPEngGlobalEventObserver;
       
    34 class MPEngSIDChangeObserver;
       
    35 class MPEngStorageManager;
       
    36 class CPEngStoreEntry;
       
    37 class CPEngSessionSlotId;
       
    38 
       
    39 
       
    40 // CLASS DECLARATION
       
    41 /**
       
    42  *  Storage manager watcher
       
    43  *  It is used to liste Storage Ids and session state changes.
       
    44  *	State changes are listened only of the session of the
       
    45  *	storage watcher.
       
    46  *	All observer Storage Id are also located in the session slot
       
    47  *	storage watcher was loaded
       
    48  *
       
    49  *  @lib PEngStoreMan2.dll
       
    50  *  @since 3.0
       
    51  */
       
    52 
       
    53 class MPEngStorageManagerWatcher
       
    54     {
       
    55     public:
       
    56         // Priority of the observers
       
    57         enum TPEngObserverPriority
       
    58             {
       
    59             /**
       
    60              *  This value is meant only for internal components
       
    61              *  so notifications will get first there and store
       
    62              *  entries can be refreshed before clients are informed
       
    63              *  about it changes
       
    64              */
       
    65             EPEngObserverInternal           = 1,
       
    66 
       
    67             /**
       
    68              *  High priority for the client observer,
       
    69              *  These observers are informed about change as first after
       
    70              *  internal observers
       
    71              */
       
    72             EPEngObserverHighPriority       = 2,
       
    73             /**
       
    74              *  Normal priority for the client observer, used as default
       
    75              */
       
    76             EPEngObserverNormalPriority     = 3,
       
    77             /**
       
    78              *  Low priority for the client observer
       
    79              *  These observers are informed about change as last
       
    80              */
       
    81             EPEngObserverLowPriority        = 4
       
    82             };
       
    83     public: // New functions
       
    84 
       
    85         /**
       
    86          *  Openes handle to the Storage Manager watcher
       
    87          *
       
    88          *  @since 3.0
       
    89          */
       
    90         virtual void Open() = 0;
       
    91 
       
    92         /**
       
    93          *  Closes handle to the Storage Manager watcher
       
    94          *
       
    95          *  @since 3.0
       
    96          */
       
    97         virtual void Close() = 0;
       
    98 
       
    99         /**
       
   100          *  Create Storage Manager
       
   101          *  It creates storage manager instance for the Session of this
       
   102          *  Storage Manager watcher
       
   103          *  Ownership is transfered to the caller
       
   104          *
       
   105          *  @since 3.0
       
   106          *  @return returns Instance of the Storage manager
       
   107          */
       
   108         virtual MPEngStorageManager* CreateStorageManagerL() = 0;
       
   109 
       
   110         /**
       
   111          *  Register new event observer
       
   112          *  Notify factory will notify observer about every new event
       
   113          *  which will occur. This function does the same as previous
       
   114          *  StartNotifyFactoryL, but it also register observer for
       
   115          *  notifications. Observing is ended when observer is
       
   116          *  unregistered.
       
   117          *  This also increase reference count for the Notify factory
       
   118          *  singleton. Notify factory is deleted when there is no more
       
   119          *  observers, that inclused, also new event and
       
   120          *  SID change observers.
       
   121          *
       
   122          *  @since 3.0
       
   123          *  @param aEventObserver event observer where to notify
       
   124          *          about new event
       
   125          *  @return returns current Presence server state
       
   126          */
       
   127         virtual TPEngNWSessionSlotState RegisterListenEventObserverL(
       
   128             MPEngGlobalEventObserver& aEventObserver ) = 0;
       
   129 
       
   130         /**
       
   131          *  Un Register event observer
       
   132          *  This unregisters event observer.
       
   133          *  Notify factory is deleted when there is no more observers,
       
   134          *  that inclused all kind of observers
       
   135          *
       
   136          *  @since 3.0
       
   137          *  @param aEventObserver event observer where to notify
       
   138          *  about new event
       
   139          */
       
   140         virtual void UnregisterListenEventObserver(
       
   141             MPEngGlobalEventObserver& aEventObserver ) = 0;
       
   142 
       
   143         /**
       
   144          *  Returns current state of the presence server
       
   145          *
       
   146          *  @since 3.0
       
   147          *  @return current state of the presence server
       
   148          */
       
   149         virtual TPEngNWSessionSlotState CurrentStateOfSessionSlot() = 0;
       
   150 
       
   151         /**
       
   152          *  Registers Storage IDs listener
       
   153          *  If Storage IDs listener does not exists it is created.
       
   154          *  If lister already exists, set of the Storage Ids is
       
   155          *  updated.
       
   156          *  Notify factory will notify observer about every change of
       
   157          *  the SIDs listener has subscribed
       
   158          *
       
   159          *	@since 3.0
       
   160          *	@param aInterestedSIDs Storage IDs listener is interested in
       
   161          *	@param aSIDChangeObserver observer call back interface
       
   162          *	@param aPriority priority of the observer
       
   163          *	@param aKeepOldIDs flag if current Sids are kept
       
   164          *			ETrue will keep previously registered Store Ids
       
   165          */
       
   166         virtual void RegisterListenSIDsObserverL(
       
   167             const MDesCArray& aInterestedSIds,
       
   168             MPEngSIDChangeObserver& aSIdChangeObserver,
       
   169             TPEngObserverPriority aPriority,
       
   170             TBool aKeepOldIds = ETrue ) = 0;
       
   171 
       
   172 
       
   173         /**
       
   174          *  Remove engaged SIDs from existing Storage IDs listener
       
   175          *  If Storage IDs listener does not exists this call is ignored
       
   176          *  Notify factory will notify observer about every change of
       
   177          *  remaining SIDs listener has subscribed.
       
   178          *
       
   179          *	@since 3.0
       
   180          *	@param aSIDsToRemove Storage IDs to be removed
       
   181          *	@param aSIDChangeObserver observer call back interface
       
   182          */
       
   183         virtual void RemoveSIDsFromSIDsObserver(
       
   184             const MDesCArray& aSIdsToRemove,
       
   185             const MPEngSIDChangeObserver& aSIdChangeObserver ) = 0;
       
   186 
       
   187         /**
       
   188          *  Restart Storage Id observer
       
   189          *  It removes all engaged SIDs from existing Storage IDs listener
       
   190          *  If Storage IDs listener does not exists this call is ignored
       
   191          *
       
   192          *	@since 3.0
       
   193          *	@param aSIDChangeObserver observer call back interface
       
   194          */
       
   195         virtual void RestartSIDsObserver(
       
   196             const MPEngSIDChangeObserver& aSIdChangeObserver ) = 0;
       
   197 
       
   198 
       
   199         /**
       
   200          *  Un Register SID change observer
       
   201          *  This unregisters SID change observer.
       
   202          *  Notify factory is deleted when there is no more observers,
       
   203          *  that inclused all kind of observers
       
   204          *
       
   205          *  @since 3.0
       
   206          *	@param aSIDChangeObserver observer call back interface
       
   207          */
       
   208         virtual void UnregisterListenSIDsObserver(
       
   209             const MPEngSIDChangeObserver& aSIdChangeObserver ) = 0;
       
   210 
       
   211         /**
       
   212          *  Suspend existing SIDs listener
       
   213          *  If listener is not found, function will return KErrNotFound
       
   214          *
       
   215          *  @since 3.0
       
   216          *  @param aSIDChangeObserver observer where notify factory
       
   217          *                                  will notify about SID change
       
   218          *  @return KErrNone or KErrNotFound
       
   219          */
       
   220         virtual TInt SuspendListenSIDsObserver(
       
   221             const MPEngSIDChangeObserver& aSIdChangeObserver ) = 0;
       
   222 
       
   223         /**
       
   224          *  Resume existing suspended SIDs listener
       
   225          *  If listener is not found, function will return KErrNotFound
       
   226          *  if listener was not suspended, function will be ignored
       
   227          *
       
   228          *  @since 3.0
       
   229          *  @param aSIDChangeObserver observer where notify factory
       
   230          *                                  will notify about SID change
       
   231          *  @return KErrNone or KErrNotFound
       
   232          */
       
   233         virtual TInt ResumeListenSIDsObserver(
       
   234             const MPEngSIDChangeObserver& aSIdChangeObserver ) = 0;
       
   235 
       
   236         /*
       
   237          *  Get Session slot Id class
       
   238          *  Returned class carries information about the session of this
       
   239          *  instance of the storage manager watcher
       
   240          *
       
   241          *  @since 3.0
       
   242          *  @return CPEngSessionSlotId& Session Id slot reference
       
   243          */
       
   244         virtual const CPEngSessionSlotId& SessionSlotId() const = 0;
       
   245 
       
   246     protected: // Constructors and destructor
       
   247 
       
   248         /**
       
   249          * Destructor. cannot be destroyed using this interface,
       
   250          * use Close Instead
       
   251          */
       
   252         virtual ~MPEngStorageManagerWatcher() {};
       
   253 
       
   254     };
       
   255 
       
   256 
       
   257 #endif      // __MPENGSTORAGEMANAGERWATCHER_H__
       
   258 
       
   259 // End of File