epoc32/include/app/MVPbkContactLink.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 contact link for referencing contacts 
williamr@4
    15
*                in different stores.
williamr@4
    16
*
williamr@4
    17
*/
williamr@4
    18
williamr@4
    19
williamr@4
    20
#ifndef MVPBKCONTACTLINK_H
williamr@4
    21
#define MVPBKCONTACTLINK_H
williamr@4
    22
williamr@4
    23
// INCLUDES
williamr@4
    24
#include <e32cmn.h>
williamr@4
    25
#include <e32std.h>
williamr@4
    26
#include <cvpbkcontactlinkarray.h>
williamr@4
    27
williamr@4
    28
// FORWARD DECLARATIONS
williamr@4
    29
class TVPbkContactStoreUriPtr;
williamr@4
    30
class MVPbkStreamable;
williamr@4
    31
class MVPbkContactStore;
williamr@4
    32
class MVPbkContactLinkPacking;
williamr@4
    33
class MVPbkBaseContact;
williamr@4
    34
williamr@4
    35
williamr@4
    36
// CLASS DECLARATIONS
williamr@4
    37
williamr@4
    38
/**
williamr@4
    39
 * Virtual Phonebook Contact link.
williamr@4
    40
 * An object that uniquely identifies a single Contact and its ContactStore.
williamr@4
    41
 */
williamr@4
    42
class MVPbkContactLink
williamr@4
    43
    {
williamr@4
    44
    public: // destructor
williamr@4
    45
        /**
williamr@4
    46
         * Destructor.
williamr@4
    47
         */
williamr@4
    48
        virtual ~MVPbkContactLink() { }
williamr@4
    49
williamr@4
    50
    public: // interface
williamr@4
    51
        /**
williamr@4
    52
         * Packages this link for IPC transfer.
williamr@4
    53
         * Read it using CVPbkContactLinkArray::NewL.
williamr@4
    54
         * @return Packed link.
williamr@4
    55
         * @see CVPbkContactLinkArray::NewL
williamr@4
    56
         */
williamr@4
    57
        HBufC8* PackLC();
williamr@4
    58
williamr@4
    59
        /**
williamr@4
    60
         * Returns the contact store which this link belongs to.
williamr@4
    61
         * @return Contact store associated with this link.
williamr@4
    62
         */
williamr@4
    63
        virtual MVPbkContactStore& ContactStore() const =0;
williamr@4
    64
williamr@4
    65
        /**
williamr@4
    66
         * Returns ETrue if this link refers to the same contact than
williamr@4
    67
         * aOther, EFalse otherwise.
williamr@4
    68
         * @param aOther Contact to check equality for.
williamr@4
    69
         * @return ETrue if this link refers to the same contact than
williamr@4
    70
         *         aOther, EFalse otherwise.
williamr@4
    71
         */
williamr@4
    72
        virtual TBool IsSame(const MVPbkContactLink& aOther) const =0;
williamr@4
    73
        
williamr@4
    74
        /**
williamr@4
    75
         * Checks if this link refers to the contact aContact.
williamr@4
    76
         * @param aContact Contact to check.
williamr@4
    77
         * @return ETrue if this link refers to aContact, EFalse otherwise.
williamr@4
    78
         */
williamr@4
    79
        virtual TBool RefersTo(const MVPbkBaseContact& aContact) const =0;
williamr@4
    80
        
williamr@4
    81
        /**
williamr@4
    82
         * Returns persistent streaming interface for this object, or NULL
williamr@4
    83
         * if persistent streaming is not supported.
williamr@4
    84
         * @return Persistent streaming object or NULL if not supported.
williamr@4
    85
         */
williamr@4
    86
        virtual const MVPbkStreamable* Streamable() const =0;
williamr@4
    87
williamr@4
    88
        /**
williamr@4
    89
         * Returns a packing interface for this link.
williamr@4
    90
         * @see CVPbkContactLinkArray
williamr@4
    91
         * @internal
williamr@4
    92
         * @return Link packing object.
williamr@4
    93
         */
williamr@4
    94
        virtual const MVPbkContactLinkPacking& Packing() const = 0;
williamr@4
    95
        
williamr@4
    96
        /**
williamr@4
    97
         * Returns a clone of this contact link.
williamr@4
    98
         * @return Contact link copy.
williamr@4
    99
         */
williamr@4
   100
        virtual MVPbkContactLink* CloneLC() const =0;
williamr@4
   101
williamr@4
   102
        /**
williamr@4
   103
         * Returns an extension point for this interface or NULL.
williamr@4
   104
         * @param aExtensionUid Uid of extension.
williamr@4
   105
         * @return Extension point or NULL.
williamr@4
   106
         */
williamr@4
   107
        virtual TAny* ContactLinkExtension(
williamr@4
   108
                TUid /*aExtensionUid*/) { return NULL; }
williamr@4
   109
    };
williamr@4
   110
williamr@4
   111
williamr@4
   112
// INLINE FUNCTIONS
williamr@4
   113
inline HBufC8* MVPbkContactLink::PackLC()
williamr@4
   114
    {
williamr@4
   115
    CVPbkContactLinkArray* array = CVPbkContactLinkArray::NewLC();
williamr@4
   116
    MVPbkContactLink* clone = CloneLC();
williamr@4
   117
    array->AppendL(clone);
williamr@4
   118
    CleanupStack::Pop(); // clone
williamr@4
   119
    HBufC8* packed = array->PackLC();
williamr@4
   120
    CleanupStack::Pop(); // packed
williamr@4
   121
    CleanupStack::PopAndDestroy(); // array
williamr@4
   122
    CleanupStack::PushL(packed);
williamr@4
   123
    return packed;
williamr@4
   124
    }
williamr@4
   125
williamr@4
   126
#endif // MVPBKCONTACTLINK_H
williamr@4
   127
williamr@4
   128
// End of File