1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000
1.2 +++ b/epoc32/include/app/MVPbkContactObserver.h Wed Mar 31 12:33:34 2010 +0100
1.3 @@ -0,0 +1,132 @@
1.4 +/*
1.5 +* Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies).
1.6 +* All rights reserved.
1.7 +* This component and the accompanying materials are made available
1.8 +* under the terms of "Eclipse Public License v1.0"
1.9 +* which accompanies this distribution, and is available
1.10 +* at the URL "http://www.eclipse.org/legal/epl-v10.html".
1.11 +*
1.12 +* Initial Contributors:
1.13 +* Nokia Corporation - initial contribution.
1.14 +*
1.15 +* Contributors:
1.16 +*
1.17 +* Description: Virtual Phonebook observer interface for contact
1.18 +* operations (Delete, Commit...).
1.19 +*
1.20 +*/
1.21 +
1.22 +
1.23 +#ifndef MVPBKCONTACTOBSERVER_H
1.24 +#define MVPBKCONTACTOBSERVER_H
1.25 +
1.26 +// INCLUDES
1.27 +#include <e32cmn.h>
1.28 +#include <e32std.h>
1.29 +
1.30 +// FORWARD DECLARATIONS
1.31 +class MVPbkStoreContact;
1.32 +
1.33 +
1.34 +// CLASS DECLARATIONS
1.35 +
1.36 +/**
1.37 + * Virtual Phonebook Contact operation observer interface.
1.38 + * This interface is used to signal the contact operation client
1.39 + * of events.
1.40 + */
1.41 +class MVPbkContactObserver
1.42 + {
1.43 + public: // Types
1.44 + /**
1.45 + * Operation codes for Contact operation observers.
1.46 + */
1.47 + enum TContactOp
1.48 + {
1.49 + /// Unknown operation
1.50 + EContactOperationUnknown = 0,
1.51 + /// See MVPbkViewContact::ReadL
1.52 + EContactRead,
1.53 + /// See MVPbkViewContact::ReadAndLockL
1.54 + EContactReadAndLock,
1.55 + /// See MVPbkBaseContact::DeleteL
1.56 + EContactDelete,
1.57 + /// See MVPbkStoreContact::LockL
1.58 + EContactLock,
1.59 + /// See MVPbkStoreContact::Commit
1.60 + EContactCommit,
1.61 + /// See MVPbkContactStore::SetOwnContacL
1.62 + EContactSetOwn
1.63 + };
1.64 +
1.65 + /// Forward declaration for MVPbkContactObserver::TResult extension
1.66 + struct TResultExt;
1.67 +
1.68 + /**
1.69 + * Result object for Contact operation observers.
1.70 + */
1.71 + struct TContactOpResult
1.72 + {
1.73 + ///Own: Operation code
1.74 + TContactOp iOpCode;
1.75 +
1.76 + /**
1.77 + * New Store Contact object.
1.78 + * Set if iOpCode is EContactRead or EContactReadAndLock.
1.79 + * If set client takes ownership of the object.
1.80 + */
1.81 + MVPbkStoreContact* iStoreContact;
1.82 +
1.83 + ///Own: Reserved for Extension
1.84 + TResultExt* iExtension;
1.85 + };
1.86 +
1.87 + public: // Interface
1.88 + /**
1.89 + * Called when a contact operation has succesfully completed.
1.90 + *
1.91 + * NOTE: If you use Cleanupstack for MVPbkStoreContact use
1.92 + * MVPbkStoreContact::PushL or CleanupDeletePushL from e32base.h.
1.93 + * (Do Not Use CleanupStack::PushL(TAny*) because then the virtual
1.94 + * destructor of the M-class won't be called when the object
1.95 + * is deleted).
1.96 + *
1.97 + * @param aResult The result of the operation. The client takes
1.98 + * the ownership of the iStoreContact immediately
1.99 + * if set in aResult.
1.100 + */
1.101 + virtual void ContactOperationCompleted(TContactOpResult aResult) =0;
1.102 +
1.103 + /**
1.104 + * Called when a contact operation has failed.
1.105 + *
1.106 + * @param aOpCode The operation that failed.
1.107 + * @param aErrorCode System error code of the failure.
1.108 + * KErrAccessDenied when EContactCommit
1.109 + * means that contact hasn't been locked.
1.110 + * @param aErrorNotified ETrue if the implementation has already
1.111 + * notified user about the error,
1.112 + * EFalse otherwise.
1.113 + */
1.114 + virtual void ContactOperationFailed
1.115 + (TContactOp aOpCode, TInt aErrorCode, TBool aErrorNotified) =0;
1.116 +
1.117 + /**
1.118 + * Returns an extension point for this interface or NULL.
1.119 + * @param aExtensionUid Uid of extension.
1.120 + * @return Extension point or NULL.
1.121 + */
1.122 + virtual TAny* ContactObserverExtension(
1.123 + TUid /*aExtensionUid*/) { return NULL; }
1.124 +
1.125 + protected: // Destructor
1.126 + /**
1.127 + * Destructor.
1.128 + */
1.129 + virtual ~MVPbkContactObserver() { }
1.130 +
1.131 + };
1.132 +
1.133 +#endif // MVPBKCONTACTOBSERVER_H
1.134 +
1.135 +// End of File