videditor/ManualVideoEditor/src/VeiSettingItemList.cpp
changeset 0 951a5db380a0
equal deleted inserted replaced
-1:000000000000 0:951a5db380a0
       
     1 /*
       
     2 * Copyright (c) 2010 Ixonos Plc.
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of the "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - Initial contribution
       
    11 *
       
    12 * Contributors:
       
    13 * Ixonos Plc
       
    14 *
       
    15 * Description: 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #include "FilenameSettingItem.h"
       
    21 #include "manualvideoeditor.hrh"	// For setting item ids
       
    22 #include "VeiSettingItemList.h"
       
    23 
       
    24 #include <caknmemoryselectionsettingitem.h> 
       
    25 #include <manualvideoeditor.rsg>
       
    26 
       
    27 CVeiSettingItemList::CVeiSettingItemList( TVeiSettings& aSettings ): iSettings( aSettings )
       
    28 {}
       
    29 
       
    30 CVeiSettingItemList::~CVeiSettingItemList()
       
    31 {}
       
    32 
       
    33 /**
       
    34  * Called by framework when the view size is changed. Resizes the
       
    35  * setting list accordingly.
       
    36  */
       
    37 void CVeiSettingItemList::SizeChanged()
       
    38     {
       
    39     if ( ListBox())
       
    40         {
       
    41         ListBox()->SetRect( Rect());
       
    42         }
       
    43     }
       
    44 
       
    45 /**
       
    46  *
       
    47  *
       
    48  */
       
    49 CAknSettingItem* CVeiSettingItemList::CreateSettingItemL( TInt aSettingId )
       
    50     {
       
    51     CAknSettingItem* settingItem = NULL;
       
    52 
       
    53     switch ( aSettingId )
       
    54         {
       
    55         /**
       
    56          * Default video name
       
    57          */
       
    58         case EVeiVideoNameSettingItem:
       
    59             settingItem = new( ELeave )CFileNameSettingItem( aSettingId, iSettings.DefaultVideoName(), R_VEI_ILLEGAL_FILENAME, R_VEI_UNSUITABLE_FILENAME );
       
    60             break;
       
    61             /**
       
    62              * Default snapshot name
       
    63              */
       
    64         case EVeiSnapshotNameSettingItem:
       
    65             settingItem = new( ELeave )CFileNameSettingItem( aSettingId, iSettings.DefaultSnapshotName(), R_VEI_ILLEGAL_FILENAME, R_VEI_UNSUITABLE_FILENAME );
       
    66             break;
       
    67             /**
       
    68              * Save quality
       
    69              */
       
    70         case EVeiSaveQualitySettingItem:
       
    71             settingItem = new( ELeave )CAknEnumeratedTextPopupSettingItem( aSettingId, iSettings.SaveQuality());
       
    72             break;
       
    73             /**
       
    74              * Memory in use
       
    75              */
       
    76         case EVeiMemoryInUseSettingItem:
       
    77             settingItem = new( ELeave )CAknMemorySelectionSettingItem( aSettingId, iSettings.MemoryInUse());
       
    78             break;
       
    79             /**
       
    80              * Default
       
    81              */
       
    82         default:
       
    83             // Panic the aplication if all setting items defined in rss
       
    84             // are not constructed
       
    85             User::Panic( _L( "CVeiSettingItemList" ), KErrNotFound );
       
    86             break;
       
    87         }
       
    88     // Return constructed item and transfer the ownership to base class.
       
    89     return settingItem;
       
    90     }
       
    91 
       
    92 /**
       
    93  *
       
    94  *
       
    95  */
       
    96 void CVeiSettingItemList::ChangeFocusedItemL()
       
    97     {
       
    98     EditItemL( ListBox()->CurrentItemIndex(), ETrue );
       
    99     }
       
   100 
       
   101 /**
       
   102  * 
       
   103  *
       
   104  */
       
   105 void CVeiSettingItemList::EditItemL( TInt aIndex, TBool aCalledFromMenu )
       
   106     {
       
   107     CAknSettingItemList::EditItemL( aIndex, aCalledFromMenu );
       
   108     ( *SettingItemArray())[aIndex]->StoreL();
       
   109     }
       
   110 
       
   111 // End of File