2 * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
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".
9 * Initial Contributors:
10 * Nokia Corporation - initial contribution.
14 * Description: An attribute class for contact defaults.
19 #ifndef CVPBKDEFAULTATTRIBUTE_H
20 #define CVPBKDEFAULTATTRIBUTE_H
24 #include <mvpbkcontactattribute.h>
25 #include <mvpbkcontactattributemanager.h>
26 #include <vpbkpublicuid.h>
27 #include <vpbkfieldtype.hrh>
32 * Virtual Phonebook default attribute for contacts.
33 * Responsible for encapsulating the default attribute management for
36 * The supported default types are declared in TVPbkDefaultType.
38 class CVPbkDefaultAttribute :
40 public MVPbkContactAttribute
42 public: // static data
44 * KDefaultTypeNotDefined.
46 static const TVPbkDefaultType KDefaultTypeNotDefined = EVPbkDefaultTypeUndefined;
49 * Returns the unique identifier associate with the default attribute.
51 * @return Default attribute implementation uid.
53 inline static TUid Uid() { return TUid::Uid(KVPbkDefaultAttributeImplementationUID); }
55 public: // constructor and destructor
57 * Two-phased constructor.
59 * @param aType New default's type.
60 * @return New instance of this class.
62 IMPORT_C static CVPbkDefaultAttribute* NewL(
63 TVPbkDefaultType aType);
66 * Two-phased constructor.
67 * Default type will be initialised to EVPbkDefaultTypeUndefined.
69 * @return New instance of this class.
71 IMPORT_C static CVPbkDefaultAttribute* NewL();
76 ~CVPbkDefaultAttribute();
82 * @param aType New default's type
84 IMPORT_C void SetDefaultType(TVPbkDefaultType aType);
87 * Returns default's type.
89 * @return Default's type.
91 IMPORT_C TVPbkDefaultType DefaultType() const;
93 public: // from MVPbkContactAttribute
94 TUid AttributeType() const;
95 MVPbkContactAttribute* CloneLC() const;
97 private: // implementation
98 CVPbkDefaultAttribute();
101 /// Own: Default's type
102 TVPbkDefaultType iDefaultType;
105 #endif // CVPBKDEFAULTATTRIBUTE_H