epoc32/include/app/MVPbkBaseContactField.h
branchSymbian3
changeset 4 837f303aceeb
     1.1 --- /dev/null	Thu Jan 01 00:00:00 1970 +0000
     1.2 +++ b/epoc32/include/app/MVPbkBaseContactField.h	Wed Mar 31 12:33:34 2010 +0100
     1.3 @@ -0,0 +1,113 @@
     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 base interface for contact fields.
    1.18 +*
    1.19 +*/
    1.20 +
    1.21 +
    1.22 +#ifndef MVPBKBASECONTACTFIELD_H
    1.23 +#define MVPBKBASECONTACTFIELD_H
    1.24 +
    1.25 +// INCLUDES
    1.26 +#include <e32cmn.h>
    1.27 +#include <e32std.h>
    1.28 +#include <mvpbkobjecthierarchy.h>
    1.29 +
    1.30 +// FORWARD DECLARATIONS
    1.31 +class MVPbkBaseContact;
    1.32 +class MVPbkFieldType;
    1.33 +class MVPbkFieldTypeList;
    1.34 +class MVPbkContactFieldData;
    1.35 +
    1.36 +// CLASS DECLARATIONS
    1.37 +
    1.38 +/**
    1.39 + * Virtual Phonebook Base contact field interface.
    1.40 + * An abstract interface Virtual Phonebook read-only contact fields.
    1.41 + */
    1.42 +class MVPbkBaseContactField
    1.43 +    {
    1.44 +    public:  // Destructor
    1.45 +        /**
    1.46 +         * Destructor.
    1.47 +         */
    1.48 +        virtual ~MVPbkBaseContactField() { }
    1.49 +
    1.50 +    public:  // Interface
    1.51 +        /**
    1.52 +         * Returns the parent contact where this field is from.
    1.53 +         *
    1.54 +         * @return The parent contact where this field is from.
    1.55 +         */
    1.56 +        virtual MVPbkBaseContact& ParentContact() const = 0;
    1.57 +
    1.58 +        /**
    1.59 +         * Returns this field's type or NULL if no mapping exists
    1.60 +         * between the native type and virtual phonebook type.
    1.61 +         *
    1.62 +         * @param aMatchPriority    matching priority to use.
    1.63 +         * @return The field type or NULL
    1.64 +         * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list))
    1.65 +         */
    1.66 +        virtual const MVPbkFieldType* MatchFieldType(
    1.67 +                TInt aMatchPriority) const =0;
    1.68 +        
    1.69 +        /**
    1.70 +         * Returns the best matching type of the field or NULL 
    1.71 +         * if no mapping exists between the native type and 
    1.72 +         * virtual phonebook type. This is the same as looping 
    1.73 +         * MatchFieldType from priority 0 and getting the first 
    1.74 +         * matched type.
    1.75 +         *
    1.76 +         * @return The field type or NULL
    1.77 +         * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list))
    1.78 +         */
    1.79 +        virtual const MVPbkFieldType* BestMatchingFieldType() const = 0;
    1.80 +
    1.81 +        /**
    1.82 +         * Returns this field's data storage (read-only). The actual
    1.83 +         * data type can be get using the static Cast functions in actual
    1.84 +         * classes.
    1.85 +         * 
    1.86 +         * @see MVPbkContactFieldTextData
    1.87 +         * @see MVPbkContactFieldBinaryData
    1.88 +         * @see MVPbkContactFieldDateTimeData
    1.89 +         * @return This field's data storage (read-only).
    1.90 +         */
    1.91 +        virtual const MVPbkContactFieldData& FieldData() const = 0;
    1.92 +
    1.93 +        /**
    1.94 +         * Returns true if this field is the same as another field in the
    1.95 +         * contact instance. 
    1.96 +         * Doesn't work for fields from different contact instances.
    1.97 +         * Always use this method instead of direct pointer comparison.
    1.98 +         *
    1.99 +         * @param aOther another field inside the contact
   1.100 +         * @return ETrue if contact is same
   1.101 +         */
   1.102 +        virtual TBool IsSame(const MVPbkBaseContactField& aOther) const = 0;
   1.103 +
   1.104 +        /**
   1.105 +         * Returns an extension point for this interface or NULL.
   1.106 +         * @param aExtensionUid Uid of extension
   1.107 +         * @return Extension point or NULL
   1.108 +         */
   1.109 +        virtual TAny* BaseContactFieldExtension(
   1.110 +                TUid /*aExtensionUid*/) { return NULL; }
   1.111 +
   1.112 +    };
   1.113 +
   1.114 +#endif  // MVPBKBASECONTACTFIELD_H
   1.115 +
   1.116 +// End of file