williamr@4: /* williamr@4: * Copyright (c) 2002-2007 Nokia Corporation and/or its subsidiary(-ies). williamr@4: * All rights reserved. williamr@4: * This component and the accompanying materials are made available williamr@4: * under the terms of "Eclipse Public License v1.0" williamr@4: * which accompanies this distribution, and is available williamr@4: * at the URL "http://www.eclipse.org/legal/epl-v10.html". williamr@4: * williamr@4: * Initial Contributors: williamr@4: * Nokia Corporation - initial contribution. williamr@4: * williamr@4: * Contributors: williamr@4: * williamr@4: * Description: Avkon keylock client class definition. williamr@4: * williamr@4: */ williamr@4: williamr@4: williamr@4: #ifndef __AKNKEYLOCK_H__ williamr@4: #define __AKNKEYLOCK_H__ williamr@4: williamr@4: #include williamr@4: #include williamr@4: williamr@4: /** williamr@4: * A handle class API disabling/enabling keylock state. williamr@4: * williamr@4: * @lib avkon.lib williamr@4: * @since S60 0.9 williamr@4: */ williamr@4: class RAknKeyLock : public RNotifier williamr@4: { williamr@4: public: williamr@4: /** williamr@4: * Locks the keys of the device and shows a keys locked note. williamr@4: */ williamr@4: IMPORT_C void EnableKeyLock(); williamr@4: williamr@4: /** williamr@4: * Unlocks the keys of the device and shows a keys unlocked note. williamr@4: */ williamr@4: IMPORT_C void DisableKeyLock(); williamr@4: williamr@4: /** williamr@4: * Returns whether the phone keys have been locked or not. williamr@4: * williamr@4: * @return ETrue if the keys have been locked normally or the phone is in williamr@4: * autolock state. williamr@4: */ williamr@4: IMPORT_C TBool IsKeyLockEnabled(); williamr@4: williamr@4: /** williamr@4: * Controls whether soft notifications will be shown at all. williamr@4: * williamr@4: * @param ETrue if soft notifications should be shown. williamr@4: */ williamr@4: IMPORT_C void EnableSoftNotifications(TBool aEnable); williamr@4: williamr@4: /** williamr@4: * Shows a note on the screen asking the user permission to lock the keypad. williamr@4: */ williamr@4: IMPORT_C void OfferKeyLock(); williamr@4: williamr@4: /** williamr@4: * All notifications queued to be shown are cancelled. williamr@4: */ williamr@4: IMPORT_C void CancelAllNotifications(); williamr@4: williamr@4: /** williamr@4: * Locks the device keys similar to autolock/device lock state. williamr@4: * williamr@4: * @internal williamr@4: * @since S60 2.0 williamr@4: */ williamr@4: IMPORT_C void EnableAutoLockEmulation(); williamr@4: williamr@4: /** williamr@4: * Unlocks the keys of the device without showing the keys unlocked note. williamr@4: * williamr@4: * @since S60 2.0 williamr@4: */ williamr@4: IMPORT_C void DisableWithoutNote(); williamr@4: williamr@4: /** williamr@4: * Locks the keys of the device without showing the keys locked note. williamr@4: * williamr@4: * @since S60 2.1 williamr@4: */ williamr@4: IMPORT_C void EnableWithoutNote(); williamr@4: williamr@4: private: williamr@4: void SendMessage(TKeyLockNotifierReason aMessage); williamr@4: }; williamr@4: williamr@4: /** williamr@4: * Direct client to AknCapServer. williamr@4: * williamr@4: * @lib avkon.lib williamr@4: * @since S60 3.0 williamr@4: */ williamr@4: class RAknKeylock2 : public RAknKeyLock williamr@4: { williamr@4: public: williamr@4: /** williamr@4: * Connects to the AknCapServer. williamr@4: * williamr@4: * @return KErrNone if connection was successful, KErrNotSupported if williamr@4: * CCoeEnv is not accessible. Other system wide error codes are williamr@4: * also possible in error situations. williamr@4: */ williamr@4: IMPORT_C TInt Connect(); williamr@4: }; williamr@4: williamr@4: #endif // __AKNKEYLOCK_H__