|
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 binary contact field data. |
|
15 * |
|
16 */ |
|
17 |
|
18 |
|
19 #ifndef MVPBKCONTACTFIELDBINARYDATA_H |
|
20 #define MVPBKCONTACTFIELDBINARYDATA_H |
|
21 |
|
22 // INCLUDES |
|
23 #include <MVPbkContactFieldData.h> |
|
24 |
|
25 |
|
26 // CLASS DECLARATIONS |
|
27 |
|
28 /** |
|
29 * Virtual Phonebook binary field data. |
|
30 * This interface is used to manipulate binary contact field data. |
|
31 */ |
|
32 class MVPbkContactFieldBinaryData : public MVPbkContactFieldData |
|
33 { |
|
34 public: // Destructor |
|
35 /** |
|
36 * Destructor. |
|
37 */ |
|
38 virtual ~MVPbkContactFieldBinaryData() { } |
|
39 |
|
40 |
|
41 public: // from MVPbkContactFieldData |
|
42 TVPbkFieldStorageType DataType() const |
|
43 { |
|
44 return EVPbkFieldStorageTypeBinary; |
|
45 } |
|
46 |
|
47 public: // Interface |
|
48 /** |
|
49 * Casts MVPbkContactFieldData to this interface. |
|
50 * |
|
51 * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary |
|
52 * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) |
|
53 * is raised if the precondition does not hold. |
|
54 * @param aFieldData Data of the field. |
|
55 * @return Casted inteface for the binary field data. |
|
56 */ |
|
57 IMPORT_C static MVPbkContactFieldBinaryData& Cast( |
|
58 MVPbkContactFieldData& aFieldData ); |
|
59 |
|
60 /** |
|
61 * Casts const MVPbkContactFieldData to this interface. |
|
62 * |
|
63 * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary |
|
64 * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) |
|
65 * is raised if the precondition does not hold. |
|
66 * @param aFieldData Data of the field. |
|
67 * @return Casted inteface for the binary field data. |
|
68 */ |
|
69 IMPORT_C static const MVPbkContactFieldBinaryData& Cast( |
|
70 const MVPbkContactFieldData& aFieldData ); |
|
71 |
|
72 /** |
|
73 * Returns the binary data pointer. |
|
74 * @return Pointer to binary data. |
|
75 */ |
|
76 virtual TPtrC8 BinaryData() const =0; |
|
77 |
|
78 /** |
|
79 * Sets the binary data. |
|
80 * @exception KErrOverflow if (aBinaryData.Length() > MaxLength()) |
|
81 * @param aBinaryData Binary data to be set. |
|
82 */ |
|
83 virtual void SetBinaryDataL( const TDesC8& aBinaryData ) = 0; |
|
84 |
|
85 /** |
|
86 * Returns maximum length of the field. |
|
87 * @return Maximum length of the field or KVPbkUnlimitedFieldLength |
|
88 * if length is only limited by available memory. |
|
89 */ |
|
90 virtual TInt MaxLength() const { return KVPbkUnlimitedFieldLength; } |
|
91 |
|
92 /** |
|
93 * Returns an extension point for this interface or NULL. |
|
94 * @param aExtensionUid Uid of extension. |
|
95 * @return Extension point or NULL. |
|
96 */ |
|
97 virtual TAny* ContactFieldBinaryDataExtension( |
|
98 TUid /*aExtensionUid*/ ) { return NULL; } |
|
99 |
|
100 }; |
|
101 |
|
102 #endif // MVPBKCONTACTFIELDBINARYDATA_H |
|
103 |
|
104 // End of File |