Determining the current editing state of a Symbian app
m (Protected "TSS000459 - Determining the current editing state of an S60 application": KB [edit=sysop:move=sysop]) |
extkbeditor1
(Talk | contribs) m |
||
| Line 5: | Line 5: | ||
[[Category:Technical Solution]] | [[Category:Technical Solution]] | ||
| − | {| | + | {{KnowledgeBase |
| − | | | + | |id=TSS000459 |
| − | = | + | |platform=S60 3rd Edition |
| − | | | + | |devices= |
| − | | | + | |category=Symbian C<nowiki>++</nowiki> |
| + | |subcategory= | ||
| + | |creationdate=October 19, 2006 | ||
| + | |keywords= | ||
| + | }} | ||
| − | + | == 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.<br>//------------------------------------------------------------------------------<br>struct S_uid: public TUid<br> <nowiki>{</nowiki><br> S_uid(int i)<nowiki>{</nowiki> iUid = i; <nowiki>}</nowiki><br> <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> <nowiki>{</nowiki><br> // T9 Mode<br> ...<br> <nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorQuery)))<br> <nowiki>{</nowiki><br> // Pen Mode<br> ...<br> <nowiki>}</nowiki><br><br>const char *cp;<br>if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorLowerCase)))<br> <nowiki>{</nowiki><br> // Lower case alphabet mode<br> ...<br> <nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorUpperCase)))<br> <nowiki>{</nowiki><br> // Upper case alphabet mode<br> ...<br> <nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorTextCase)))<br> <nowiki>{</nowiki><br> // Text Auto-case mode (Abc)<br> ...<br> <nowiki>}</nowiki><br>else if(ic-<nowiki>></nowiki>IndicatorState(S_uid(EAknNaviPaneEditorIndicatorNumberCase)))<br> <nowiki>{</nowiki><br> // Numeric mode<br> ...<br> <nowiki>}</nowiki><br>//------------------------------------------------------------------------------ | |
| − | ==== | + | |
| − | + | ||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
| − | |||
[[Category:Symbian C++]][[Category:S60 3rd Edition]] | [[Category:Symbian C++]][[Category:S60 3rd Edition]] | ||
Revision as of 16:40, 3 November 2008
Article Metadata
Compatibility
Article
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
...
}
//------------------------------------------------------------------------------

