epoc32/include/app/MVPbkContactFieldTextData.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/MVPbkContactFieldTextData.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,100 @@
     1.4 +/*
     1.5 +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
     1.6 +* All rights reserved.
     1.7 +* This component and the accompanying materials are made available
     1.8 +* under the terms of "Eclipse Public License v1.0"
     1.9 +* which accompanies this distribution, and is available
    1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
    1.11 +*
    1.12 +* Initial Contributors:
    1.13 +* Nokia Corporation - initial contribution.
    1.14 +*
    1.15 +* Contributors:
    1.16 +*
    1.17 +* Description:  Virtual Phonebook interface for text data of the contact field.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef MVPBKCONTACTFIELDTEXTDATA_H
    1.23 +#define MVPBKCONTACTFIELDTEXTDATA_H
    1.24 +
    1.25 +
    1.26 +// INCLUDES
    1.27 +#include <mvpbkcontactfielddata.h>
    1.28 +
    1.29 +// CLASS DECLARATIONS
    1.30 +
    1.31 +/**
    1.32 + * Virtual Phonebook Contact field text data.
    1.33 + * This interface is used to manipulate text contact field data.
    1.34 + */
    1.35 +class MVPbkContactFieldTextData : public MVPbkContactFieldData
    1.36 +    {
    1.37 +    public:  // Destructor
    1.38 +        /**
    1.39 +         * Destructor.
    1.40 +         */
    1.41 +        virtual ~MVPbkContactFieldTextData() { }
    1.42 +
    1.43 +    public:  // from MVPbkContactFieldData
    1.44 +        TVPbkFieldStorageType DataType() const
    1.45 +            {
    1.46 +            return EVPbkFieldStorageTypeText;
    1.47 +            }
    1.48 +
    1.49 +    public:  // Interface
    1.50 +        /**
    1.51 +         * Casts MVPbkContactFieldData to this interface.
    1.52 +         *
    1.53 +         * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
    1.54 +         *          VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
    1.55 +         *          is raised if the precondition does not hold.
    1.56 +         * @param aFieldData    Data of the field.
    1.57 +         * @return Casted inteface for the text field data.
    1.58 +         */
    1.59 +        IMPORT_C static MVPbkContactFieldTextData& Cast(
    1.60 +                MVPbkContactFieldData& aFieldData);
    1.61 +
    1.62 +        /**
    1.63 +         * Casts const MVPbkContactFieldData to this interface.
    1.64 +         *
    1.65 +         * @precond aFieldData.DataType() == EVPbkFieldStorageTypeText
    1.66 +         *          VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
    1.67 +         *          is raised if the precondition does not hold.
    1.68 +         * @param aFieldData    Data of the field.
    1.69 +         * @return Casted inteface for the text field data.
    1.70 +         */
    1.71 +        IMPORT_C static const MVPbkContactFieldTextData& Cast(
    1.72 +                const MVPbkContactFieldData& aFieldData);
    1.73 +
    1.74 +        /**
    1.75 +         * Returns the string data.
    1.76 +         * @return Pointer to the text data.
    1.77 +         */
    1.78 +        virtual TPtrC Text() const = 0;
    1.79 +
    1.80 +        /**
    1.81 +         * Sets the string data.
    1.82 +         * @exception KErrOverflow if (aText.Length() > MaxLength())
    1.83 +         */
    1.84 +        virtual void SetTextL( const TDesC& aText ) = 0;
    1.85 +
    1.86 +        /**
    1.87 +         * Returns maximum length of the field.
    1.88 +         * @return Maximum length of the field or KVPbkUnlimitedFieldLength 
    1.89 +         *         if length is only limited by available memory.
    1.90 +         */
    1.91 +        virtual TInt MaxLength() const = 0;
    1.92 +
    1.93 +        /**
    1.94 +         * Returns an extension point for this interface or NULL.
    1.95 +         * @param aExtensionUid Uid of extension.
    1.96 +         * @return Extension point or NULL.
    1.97 +         */
    1.98 +        virtual TAny* ContactFieldTextDataExtension(TUid /*aExtensionUid*/) { return NULL; }
    1.99 +    };
   1.100 +
   1.101 +#endif  // MVPBKCONTACTFIELDTEXTDATA_H
   1.102 +
   1.103 +// End of File