Determining the current editing state of a Symbian app
hamishwillee
(Talk | contribs) |
ashraf fawzy
(Talk | contribs) m (Ashraf fawzy -) |
||
| Line 1: | Line 1: | ||
| − | + | [[Category:Symbian C++]][[Category:S60 3rd Edition (initial release)]] | |
| − | + | ||
| − | + | ||
| − | + | ||
{{ArticleMetaData <!-- v1.2 --> | {{ArticleMetaData <!-- v1.2 --> | ||
|sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | |sourcecode= <!-- Link to example source code (e.g. [[Media:The Code Example ZIP.zip]]) --> | ||
| Line 36: | Line 33: | ||
== Solution == | == Solution == | ||
| − | The solution is to use the CAknEnv class to get the current editing state indicator.< | + | The solution is to use the CAknEnv class to get the current editing state indicator. |
| + | <code cpp> | ||
| + | struct S_uid: public TUid | ||
| + | { | ||
| + | S_uid(int i){ iUid = i; } | ||
| + | }; | ||
| + | //Get a reference the indicator container using the CAKnEnv class. | ||
| + | MAknEditingStateIndicator *ei = CAknEnv::Static()->EditingStateIndicator(); | ||
| + | CAknIndicatorContainer *ic = ei->IndicatorContainer(); | ||
| + | //Check which editing state is active | ||
| + | if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorT9))) | ||
| + | { | ||
| + | // T9 Mode | ||
| + | ... | ||
| + | } | ||
| + | else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorQuery))) | ||
| + | { | ||
| + | // Pen Mode | ||
| + | ... | ||
| + | } | ||
| − | + | const char *cp; | |
| + | if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorLowerCase))) | ||
| + | { | ||
| + | // Lower case alphabet mode | ||
| + | ... | ||
| + | } | ||
| + | else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorUpperCase))) | ||
| + | { | ||
| + | // Upper case alphabet mode | ||
| + | ... | ||
| + | } | ||
| + | else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorTextCase))) | ||
| + | { | ||
| + | // Text Auto-case mode (Abc) | ||
| + | ... | ||
| + | } | ||
| + | else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorNumberCase))) | ||
| + | { | ||
| + | // Numeric mode | ||
| + | ... | ||
| + | } | ||
| + | |||
| + | </code> | ||
Revision as of 10:49, 7 October 2012
Article Metadata
Compatibility
Platform(s): S60 3rd Edition
Article
Created: User:Technical writer 2
(19 Oct 2006)
Last edited: ashraf fawzy
(07 Oct 2012)
Overview
Determining the current editing state of an S60 application
Description
S60 applications can get the current editing state. This information is displayed as an editing state indicator in the status pane. Some applications may want to indicate the editing state in a custom way in, e.g., their main pane. The following code snippet can be used to handle such situations.
Solution
The solution is to use the CAknEnv class to get the current editing state indicator.
struct S_uid: public TUid
{
S_uid(int i){ iUid = i; }
};
//Get a reference the indicator container using the CAKnEnv class.
MAknEditingStateIndicator *ei = CAknEnv::Static()->EditingStateIndicator();
CAknIndicatorContainer *ic = ei->IndicatorContainer();
//Check which editing state is active
if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorT9)))
{
// T9 Mode
...
}
else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorQuery)))
{
// Pen Mode
...
}
const char *cp;
if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorLowerCase)))
{
// Lower case alphabet mode
...
}
else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorUpperCase)))
{
// Upper case alphabet mode
...
}
else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorTextCase)))
{
// Text Auto-case mode (Abc)
...
}
else if(ic->IndicatorState(S_uid(EAknNaviPaneEditorIndicatorNumberCase)))
{
// Numeric mode
...
}

