×
Namespaces

Variants
Actions
(Difference between revisions)

Determining the current editing state of a Symbian app

From Nokia Developer Wiki
Jump to: navigation, search
Forum Nokia KB (Talk | contribs)
extkbeditor1 (Talk | contribs)
m
Line 5: Line 5:
 
[[Category:Technical Solution]]
 
[[Category:Technical Solution]]
  
{|border="2" cellspacing="0" cellpadding="4" width="100%"
+
{{KnowledgeBase
|
+
|id=TSS000459
====Subject:====
+
|platform=S60 3rd Edition
|colspan = "2"|Determining the current editing state of an S60 application
+
|devices=
|TSS000459
+
|category=Symbian C<nowiki>++</nowiki>
 +
|subcategory=
 +
|creationdate=October 19, 2006
 +
|keywords=
 +
}}
  
|-
+
== Overview ==
|rowspan = "2"|
+
Determining the current editing state of an S60 application
====&nbsp;====
+
|Platform(s):
+
|colspan = "2"|Device(s), SW version(s):
+
  
|-
+
== Description ==
|S60 3rd Edition
+
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.
|colspan = "2"|&nbsp;
+
  
|-
+
== Solution ==
|
+
The solution is to use the CAknEnv class to get the current editing state indicator.<br>//------------------------------------------------------------------------------<br>struct S_uid: public TUid<br>&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;S_uid(int i)<nowiki>{</nowiki> iUid = i; <nowiki>}</nowiki><br>&nbsp;&nbsp;<nowiki>}</nowiki>;<br>//Get a reference the indicator container using the CAKnEnv class.<br>MAknEditingStateIndicator *ei = CAknEnv::Static()-<nowiki>></nowiki>EditingStateIndicator();<br>CAknIndicatorContainer *ic = ei-<nowiki>></nowiki>IndicatorContainer();<br>//Check which editing state is active<br>if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorT9)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;// T9 Mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorQuery)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;// Pen Mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br><br>const char *cp;<br>if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorLowerCase)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;// Lower case alphabet mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorUpperCase)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Upper case alphabet mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorTextCase)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Text Auto-case mode (Abc)<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorNumberCase)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;// Numeric mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>//------------------------------------------------------------------------------
====Category:====
+
|colspan = "3"|Symbian C<nowiki>++</nowiki>
+
  
|-
 
|
 
====Subcategory:====
 
|colspan = "3"|-
 
 
|-
 
|
 
====Description:====
 
|colspan = "3"|'''Overview:'''<br>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.<br>'''Solution:'''<br>The solution is to use the CAknEnv class to get the current editing state indicator.<br>//------------------------------------------------------------------------------<br>struct S_uid: public TUid<br>&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;S_uid(int i)<nowiki>{</nowiki> iUid = i; <nowiki>}</nowiki><br>&nbsp;&nbsp;<nowiki>}</nowiki>;<br>//Get a reference the indicator container using the CAKnEnv class.<br>MAknEditingStateIndicator *ei = CAknEnv::Static()-<nowiki>></nowiki>EditingStateIndicator();<br>CAknIndicatorContainer *ic = ei-<nowiki>></nowiki>IndicatorContainer();<br>//Check which editing state is active<br>if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorT9)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;// T9 Mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorQuery)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;// Pen Mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br><br>const char *cp;<br>if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorLowerCase)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;// Lower case alphabet mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorUpperCase)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Upper case alphabet mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorTextCase)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;&nbsp;// Text Auto-case mode (Abc)<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorNumberCase)))<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>{</nowiki><br>&nbsp;&nbsp;&nbsp;&nbsp;// Numeric mode<br>&nbsp;&nbsp;&nbsp;&nbsp;...<br>&nbsp;&nbsp;&nbsp;&nbsp;<nowiki>}</nowiki><br>//------------------------------------------------------------------------------
 
 
|-
 
|
 
====Creation date:====
 
|colspan = "3"|October 19, 2006
 
 
|-
 
|
 
====Last modified:====
 
|colspan = "3"|-
 
 
|-
 
 
[[Category:Symbian C++]][[Category:S60 3rd Edition]]
 
[[Category:Symbian C++]][[Category:S60 3rd Edition]]

Revision as of 16:40, 3 November 2008

Template:KBTS

Article Metadata
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Article
Created: (19 Oct 2006)
Last edited: extkbeditor1 (03 Nov 2008)

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
    ...
    }
//------------------------------------------------------------------------------

85 page views in the last 30 days.
×