XDMSettingsUI/src/XDMPlugin.cpp
author Pat Downey <patd@symbian.org>
Wed, 01 Sep 2010 12:23:14 +0100
branchRCL_3
changeset 35 fbd2e7cec7ef
permissions -rw-r--r--
Revert incorrect RCL_3 drop: Revision: 201027 Kit: 201035
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
35
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     1
/*
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     2
* Copyright (c) 2005-2010 Nokia Corporation and/or its subsidiary(-ies).
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     3
* All rights reserved.
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     4
* This component and the accompanying materials are made available
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     6
* which accompanies this distribution, and is available
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     8
*
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
     9
* Initial Contributors:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    11
*
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    12
* Contributors:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    13
*
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    14
* Description:    XDMPlugin Implementation
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    15
*
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    16
*/
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    17
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    18
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    19
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    20
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    21
// Includes
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    22
#include "XDMExternalInterface.h"
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    23
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    24
#include <aknViewAppUi.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    25
#include <StringLoader.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    26
#include <gsprivatepluginproviderids.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    27
#include <eikmenub.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    28
#include <aknlists.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    29
#include <aknPopup.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    30
#include <XdmSettingsApi.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    31
#include <AknQueryDialog.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    32
#include <featmgr.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    33
#include <hlplch.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    34
#include <csxhelp/xdm.hlp.hrh>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    35
#include <gsxdmplugin.mbg>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    36
#include <bautils.h>
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    37
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    38
#include "XDMPlugin.h"
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    39
#include "XDMPluginContainer.h"
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    40
#include "XDMPluginSLContainer.h"
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    41
#include "XDMPlugin.hrh"
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    42
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    43
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    44
// Constants
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    45
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    46
const TInt KMaxNameLength = 255;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    47
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    48
_LIT( KGSXDMPluginResourceFileName, "z:\\resource\\XDMPluginRsc.rsc" );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    49
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    50
#ifdef __SCALABLE_ICONS
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    51
// bitmap
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    52
_LIT( KGSXDMPluginIconFileName, "\\resource\\apps\\GSXDMplugin.mif");
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    53
#else //__SCALABLE_ICONS
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    54
// svg file
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    55
_LIT( KGSXDMPluginIconFileName, "\\resource\\apps\\GSXDMplugin.mbm");
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    56
#endif //__SCALABLE_ICONS
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    57
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    58
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    59
// ========================= MEMBER FUNCTIONS ================================
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    60
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    61
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    62
// CXDMPlugin::CXDMPlugin()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    63
// Constructor
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    64
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    65
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    66
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    67
CXDMPlugin::CXDMPlugin( )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    68
    : iAppUi( CAknView::AppUi() ), iResources( *CCoeEnv::Static() )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    69
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    70
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    71
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    72
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    73
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    74
// CXDMPlugin::~CXDMPlugin()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    75
// Destructor
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    76
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    77
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    78
CXDMPlugin::~CXDMPlugin()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    79
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    80
    if (iCurrentContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    81
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    82
        if(iAppUi)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    83
        iAppUi->RemoveFromViewStack( *this, iCurrentContainer );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    84
        iCurrentContainer = NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    85
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    86
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    87
    if( iMainListContainer )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    88
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    89
        delete iMainListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    90
        iMainListContainer=NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    91
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    92
        
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    93
    if (iSettingListContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    94
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    95
        delete iSettingListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    96
        iSettingListContainer=NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    97
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    98
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
    99
    iResources.Close();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   100
    /** Nice to know when the plugin is cleaned up */
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   101
    #ifdef _DEBUG
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   102
    RDebug::Print( _L( "[CXDMPlugin] ~CXDMPlugin()" ) );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   103
    #endif
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   104
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   105
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   106
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   107
// CXDMPlugin::ConstructL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   108
// Symbian OS two-phased constructor
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   109
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   110
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   111
void CXDMPlugin::ConstructL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   112
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   113
    // To know if the plugin is loaded (for debugging)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   114
    #ifdef _DEBUG
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   115
    RDebug::Print(_L("[CXDMPlugin] ConstructL()" ));
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   116
    RDebug::Print( _L( "[CXDMPlugin] Loading resource from :" ) );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   117
    RDebug::Print( KGSXDMPluginResourceFileName );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   118
    #endif
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   119
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   120
    TFileName fileName( KGSXDMPluginResourceFileName );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   121
    BaflUtils::NearestLanguageFile( iCoeEnv->FsSession(), fileName );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   122
    iResources.OpenL( fileName );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   123
    BaseConstructL( R_GS_XDM_MAIN_VIEW );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   124
        
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   125
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   126
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   127
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   128
// CXDMPlugin::NewL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   129
// Static constructor
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   130
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   131
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   132
CXDMPlugin* CXDMPlugin::NewL( TAny* /*aInitParams*/ )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   133
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   134
    CXDMPlugin* self = new(ELeave) CXDMPlugin( );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   135
    CleanupStack::PushL(self);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   136
    self->ConstructL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   137
    CleanupStack::Pop(self);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   138
    return self;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   139
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   140
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   141
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   142
// CXDMPlugin::Id() const
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   143
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   144
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   145
TUid CXDMPlugin::Id() const
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   146
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   147
    return KGSXDMPluginUid;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   148
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   149
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   150
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   151
// CXDMPlugin::HandleClientRectChange()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   152
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   153
void CXDMPlugin::HandleViewRectChange()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   154
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   155
    if ( iMainListContainer->IsVisible() )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   156
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   157
        iMainListContainer->SetRect( ClientRect() );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   158
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   159
        
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   160
    if ( iSettingListContainer->IsVisible() )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   161
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   162
        iSettingListContainer->SetRect( ClientRect() );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   163
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   164
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   165
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   166
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   167
// CXDMPlugin::DoActivateL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   168
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   169
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   170
void CXDMPlugin::DoActivateL( const TVwsViewId& aPrevViewId,
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   171
                                  TUid /*aCustomMessageId*/,
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   172
                                  const TDesC8& /*aCustomMessage*/ )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   173
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   174
    iPrevViewId = aPrevViewId;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   175
    if (iCurrentContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   176
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   177
        iAppUi->RemoveFromViewStack( *this, iCurrentContainer );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   178
        iCurrentContainer = NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   179
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   180
        
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   181
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   182
    if( iMainListContainer )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   183
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   184
        delete iMainListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   185
        iMainListContainer=NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   186
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   187
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   188
    if( iSettingListContainer )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   189
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   190
        delete iSettingListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   191
        iSettingListContainer = NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   192
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   193
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   194
    iMainListContainer = new( ELeave ) CXDMPluginContainer(this);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   195
    iMainListContainer->SetMopParent(this);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   196
    TRAPD( error, iMainListContainer->ConstructL( ClientRect() ) );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   197
    if (error)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   198
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   199
        delete iMainListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   200
        iMainListContainer = NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   201
        User::Leave( error );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   202
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   203
        
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   204
    iSettingListContainer = new( ELeave ) CXDMPluginSLContainer(this);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   205
    iSettingListContainer->SetMopParent(this);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   206
    TRAPD( error1, iSettingListContainer->ConstructL( ClientRect()));
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   207
    if (error1)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   208
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   209
        delete iSettingListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   210
        iSettingListContainer = NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   211
        User::Leave( error1 );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   212
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   213
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   214
    // switching control
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   215
    iSettingListContainer->MakeVisible(EFalse);    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   216
    iCurrentContainer = iMainListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   217
    iAppUi->AddToViewStackL( *this, iCurrentContainer );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   218
    UpdateMskL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   219
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   220
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   221
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   222
// CXDMPlugin::DoDeactivate()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   223
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   224
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   225
void CXDMPlugin::DoDeactivate()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   226
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   227
    // try to save settings if in settings list container
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   228
    TInt err;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   229
    if (iCurrentContainer == iSettingListContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   230
        TRAP(err, iSettingListContainer->SaveSettingsIfPossibleL());
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   231
    if (iCurrentContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   232
        iAppUi->RemoveFromViewStack( *this, iCurrentContainer );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   233
    iCurrentContainer = NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   234
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   235
    if( iMainListContainer )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   236
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   237
        delete iMainListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   238
        iMainListContainer = NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   239
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   240
        
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   241
    if( iSettingListContainer )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   242
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   243
        delete iSettingListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   244
        iSettingListContainer = NULL;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   245
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   246
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   247
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   248
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   249
// CXDMPlugin::HandleCommandL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   250
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   251
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   252
void CXDMPlugin::HandleCommandL( TInt aCommand )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   253
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   254
    switch ( aCommand )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   255
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   256
        case EAknSoftkeyBack:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   257
            if (iCurrentContainer == iSettingListContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   258
                {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   259
                if (iSettingListContainer->IsExitProcessingOKL())
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   260
                    LoadMainViewL();    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   261
                }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   262
            else 
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   263
                iAppUi->ActivateLocalViewL( iPrevViewId.iViewUid );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   264
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   265
        case EGSXDMPluginCmdChange:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   266
            iSettingListContainer->EditCurrentItemL();                       
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   267
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   268
        case EGSXDMPluginCmdEdit:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   269
            iMainListContainer->EditCurrentItemL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   270
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   271
        case EGSXDMPluginCmdNewExisting:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   272
            if(iSettingListContainer->DisplayNewXDMSetOptionsL()) // if user ok
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   273
                LoadSettingsViewL(ENewFromExisting, iSettingListContainer->GetCurrentSetName());
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   274
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   275
        case EGSXDMPluginCmdNewDefault:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   276
            LoadSettingsViewL(ENewDefault, iSettingListContainer->GetCurrentSetName());
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   277
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   278
        case EGSXDMPluginCmdDelete:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   279
            iMainListContainer->DeleteSetProcedureL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   280
            UpdateMskL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   281
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   282
        case EAknCmdHelp:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   283
            HlpLauncher::LaunchHelpApplicationL(iEikonEnv->WsSession(), AppUi()->AppHelpContextL ());
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   284
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   285
        case EGSXDMPluginCmdExitFromSL:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   286
            if (iCurrentContainer == iSettingListContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   287
                {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   288
                if (iSettingListContainer->IsExitProcessingOKL())
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   289
                    iAppUi->HandleCommandL( EAknCmdExit ); 
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   290
                }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   291
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   292
        case EAknCmdExit:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   293
        case EEikCmdExit:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   294
            if (iCurrentContainer == iSettingListContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   295
                iSettingListContainer->SaveSettingsIfPossibleL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   296
            iAppUi->HandleCommandL( EAknCmdExit );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   297
            break;    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   298
        default:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   299
            iAppUi->HandleCommandL( aCommand );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   300
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   301
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   302
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   303
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   304
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   305
// CXDMPlugin::GetCaptionL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   306
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   307
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   308
void CXDMPlugin::GetCaptionL( TDes& aCaption ) const
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   309
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   310
    StringLoader::Load( aCaption, R_STR_XDM_SETTINGS );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   311
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   312
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   313
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   314
// CXDMPlugin::PluginProviderCategory()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   315
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   316
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   317
TInt CXDMPlugin::PluginProviderCategory() const
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   318
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   319
    return KGSPluginProviderInternal;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   320
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   321
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   322
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   323
// CXDMPlugin::LoadSettingsViewL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   324
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   325
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   326
void CXDMPlugin::LoadSettingsViewL(TXDMSettingsViewType aType, TDesC& aXDMSetName)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   327
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   328
    switch(aType)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   329
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   330
        case EEditExisting:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   331
            iSettingListContainer->PrepareXDMSetForEditingL(aXDMSetName);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   332
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   333
        case ENewDefault:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   334
            iSettingListContainer->PrepareXDMSetNewDefaultL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   335
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   336
        case ENewFromExisting:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   337
            iSettingListContainer->PrepareNewXDMSetFromExistingL(aXDMSetName);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   338
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   339
        default:
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   340
            break;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   341
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   342
    if (iCurrentContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   343
        iAppUi->RemoveFromViewStack( *this, iCurrentContainer );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   344
    iCurrentContainer = iSettingListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   345
    iAppUi->AddToViewStackL( *this, iCurrentContainer );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   346
    iMainListContainer->MakeVisible(EFalse);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   347
    iSettingListContainer->MakeVisible(ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   348
    UpdateMskL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   349
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   350
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   351
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   352
// CXDMPlugin::LoadMainViewL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   353
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   354
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   355
void CXDMPlugin::LoadMainViewL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   356
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   357
    TInt err(KErrNone);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   358
    TRAP(err,iMainListContainer->LoadSettingsListArrayL()); // update main container
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   359
    if (iCurrentContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   360
        iAppUi->RemoveFromViewStack( *this, iCurrentContainer );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   361
    iCurrentContainer = iMainListContainer;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   362
    iAppUi->AddToViewStackL( *this, iCurrentContainer );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   363
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   364
    iMainListContainer->SetFocusIfExist(iSettingListContainer->GetCurrentSetName());
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   365
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   366
    iSettingListContainer->MakeVisible(EFalse);  
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   367
    iMainListContainer->MakeVisible(ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   368
    UpdateMskL();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   369
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   370
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   371
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   372
// CXDMPlugin::DynInitMenuPaneL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   373
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   374
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   375
void CXDMPlugin::DynInitMenuPaneL(TInt aResourceId,CEikMenuPane* aMenuPane)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   376
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   377
    if (!FeatureManager::FeatureSupported(KFeatureIdHelp))
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   378
    	{
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   379
    	aMenuPane->SetItemDimmed(EAknCmdHelp, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   380
    	}
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   381
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   382
    if (aResourceId == R_GS_XDM_SETTINGS_MAIN_MENU)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   383
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   384
        if (iCurrentContainer == iMainListContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   385
            {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   386
            aMenuPane->SetItemDimmed(EGSXDMPluginCmdChange, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   387
            aMenuPane->SetItemDimmed(EGSXDMPluginCmdExitFromSL, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   388
            if (iMainListContainer->IsListEmpty())
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   389
                {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   390
                aMenuPane->SetItemDimmed(EGSXDMPluginCmdEdit, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   391
                aMenuPane->SetItemDimmed(EGSXDMPluginCmdDelete, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   392
                }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   393
            }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   394
        else
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   395
            {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   396
            aMenuPane->SetItemDimmed(EGSXDMPluginCmdEdit, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   397
            aMenuPane->SetItemDimmed(EGSXDMPluginCmdDelete, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   398
            aMenuPane->SetItemDimmed(EGSXDMPluginCmdNewSettings, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   399
            aMenuPane->SetItemDimmed(EAknCmdExit, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   400
            }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   401
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   402
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   403
    if (aResourceId == R_GS_XDM_NEW_SETTINGS_MENU)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   404
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   405
        if (iMainListContainer->IsListEmpty())
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   406
            {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   407
            aMenuPane->SetItemDimmed(EGSXDMPluginCmdNewExisting, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   408
            }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   409
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   410
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   411
    if ( iSettingListContainer && !iMainListContainer->IsListEmpty() )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   412
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   413
        TBool inUse( EFalse );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   414
        HBufC* currentSetName = iMainListContainer->GetCurrentSetNameLC();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   415
        TBuf<KMaxNameLength> setName;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   416
        setName.Copy( currentSetName->Des() );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   417
        TRAP_IGNORE( inUse = iSettingListContainer->SettingsApInUseL( setName ) );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   418
        CleanupStack::PopAndDestroy( currentSetName );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   419
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   420
        if ( inUse )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   421
            {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   422
            TInt pos( KErrNotFound );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   423
            if ( aMenuPane->MenuItemExists( EGSXDMPluginCmdDelete, pos ) )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   424
                {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   425
                aMenuPane->SetItemSpecific( EGSXDMPluginCmdDelete, EFalse );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   426
                aMenuPane->SetItemDimmed(EGSXDMPluginCmdDelete, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   427
                }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   428
            }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   429
        else
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   430
            {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   431
            TInt pos( KErrNotFound );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   432
            if ( aMenuPane->MenuItemExists( EGSXDMPluginCmdDelete, pos ) )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   433
                {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   434
                aMenuPane->SetItemSpecific( EGSXDMPluginCmdDelete, ETrue );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   435
                aMenuPane->SetItemDimmed(EGSXDMPluginCmdDelete, EFalse);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   436
                }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   437
            }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   438
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   439
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   440
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   441
// ---------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   442
// CXDMPlugin::HandleResourceChangeManual()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   443
// ---------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   444
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   445
void CXDMPlugin::HandleResourceChangeManual(TInt aType)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   446
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   447
    if ( iSettingListContainer )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   448
        iSettingListContainer->HandleResourceChangeManual(aType);    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   449
    if ( iMainListContainer )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   450
        iMainListContainer->HandleResourceChangeManual(aType);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   451
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   452
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   453
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   454
// CXDMPlugin::CreateIconL
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   455
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   456
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   457
CGulIcon* CXDMPlugin::CreateIconL( const TUid aIconType )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   458
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   459
    CGulIcon* icon;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   460
       
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   461
    if( aIconType == KGSIconTypeLbxItem )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   462
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   463
        icon = AknsUtils::CreateGulIconL(
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   464
        AknsUtils::SkinInstance(), 
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   465
        KAknsIIDQgnPropSetConnXdm, 
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   466
        KGSXDMPluginIconFileName,
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   467
        EMbmGsxdmpluginQgn_prop_set_conn_xdm,
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   468
        EMbmGsxdmpluginQgn_prop_set_conn_xdm_mask);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   469
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   470
     else
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   471
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   472
        icon = CGSPluginInterface::CreateIconL( aIconType );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   473
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   474
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   475
    return icon;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   476
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   477
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   478
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   479
// CXDMPlugin::UpdateMskL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   480
// ---------------------------------------------------------------------------
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   481
//
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   482
void CXDMPlugin::UpdateMskL()
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   483
    {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   484
    if ( !Cba() )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   485
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   486
        return;
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   487
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   488
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   489
    CEikCba* cba = static_cast< CEikCba* >( Cba()->ButtonGroup() );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   490
    if(iCurrentContainer==iMainListContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   491
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   492
        TBool showEdit = !(iMainListContainer->IsListEmpty());
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   493
        cba->SetCommandSetL(R_XDMUI_MAINVIEW_SOFTKEYS);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   494
        cba->MakeCommandVisible( EGSXDMPluginCmdEdit, showEdit );
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   495
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   496
    else if(iCurrentContainer==iSettingListContainer)
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   497
        {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   498
        cba->SetCommandSetL(R_XDMUI_MAINVIEW_SOFTKEYS_SL);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   499
        cba->MakeCommandVisible( EGSXDMPluginCmdChange, ETrue);
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   500
        if ( iSettingListContainer->IsVisible() )
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   501
            {
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   502
            iCurrentContainer->DrawNow();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   503
            }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   504
        }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   505
    cba->DrawNow();
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   506
    }
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   507
    
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   508
// End of file
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   509
fbd2e7cec7ef Revert incorrect RCL_3 drop:
Pat Downey <patd@symbian.org>
parents:
diff changeset
   510