|
1 /* |
|
2 * Copyright (c) 2002-2007 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: Virtual Phonebook interface for URI data of the contact field. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MVPBKCONTACTFIELDURIDATA_H |
|
20 #define MVPBKCONTACTFIELDURIDATA_H |
|
21 |
|
22 |
|
23 // INCLUDES |
|
24 #include <MVPbkContactFieldData.h> |
|
25 |
|
26 // CLASS DECLARATIONS |
|
27 |
|
28 /** |
|
29 * Virtual Phonebook Contact field URI data. |
|
30 * This interface is used to manipulate URI contact field data. |
|
31 */ |
|
32 class MVPbkContactFieldUriData : public MVPbkContactFieldData |
|
33 { |
|
34 public: // Destructor |
|
35 /** |
|
36 * Destructor. |
|
37 */ |
|
38 virtual ~MVPbkContactFieldUriData() { } |
|
39 |
|
40 public: // from MVPbkContactFieldData |
|
41 TVPbkFieldStorageType DataType() const |
|
42 { |
|
43 return EVPbkFieldStorageTypeUri; |
|
44 } |
|
45 |
|
46 public: // Interface |
|
47 /** |
|
48 * Casts MVPbkContactFieldData to this interface. |
|
49 * |
|
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. |
|
55 */ |
|
56 IMPORT_C static MVPbkContactFieldUriData& Cast( |
|
57 MVPbkContactFieldData& aFieldData); |
|
58 |
|
59 /** |
|
60 * Casts const MVPbkContactFieldData to this interface. |
|
61 * |
|
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. |
|
67 */ |
|
68 IMPORT_C static const MVPbkContactFieldUriData& Cast( |
|
69 const MVPbkContactFieldData& aFieldData); |
|
70 |
|
71 /** |
|
72 * Returns the URI scheme. |
|
73 * @return Pointer to the URI scheme. |
|
74 */ |
|
75 virtual TPtrC Scheme() const = 0; |
|
76 |
|
77 /** |
|
78 * Returns the URI . |
|
79 * @return Pointer to the URI text. |
|
80 */ |
|
81 virtual TPtrC Text() const = 0; |
|
82 |
|
83 /** |
|
84 * Returns the string data. |
|
85 * @return Pointer to the whole URI. |
|
86 */ |
|
87 virtual TPtrC Uri() const = 0; |
|
88 |
|
89 /** |
|
90 * Sets the URI data. |
|
91 * @exception KErrOverflow if (aUri.Length() > MaxLength()) |
|
92 */ |
|
93 virtual void SetUriL(const TDesC& aUri) = 0; |
|
94 |
|
95 /** |
|
96 * Sets the URI data. |
|
97 * @exception KErrOverflow if (aScheme.Length() + aText.Length() |
|
98 * + 1 > MaxLength()) |
|
99 */ |
|
100 virtual void SetUriL(const TDesC& aScheme, const TDesC& aText) = 0; |
|
101 |
|
102 /** |
|
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. |
|
106 */ |
|
107 virtual TInt MaxLength() const = 0; |
|
108 |
|
109 /** |
|
110 * Returns an extension point for this interface or NULL. |
|
111 * @param aExtensionUid Uid of extension. |
|
112 * @return Extension point or NULL. |
|
113 */ |
|
114 virtual TAny* ContactFieldTextDataExtension(TUid /*aExtensionUid*/) { return NULL; } |
|
115 }; |
|
116 |
|
117 #endif // MVPBKCONTACTFIELDURIDATA_H |
|
118 |
|
119 // End of File |