tsrc/CenrepEditor/Src/cenrepeditorlistbox2.cpp
branchRCL_3
changeset 33 bc78a40cd63c
parent 32 73a1feb507fb
equal deleted inserted replaced
32:73a1feb507fb 33:bc78a40cd63c
    14 * Description:
    14 * Description:
    15 *
    15 *
    16 */
    16 */
    17 #include <aknnotewrappers.h>
    17 #include <aknnotewrappers.h>
    18 #include <akntextsettingpage.h> 
    18 #include <akntextsettingpage.h> 
       
    19 #include "cenrepeditorListbox2.h"
    19 
    20 
    20 #include "cenrepeditorListbox2.h"
    21 #include "cenrepeditorListbox2.h"
    21 
    22 #include <e32debug.h>
    22 
    23 
    23 CAknSettingItem* COtherResourcesListbox::CreateSettingItemL( TInt aIdentifier )
    24 CAknSettingItem* COtherResourcesListbox::CreateSettingItemL( TInt aIdentifier )
    24     {
    25     {
    25     CAknSettingItem* settingItem = NULL;
    26     CAknSettingItem* settingItem = NULL;
    26 
    27 
    46         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iEdgeDtmSupport);
    47         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iEdgeDtmSupport);
    47         break;
    48         break;
    48     case EOtherResourceSessionSetupMethod:        
    49     case EOtherResourceSessionSetupMethod:        
    49         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iSessionSetupMethod);
    50         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iSessionSetupMethod);
    50         break;
    51         break;
       
    52     case EOtherRResourcePrivacyVariationMode:
       
    53         settingItem=ConstructByValueL( aIdentifier, iOtherResources->iPrivacyVariation ); 
       
    54         break;  
    51     case EOtherResourceAutoRecord:        
    55     case EOtherResourceAutoRecord:        
    52         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iAutoRecord);
    56         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iAutoRecord);
    53         break;
    57         break;
    54     case EOtherResourceVideoLocation:        
    58     case EOtherResourceVideoLocation:        
    55         settingItem=new (ELeave) 
    59         settingItem=new (ELeave) 
    75         settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
    79         settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
    76 
    80 
    77         break;   
    81         break;   
    78     case EOtherResourceEncodingDevice:
    82     case EOtherResourceEncodingDevice:
    79         settingItem = new (ELeave) 
    83         settingItem = new (ELeave) 
    80             CAknTextSettingItem( aIdentifier, iOtherResources->iEncodingDeviceStr );
    84            CAknTextSettingItem( aIdentifier, iOtherResources->iEncodingDeviceStr ); 
    81         settingItem->SetSettingPageFlags(CAknTextSettingPage::EZeroLengthAllowed);
    85     	break;             
    82         break;        
       
    83     case EOtherResourceAllowOnlyWithActiveCSCall:        
       
    84         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iOnlyWithActiveCSCall );
       
    85         break;    
       
    86     case EOtherResourceAllowOnlyIn3GNetwork:        
       
    87         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iOnlyIn3GNetwork );
       
    88         break;
       
    89     case EOtherResourceCameraUsage:        
       
    90         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iCameraUsage );
       
    91         break;
       
    92     case EOtherResourceVideoDirection:        
       
    93         settingItem=ConstructByValueL( aIdentifier,iOtherResources->iVideoDirection );
       
    94         break;
       
    95     case EOtherResourceVideoBandwidth:        
       
    96         settingItem = new (ELeave) 
       
    97             CAknIntegerEdwinSettingItem( aIdentifier,iOtherResources->iVideoBandwidth );
       
    98         break;
       
    99     case EOtherResourceFastMode:        
       
   100         settingItem = ConstructByValueL( aIdentifier, iOtherResources->iFastMode );
       
   101         break;
       
   102     default:
    86     default:
   103         break;
    87         break;
   104         }
    88         }
   105     return settingItem;
    89     return settingItem;
   106     }
    90     }
   118         ListBox()->SetRect(Rect());
   102         ListBox()->SetRect(Rect());
   119         }    
   103         }    
   120     }
   104     }
   121 
   105 
   122 
   106 
   123 CAknSettingItem* COtherResourcesListbox::ConstructByValueL( 
   107 // ------------------------------------------------------------------
   124     TInt aIdentifier,
   108 // CPhoneResourcesListbox::ConstructByValueL( aIdentifier, )
   125     TInt& aVal)
   109 // ------------------------------------------------------------------
       
   110 //
       
   111 
       
   112 CAknSettingItem* COtherResourcesListbox::ConstructByValueL( TInt aIdentifier,  
       
   113                                             TInt& aVal )
   126     {    
   114     {    
   127     return new (ELeave) CAknEnumeratedTextPopupSettingItem(aIdentifier,aVal);
   115     CAknSettingItem* settingItem = NULL ;
       
   116     if(aVal<0 )
       
   117         {        
       
   118         settingItem = new (ELeave) CAknSettingItem(aIdentifier);
       
   119         settingItem->SetProtectionState(CAknSettingItem::ESettingItemProtected);
       
   120         }
       
   121     else
       
   122         {
       
   123         settingItem = new (ELeave) 
       
   124             CAknEnumeratedTextPopupSettingItem(aIdentifier,aVal);
       
   125         }
       
   126     return settingItem ;
   128     }
   127     }
       
   128 
       
   129 
       
   130 void COtherResourcesListbox::EditItemL(TInt aIndex, TBool aCalledFromMenu)
       
   131     {
       
   132     CAknSettingItemList::EditItemL(aIndex, aCalledFromMenu);
       
   133     
       
   134     CAknSettingItem* currentItem = SettingItemArray()->At(aIndex);
       
   135     if ( currentItem->Identifier() == EOtherResourceEncodingDevice )
       
   136         {
       
   137         TLex lex( currentItem->SettingTextL() );
       
   138         TUint uid;
       
   139         TInt err = lex.Val(uid, EHex);
       
   140         
       
   141         if ( (err != KErrNone) || !lex.Eos() )
       
   142             {
       
   143             currentItem->LoadL();
       
   144             currentItem->UpdateListBoxTextL();
       
   145 
       
   146             CAknWarningNote* warningNote = new (ELeave) CAknWarningNote;
       
   147             warningNote->ExecuteLD(_L("Invalid value"));
       
   148             }
       
   149          }
       
   150     }