uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldUriData.cpp
branchRCL_3
changeset 28 3104fc151679
parent 27 2b7283837edb
child 29 9a48e301e94b
equal deleted inserted replaced
27:2b7283837edb 28:3104fc151679
     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 #include "s_MVPbkContactFieldUriData_stub.h"
       
    21 
       
    22 _LIT(KTestUriData, "gizmo:someuser@gizmo.com");
       
    23 
       
    24 /**
       
    25  * Casts MVPbkContactFieldData to this interface.
       
    26  *
       
    27  * @precond aFieldData.DataType() == EVPbkFieldStorageTypeUri
       
    28  *          VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
       
    29  *          is raised if the precondition does not hold.
       
    30  * @param aFieldData    Data of the field.
       
    31  * @return Casted inteface for the text field data.
       
    32  */
       
    33 EXPORT_C MVPbkContactFieldUriData& MVPbkContactFieldUriData::Cast(
       
    34         MVPbkContactFieldData& aFieldData)
       
    35 {
       
    36 return static_cast<MVPbkContactFieldUriData&>(aFieldData);	
       
    37 };
       
    38 
       
    39 /**
       
    40  * Casts const MVPbkContactFieldData to this interface.
       
    41  *
       
    42  * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
       
    43  *          VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
       
    44  *          is raised if the precondition does not hold.
       
    45  * @param aFieldData    Data of the field.
       
    46  * @return Casted inteface for the text field data.
       
    47  */
       
    48 EXPORT_C const MVPbkContactFieldUriData& MVPbkContactFieldUriData::Cast(
       
    49         const MVPbkContactFieldData& aFieldData)
       
    50 {
       
    51 return static_cast<const MVPbkContactFieldUriData&>(aFieldData);	
       
    52 };
       
    53 
       
    54 /**
       
    55  * Returns the URI scheme.
       
    56  * @return Pointer to the URI scheme.
       
    57  */
       
    58 TPtrC CVPbkContactFieldUriData_Stub::Scheme() const
       
    59 {
       
    60 return KNullDesC();	
       
    61 }
       
    62 
       
    63 /**
       
    64  * Returns the URI .
       
    65  * @return Pointer to the URI text.
       
    66  */
       
    67 TPtrC CVPbkContactFieldUriData_Stub::Text() const 
       
    68 {
       
    69 return KTestUriData();	
       
    70 }
       
    71 
       
    72 /**
       
    73  * Returns the string data.
       
    74  * @return Pointer to the whole URI.
       
    75  */
       
    76 TPtrC CVPbkContactFieldUriData_Stub::Uri() const
       
    77 {
       
    78 return KNullDesC();	
       
    79 }
       
    80 
       
    81 /**
       
    82  * Sets the URI data.
       
    83  * @exception KErrOverflow if (aUri.Length() > MaxLength())
       
    84  */
       
    85 void CVPbkContactFieldUriData_Stub::SetUriL(const TDesC& /*aUri*/)
       
    86 {
       
    87 	
       
    88 }
       
    89 
       
    90 /**
       
    91  * Sets the URI data.
       
    92  * @exception KErrOverflow if (aScheme.Length() + aText.Length()
       
    93  *              + 1 > MaxLength())
       
    94  */
       
    95 void CVPbkContactFieldUriData_Stub::SetUriL(const TDesC& /*aScheme*/, const TDesC& /*aText*/)
       
    96 {
       
    97 	
       
    98 }
       
    99 
       
   100 /**
       
   101  * Returns maximum length of the field.
       
   102  * @return Maximum length of the field or KVPbkUnlimitedFieldLength 
       
   103  *         if length is only limited by available memory.
       
   104  */
       
   105 TInt CVPbkContactFieldUriData_Stub::MaxLength() const
       
   106 {
       
   107 return 1;	
       
   108 }
       
   109 
       
   110 
       
   111 /**
       
   112  * Returns the derived data type id.
       
   113  * @return Contact field storage type.
       
   114  */
       
   115 TVPbkFieldStorageType CVPbkContactFieldUriData_Stub::DataType() const
       
   116 	{
       
   117 	return EVPbkFieldStorageTypeUri;	
       
   118 	}
       
   119 
       
   120 /**
       
   121  * Returns true if the storage is empty.
       
   122  * @return ETrue if the data field is empty.
       
   123  */
       
   124 TBool CVPbkContactFieldUriData_Stub::IsEmpty() const
       
   125 {
       
   126 return EFalse;	
       
   127 }
       
   128 
       
   129 /**
       
   130  * Copies data from given field data.
       
   131  * @param aFieldData    Data that is copied to this object.
       
   132  * @precond aFieldData.DataType() == this->DataType()
       
   133  */
       
   134 void CVPbkContactFieldUriData_Stub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) 
       
   135 {
       
   136 	
       
   137 }
       
   138    
       
   139 CVPbkContactFieldUriData_Stub::CVPbkContactFieldUriData_Stub()
       
   140 {
       
   141 	
       
   142 }
       
   143 
       
   144 CVPbkContactFieldUriData_Stub::~CVPbkContactFieldUriData_Stub()
       
   145 {
       
   146 	
       
   147 }
       
   148 
       
   149 // End of File