sdkcreationmw/sdkruntimes/GuiLauncher/src/EcmtGuiSettingsView.cpp
author Shabe Razvi <shaber@symbian.org>
Thu, 04 Nov 2010 17:22:05 +0000
changeset 4 b3b823debf08
parent 0 b26acd06ea60
permissions -rw-r--r--
Workaround for Bug 3917 - CWinsockInterface::DataSent calls NotifyDataSent which is not implemented.
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
0
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     1
/*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     3
* All rights reserved.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     4
* This component and the accompanying materials are made available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     6
* which accompanies this distribution, and is available
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     8
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
     9
* Initial Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    11
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    12
* Contributors:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    13
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    14
* Description:  View class for setting list
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    15
*
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    16
*/
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    17
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    18
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    19
#include <EcmtGui.rsg>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    20
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    21
#include "EcmtGuiSettingsView.h"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    22
#include "EcmtGuiSettingList.h"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    23
#include "EcmtGui.hrh"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    24
#include "EcmtGuiAppUi.h"
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    25
#include <aknnotewrappers.h>
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    26
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    27
// ======== MEMBER FUNCTIONS ========
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    28
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    29
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    30
// Two-phased constructor.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    31
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    32
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    33
CEcmtGuiSettingsView* CEcmtGuiSettingsView::NewL()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    34
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    35
    CEcmtGuiSettingsView* self = new (ELeave) CEcmtGuiSettingsView;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    36
    CleanupStack::PushL(self);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    37
    self->ConstructL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    38
    CleanupStack::Pop(self);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    39
    return self;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    40
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    41
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    42
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    43
// C++ default constructor
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    44
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    45
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    46
CEcmtGuiSettingsView::CEcmtGuiSettingsView()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    47
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    48
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    49
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    50
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    51
// Destructor
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    52
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    53
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    54
CEcmtGuiSettingsView::~CEcmtGuiSettingsView()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    55
	{
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    56
	if ( iContainer )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    57
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    58
        AppUi()->RemoveFromStack( iContainer );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    59
        delete iContainer;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    60
        }     
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    61
	}
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    62
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    63
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    64
// From class CAknView.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    65
// Returns views id.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    66
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    67
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    68
TUid CEcmtGuiSettingsView::Id() const 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    69
    { 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    70
    return TUid::Uid(EEcmtSettingsViewId); 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    71
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    72
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    73
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    74
// From class CAknView.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    75
// Handles commands.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    76
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    77
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    78
void CEcmtGuiSettingsView::HandleCommandL( TInt aCommand )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    79
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    80
    switch( aCommand )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    81
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    82
        case EEcmtGuiCmdChange:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    83
            iContainer->EditItemL( 0, ETrue );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    84
            break;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    85
        case EAknSoftkeyBack:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    86
		    		iContainer->StoreSelectionL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    87
            AppUi()->HandleCommandL( EEcmtGuiCmdStop );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    88
            AppUi()->HandleCommandL( EEcmtGuiCmdClearLog );       
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    89
            AppUi()->ActivateLocalViewL( TUid::Uid( EEcmtLogViewId ) );               
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    90
            break;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    91
        default:
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    92
            AppUi()->HandleCommandL(aCommand);  
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    93
            break;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    94
        }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    95
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    96
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    97
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    98
// From class CAknView.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
    99
// Activates this view.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   100
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   101
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   102
void CEcmtGuiSettingsView::DoActivateL( const TVwsViewId& /*aPrevViewId*/,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   103
                      TUid /*aCustomMessageId*/,
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   104
                      const TDesC8& /*aCustomMessage*/ )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   105
    {    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   106
    iContainer = new (ELeave) CEcmtGuiSettingList();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   107
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   108
    iContainer->SetMopParent( this );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   109
    iContainer->ConstructFromResourceL( R_ECMTGUI_SETTING_ITEM_LIST );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   110
    iContainer->SetDataL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   111
    AppUi()->AddToStackL( *this, iContainer );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   112
    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   113
    iContainer->MakeVisible( ETrue );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   114
    iContainer->SetRect( ClientRect() );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   115
    iContainer->ActivateL();
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   116
    iContainer->DrawNow();    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   117
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   118
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   119
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   120
// From class CAknView.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   121
// Deactivates this view
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   122
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   123
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   124
void CEcmtGuiSettingsView::DoDeactivate()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   125
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   126
    if ( iContainer )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   127
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   128
        AppUi()->RemoveFromViewStack( *this, iContainer );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   129
        delete iContainer;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   130
        iContainer = NULL;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   131
        }    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   132
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   133
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   134
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   135
// Symbian 2nd phase constructor can leave.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   136
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   137
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   138
void CEcmtGuiSettingsView::ConstructL()
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   139
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   140
    BaseConstructL(R_ECMTGUI_SETTINGS_VIEW);    
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   141
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   142
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   143
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   144
// Called by HandleResourceChangeL() from CEcmtGuiAppUi when layout 
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   145
// is changed.
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   146
// ---------------------------------------------------------------------------
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   147
//
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   148
void CEcmtGuiSettingsView::HandleSizeChange( TInt aType )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   149
    {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   150
    if( iContainer )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   151
        {
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   152
        iContainer->HandleResourceChange( aType );
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   153
        
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   154
        if ( aType==KEikDynamicLayoutVariantSwitch )
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   155
            {        
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   156
            TRect rect;
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   157
            AknLayoutUtils::LayoutMetricsRect(AknLayoutUtils::EMainPane, rect);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   158
            iContainer->SetRect(rect);
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   159
            }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   160
        }       
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   161
    }
b26acd06ea60 First Contribution of SDK components
rajpuroh
parents:
diff changeset
   162