PECengine/PresenceManager2/SrcAttribute/CPEngAttributeStore2.cpp
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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:  Store API to retrieve presence attribute models.
       
    15 *
       
    16 */
       
    17 
       
    18 // INCLUDE FILES
       
    19 #include "CPEngAttributeStore2.h"
       
    20 #include "CPEngAttributeStore2Imp.h"
       
    21 #include "PEngPresenceEngineConsts2.h"
       
    22 
       
    23 
       
    24 // ============================ MEMBER FUNCTIONS ===============================
       
    25 
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CPEngAttributeStore2::NewL()
       
    29 // Two-phased constructor.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 EXPORT_C CPEngAttributeStore2* CPEngAttributeStore2::NewL(
       
    33     const CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    34     TInt aPriority )
       
    35     {
       
    36     CPEngAttributeStore2* self = CPEngAttributeStore2::NewLC( aNWSessionSlotID,
       
    37                                                               aPriority );
       
    38     CleanupStack::Pop( self );
       
    39     return self;
       
    40     }
       
    41 
       
    42 
       
    43 // -----------------------------------------------------------------------------
       
    44 // CPEngAttributeStore2::NewLC()
       
    45 // Two-phased constructor.
       
    46 // -----------------------------------------------------------------------------
       
    47 //
       
    48 EXPORT_C CPEngAttributeStore2* CPEngAttributeStore2::NewLC(
       
    49     const CPEngNWSessionSlotID2& aNWSessionSlotID,
       
    50     TInt aPriority )
       
    51     {
       
    52     CPEngAttributeStore2* self = new ( ELeave ) CPEngAttributeStore2;
       
    53     CleanupStack::PushL( self );
       
    54     self->iImp = CPEngAttributeStore2Imp::NewL( aNWSessionSlotID,
       
    55                                                 aPriority );
       
    56     return self;
       
    57     }
       
    58 
       
    59 
       
    60 
       
    61 // Destructor
       
    62 CPEngAttributeStore2::~CPEngAttributeStore2()
       
    63     {
       
    64     delete iImp;
       
    65     }
       
    66 
       
    67 
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CPEngAttributeStore2::CPEngAttributeStore2
       
    71 // C++ default constructor can NOT contain any code, that
       
    72 // might leave.
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 CPEngAttributeStore2::CPEngAttributeStore2()
       
    76     {
       
    77     }
       
    78 
       
    79 
       
    80 
       
    81 // -----------------------------------------------------------------------------
       
    82 // CPEngAttributeStore2::GetCachedAttribute()
       
    83 // -----------------------------------------------------------------------------
       
    84 //
       
    85 EXPORT_C TInt CPEngAttributeStore2::GetCachedAttribute(
       
    86     const TDesC& aPresenceID,
       
    87     TUint32 aType,
       
    88     MPEngPresenceAttrModel2*& aModel ) const
       
    89     {
       
    90     return iImp->GetAttribute( aType,
       
    91                                aPresenceID,
       
    92                                aModel );
       
    93     }
       
    94 
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CPEngAttributeStore2::GetAndLockCachedAttribute()
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 EXPORT_C TInt CPEngAttributeStore2::GetAndLockCachedAttribute(
       
   101     const TDesC& aPresenceID,
       
   102     TUint32 aType,
       
   103     MPEngPresenceAttrModel2*& aModel )
       
   104     {
       
   105     return iImp->GetAndLockAttribute( aType, aPresenceID, aModel );
       
   106     }
       
   107 
       
   108 
       
   109 
       
   110 // -----------------------------------------------------------------------------
       
   111 // CPEngAttributeStore2::StoreCachedAttribute()
       
   112 // -----------------------------------------------------------------------------
       
   113 //
       
   114 EXPORT_C TInt CPEngAttributeStore2::StoreCachedAttribute(
       
   115     MPEngPresenceAttrModel2& aModel,
       
   116     TBool aReleaseEditLock )
       
   117     {
       
   118     return iImp->StoreAttribute( aModel, aReleaseEditLock );
       
   119     }
       
   120 
       
   121 
       
   122 
       
   123 // -----------------------------------------------------------------------------
       
   124 // CPEngAttributeStore2::GetOwnAttribute()
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 EXPORT_C TInt CPEngAttributeStore2::GetOwnAttribute(
       
   128     TUint32 aType,
       
   129     MPEngPresenceAttrModel2*& aModel ) const
       
   130     {
       
   131     return iImp->GetAttribute( aType, KPEngUserOwnPresenceId, aModel );
       
   132     }
       
   133 
       
   134 
       
   135 
       
   136 // -----------------------------------------------------------------------------
       
   137 // CPEngAttributeStore2::GetAndLockOwnAttribute()
       
   138 // -----------------------------------------------------------------------------
       
   139 //
       
   140 EXPORT_C TInt CPEngAttributeStore2::GetAndLockOwnAttribute(
       
   141     TUint32 aType,
       
   142     MPEngPresenceAttrModel2*& aModel )
       
   143     {
       
   144     return iImp->GetAndLockAttribute( aType, KPEngUserOwnPresenceId, aModel );
       
   145     }
       
   146 
       
   147 
       
   148 
       
   149 // -----------------------------------------------------------------------------
       
   150 // CPEngAttributeStore2::StoreOwnAttribute()
       
   151 // -----------------------------------------------------------------------------
       
   152 //
       
   153 EXPORT_C TInt CPEngAttributeStore2::StoreOwnAttribute(
       
   154     MPEngPresenceAttrModel2& aModel,
       
   155     TBool aReleaseEditLock )
       
   156     {
       
   157     return iImp->StoreAttribute( aModel, aReleaseEditLock );
       
   158     }
       
   159 
       
   160 
       
   161 
       
   162 // -----------------------------------------------------------------------------
       
   163 // CPEngAttributeStore2::UnLockOwnAttribute()
       
   164 // -----------------------------------------------------------------------------
       
   165 //
       
   166 EXPORT_C TInt CPEngAttributeStore2::UnLockOwnAttribute(
       
   167     MPEngPresenceAttrModel2& aModel )
       
   168     {
       
   169     return iImp->UnLockAttribute( aModel );
       
   170     }
       
   171 
       
   172 
       
   173 // -----------------------------------------------------------------------------
       
   174 // CPEngAttributeStore2::OwnAttributeAvailable()
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 EXPORT_C TInt CPEngAttributeStore2::OwnAttributeAvailable( TUint32 aType ) const
       
   178     {
       
   179     return iImp->AttributeAvailable( aType, KPEngUserOwnPresenceId );
       
   180     }
       
   181 
       
   182 
       
   183 // -----------------------------------------------------------------------------
       
   184 // CPEngAttributeStore2::AttributeTypeSupported()
       
   185 // -----------------------------------------------------------------------------
       
   186 //
       
   187 EXPORT_C TInt CPEngAttributeStore2::AttributeTypeSupported( TUint32 aType ) const
       
   188     {
       
   189     return iImp->AttributeTypeSupported( aType );
       
   190     }
       
   191 
       
   192 
       
   193 
       
   194 // End of File
       
   195 
       
   196