uiservicetab/vimpststorage/tsrc/vimpststorage_ut/src/s_MVPbkContactFieldTextData.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 
       
    21 // INCLUDES
       
    22 
       
    23 #include "CVPbkContactFieldTextData_stub.h"
       
    24 
       
    25 _LIT(KTestData, "123@voip");
       
    26 
       
    27 /**
       
    28  * Casts MVPbkContactFieldData to this interface.
       
    29  *
       
    30  * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
       
    31  *          VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
       
    32  *          is raised if the precondition does not hold.
       
    33  * @param aFieldData    Data of the field.
       
    34  * @return Casted inteface for the text field data.
       
    35  */
       
    36 EXPORT_C MVPbkContactFieldTextData& MVPbkContactFieldTextData::Cast(
       
    37         MVPbkContactFieldData& aFieldData)
       
    38 {
       
    39 return static_cast<MVPbkContactFieldTextData&>(aFieldData);	
       
    40 };
       
    41 
       
    42 /**
       
    43  * Casts const MVPbkContactFieldData to this interface.
       
    44  *
       
    45  * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
       
    46  *          VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
       
    47  *          is raised if the precondition does not hold.
       
    48  * @param aFieldData    Data of the field.
       
    49  * @return Casted inteface for the text field data.
       
    50  */
       
    51 EXPORT_C const MVPbkContactFieldTextData& MVPbkContactFieldTextData::Cast(
       
    52         const MVPbkContactFieldData& aFieldData)
       
    53 {
       
    54 return static_cast<const MVPbkContactFieldTextData&>(aFieldData);		
       
    55 };
       
    56 
       
    57 /**
       
    58  * Returns the string data.
       
    59  * @return Pointer to the text data.
       
    60  */
       
    61 TPtrC CVPbkContactFieldTextData_stub::Text() const
       
    62 {
       
    63 return KTestData();	
       
    64 }
       
    65 
       
    66 /**
       
    67  * Sets the string data.
       
    68  * @exception KErrOverflow if (aText.Length() > MaxLength())
       
    69  */
       
    70 void CVPbkContactFieldTextData_stub::SetTextL( const TDesC& /*aText*/ )
       
    71 {
       
    72 	
       
    73 }
       
    74 
       
    75 /**
       
    76  * Returns maximum length of the field.
       
    77  * @return Maximum length of the field or KVPbkUnlimitedFieldLength 
       
    78  *         if length is only limited by available memory.
       
    79  */
       
    80 TInt CVPbkContactFieldTextData_stub::MaxLength() const
       
    81 {
       
    82 return 	KTestData().Length();
       
    83 }
       
    84 
       
    85 CVPbkContactFieldTextData_stub::~CVPbkContactFieldTextData_stub()
       
    86 {
       
    87 	
       
    88 }
       
    89 
       
    90 CVPbkContactFieldTextData_stub::CVPbkContactFieldTextData_stub()
       
    91 {
       
    92 	
       
    93 }
       
    94 /**
       
    95  * Returns the derived data type id.
       
    96  * @return Contact field storage type.
       
    97  */
       
    98 TVPbkFieldStorageType CVPbkContactFieldTextData_stub::DataType() const
       
    99 	{
       
   100 	return EVPbkFieldStorageTypeText;	
       
   101 	}
       
   102 
       
   103 /**
       
   104  * Returns true if the storage is empty.
       
   105  * @return ETrue if the data field is empty.
       
   106  */
       
   107 TBool CVPbkContactFieldTextData_stub::IsEmpty() const
       
   108 {
       
   109 return EFalse;	
       
   110 }
       
   111 
       
   112 /**
       
   113  * Copies data from given field data.
       
   114  * @param aFieldData    Data that is copied to this object.
       
   115  * @precond aFieldData.DataType() == this->DataType()
       
   116  */
       
   117 void CVPbkContactFieldTextData_stub::CopyL(const MVPbkContactFieldData& /*aFieldData*/) 
       
   118 {
       
   119 	
       
   120 }
       
   121    
       
   122 
       
   123 // End of File