1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/MVPbkContactFieldBinaryData.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,104 @@
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 binary contact field data.
1.18 +*
1.19 +*/
1.20 +
1.21 +
1.22 +#ifndef MVPBKCONTACTFIELDBINARYDATA_H
1.23 +#define MVPBKCONTACTFIELDBINARYDATA_H
1.24 +
1.25 +// INCLUDES
1.26 +#include <mvpbkcontactfielddata.h>
1.27 +
1.28 +
1.29 +// CLASS DECLARATIONS
1.30 +
1.31 +/**
1.32 + * Virtual Phonebook binary field data.
1.33 + * This interface is used to manipulate binary contact field data.
1.34 + */
1.35 +class MVPbkContactFieldBinaryData : public MVPbkContactFieldData
1.36 + {
1.37 + public: // Destructor
1.38 + /**
1.39 + * Destructor.
1.40 + */
1.41 + virtual ~MVPbkContactFieldBinaryData() { }
1.42 +
1.43 +
1.44 + public: // from MVPbkContactFieldData
1.45 + TVPbkFieldStorageType DataType() const
1.46 + {
1.47 + return EVPbkFieldStorageTypeBinary;
1.48 + }
1.49 +
1.50 + public: // Interface
1.51 + /**
1.52 + * Casts MVPbkContactFieldData to this interface.
1.53 + *
1.54 + * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary
1.55 + * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
1.56 + * is raised if the precondition does not hold.
1.57 + * @param aFieldData Data of the field.
1.58 + * @return Casted inteface for the binary field data.
1.59 + */
1.60 + IMPORT_C static MVPbkContactFieldBinaryData& Cast(
1.61 + MVPbkContactFieldData& aFieldData );
1.62 +
1.63 + /**
1.64 + * Casts const MVPbkContactFieldData to this interface.
1.65 + *
1.66 + * @precond aFieldData.DataType() == EVPbkFieldStorageTypeBinary
1.67 + * VPbkError::Panic(VPbkError::EFieldDataTypeMismatch)
1.68 + * is raised if the precondition does not hold.
1.69 + * @param aFieldData Data of the field.
1.70 + * @return Casted inteface for the binary field data.
1.71 + */
1.72 + IMPORT_C static const MVPbkContactFieldBinaryData& Cast(
1.73 + const MVPbkContactFieldData& aFieldData );
1.74 +
1.75 + /**
1.76 + * Returns the binary data pointer.
1.77 + * @return Pointer to binary data.
1.78 + */
1.79 + virtual TPtrC8 BinaryData() const =0;
1.80 +
1.81 + /**
1.82 + * Sets the binary data.
1.83 + * @exception KErrOverflow if (aBinaryData.Length() > MaxLength())
1.84 + * @param aBinaryData Binary data to be set.
1.85 + */
1.86 + virtual void SetBinaryDataL( const TDesC8& aBinaryData ) = 0;
1.87 +
1.88 + /**
1.89 + * Returns maximum length of the field.
1.90 + * @return Maximum length of the field or KVPbkUnlimitedFieldLength
1.91 + * if length is only limited by available memory.
1.92 + */
1.93 + virtual TInt MaxLength() const { return KVPbkUnlimitedFieldLength; }
1.94 +
1.95 + /**
1.96 + * Returns an extension point for this interface or NULL.
1.97 + * @param aExtensionUid Uid of extension.
1.98 + * @return Extension point or NULL.
1.99 + */
1.100 + virtual TAny* ContactFieldBinaryDataExtension(
1.101 + TUid /*aExtensionUid*/ ) { return NULL; }
1.102 +
1.103 + };
1.104 +
1.105 +#endif // MVPBKCONTACTFIELDBINARYDATA_H
1.106 +
1.107 +// End of File