epoc32/include/app/MVPbkBaseContactField.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@4
     1
/*
williamr@4
     2
* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
williamr@4
     3
* All rights reserved.
williamr@4
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@4
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@4
     8
*
williamr@4
     9
* Initial Contributors:
williamr@4
    10
* Nokia Corporation - initial contribution.
williamr@4
    11
*
williamr@4
    12
* Contributors:
williamr@4
    13
*
williamr@4
    14
* Description:  Virtual Phonebook base interface for contact fields.
williamr@4
    15
*
williamr@4
    16
*/
williamr@4
    17
williamr@4
    18
williamr@4
    19
#ifndef MVPBKBASECONTACTFIELD_H
williamr@4
    20
#define MVPBKBASECONTACTFIELD_H
williamr@4
    21
williamr@4
    22
// INCLUDES
williamr@4
    23
#include <e32cmn.h>
williamr@4
    24
#include <e32std.h>
williamr@4
    25
#include <mvpbkobjecthierarchy.h>
williamr@4
    26
williamr@4
    27
// FORWARD DECLARATIONS
williamr@4
    28
class MVPbkBaseContact;
williamr@4
    29
class MVPbkFieldType;
williamr@4
    30
class MVPbkFieldTypeList;
williamr@4
    31
class MVPbkContactFieldData;
williamr@4
    32
williamr@4
    33
// CLASS DECLARATIONS
williamr@4
    34
williamr@4
    35
/**
williamr@4
    36
 * Virtual Phonebook Base contact field interface.
williamr@4
    37
 * An abstract interface Virtual Phonebook read-only contact fields.
williamr@4
    38
 */
williamr@4
    39
class MVPbkBaseContactField
williamr@4
    40
    {
williamr@4
    41
    public:  // Destructor
williamr@4
    42
        /**
williamr@4
    43
         * Destructor.
williamr@4
    44
         */
williamr@4
    45
        virtual ~MVPbkBaseContactField() { }
williamr@4
    46
williamr@4
    47
    public:  // Interface
williamr@4
    48
        /**
williamr@4
    49
         * Returns the parent contact where this field is from.
williamr@4
    50
         *
williamr@4
    51
         * @return The parent contact where this field is from.
williamr@4
    52
         */
williamr@4
    53
        virtual MVPbkBaseContact& ParentContact() const = 0;
williamr@4
    54
williamr@4
    55
        /**
williamr@4
    56
         * Returns this field's type or NULL if no mapping exists
williamr@4
    57
         * between the native type and virtual phonebook type.
williamr@4
    58
         *
williamr@4
    59
         * @param aMatchPriority    matching priority to use.
williamr@4
    60
         * @return The field type or NULL
williamr@4
    61
         * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list))
williamr@4
    62
         */
williamr@4
    63
        virtual const MVPbkFieldType* MatchFieldType(
williamr@4
    64
                TInt aMatchPriority) const =0;
williamr@4
    65
        
williamr@4
    66
        /**
williamr@4
    67
         * Returns the best matching type of the field or NULL 
williamr@4
    68
         * if no mapping exists between the native type and 
williamr@4
    69
         * virtual phonebook type. This is the same as looping 
williamr@4
    70
         * MatchFieldType from priority 0 and getting the first 
williamr@4
    71
         * matched type.
williamr@4
    72
         *
williamr@4
    73
         * @return The field type or NULL
williamr@4
    74
         * @postcond !FieldType(list) || list.ContainsSame(*FieldType(list))
williamr@4
    75
         */
williamr@4
    76
        virtual const MVPbkFieldType* BestMatchingFieldType() const = 0;
williamr@4
    77
williamr@4
    78
        /**
williamr@4
    79
         * Returns this field's data storage (read-only). The actual
williamr@4
    80
         * data type can be get using the static Cast functions in actual
williamr@4
    81
         * classes.
williamr@4
    82
         * 
williamr@4
    83
         * @see MVPbkContactFieldTextData
williamr@4
    84
         * @see MVPbkContactFieldBinaryData
williamr@4
    85
         * @see MVPbkContactFieldDateTimeData
williamr@4
    86
         * @return This field's data storage (read-only).
williamr@4
    87
         */
williamr@4
    88
        virtual const MVPbkContactFieldData& FieldData() const = 0;
williamr@4
    89
williamr@4
    90
        /**
williamr@4
    91
         * Returns true if this field is the same as another field in the
williamr@4
    92
         * contact instance. 
williamr@4
    93
         * Doesn't work for fields from different contact instances.
williamr@4
    94
         * Always use this method instead of direct pointer comparison.
williamr@4
    95
         *
williamr@4
    96
         * @param aOther another field inside the contact
williamr@4
    97
         * @return ETrue if contact is same
williamr@4
    98
         */
williamr@4
    99
        virtual TBool IsSame(const MVPbkBaseContactField& aOther) const = 0;
williamr@4
   100
williamr@4
   101
        /**
williamr@4
   102
         * Returns an extension point for this interface or NULL.
williamr@4
   103
         * @param aExtensionUid Uid of extension
williamr@4
   104
         * @return Extension point or NULL
williamr@4
   105
         */
williamr@4
   106
        virtual TAny* BaseContactFieldExtension(
williamr@4
   107
                TUid /*aExtensionUid*/) { return NULL; }
williamr@4
   108
williamr@4
   109
    };
williamr@4
   110
williamr@4
   111
#endif  // MVPBKBASECONTACTFIELD_H
williamr@4
   112
williamr@4
   113
// End of file