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