applicationinterworkingfw/ServiceHandler/src/AiwMenu.cpp
branchRCL_3
changeset 19 aecbbf00d063
parent 9 0aa5fbdfbc30
child 20 d48ab3b357f1
equal deleted inserted replaced
18:fcdfafb36fe7 19:aecbbf00d063
    24 #include "AiwMenu.h"
    24 #include "AiwMenu.h"
    25 #include "AiwCommon.hrh"
    25 #include "AiwCommon.hrh"
    26 
    26 
    27 // This is needed for resource reading.
    27 // This is needed for resource reading.
    28 const TInt KCCMask(0x00000fff);
    28 const TInt KCCMask(0x00000fff);
    29 const TInt KNominalTextLength = 40;
    29 
    30 
    30 
    31 EXPORT_C CAiwMenuPane::CAiwMenuPane(CEikMenuPane& aMenuPane, TInt aBaseCmdId) 
    31 EXPORT_C CAiwMenuPane::CAiwMenuPane(CEikMenuPane& aMenuPane, TInt aBaseCmdId) 
    32 : iMenuPane(&aMenuPane), iBaseCmdId(aBaseCmdId)
    32 : iMenuPane(&aMenuPane), iBaseCmdId(aBaseCmdId)
    33     {
    33     {
    34     iNextCmdId = aBaseCmdId;
    34     iNextCmdId = aBaseCmdId;
    96     for (TInt i = 0; i < count; i++)
    96     for (TInt i = 0; i < count; i++)
    97         {
    97         {
    98         data.iCommandId = aReader.ReadInt32();
    98         data.iCommandId = aReader.ReadInt32();
    99         data.iCascadeId = aReader.ReadInt32();  
    99         data.iCascadeId = aReader.ReadInt32();  
   100         data.iFlags = aReader.ReadInt32();
   100         data.iFlags = aReader.ReadInt32();
   101         TPtrC text( aReader.ReadTPtrC() );
   101         data.iText.Copy(aReader.ReadTPtrC());
   102         data.iText.Copy( text.Ptr(), Min( KNominalTextLength, text.Length() ) );
       
   103         
   102         
   104         // Extra text (additional submenu text) must be handled separately
   103         // Extra text (additional submenu text) must be handled separately
   105         // because SData doesn't offer space for it.
   104         // because SData doesn't offer space for it.
   106         TPtrC extraText = aReader.ReadTPtrC();
   105         TPtrC extraText = aReader.ReadTPtrC();
   107         
   106         
   223     CEikMenuPaneItem::SData data;
   222     CEikMenuPaneItem::SData data;
   224     
   223     
   225     data.iCommandId = AIW_SUBMENU_TITLE;
   224     data.iCommandId = AIW_SUBMENU_TITLE;
   226     data.iCascadeId = 0;  
   225     data.iCascadeId = 0;  
   227     data.iFlags = 0;
   226     data.iFlags = 0;
   228     data.iText.Copy(aTitle.Ptr(),Min(KNominalTextLength,aTitle.Length()));
   227     data.iText.Copy(aTitle);
   229 
   228 
   230     iMenuPane->InsertMenuItemL(data, aIndex);       
   229     iMenuPane->InsertMenuItemL(data, aIndex);       
   231     }
   230     }
   232 
   231 
   233 
   232