williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // class TEikVirtualCursor williamr@2: // williamr@2: // williamr@2: williamr@2: #ifndef __EIKVCURS_H__ williamr@2: #define __EIKVCURS_H__ williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: williamr@2: /** Provides support for the virtual cursor's state within an application. williamr@2: williamr@2: There is one instance of this object per CEikonEnv. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: class TEikVirtualCursor williamr@2: { williamr@2: public: williamr@2: /** Specifies the virtual cursor's state. williamr@2: williamr@2: The state may be on, off or suspended. The suspended state is for use by applications williamr@2: that wish to temporarily disable the cursor, but do not want to switch it williamr@2: off completely. For example, an editor control which when focused needs to williamr@2: capture arrow keys would disable the virtual cursor when it gains focus, williamr@2: and enable it when unfocused. */ williamr@2: enum TState williamr@2: { williamr@2: /** Sets the virtual cursor off. */ williamr@2: EOff=0, williamr@2: /** Sets the virtual cursor on. */ williamr@2: EOn, williamr@2: /** Sets the virtual cursor as suspended. */ williamr@2: ESuspended williamr@2: }; williamr@2: public: williamr@2: TEikVirtualCursor(); williamr@2: private: //prevent passing by value williamr@2: inline TEikVirtualCursor(const TEikVirtualCursor&); williamr@2: public: williamr@2: IMPORT_C void SetCursorStateL(TState aState, CCoeEnv& aEnv); williamr@2: IMPORT_C TState CursorState(CCoeEnv& aEnv); williamr@2: public: // but not exported williamr@2: void HandleAppToForeground(CCoeEnv& aEnv); williamr@2: private: williamr@2: void SwitchOffEmulationAndBitmap(CCoeEnv& aEnv); williamr@2: void SwitchOnEmulationAndBitmap(CCoeEnv& aEnv); williamr@2: private: williamr@2: TState iState; williamr@2: }; williamr@2: williamr@2: williamr@2: // inlines williamr@2: williamr@2: /** Constructor. williamr@2: williamr@2: Sets the cursor's state to ESuspended so that the call to switch off the virtual williamr@2: cursor will succeed when the application starts. Required due to the efficient williamr@2: implementation of SetCursorState(). */ williamr@2: inline TEikVirtualCursor::TEikVirtualCursor(const TEikVirtualCursor&) williamr@2: {} williamr@2: williamr@2: #endif