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