×
Namespaces

Variants
Actions
(Difference between revisions)

Determining the current editing state of a Symbian app

From Nokia Developer Wiki
Jump to: navigation, search
hamishwillee (Talk | contribs)
hamishwillee (Talk | contribs)
m (Hamishwillee - Fix layout)
 
(4 intermediate revisions by 2 users not shown)
Line 1: Line 1:
{{KBTS}}
+
[[Category:Symbian C++]][[Category:S60 3rd Edition (initial release)]][[Category:UI]][[Category:Code Snippet]]
__NOTOC__
+
{{Abstract|This code snippet shows how to get the value of the Symbian status pane "editing value" indicator.}}
__NOEDITSECTION__
+
 
+
[[Category:Technical Solution]]
+
 
+
{{ArticleMetaData
+
|id=TSS000459
+
|platform=S60 3rd Edition
+
|devices=
+
|category=Symbian C<nowiki>++</nowiki>
+
|subcategory=
+
|creationdate=October 19, 2006
+
|keywords=
+
  
 +
{{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]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
 
|installfile= <!-- Link to installation file (e.g. [[Media:The Installation File.sis]]) -->
|sdk=<!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
+
|devices= <!-- Devices tested against - e.g. ''devices=Nokia 6131 NFC, Nokia C7-00'') -->
|devicecompatability=<!-- Compatible devices (e.g.: All* (must have GPS) ) -->
+
|sdk= <!-- SDK(s) built and tested against (e.g. [http://linktosdkdownload/ Nokia Qt SDK 1.1]) -->
|signing=<!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
+
|platform= S60 3rd Edition
|capabilities=<!-- Capabilities required (e.g. Location, NetworkServices.) -->
+
|devicecompatability= <!-- Compatible devices (e.g.: All* (must have GPS) ) -->
|author=[[User:Technical writer 2]]
+
|dependencies= <!-- Any other/external dependencies e.g.: Google Maps Api v1.0 -->
 +
|signing= <!-- Empty or one of Self-Signed, DevCert, Manufacturer -->
 +
|capabilities= <!-- Capabilities required by the article/code example (e.g. Location, NetworkServices. -->
 +
|keywords= <!-- APIs, classes and methods (e.g. QSystemScreenSaver, QList, CBase -->
 +
|language= <!-- Language category code for non-English topics - e.g. Lang-Chinese -->
 +
|translated-by= <!-- [[User:XXXX]] -->
 +
|translated-from-title= <!-- Title only -->
 +
|translated-from-id= <!-- Id of translated revision -->
 +
|review-by= <!-- After re-review: [[User:username]] -->
 +
|review-timestamp= <!-- After re-review: YYYYMMDD -->
 +
|update-by= <!-- After significant update: [[User:username]]-->
 +
|update-timestamp= <!-- After significant update: YYYYMMDD -->
 +
|creationdate= 20061019
 +
|author= [[User:Technical writer 2]]
 +
<!-- The following are not in current metadata -->
 +
|id= TSS000459
 
}}
 
}}
  
 
== Overview ==
 
== Overview ==
Determining the current editing state of an S60 application
+
Symbian 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.
  
== Description ==
+
== Solution ==
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.
+
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
 +
    ...
 +
    }
  
== Solution ==
+
const char *cp;
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>//------------------------------------------------------------------------------
+
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
 +
    ...
 +
    }
  
[[Category:Symbian C++]][[Category:S60 3rd Edition]]
+
</code>

Latest revision as of 06:15, 8 October 2012

This code snippet shows how to get the value of the Symbian status pane "editing value" indicator.

Article Metadata
Compatibility
Platform(s): S60 3rd Edition
S60 3rd Edition (initial release)
Article
Created: User:Technical writer 2 (19 Oct 2006)
Last edited: hamishwillee (08 Oct 2012)

[edit] Overview

Symbian 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.

[edit] 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
...
}
This page was last modified on 8 October 2012, at 06:15.
53 page views in the last 30 days.