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 URI data of the contact field.
19 #ifndef MVPBKCONTACTFIELDURIDATA_H
20 #define MVPBKCONTACTFIELDURIDATA_H
24 #include <mvpbkcontactfielddata.h>
29 * Virtual Phonebook Contact field URI data.
30 * This interface is used to manipulate URI contact field data.
32 class MVPbkContactFieldUriData : public MVPbkContactFieldData
38 virtual ~MVPbkContactFieldUriData() { }
40 public: // from MVPbkContactFieldData
41 TVPbkFieldStorageType DataType() const
43 return EVPbkFieldStorageTypeUri;
48 * Casts MVPbkContactFieldData to this interface.
50 * @precond aFieldData.DataType() == EVPbkFieldStorageTypeUri
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 MVPbkContactFieldUriData& 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 MVPbkContactFieldUriData& Cast(
69 const MVPbkContactFieldData& aFieldData);
72 * Returns the URI scheme.
73 * @return Pointer to the URI scheme.
75 virtual TPtrC Scheme() const = 0;
79 * @return Pointer to the URI text.
81 virtual TPtrC Text() const = 0;
84 * Returns the string data.
85 * @return Pointer to the whole URI.
87 virtual TPtrC Uri() const = 0;
91 * @exception KErrOverflow if (aUri.Length() > MaxLength())
93 virtual void SetUriL(const TDesC& aUri) = 0;
97 * @exception KErrOverflow if (aScheme.Length() + aText.Length()
100 virtual void SetUriL(const TDesC& aScheme, const TDesC& aText) = 0;
103 * Returns maximum length of the field.
104 * @return Maximum length of the field or KVPbkUnlimitedFieldLength
105 * if length is only limited by available memory.
107 virtual TInt MaxLength() const = 0;
110 * Returns an extension point for this interface or NULL.
111 * @param aExtensionUid Uid of extension.
112 * @return Extension point or NULL.
114 virtual TAny* ContactFieldTextDataExtension(TUid /*aExtensionUid*/) { return NULL; }
117 #endif // MVPBKCONTACTFIELDURIDATA_H