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: Virtual Phonebook interface for text data of the contact field.
19 #ifndef MVPBKCONTACTFIELDTEXTDATA_H
20 #define MVPBKCONTACTFIELDTEXTDATA_H
24 #include <mvpbkcontactfielddata.h>
29 * Virtual Phonebook Contact field text data.
30 * This interface is used to manipulate text contact field data.
32 class MVPbkContactFieldTextData : public MVPbkContactFieldData
38 virtual ~MVPbkContactFieldTextData() { }
40 public: // from MVPbkContactFieldData
41 TVPbkFieldStorageType DataType() const
43 return EVPbkFieldStorageTypeText;
48 * Casts MVPbkContactFieldData to this interface.
50 * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
51 * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
52 * is raised if the precondition does not hold.
53 * @param aFieldData Data of the field.
54 * @return Casted inteface for the text field data.
56 IMPORT_C static MVPbkContactFieldTextData& Cast(
57 MVPbkContactFieldData& aFieldData);
60 * Casts const MVPbkContactFieldData to this interface.
62 * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
63 * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
64 * is raised if the precondition does not hold.
65 * @param aFieldData Data of the field.
66 * @return Casted inteface for the text field data.
68 IMPORT_C static const MVPbkContactFieldTextData& Cast(
69 const MVPbkContactFieldData& aFieldData);
72 * Returns the string data.
73 * @return Pointer to the text data.
75 virtual TPtrC Text() const = 0;
78 * Sets the string data.
79 * @exception KErrOverflow if (aText.Length() > MaxLength())
81 virtual void SetTextL( const TDesC& aText ) = 0;
84 * Returns maximum length of the field.
85 * @return Maximum length of the field or KVPbkUnlimitedFieldLength
86 * if length is only limited by available memory.
88 virtual TInt MaxLength() const = 0;
91 * Returns an extension point for this interface or NULL.
92 * @param aExtensionUid Uid of extension.
93 * @return Extension point or NULL.
95 virtual TAny* ContactFieldTextDataExtension(TUid /*aExtensionUid*/) { return NULL; }
98 #endif // MVPBKCONTACTFIELDTEXTDATA_H