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