PECengine/AttributeLibrary2/Src/CPEngPresenceAttrManager.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2005 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:  Concrete presence attribute manager implementation.
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef CPENGPRESENCEATTRMANAGER_H
       
    19 #define CPENGPRESENCEATTRMANAGER_H
       
    20 
       
    21 //  INCLUDES
       
    22 #include "CPEngSessionSlotObject.h"
       
    23 #include "MPEngPresenceAttrManager.h"
       
    24 #include <E32Base.h>
       
    25 
       
    26 
       
    27 // FORWARD DECLARATIONS
       
    28 class MPEngStorageManager;
       
    29 class CPEngAttrConstructorCon;
       
    30 
       
    31 
       
    32 
       
    33 
       
    34 
       
    35 // CLASS DECLARATION
       
    36 
       
    37 /**
       
    38  * Presence attribute manager implementation.
       
    39  *
       
    40  * @since 3.0
       
    41  */
       
    42 NONSHARABLE_CLASS( CPEngPresenceAttrManager ) : public CPEngSessionSlotObject,
       
    43         public MPEngPresenceAttrManager
       
    44 
       
    45     {
       
    46 public:  // Constructors and destructor
       
    47 
       
    48     /**
       
    49      * Two-phased constructor.
       
    50      */
       
    51     static CPEngPresenceAttrManager* NewLC( const CPEngSessionSlotId& aSlotId );
       
    52 
       
    53     /**
       
    54      * Destructor.
       
    55      */
       
    56     ~CPEngPresenceAttrManager();
       
    57 
       
    58 
       
    59 private:
       
    60 
       
    61     /**
       
    62      * By default Symbian OS constructor is private.
       
    63      */
       
    64     void ConstructL( const CPEngSessionSlotId& aSlotId );
       
    65 
       
    66     /**
       
    67      * C++ default constructor.
       
    68      */
       
    69     CPEngPresenceAttrManager();
       
    70 
       
    71 
       
    72 
       
    73 public: // Functions from MPEngPresenceAttrManager
       
    74 
       
    75 
       
    76     /**
       
    77      * From MPEngPresenceAttrManager.
       
    78      *
       
    79      * @since 3.0
       
    80      */
       
    81     void Close();
       
    82 
       
    83     void InstantiateAttributeLC( MPEngPresenceAttrModel2*& aModel,
       
    84                                  const TDesC& aPresenceID,
       
    85                                  TUint32 aType,
       
    86                                  TInt aInstanceOptions );
       
    87 
       
    88 
       
    89     TInt LoadAttributeLC( MPEngPresenceAttrModel2*& aModel,
       
    90                           const TDesC& aPresenceID,
       
    91                           TUint32 aType,
       
    92                           TInt aInstanceOptions );
       
    93 
       
    94     void StoreEditLockedAttributeL( const MPEngPresenceAttrModel2& aModel );
       
    95     TInt StopEditSupport( MPEngPresenceAttrModel2& aModel ) const;
       
    96     void ModelEditLockedFromThisSlotL( const MPEngPresenceAttrModel2& aModel ) const;
       
    97 
       
    98     TInt ValidNetworkAttribute( TUint32 aType ) const;
       
    99     TArray<TUint32> KnownAttributeTypes() const;
       
   100 
       
   101     TInt GetAttributeXmlNameAndNameSpace( TUint32 aType,
       
   102                                           TPtrC8& aAttributeName,
       
   103                                           TPtrC8& aAttributeNameSpace ) const;
       
   104 
       
   105 
       
   106 
       
   107     HBufC16* PackModelArrayL( const RPointerArray<MPEngPresenceAttrModel2>& aModels ) const;
       
   108     void UnpackModelArrayL( const TDesC16& aModelPkg,
       
   109                             TInt aInstanceOptions,
       
   110                             RPointerArray<MPEngPresenceAttrModel2>& aModels );
       
   111 
       
   112 
       
   113     HBufC16* PackFetchRequestL( const MDesCArray& aPresenceIDs,
       
   114                                 const TArray<TUint32>& aTypes ) const;
       
   115     void UnpackFetchRequestL( const TDesC16& aFetchRequestPkg,
       
   116                               CDesCArray& aPresenceIDs,
       
   117                               RArray<TUint32>& aTypes ) const;
       
   118 
       
   119 
       
   120     HBufC* GenerateStoreIdL( TUint32 aAttributeType,
       
   121                              const TDesC& aPresenceId ) const;
       
   122     TInt ResolveStoreId( const TDesC& aStoreId,
       
   123                          TUint32& aAttributeType,
       
   124                          TPtrC& aPresenceId ) const;
       
   125 
       
   126     void ForceStoreBatchL( const RPointerArray<MPEngPresenceAttrModel2> aModels );
       
   127     void ForceRemoveFromStoreBatchL( RPointerArray<MPEngPresenceAttrModel2> aModels );
       
   128 
       
   129 
       
   130 
       
   131 private:    // Data
       
   132 
       
   133     //OWN: Storage manager
       
   134     MPEngStorageManager*    iStorageManager;
       
   135 
       
   136     //OWNn: Attribute type constructors
       
   137     CPEngAttrConstructorCon*    iTypeConstructors;
       
   138 
       
   139 
       
   140     };
       
   141 
       
   142 #endif      // CPENGPRESENCEATTRMANAGER_H
       
   143 
       
   144 //  End of File
       
   145 
       
   146