epoc32/include/app/MVPbkContactObserver.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 observer interface for contact 
williamr@4
    15
*                operations (Delete, Commit...).
williamr@4
    16
*
williamr@4
    17
*/
williamr@4
    18
williamr@4
    19
williamr@4
    20
#ifndef MVPBKCONTACTOBSERVER_H
williamr@4
    21
#define MVPBKCONTACTOBSERVER_H
williamr@4
    22
williamr@4
    23
// INCLUDES
williamr@4
    24
#include <e32cmn.h>
williamr@4
    25
#include <e32std.h>
williamr@4
    26
williamr@4
    27
// FORWARD DECLARATIONS
williamr@4
    28
class MVPbkStoreContact;
williamr@4
    29
williamr@4
    30
williamr@4
    31
// CLASS DECLARATIONS
williamr@4
    32
williamr@4
    33
/**
williamr@4
    34
 * Virtual Phonebook Contact operation observer interface.
williamr@4
    35
 * This interface is used to signal the contact operation client 
williamr@4
    36
 * of events.
williamr@4
    37
 */
williamr@4
    38
class MVPbkContactObserver
williamr@4
    39
    {
williamr@4
    40
    public:  // Types
williamr@4
    41
        /**
williamr@4
    42
         * Operation codes for Contact operation observers.
williamr@4
    43
         */
williamr@4
    44
        enum TContactOp
williamr@4
    45
            {
williamr@4
    46
            /// Unknown operation
williamr@4
    47
            EContactOperationUnknown = 0,
williamr@4
    48
            /// See MVPbkViewContact::ReadL
williamr@4
    49
            EContactRead,
williamr@4
    50
            /// See MVPbkViewContact::ReadAndLockL
williamr@4
    51
            EContactReadAndLock,
williamr@4
    52
            /// See MVPbkBaseContact::DeleteL
williamr@4
    53
            EContactDelete,
williamr@4
    54
            /// See MVPbkStoreContact::LockL
williamr@4
    55
            EContactLock,
williamr@4
    56
            /// See MVPbkStoreContact::Commit
williamr@4
    57
            EContactCommit,
williamr@4
    58
            /// See MVPbkContactStore::SetOwnContacL
williamr@4
    59
            EContactSetOwn
williamr@4
    60
            };
williamr@4
    61
williamr@4
    62
        /// Forward declaration for MVPbkContactObserver::TResult extension
williamr@4
    63
        struct TResultExt;
williamr@4
    64
williamr@4
    65
        /**
williamr@4
    66
         * Result object for Contact operation observers.
williamr@4
    67
         */
williamr@4
    68
        struct TContactOpResult
williamr@4
    69
            {
williamr@4
    70
            ///Own: Operation code
williamr@4
    71
            TContactOp iOpCode;
williamr@4
    72
williamr@4
    73
            /**
williamr@4
    74
             * New Store Contact object.
williamr@4
    75
             * Set if iOpCode is EContactRead or EContactReadAndLock.
williamr@4
    76
             * If set client takes ownership of the object.
williamr@4
    77
             */
williamr@4
    78
            MVPbkStoreContact* iStoreContact;
williamr@4
    79
williamr@4
    80
            ///Own: Reserved for Extension
williamr@4
    81
            TResultExt* iExtension;
williamr@4
    82
            };
williamr@4
    83
williamr@4
    84
    public:  // Interface
williamr@4
    85
        /**
williamr@4
    86
         * Called when a contact operation has succesfully completed.
williamr@4
    87
         *
williamr@4
    88
         * NOTE: If you use Cleanupstack for MVPbkStoreContact use 
williamr@4
    89
         * MVPbkStoreContact::PushL or CleanupDeletePushL from e32base.h.
williamr@4
    90
         * (Do Not Use CleanupStack::PushL(TAny*) because then the virtual 
williamr@4
    91
         * destructor of the M-class won't be called when the object 
williamr@4
    92
         * is deleted).
williamr@4
    93
         *
williamr@4
    94
         * @param aResult   The result of the operation. The client takes
williamr@4
    95
         *                  the ownership of the iStoreContact immediately
williamr@4
    96
         *                  if set in aResult.
williamr@4
    97
         */
williamr@4
    98
        virtual void ContactOperationCompleted(TContactOpResult aResult) =0;
williamr@4
    99
williamr@4
   100
        /**
williamr@4
   101
         * Called when a contact operation has failed.
williamr@4
   102
         *
williamr@4
   103
         * @param aOpCode           The operation that failed.
williamr@4
   104
         * @param aErrorCode        System error code of the failure.
williamr@4
   105
         *							KErrAccessDenied when EContactCommit 
williamr@4
   106
         *							means that contact hasn't been locked.
williamr@4
   107
         * @param aErrorNotified    ETrue if the implementation has already
williamr@4
   108
         *                          notified user about the error, 
williamr@4
   109
         *                          EFalse otherwise.
williamr@4
   110
         */
williamr@4
   111
        virtual void ContactOperationFailed
williamr@4
   112
            (TContactOp aOpCode, TInt aErrorCode, TBool aErrorNotified) =0;
williamr@4
   113
williamr@4
   114
        /**
williamr@4
   115
         * Returns an extension point for this interface or NULL.
williamr@4
   116
         * @param aExtensionUid Uid of extension.
williamr@4
   117
         * @return Extension point or NULL.
williamr@4
   118
         */
williamr@4
   119
        virtual TAny* ContactObserverExtension(
williamr@4
   120
                TUid /*aExtensionUid*/) { return NULL; }
williamr@4
   121
williamr@4
   122
    protected:  // Destructor
williamr@4
   123
        /**
williamr@4
   124
         * Destructor.
williamr@4
   125
         */
williamr@4
   126
        virtual ~MVPbkContactObserver() { }
williamr@4
   127
williamr@4
   128
    };
williamr@4
   129
williamr@4
   130
#endif  // MVPBKCONTACTOBSERVER_H
williamr@4
   131
williamr@4
   132
// End of File