PECengine/StorageManager2/ClientSrc/CPEngSIDContainer.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 Id container
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef __CPENGSIDCONTAINER_H__
       
    21 #define __CPENGSIDCONTAINER_H__
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include "MPEngSIDContainer.h"
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MPEngSIDChangeObserver;
       
    29 
       
    30 /**
       
    31  *  One storage Id container
       
    32  *  It hold reference to the all observers
       
    33  *	which are observing this storage Id
       
    34  *
       
    35  *  @lib PEngStorMan2.dll
       
    36  *  @since 3.0
       
    37  */
       
    38 NONSHARABLE_CLASS( CPEngSIdContainer ):
       
    39         public CBase,
       
    40         public MPEngSIdContainer
       
    41     {
       
    42 public:  // Constructors and destructor
       
    43 
       
    44     /**
       
    45      * Two-phased constructor.
       
    46      */
       
    47     static CPEngSIdContainer* NewLC( const TDesC& aSId );
       
    48 
       
    49     /**
       
    50      * Destructor.
       
    51      */
       
    52     virtual ~CPEngSIdContainer();
       
    53 
       
    54 public: // New functions of MPEngSIDContainer
       
    55 
       
    56     /**
       
    57      * Returns engaged SId
       
    58      * More info in <MPEngSIDContainer.h>
       
    59      * @since 3.0
       
    60      */
       
    61     const TDesC& SId() const;
       
    62 
       
    63     /**
       
    64      *	Add Observer container to the container
       
    65      *	More info in <MPEngSIDContainer.h>
       
    66      *	@since 3.0
       
    67      */
       
    68     TInt AddObserverContainer(
       
    69         const CPEngObserverContainer* aObserver );
       
    70 
       
    71     /**
       
    72      *	Remove Observer from the container
       
    73      *	More info in <MPEngSIDContainer.h>
       
    74      *	@since 3.0
       
    75      */
       
    76     void RemoveObserverContainer(
       
    77         const CPEngObserverContainer* aObserver );
       
    78 
       
    79 public: // New functions
       
    80 
       
    81     /**
       
    82      *  Notify change of the storage Id to the observers
       
    83      *
       
    84      *  @since 3.0
       
    85      */
       
    86     void NotifySIdChangeL();
       
    87 
       
    88     /**
       
    89      *  SId published to the Server
       
    90      *
       
    91      *  @since 3.0
       
    92      *  @return ETrue if it was published
       
    93      */
       
    94     TBool SIdPublished() const;
       
    95 
       
    96     /**
       
    97      *  Set SId as published to the Server
       
    98      *
       
    99      *  @since 3.0
       
   100      *  @return ETrue if yes
       
   101      */
       
   102     void SetSIdPublished();
       
   103 
       
   104     /**
       
   105      *  Observers count
       
   106      *
       
   107      *  @since 3.0
       
   108      *  @return count of observers
       
   109      */
       
   110     TInt ObserverCount() const;
       
   111 
       
   112     /**
       
   113      *  Allocated free slots in array
       
   114      *
       
   115      *  @since 3.0
       
   116      *  @param count of new slots to be still allocated
       
   117      *  @param aDone number already allocated slots
       
   118      *  @return KErrNone if OK otherwise wise error code
       
   119      */
       
   120     TInt AllocateSlots( TInt aCount, TInt aDone = 0 );
       
   121 
       
   122 private:
       
   123 
       
   124     /**
       
   125      * C++ default constructor.
       
   126      */
       
   127     CPEngSIdContainer();
       
   128 
       
   129     /**
       
   130      * By default Symbian 2nd phase constructor is private.
       
   131      */
       
   132     void ConstructL( const TDesC& aSId );
       
   133 
       
   134 private:    // Data
       
   135     /// OWN: Store ID owned
       
   136     HBufC*									iSId;
       
   137 
       
   138     /// REF: Observer Container array
       
   139     RPointerArray<CPEngObserverContainer>	iObservers;
       
   140 
       
   141 
       
   142     /// Flag is SID was published to the server
       
   143     TBool									iPublished;
       
   144     };
       
   145 
       
   146 #endif      // __CPENGSIDCONTAINER_H__
       
   147 
       
   148 // End of File