securitydialogs/lockclient/inc/lockaccessextension.h
changeset 0 164170e6151a
child 21 09b1ac925e3f
--- /dev/null	Thu Jan 01 00:00:00 1970 +0000
+++ b/securitydialogs/lockclient/inc/lockaccessextension.h	Tue Jan 26 15:20:08 2010 +0200
@@ -0,0 +1,93 @@
+/*
+* Copyright (c) 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:  Extension to lockapp clients.
+ *
+*/
+
+
+#ifndef __LOCKACCESSEXTENSION_H__
+#define __LOCKACCESSEXTENSION_H__
+
+#include <e32base.h>
+
+class RWsSession;
+
+/**
+ *  RLockAccessExtension class.
+ *  Extension class used to access lockapp.
+ *
+ *  @lib    lockclient
+ *  @since  5.0
+ *  @author Tamas Koteles
+ */
+class RLockAccessExtension : public RSessionBase
+	{
+	public:
+
+		/**
+		 * From @c RSessionBase. Sends a message.
+		 * @return KErrNone if succeeded or already connected.
+		 *         KErrNotReady if the server is not yet fully initialized.
+		 *         otherwise standard RSessionBase error values.
+		 */
+		TInt SendMessage( TInt aMessage );
+
+		/**
+		 * From @c RSessionBase. Sends a message with a parameter.
+		 * @return KErrNone if succeeded or already connected.
+		 *         KErrNotReady if the server is not yet fully initialized.
+		 *         otherwise standard RSessionBase error values.
+		 */
+		TInt SendMessage( TInt aMessage, TInt aParam1 );
+
+		/**
+		 * From @c RSessionBase. Sends a message with two parameter.
+		 * @return KErrNone if succeeded or already connected.
+		 *         KErrNotReady if the server is not yet fully initialized.
+		 *         otherwise standard RSessionBase error values.
+		 */
+		TInt SendMessage( TInt aMessage, TInt aParam1, TInt aParam2 );
+
+	private:
+
+		/**
+		 * Returns the server's version.
+		 */
+		TVersion GetVersion( );
+
+		/**
+		 * Tries to create session to service.
+		 * Must be called before accessing other methods in the API.
+		 *
+		 * @return KErrNone if succeeded or already connected.
+		 *         KErrNotReady if the server is not yet fully initialized.
+		 *         KErrNotSupported if the CoeEnv is not available
+		 *         otherwise standard RSessionBase error values.
+		 */
+		TInt TryConnect( RWsSession& aWsSession );
+
+		/**
+		 * Ensures that the connection to the service is alive.
+		 * Tries to connect to service if not connected.
+		 *
+		 * @return KErrNone if succeeded or already connected.
+		 *         KErrNotReady if the server is not yet fully initialized.
+		 *         KErrNotSupported if the CoeEnv is not available
+		 *         otherwise standard RSessionBase error values.
+		 */
+		TInt EnsureConnected( );
+
+	};
+
+#endif // __LOCKACCESSEXTENSION_H__