|
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: |
|
15 : |
|
16 * |
|
17 */ |
|
18 |
|
19 |
|
20 |
|
21 #include "s_MVPbkContactFieldBinaryDatastub.h" |
|
22 |
|
23 _LIT8(KTestBinaryData, "some binary dataJunk"); |
|
24 |
|
25 /** |
|
26 * Casts MVPbkContactFieldData to this interface. |
|
27 * |
|
28 * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary |
|
29 * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) |
|
30 * is raised if the precondition does not hold. |
|
31 * @param aFieldData Data of the field. |
|
32 * @return Casted inteface for the binary field data. |
|
33 */ |
|
34 EXPORT_C MVPbkContactFieldBinaryData& MVPbkContactFieldBinaryData::Cast( |
|
35 MVPbkContactFieldData& aFieldData ) |
|
36 { |
|
37 return static_cast<MVPbkContactFieldBinaryData&>(aFieldData); |
|
38 }; |
|
39 |
|
40 /** |
|
41 * Casts const MVPbkContactFieldData to this interface. |
|
42 * |
|
43 * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary |
|
44 * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch) |
|
45 * is raised if the precondition does not hold. |
|
46 * @param aFieldData Data of the field. |
|
47 * @return Casted inteface for the binary field data. |
|
48 */ |
|
49 EXPORT_C const MVPbkContactFieldBinaryData& MVPbkContactFieldBinaryData::Cast( |
|
50 const MVPbkContactFieldData& aFieldData ) |
|
51 { |
|
52 return static_cast<const MVPbkContactFieldBinaryData&>(aFieldData); |
|
53 }; |
|
54 /** |
|
55 * Returns the binary data pointer. |
|
56 * @return Pointer to binary data. |
|
57 */ |
|
58 TPtrC8 CVPbkContactFieldBinaryDataStub::BinaryData() const |
|
59 { |
|
60 return KTestBinaryData(); |
|
61 } |
|
62 /** |
|
63 * Sets the binary data. |
|
64 * @exception KErrOverflow if (aBinaryData.Length() > MaxLength()) |
|
65 * @param aBinaryData Binary data to be set. |
|
66 */ |
|
67 void CVPbkContactFieldBinaryDataStub::SetBinaryDataL( const TDesC8& /*aBinaryData*/ ) |
|
68 { |
|
69 |
|
70 } |
|
71 |
|
72 /** |
|
73 * Returns the derived data type id. |
|
74 * @return Contact field storage type. |
|
75 */ |
|
76 TVPbkFieldStorageType CVPbkContactFieldBinaryDataStub::DataType() const |
|
77 { |
|
78 return EVPbkFieldStorageTypeBinary; |
|
79 } |
|
80 |
|
81 /** |
|
82 * Returns true if the storage is empty. |
|
83 * @return ETrue if the data field is empty. |
|
84 */ |
|
85 TBool CVPbkContactFieldBinaryDataStub::IsEmpty() const |
|
86 { |
|
87 return EFalse; |
|
88 } |
|
89 |
|
90 /** |
|
91 * Copies data from given field data. |
|
92 * @param aFieldData Data that is copied to this object. |
|
93 * @precond aFieldData.DataType() == this->DataType() |
|
94 */ |
|
95 void CVPbkContactFieldBinaryDataStub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) |
|
96 { |
|
97 |
|
98 } |
|
99 |
|
100 CVPbkContactFieldBinaryDataStub::CVPbkContactFieldBinaryDataStub() |
|
101 { |
|
102 |
|
103 } |
|
104 |
|
105 CVPbkContactFieldBinaryDataStub::~CVPbkContactFieldBinaryDataStub() |
|
106 { |
|
107 |
|
108 } |
|
109 // End of File |