contacts_plat/phonebook_2_ui_controls_api/inc/MPbk2ContactEditorEventObserver.h
branchRCL_3
changeset 63 f4a778e096c2
child 64 c1e8ba0c2b16
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/contacts_plat/phonebook_2_ui_controls_api/inc/MPbk2ContactEditorEventObserver.h	Wed Sep 01 12:29:52 2010 +0100
@@ -0,0 +1,112 @@
+/*
+* Copyright (c) 2005-2007 Nokia Corporation and/or its subsidiary(-ies).
+* All rights reserved.
+* This component and the accompanying materials are made available
+* under the terms of "Eclipse Public License v1.0"
+* which accompanies this distribution, and is available
+* at the URL "http://www.eclipse.org/legal/epl-v10.html".
+*
+* Initial Contributors:
+* Nokia Corporation - initial contribution.
+*
+* Contributors:
+*
+* Description:  Phonebook 2 contact editor event observer interface.
+*
+*/
+
+
+#ifndef MPBK2CONTACTEDITOREVENTOBSERVER_H
+#define MPBK2CONTACTEDITOREVENTOBSERVER_H
+
+// INCLUDES
+#include <e32std.h>
+#include <MVPbkContactObserver.h>
+
+// CLASS DECLARATION
+
+/**
+ * Phonebook 2 contact editor event observer interface.
+ */
+class MPbk2ContactEditorEventObserver
+    {
+    public: // Data types
+
+        /**
+         * Editor flags.
+         */
+        enum TPbk2ContactEditorFlag
+            {
+            /// Command id
+            EPbk2EditorCommandId        = 0x00000001,
+            /// Key code
+            EPbk2EditorKeyCode          = 0x00000002
+            };
+
+        /**
+         * Additional parameters for contact editor events.
+         */
+        struct TParams
+            {
+            /// A collection of TPbk2ContactEditorFlags
+            TUint32 iFlags;
+            /// This must be set if the flag EPbk2EditorCommandId is set
+            TInt iCommandId;
+            /// This must be set if the flag EPbk2EditorKeyCode is set
+            TInt iKeyCode;
+            };
+
+        /**
+         * Parameters for operation failed callback.
+         */
+        struct TFailParams
+            {
+            /// Indicates whether the error was notified
+            TBool iErrorNotified;
+            /// Indicates whether the editor should be closed
+            TBool iCloseEditor;
+            /// Internal error code
+            TInt iErrorCode;
+            /// Spare data
+            TInt32 iSpare;
+            };
+
+
+    public: // Interface
+
+        /**
+         * Called when a contact editor operation has succesfully completed.
+         *
+         * @param aResult           Result of the operation.
+         * @param aParams           Parameters of the contact event.
+         */
+        virtual void ContactEditorOperationCompleted(
+                MVPbkContactObserver::TContactOpResult aResult,
+                TParams aParams ) = 0;
+
+        /**
+         * Called when a contact editor operation has failed.
+         *
+         * @param aOpCode           The operation that failed.
+         * @param aErrorCode        System error code of the failure.
+         *                          KErrAccessDenied (when EContactCommit)
+         *                          means that the contact has not been
+         *                          locked.
+         * @param aParams           Parameters of the event.
+         * @param aFailParams       Extra params for error handling.
+         * @return  Error code.
+         */
+        virtual void ContactEditorOperationFailed(
+                MVPbkContactObserver::TContactOp aOpCode,
+                TInt aErrorCode,
+                TParams aParams,
+                TFailParams& aFailParams ) = 0;
+
+    protected: // Protected destructor
+        ~MPbk2ContactEditorEventObserver()
+                {}
+    };
+
+#endif // MPBK2CONTACTEDITOREVENTOBSERVER_H
+
+// End of File