epoc32/include/eikvcurs.h
branchSymbian2
changeset 2 2fe1408b6811
parent 0 061f57f2323e
equal deleted inserted replaced
1:666f914201fb 2:2fe1408b6811
     1 eikvcurs.h
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
       
     2 // All rights reserved.
       
     3 // This component and the accompanying materials are made available
       
     4 // 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
       
     5 // which accompanies this distribution, and is available
       
     6 // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html".
       
     7 //
       
     8 // Initial Contributors:
       
     9 // Nokia Corporation - initial contribution.
       
    10 //
       
    11 // Contributors:
       
    12 //
       
    13 // Description:
       
    14 // class TEikVirtualCursor
       
    15 // 
       
    16 //
       
    17 
       
    18 #ifndef __EIKVCURS_H__
       
    19 #define __EIKVCURS_H__
       
    20 
       
    21 #include <e32std.h>
       
    22 #include <coemain.h>
       
    23 
       
    24 
       
    25 /** Provides support for the virtual cursor's state within an application.
       
    26 
       
    27 There is one instance of this object per CEikonEnv. 
       
    28 
       
    29 @publishedAll
       
    30 @released */
       
    31 class TEikVirtualCursor
       
    32 	{
       
    33 public:
       
    34 	/** Specifies the virtual cursor's state. 
       
    35 
       
    36 	The state may be on, off or suspended. The suspended state is for use by applications 
       
    37 	that wish to temporarily disable the cursor, but do not want to switch it 
       
    38 	off completely. For example, an editor control which when focused needs to 
       
    39 	capture arrow keys would disable the virtual cursor when it gains focus, 
       
    40 	and enable it when unfocused. */
       
    41 	enum TState
       
    42 		{
       
    43 		/** Sets the virtual cursor off. */
       
    44 		EOff=0,
       
    45 		/** Sets the virtual cursor on. */
       
    46 		EOn,
       
    47 		/** Sets the virtual cursor as suspended. */
       
    48 		ESuspended
       
    49 		};
       
    50 public:
       
    51 	TEikVirtualCursor();
       
    52 private: //prevent passing by value
       
    53 	inline TEikVirtualCursor(const TEikVirtualCursor&);
       
    54 public:
       
    55 	IMPORT_C void SetCursorStateL(TState aState, CCoeEnv& aEnv);
       
    56 	IMPORT_C TState CursorState(CCoeEnv& aEnv);
       
    57 public: // but not exported
       
    58 	void HandleAppToForeground(CCoeEnv& aEnv);
       
    59 private:
       
    60 	void SwitchOffEmulationAndBitmap(CCoeEnv& aEnv);
       
    61 	void SwitchOnEmulationAndBitmap(CCoeEnv& aEnv);
       
    62 private:
       
    63 	TState iState;
       
    64 	};
       
    65 
       
    66 
       
    67 // inlines
       
    68 
       
    69 /** Constructor.
       
    70 
       
    71 Sets the cursor's state to ESuspended so that the call to switch off the virtual 
       
    72 cursor will succeed when the application starts. Required due to the efficient 
       
    73 implementation of SetCursorState(). */
       
    74 inline TEikVirtualCursor::TEikVirtualCursor(const TEikVirtualCursor&)
       
    75 	{}
       
    76 
       
    77 #endif