uifw/AvKon/aknconf/src/aknconfsettingitem.cpp
changeset 0 2f259fa3e83a
equal deleted inserted replaced
-1:000000000000 0:2f259fa3e83a
       
     1 /*
       
     2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "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 *
       
    14 * Description:  
       
    15  *
       
    16 */
       
    17 
       
    18 
       
    19 // INCLUDE FILES
       
    20 #include "aknconfsettingitem.h"
       
    21 #include "aknconfsettinglist.h"
       
    22 
       
    23 // ============================ MEMBER FUNCTIONS ===============================
       
    24 
       
    25 
       
    26 // -----------------------------------------------------------------------------
       
    27 // CAknConfSettingItem::CAknConfSettingItem()
       
    28 // -----------------------------------------------------------------------------
       
    29 //
       
    30 CAknConfSettingItem::CAknConfSettingItem( CAknConfSettingList* aList,
       
    31                                           TInt& aValue,
       
    32                                           const TInt& aId,
       
    33                                           const TInt& aCenRepKey )
       
    34     : CAknIntegerEdwinSettingItem( aId, aValue ),
       
    35       iList( aList ),
       
    36       iValue( &aValue ),
       
    37       iCenRepKey( aCenRepKey )
       
    38     {
       
    39     }
       
    40 
       
    41 
       
    42 // -----------------------------------------------------------------------------
       
    43 // CAknConfSettingItem::~CAknConfSettingItem()
       
    44 // -----------------------------------------------------------------------------
       
    45 //
       
    46 CAknConfSettingItem::~CAknConfSettingItem()
       
    47     {
       
    48     }
       
    49 
       
    50 
       
    51 // -----------------------------------------------------------------------------
       
    52 // CAknConfSettingItem::HandleSettingPageEventL()
       
    53 // -----------------------------------------------------------------------------
       
    54 //
       
    55 void CAknConfSettingItem::HandleSettingPageEventL(
       
    56     CAknSettingPage *aSettingPage, TAknSettingPageEvent aEventType)
       
    57     {
       
    58     CAknIntegerEdwinSettingItem::HandleSettingPageEventL( aSettingPage,
       
    59                                                           aEventType );
       
    60     TBool okPressed( aEventType == EEventSettingOked );
       
    61     if ( aEventType == EEventSettingCancelled
       
    62         || aEventType == EEventSettingOked && iList )
       
    63         {
       
    64         StoreL();
       
    65         iList->SettingPageClosed( okPressed,
       
    66                                   *iValue,
       
    67                                   iCenRepKey );
       
    68         }
       
    69     }
       
    70 
       
    71 // -----------------------------------------------------------------------------
       
    72 // CAknConfBinarySettingItem::CAknConfBinarySettingItem()
       
    73 // -----------------------------------------------------------------------------
       
    74 //
       
    75 CAknConfBinarySettingItem::CAknConfBinarySettingItem( CAknConfSettingList* aList,
       
    76                                                       TBool& aValue,
       
    77                                                       const TInt& aId,
       
    78                                                       const TInt& aCenRepKey )
       
    79     : CAknBinaryPopupSettingItem( aId, aValue ),
       
    80       iList( aList ),
       
    81       iValue( &aValue ),
       
    82       iCenRepKey( aCenRepKey )
       
    83     {
       
    84     }
       
    85 
       
    86 
       
    87 // -----------------------------------------------------------------------------
       
    88 // CAknConfBinarySettingItem::~CAknConfBinarySettingItem()
       
    89 // -----------------------------------------------------------------------------
       
    90 //
       
    91 CAknConfBinarySettingItem::~CAknConfBinarySettingItem()
       
    92     {
       
    93     }
       
    94 
       
    95 
       
    96 // -----------------------------------------------------------------------------
       
    97 // CAknConfBinarySettingItem::EditItemL()
       
    98 // -----------------------------------------------------------------------------
       
    99 //
       
   100 void CAknConfBinarySettingItem::EditItemL( TBool aCalledFromMenu )
       
   101     {
       
   102     CAknBinaryPopupSettingItem::EditItemL( aCalledFromMenu );
       
   103     
       
   104     // Value has been toggled, send event to list
       
   105     if ( !aCalledFromMenu )
       
   106         {
       
   107         StoreL();
       
   108         iList->SettingPageClosed( ETrue,
       
   109                                   *iValue,
       
   110                                   iCenRepKey );
       
   111         }
       
   112     }
       
   113 
       
   114 
       
   115 // -----------------------------------------------------------------------------
       
   116 // CAknConfBinarySettingItem::HandleSettingPageEventL()
       
   117 // -----------------------------------------------------------------------------
       
   118 //
       
   119 void CAknConfBinarySettingItem::HandleSettingPageEventL(
       
   120     CAknSettingPage *aSettingPage, TAknSettingPageEvent aEventType)
       
   121     {
       
   122     CAknBinaryPopupSettingItem::HandleSettingPageEventL( aSettingPage,
       
   123                                                           aEventType );
       
   124     TBool okPressed( aEventType == EEventSettingOked );
       
   125     if ( aEventType == EEventSettingCancelled
       
   126         || aEventType == EEventSettingOked && iList )
       
   127         {
       
   128         StoreL();
       
   129         iList->SettingPageClosed( okPressed,
       
   130                                   *iValue,
       
   131                                   iCenRepKey );
       
   132         }
       
   133     }
       
   134 
       
   135 
       
   136 // -----------------------------------------------------------------------------
       
   137 // CAknConfSliderSettingItem::CAknConfSliderSettingItem()
       
   138 // -----------------------------------------------------------------------------
       
   139 //
       
   140 CAknConfSliderSettingItem::CAknConfSliderSettingItem( 
       
   141     CAknConfSettingList* aList, TInt& aValue, const TInt& aId, 
       
   142     const TInt& aCenRepKey )
       
   143     : CAknSliderSettingItem( aId, aValue ),
       
   144       iList( aList ),
       
   145       iValue( &aValue ),
       
   146       iCenRepKey( aCenRepKey )
       
   147     {
       
   148     }
       
   149 
       
   150 
       
   151 // -----------------------------------------------------------------------------
       
   152 // CAknConfSliderSettingItem::~CAknConfSliderSettingItem()
       
   153 // -----------------------------------------------------------------------------
       
   154 //
       
   155 CAknConfSliderSettingItem::~CAknConfSliderSettingItem()
       
   156     {
       
   157     }
       
   158 
       
   159 
       
   160 // -----------------------------------------------------------------------------
       
   161 // CAknConfSliderSettingItem::HandleSettingPageEventL()
       
   162 // -----------------------------------------------------------------------------
       
   163 //
       
   164 void CAknConfSliderSettingItem::HandleSettingPageEventL(
       
   165     CAknSettingPage *aSettingPage, TAknSettingPageEvent aEventType)
       
   166     {
       
   167     CAknSliderSettingItem::HandleSettingPageEventL( aSettingPage,
       
   168                                                     aEventType );
       
   169     TBool okPressed( aEventType == EEventSettingOked );
       
   170     if ( aEventType == EEventSettingCancelled
       
   171         || aEventType == EEventSettingOked && iList )
       
   172         {
       
   173         StoreL();
       
   174         iList->SettingPageClosed( okPressed,
       
   175                                   *iValue,
       
   176                                   iCenRepKey );
       
   177         }
       
   178     }