phonebookengines/VirtualPhonebook/VPbkLdapStore/src/ContactStoreProperties.cpp
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2005-2006 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:  CContactStoreProperties implementation
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "contactstoreproperties.h"
       
    21 
       
    22 // -----------------------------------------------------------------------------
       
    23 // LDAP Store namespace
       
    24 // -----------------------------------------------------------------------------
       
    25 namespace LDAPStore {
       
    26 
       
    27 // -----------------------------------------------------------------------------
       
    28 // CContactStoreProperties::CContactStoreProperties
       
    29 // C++ default constructor can NOT contain any code, that might leave.
       
    30 // -----------------------------------------------------------------------------
       
    31 //
       
    32 CContactStoreProperties::CContactStoreProperties()
       
    33     {
       
    34     // No implementation required
       
    35     }
       
    36 // -----------------------------------------------------------------------------
       
    37 // CContactStoreProperties::ConstructL
       
    38 // CContactStoreProperties constructor for performing 2nd stage construction
       
    39 // -----------------------------------------------------------------------------
       
    40 //
       
    41 void CContactStoreProperties::ConstructL()
       
    42     {
       
    43     // No implementation at the moment
       
    44     }
       
    45 // -----------------------------------------------------------------------------
       
    46 // CContactStoreProperties::NewLC
       
    47 // CContactStoreProperties two-phased constructor.
       
    48 // -----------------------------------------------------------------------------
       
    49 //
       
    50 CContactStoreProperties* CContactStoreProperties::NewLC()
       
    51     {
       
    52     CContactStoreProperties* self = new (ELeave)CContactStoreProperties();
       
    53     CleanupStack::PushL(self);
       
    54     self->ConstructL();
       
    55     return self;
       
    56     }
       
    57 // -----------------------------------------------------------------------------
       
    58 // CContactStoreProperties::NewL
       
    59 // CContactStoreProperties two-phased constructor.
       
    60 // -----------------------------------------------------------------------------
       
    61 //
       
    62 CContactStoreProperties* CContactStoreProperties::NewL()
       
    63     {
       
    64     CContactStoreProperties* self = CContactStoreProperties::NewLC();
       
    65     CleanupStack::Pop(self);
       
    66     return self;
       
    67     }
       
    68 
       
    69 // -----------------------------------------------------------------------------
       
    70 // CContactStoreProperties::~CContactStoreProperties
       
    71 // CContactStoreProperties Destructor
       
    72 // -----------------------------------------------------------------------------
       
    73 //
       
    74 CContactStoreProperties::~CContactStoreProperties()
       
    75     {
       
    76     }
       
    77 
       
    78 // -----------------------------------------------------------------------------
       
    79 //                  CContactStoreProperties public methods
       
    80 // -----------------------------------------------------------------------------
       
    81 // CContactStoreProperties::SetName
       
    82 // -----------------------------------------------------------------------------
       
    83 //
       
    84 void CContactStoreProperties::SetName(const TVPbkContactStoreUriPtr& aName)
       
    85     {
       
    86     iUriName.Set(aName);
       
    87     }
       
    88 
       
    89 // -----------------------------------------------------------------------------
       
    90 // CContactStoreProperties::SetSupportedFields
       
    91 // -----------------------------------------------------------------------------
       
    92 //
       
    93 void CContactStoreProperties::SetSupportedFields
       
    94 (
       
    95     const MVPbkFieldTypeList& aSupportedFields
       
    96 )
       
    97     {
       
    98     iSupportedFields = &aSupportedFields;
       
    99     }
       
   100 
       
   101 // -----------------------------------------------------------------------------
       
   102 // CContactStoreProperties::SetBooleanProperty
       
   103 // -----------------------------------------------------------------------------
       
   104 //
       
   105 void CContactStoreProperties::SetBooleanProperty
       
   106 (
       
   107     TPropertyFlag aFlag,
       
   108     TBool        aValue
       
   109 )
       
   110     {
       
   111     if (aValue)
       
   112         {
       
   113         iFlags |= static_cast<TUint32>(aFlag);
       
   114         }
       
   115     else
       
   116         {
       
   117         iFlags &= ~static_cast<TUint32>(aFlag);
       
   118         }
       
   119     }
       
   120 
       
   121 // -----------------------------------------------------------------------------
       
   122 //                  MVPbkContactStoreProperties implementation
       
   123 // -----------------------------------------------------------------------------
       
   124 // CContactStoreProperties::Name
       
   125 // -----------------------------------------------------------------------------
       
   126 //
       
   127 TVPbkContactStoreUriPtr CContactStoreProperties::Name() const
       
   128     {
       
   129     // Parse actual name of the contact store
       
   130     return iUriName.Component(TVPbkContactStoreUriPtr::EContactStoreUriStoreLocation);
       
   131     }
       
   132 
       
   133 // -----------------------------------------------------------------------------
       
   134 // CContactStoreProperties::Uri
       
   135 // -----------------------------------------------------------------------------
       
   136 //
       
   137 TVPbkContactStoreUriPtr CContactStoreProperties::Uri() const
       
   138     {
       
   139     return iUriName;
       
   140     }
       
   141 
       
   142 // -----------------------------------------------------------------------------
       
   143 // CContactStoreProperties::ReadOnly
       
   144 // Returns true if the store is read-only.
       
   145 // -----------------------------------------------------------------------------
       
   146 //
       
   147 TBool CContactStoreProperties::ReadOnly() const
       
   148     {
       
   149     return ETrue;
       
   150     }
       
   151 
       
   152 // -----------------------------------------------------------------------------
       
   153 // CContactStoreProperties::Persistent
       
   154 // Returns true if the store is persistent.
       
   155 // -----------------------------------------------------------------------------
       
   156 //
       
   157 TBool CContactStoreProperties::Persistent() const
       
   158     {
       
   159     return ETrue;
       
   160     }
       
   161 
       
   162 // -----------------------------------------------------------------------------
       
   163 // CContactStoreProperties::Local
       
   164 // Returns true if the store is local.
       
   165 // -----------------------------------------------------------------------------
       
   166 //
       
   167 TBool CContactStoreProperties::Local() const
       
   168     {
       
   169     return EFalse;
       
   170     }
       
   171 
       
   172 // -----------------------------------------------------------------------------
       
   173 // CContactStoreProperties::Removable
       
   174 // Returns true if the store data is stored on removable media.
       
   175 // -----------------------------------------------------------------------------
       
   176 //
       
   177 TBool CContactStoreProperties::Removable() const
       
   178     {
       
   179     return EFalse;
       
   180     }
       
   181 
       
   182 // -----------------------------------------------------------------------------
       
   183 // CContactStoreProperties::SupportsFieldLabels
       
   184 // Returns true if the store supports field labels.
       
   185 // -----------------------------------------------------------------------------
       
   186 //
       
   187 TBool CContactStoreProperties::SupportsFieldLabels() const
       
   188     {
       
   189     return EFalse;
       
   190     }
       
   191 
       
   192 // -----------------------------------------------------------------------------
       
   193 // CContactStoreProperties::SupportsDefaults
       
   194 // Returns true if the store supports defaults.
       
   195 // -----------------------------------------------------------------------------
       
   196 //
       
   197 TBool CContactStoreProperties::SupportsDefaults() const
       
   198     {
       
   199     return EFalse;
       
   200     }
       
   201 
       
   202 // -----------------------------------------------------------------------------
       
   203 // CContactStoreProperties::SupportsVoiceTags
       
   204 // Returns true if the store supports voice tags.
       
   205 // -----------------------------------------------------------------------------
       
   206 //
       
   207 TBool CContactStoreProperties::SupportsVoiceTags() const
       
   208     {
       
   209     return EFalse;
       
   210     }
       
   211 
       
   212 // -----------------------------------------------------------------------------
       
   213 // CContactStoreProperties::SupportsSpeedDials
       
   214 // Returns true if the store supports speed dials.
       
   215 // -----------------------------------------------------------------------------
       
   216 //
       
   217 TBool CContactStoreProperties::SupportsSpeedDials() const
       
   218     {
       
   219     return EFalse;
       
   220     }
       
   221 
       
   222 // -----------------------------------------------------------------------------
       
   223 // CContactStoreProperties::SupportsContactGroups
       
   224 // Returns true if the store supports contact groups.
       
   225 // -----------------------------------------------------------------------------
       
   226 //
       
   227 TBool CContactStoreProperties::SupportsContactGroups() const
       
   228     {
       
   229     return EFalse;
       
   230     }
       
   231 
       
   232 // -----------------------------------------------------------------------------
       
   233 // CContactStoreProperties::SupportedFields
       
   234 // -----------------------------------------------------------------------------
       
   235 //
       
   236 const MVPbkFieldTypeList& CContactStoreProperties::SupportedFields() const
       
   237     {
       
   238     return *iSupportedFields;
       
   239     }
       
   240 
       
   241 
       
   242 // -----------------------------------------------------------------------------
       
   243 // CContactStoreProperties::SupportsService
       
   244 // -----------------------------------------------------------------------------
       
   245 //
       
   246 TBool CContactStoreProperties::SupportsService(TUid aServiceUid) const
       
   247     {
       
   248     // TODO
       
   249     return EFalse;
       
   250     }
       
   251 
       
   252 
       
   253 } // End of namespace LDAPStore
       
   254 // -----------------------------------------------------------------------------
       
   255 //  End of File
       
   256 // -----------------------------------------------------------------------------