idlehomescreen/xmluicontroller/src/texttransactionelement.cpp
branchRCL_3
changeset 9 f966699dea19
parent 2 08c6ee43b396
equal deleted inserted replaced
5:c743ef5928ba 9:f966699dea19
    20 #include    "aixmluiutils.h"
    20 #include    "aixmluiutils.h"
    21 
    21 
    22 #include    "xntype.h"
    22 #include    "xntype.h"
    23 #include    "xnproperty.h"
    23 #include    "xnproperty.h"
    24 #include    "xntext.h"
    24 #include    "xntext.h"
       
    25 #include    "xntexteditor.h"
    25 #include    "xnmenuadapter.h"
    26 #include    "xnmenuadapter.h"
    26 #include    "xnnewsticker.h"
    27 #include    "xnnewsticker.h"
    27 //#include    <xnmarquee.h>
    28 //#include    <xnmarquee.h>
    28 #include    "mxncomponentinterface.h"
    29 #include    "mxncomponentinterface.h"
    29 #include    "xnnodeappif.h"
    30 #include    "xnnodeappif.h"
    31 #include    "xnproperty.h"
    32 #include    "xnproperty.h"
    32 #include    "xndompropertyvalue.h"
    33 #include    "xndompropertyvalue.h"
    33 #include    "xnvolumecontrol.h"
    34 #include    "xnvolumecontrol.h"
    34 #include    "aistrcnv.h"
    35 #include    "aistrcnv.h"
    35 
    36 
       
    37 _LIT8( KTextEditor, "texteditor" );
       
    38 
    36 // ============================ MEMBER FUNCTIONS ===============================
    39 // ============================ MEMBER FUNCTIONS ===============================
    37 
    40 
    38 using namespace AiXmlUiController;
    41 using namespace AiXmlUiController;
    39 using namespace XnTextInterface;
    42 using namespace XnTextInterface;
    40 
    43 
   107     // Text element, menu item, newsticker, and marquee supported
   110     // Text element, menu item, newsticker, and marquee supported
   108     return ( type == XnTextInterface::MXnTextInterface::Type() ||
   111     return ( type == XnTextInterface::MXnTextInterface::Type() ||
   109              type == KXnMenuItem ||
   112              type == KXnMenuItem ||
   110              type == KXnMenu ||
   113              type == KXnMenu ||
   111              type == XnPropertyNames::softkey::KNodeName || 
   114              type == XnPropertyNames::softkey::KNodeName || 
   112              type == XnPropertyNames::volumecontrol::KSlider /*||
   115              type == XnPropertyNames::volumecontrol::KSlider ||
   113              type == XnNewstickerInterface::MXnNewstickerInterface::Type() ||
   116              type == KTextEditor );
   114              type == XnMarqueeInterface::MXnMarqueeInterface::Type() */);
       
   115     }
   117     }
   116 
   118 
   117 void CTextTransactionElement::CheckTypeL( CXnNodeAppIf& aTarget )
   119 void CTextTransactionElement::CheckTypeL( CXnNodeAppIf& aTarget )
   118     {
   120     {
   119     if ( !IsSupported( aTarget ) )
   121     if ( !IsSupported( aTarget ) )
   132         // Get control interface
   134         // Get control interface
   133         XnTextInterface::MXnTextInterface* textControl = NULL;
   135         XnTextInterface::MXnTextInterface* textControl = NULL;
   134         XnComponentInterface::MakeInterfaceL( textControl, Target() );
   136         XnComponentInterface::MakeInterfaceL( textControl, Target() );
   135         LeaveIfNull( textControl, KErrNotSupported );
   137         LeaveIfNull( textControl, KErrNotSupported );
   136         
   138         
   137         // Set text
   139         // set text
   138         
       
   139         textControl->SetTextL( *iNewText );
   140         textControl->SetTextL( *iNewText );
       
   141         }
       
   142     else if( type == XnTextEditorInterface::MXnTextEditorInterface::Type() )
       
   143         {
       
   144         XnTextEditorInterface::MXnTextEditorInterface* editorControl = NULL;
       
   145         XnComponentInterface::MakeInterfaceL( editorControl, Target() );
       
   146         LeaveIfNull( editorControl, KErrNotSupported );
       
   147         
       
   148         // set text
       
   149         editorControl->SetTextL( *iNewText );
   140         }
   150         }
   141        
   151        
   142  // Menu softkey texts
   152  // Menu softkey texts
   143     else if ( type == XnPropertyNames::softkey::KNodeName)
   153     else if ( type == XnPropertyNames::softkey::KNodeName)
   144         {
   154         {