1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/MVPbkContactFieldUriData.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,119 @@
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 URI data of the contact field.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef MVPBKCONTACTFIELDURIDATA_H
1.23 +#define MVPBKCONTACTFIELDURIDATA_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 URI data.
1.33 + * This interface is used to manipulate URI contact field data.
1.34 + */
1.35 +class MVPbkContactFieldUriData : public MVPbkContactFieldData
1.36 + {
1.37 + public: // Destructor
1.38 + /**
1.39 + * Destructor.
1.40 + */
1.41 + virtual ~MVPbkContactFieldUriData() { }
1.42 +
1.43 + public: // from MVPbkContactFieldData
1.44 + TVPbkFieldStorageType DataType() const
1.45 + {
1.46 + return EVPbkFieldStorageTypeUri;
1.47 + }
1.48 +
1.49 + public: // Interface
1.50 + /**
1.51 + * Casts MVPbkContactFieldData to this interface.
1.52 + *
1.53 + * @precond aFieldData.DataType() == EVPbkFieldStorageTypeUri
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 MVPbkContactFieldUriData& 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 MVPbkContactFieldUriData& Cast(
1.72 + const MVPbkContactFieldData& aFieldData);
1.73 +
1.74 + /**
1.75 + * Returns the URI scheme.
1.76 + * @return Pointer to the URI scheme.
1.77 + */
1.78 + virtual TPtrC Scheme() const = 0;
1.79 +
1.80 + /**
1.81 + * Returns the URI .
1.82 + * @return Pointer to the URI text.
1.83 + */
1.84 + virtual TPtrC Text() const = 0;
1.85 +
1.86 + /**
1.87 + * Returns the string data.
1.88 + * @return Pointer to the whole URI.
1.89 + */
1.90 + virtual TPtrC Uri() const = 0;
1.91 +
1.92 + /**
1.93 + * Sets the URI data.
1.94 + * @exception KErrOverflow if (aUri.Length() > MaxLength())
1.95 + */
1.96 + virtual void SetUriL(const TDesC& aUri) = 0;
1.97 +
1.98 + /**
1.99 + * Sets the URI data.
1.100 + * @exception KErrOverflow if (aScheme.Length() + aText.Length()
1.101 + * + 1 > MaxLength())
1.102 + */
1.103 + virtual void SetUriL(const TDesC& aScheme, const TDesC& aText) = 0;
1.104 +
1.105 + /**
1.106 + * Returns maximum length of the field.
1.107 + * @return Maximum length of the field or KVPbkUnlimitedFieldLength
1.108 + * if length is only limited by available memory.
1.109 + */
1.110 + virtual TInt MaxLength() const = 0;
1.111 +
1.112 + /**
1.113 + * Returns an extension point for this interface or NULL.
1.114 + * @param aExtensionUid Uid of extension.
1.115 + * @return Extension point or NULL.
1.116 + */
1.117 + virtual TAny* ContactFieldTextDataExtension(TUid /*aExtensionUid*/) { return NULL; }
1.118 + };
1.119 +
1.120 +#endif // MVPBKCONTACTFIELDURIDATA_H
1.121 +
1.122 +// End of File