contacts_plat/virtual_phonebook_engine_api/inc/MVPbkContactFieldTextData.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
equal deleted inserted replaced
62:5b6f26637ad3 63:f4a778e096c2
       
     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 text data of the contact field.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef MVPBKCONTACTFIELDTEXTDATA_H
       
    20 #define MVPBKCONTACTFIELDTEXTDATA_H
       
    21 
       
    22 
       
    23 // INCLUDES
       
    24 #include <MVPbkContactFieldData.h>
       
    25 
       
    26 // CLASS DECLARATIONS
       
    27 
       
    28 /**
       
    29  * Virtual Phonebook Contact field text data.
       
    30  * This interface is used to manipulate text contact field data.
       
    31  */
       
    32 class MVPbkContactFieldTextData : public MVPbkContactFieldData
       
    33     {
       
    34     public:  // Destructor
       
    35         /**
       
    36          * Destructor.
       
    37          */
       
    38         virtual ~MVPbkContactFieldTextData() { }
       
    39 
       
    40     public:  // from MVPbkContactFieldData
       
    41         TVPbkFieldStorageType DataType() const
       
    42             {
       
    43             return EVPbkFieldStorageTypeText;
       
    44             }
       
    45 
       
    46     public:  // Interface
       
    47         /**
       
    48          * Casts MVPbkContactFieldData to this interface.
       
    49          *
       
    50          * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
       
    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 MVPbkContactFieldTextData& 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 MVPbkContactFieldTextData& Cast(
       
    69                 const MVPbkContactFieldData& aFieldData);
       
    70 
       
    71         /**
       
    72          * Returns the string data.
       
    73          * @return Pointer to the text data.
       
    74          */
       
    75         virtual TPtrC Text() const = 0;
       
    76 
       
    77         /**
       
    78          * Sets the string data.
       
    79          * @exception KErrOverflow if (aText.Length() > MaxLength())
       
    80          */
       
    81         virtual void SetTextL( const TDesC& aText ) = 0;
       
    82 
       
    83         /**
       
    84          * Returns maximum length of the field.
       
    85          * @return Maximum length of the field or KVPbkUnlimitedFieldLength 
       
    86          *         if length is only limited by available memory.
       
    87          */
       
    88         virtual TInt MaxLength() const = 0;
       
    89 
       
    90         /**
       
    91          * Returns an extension point for this interface or NULL.
       
    92          * @param aExtensionUid Uid of extension.
       
    93          * @return Extension point or NULL.
       
    94          */
       
    95         virtual TAny* ContactFieldTextDataExtension(TUid /*aExtensionUid*/) { return NULL; }
       
    96     };
       
    97 
       
    98 #endif  // MVPBKCONTACTFIELDTEXTDATA_H
       
    99 
       
   100 // End of File