phonebookui/Phonebook2/remotecontactlookup/contactactionservice/inc/CFscPresentationContactFieldTextData.h
changeset 0 e686773b3f54
equal deleted inserted replaced
-1:000000000000 0:e686773b3f54
       
     1 /*
       
     2 * Copyright (c) 2008 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:  Presentation text data of the contact field.
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef CFSCPRESENTATIONCONTACTFIELDTEXTDATA_H
       
    20 #define CFSCPRESENTATIONCONTACTFIELDTEXTDATA_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <MVPbkContactFieldTextData.h>
       
    25 
       
    26 class MVPbkStoreContactField;
       
    27 class MPbk2FieldProperty;
       
    28 
       
    29 // CLASS DECLARATIONS
       
    30 
       
    31 /**
       
    32  * Presentation text data of the contact field
       
    33  */
       
    34 NONSHARABLE_CLASS( CFscPresentationContactFieldTextData ) :
       
    35 public MVPbkContactFieldTextData
       
    36     {
       
    37 public: // Constructor & Destructor
       
    38     /**
       
    39      * Creates a new instance of this class.
       
    40      *
       
    41      * @param aTextData         The field text data
       
    42      * @param aFieldProperty    Phonebook 2 field property.
       
    43      * @param aMaxDataLength    Data's max length
       
    44      * @return  A new instance of this class.
       
    45      */
       
    46     static CFscPresentationContactFieldTextData* NewL(
       
    47             MVPbkContactFieldTextData& aTextData,
       
    48             const MPbk2FieldProperty& aFieldProperty,
       
    49             const TInt aMaxDataLength );
       
    50 
       
    51     /**
       
    52      * Destructor.
       
    53      */
       
    54     ~CFscPresentationContactFieldTextData();
       
    55 
       
    56 public: // Interface
       
    57     /**
       
    58      * Casts MVPbkContactFieldData to this interface.
       
    59      *
       
    60      * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
       
    61      *          VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
       
    62      *          is raised if the precondition does not hold.
       
    63      * @param aFieldData    Data of the field.
       
    64      * @return Casted inteface for the text field data.
       
    65      */
       
    66     static CFscPresentationContactFieldTextData& Cast(
       
    67             MVPbkContactFieldData& aFieldData);
       
    68 
       
    69     /**
       
    70      * Casts const MVPbkContactFieldData to this interface.
       
    71      *
       
    72      * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
       
    73      *          VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
       
    74      *          is raised if the precondition does not hold.
       
    75      * @param aFieldData    Data of the field.
       
    76      * @return Casted inteface for the text field data.
       
    77      */
       
    78     static const CFscPresentationContactFieldTextData& Cast(
       
    79             const MVPbkContactFieldData& aFieldData);
       
    80 
       
    81     TPtrC Text() const;
       
    82     void SetTextL( const TDesC& aText );
       
    83     TInt MaxLength() const;
       
    84     TVPbkFieldStorageType DataType() const;
       
    85     TBool IsEmpty() const;
       
    86     void CopyL(const MVPbkContactFieldData& aFieldData);
       
    87 
       
    88 private:
       
    89     CFscPresentationContactFieldTextData(
       
    90             MVPbkContactFieldTextData& aTextData,
       
    91             const MPbk2FieldProperty& aFieldProperty,
       
    92             const TInt aMaxDataLength );
       
    93 
       
    94 private: // Data
       
    95     /// Ref: The contact field text data
       
    96     MVPbkContactFieldTextData& iTextData;
       
    97     /// Ref: Phonebook 2 field property
       
    98     const MPbk2FieldProperty& iFieldProperty;
       
    99     /// Own: Field data max length
       
   100     const TInt iMaxDataLength;
       
   101 
       
   102     };
       
   103 
       
   104 #endif  // CFSCPRESENTATIONCONTACTFIELDTEXTDATA_H
       
   105 // End of File