securitydialogs/lockclient/inc/lockaccessextension.h
author Dremov Kirill (Nokia-D-MSW/Tampere) <kirill.dremov@nokia.com>
Tue, 26 Jan 2010 15:20:08 +0200
changeset 0 164170e6151a
child 21 09b1ac925e3f
permissions -rw-r--r--
Revision: 201004

/*
* 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__