gssettingsuis/Gs/GSPDataHSDPAPlugin/inc/GSPDataHSDPAPlugin.h
author hgs
Thu, 04 Nov 2010 13:38:47 +0800
changeset 68 13e71d907dc3
permissions -rw-r--r--
201044
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
68
hgs
parents:
diff changeset
     1
/*
hgs
parents:
diff changeset
     2
* Copyright (c) 2007 Nokia Corporation and/or its subsidiary(-ies).
hgs
parents:
diff changeset
     3
* All rights reserved.
hgs
parents:
diff changeset
     4
* This component and the accompanying materials are made available
hgs
parents:
diff changeset
     5
* under the terms of "Eclipse Public License v1.0"
hgs
parents:
diff changeset
     6
* which accompanies this distribution, and is available
hgs
parents:
diff changeset
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
hgs
parents:
diff changeset
     8
*
hgs
parents:
diff changeset
     9
* Initial Contributors:
hgs
parents:
diff changeset
    10
* Nokia Corporation - initial contribution.
hgs
parents:
diff changeset
    11
*
hgs
parents:
diff changeset
    12
* Contributors:
hgs
parents:
diff changeset
    13
*
hgs
parents:
diff changeset
    14
* Description:  GSPDataHSDPAPlugin implementation.
hgs
parents:
diff changeset
    15
*
hgs
parents:
diff changeset
    16
*/
hgs
parents:
diff changeset
    17
hgs
parents:
diff changeset
    18
#ifndef GSPDATAHSDPAPLUGIN_H
hgs
parents:
diff changeset
    19
#define GSPDATAHSDPAPLUGIN_H
hgs
parents:
diff changeset
    20
hgs
parents:
diff changeset
    21
// User includes
hgs
parents:
diff changeset
    22
hgs
parents:
diff changeset
    23
// System includes
hgs
parents:
diff changeset
    24
#include <gsplugininterface.h>
hgs
parents:
diff changeset
    25
#include <aknview.h>
hgs
parents:
diff changeset
    26
#include <ConeResLoader.h>
hgs
parents:
diff changeset
    27
#include <eikclb.h>
hgs
parents:
diff changeset
    28
#include <gspubsubslistener.h>
hgs
parents:
diff changeset
    29
#include <mgssettingpsobserver.h>
hgs
parents:
diff changeset
    30
#include <MProfileEngine.h>
hgs
parents:
diff changeset
    31
#include <MProEngProfileActivationObserver.h>
hgs
parents:
diff changeset
    32
#include <MProEngNotifyHandler.h>
hgs
parents:
diff changeset
    33
hgs
parents:
diff changeset
    34
// Classes referenced
hgs
parents:
diff changeset
    35
class CAknNavigationDecorator;
hgs
parents:
diff changeset
    36
class CAknViewAppUi;
hgs
parents:
diff changeset
    37
class CAknWaitDialog;
hgs
parents:
diff changeset
    38
class CGSPDataHSDPAModel;
hgs
parents:
diff changeset
    39
hgs
parents:
diff changeset
    40
// Constants
hgs
parents:
diff changeset
    41
const TUid KGSPDataHSDPAPluginUID   = { 0x10282DC8 };
hgs
parents:
diff changeset
    42
_LIT( KPDataHSDPAResourceFileName, "z:gspdatahsdpapluginrsc.rsc" );
hgs
parents:
diff changeset
    43
hgs
parents:
diff changeset
    44
// CLASS DECLARATION
hgs
parents:
diff changeset
    45
hgs
parents:
diff changeset
    46
/**
hgs
parents:
diff changeset
    47
*  CGSPDataHSDPAPlugin view class.
hgs
parents:
diff changeset
    48
*
hgs
parents:
diff changeset
    49
* This class handles state and application logic of PDataHSDPA settings.
hgs
parents:
diff changeset
    50
* The plugin is a type of EGSItemTypeSettingDialog and therefore the GS FW will
hgs
parents:
diff changeset
    51
* call HandleSelection() instead of DoActivate().
hgs
parents:
diff changeset
    52
*
hgs
parents:
diff changeset
    53
*/
hgs
parents:
diff changeset
    54
class CGSPDataHSDPAPlugin : public CGSPluginInterface,
hgs
parents:
diff changeset
    55
                            public MGSSettingPSObserver,
hgs
parents:
diff changeset
    56
                            public MProEngProfileActivationObserver
hgs
parents:
diff changeset
    57
    {
hgs
parents:
diff changeset
    58
    public: // Constructors and destructor
hgs
parents:
diff changeset
    59
hgs
parents:
diff changeset
    60
        /**
hgs
parents:
diff changeset
    61
        * Symbian OS two-phased constructor
hgs
parents:
diff changeset
    62
        * @return
hgs
parents:
diff changeset
    63
        */
hgs
parents:
diff changeset
    64
        static CGSPDataHSDPAPlugin* NewL( TAny* aInitParams );
hgs
parents:
diff changeset
    65
hgs
parents:
diff changeset
    66
        /**
hgs
parents:
diff changeset
    67
        * Destructor.
hgs
parents:
diff changeset
    68
        */
hgs
parents:
diff changeset
    69
        ~CGSPDataHSDPAPlugin();
hgs
parents:
diff changeset
    70
hgs
parents:
diff changeset
    71
	public: // From CAknView
hgs
parents:
diff changeset
    72
hgs
parents:
diff changeset
    73
        /**
hgs
parents:
diff changeset
    74
        * See base class.
hgs
parents:
diff changeset
    75
        */
hgs
parents:
diff changeset
    76
        TUid Id() const;
hgs
parents:
diff changeset
    77
hgs
parents:
diff changeset
    78
    public: // From CGSPluginInterface
hgs
parents:
diff changeset
    79
hgs
parents:
diff changeset
    80
        /**
hgs
parents:
diff changeset
    81
        * See base class.
hgs
parents:
diff changeset
    82
        */
hgs
parents:
diff changeset
    83
        void GetCaptionL( TDes& aCaption ) const;
hgs
parents:
diff changeset
    84
hgs
parents:
diff changeset
    85
        /**
hgs
parents:
diff changeset
    86
        * See base class.
hgs
parents:
diff changeset
    87
        */
hgs
parents:
diff changeset
    88
        TInt PluginProviderCategory() const;
hgs
parents:
diff changeset
    89
hgs
parents:
diff changeset
    90
        /**
hgs
parents:
diff changeset
    91
        * See base class.
hgs
parents:
diff changeset
    92
        */
hgs
parents:
diff changeset
    93
        TGSListboxItemTypes ItemType();
hgs
parents:
diff changeset
    94
hgs
parents:
diff changeset
    95
        /**
hgs
parents:
diff changeset
    96
        * See base class.
hgs
parents:
diff changeset
    97
        */
hgs
parents:
diff changeset
    98
        void GetValue( const TGSPluginValueKeys aKey,
hgs
parents:
diff changeset
    99
                       TDes& aValue );
hgs
parents:
diff changeset
   100
hgs
parents:
diff changeset
   101
        /**
hgs
parents:
diff changeset
   102
        * See base class.
hgs
parents:
diff changeset
   103
        */
hgs
parents:
diff changeset
   104
        void HandleSelection( const TGSSelectionTypes aSelectionType );
hgs
parents:
diff changeset
   105
hgs
parents:
diff changeset
   106
        /**
hgs
parents:
diff changeset
   107
        * See base class.
hgs
parents:
diff changeset
   108
        */
hgs
parents:
diff changeset
   109
        TGSMenuActivationItems MenuActivationItem();
hgs
parents:
diff changeset
   110
        
hgs
parents:
diff changeset
   111
        /**
hgs
parents:
diff changeset
   112
        * @see CGSPluginInterface header file.
hgs
parents:
diff changeset
   113
        */
hgs
parents:
diff changeset
   114
        TBool Visible() const;
hgs
parents:
diff changeset
   115
hgs
parents:
diff changeset
   116
    public: //From MProEngProfileActivationObserver
hgs
parents:
diff changeset
   117
    
hgs
parents:
diff changeset
   118
        /**
hgs
parents:
diff changeset
   119
        * Callback for device profile change
hgs
parents:
diff changeset
   120
        * Used for observing offline mode activation
hgs
parents:
diff changeset
   121
        */
hgs
parents:
diff changeset
   122
        void HandleProfileActivatedL( TInt aProfileId );
hgs
parents:
diff changeset
   123
hgs
parents:
diff changeset
   124
    protected: // New
hgs
parents:
diff changeset
   125
hgs
parents:
diff changeset
   126
        /**
hgs
parents:
diff changeset
   127
        * C++ default constructor.
hgs
parents:
diff changeset
   128
        */
hgs
parents:
diff changeset
   129
        CGSPDataHSDPAPlugin();
hgs
parents:
diff changeset
   130
hgs
parents:
diff changeset
   131
        /**
hgs
parents:
diff changeset
   132
        * Symbian OS default constructor.
hgs
parents:
diff changeset
   133
        */
hgs
parents:
diff changeset
   134
        void ConstructL();
hgs
parents:
diff changeset
   135
hgs
parents:
diff changeset
   136
    protected: // From CAknView
hgs
parents:
diff changeset
   137
hgs
parents:
diff changeset
   138
        /**
hgs
parents:
diff changeset
   139
        * See base class.
hgs
parents:
diff changeset
   140
        */
hgs
parents:
diff changeset
   141
        void DoActivateL( const TVwsViewId& aPrevViewId,
hgs
parents:
diff changeset
   142
                          TUid aCustomMessageId,
hgs
parents:
diff changeset
   143
                          const TDesC8& aCustomMessage );
hgs
parents:
diff changeset
   144
hgs
parents:
diff changeset
   145
        /**
hgs
parents:
diff changeset
   146
        * See base class.
hgs
parents:
diff changeset
   147
        */
hgs
parents:
diff changeset
   148
        void DoDeactivate();
hgs
parents:
diff changeset
   149
hgs
parents:
diff changeset
   150
    private: // New
hgs
parents:
diff changeset
   151
hgs
parents:
diff changeset
   152
        /**
hgs
parents:
diff changeset
   153
        * Sets HSDPA state.
hgs
parents:
diff changeset
   154
        * Launches a setting page with a confirmation dialog
hgs
parents:
diff changeset
   155
        */
hgs
parents:
diff changeset
   156
        void SetHSDPAStateL();
hgs
parents:
diff changeset
   157
hgs
parents:
diff changeset
   158
        /**
hgs
parents:
diff changeset
   159
        * Opens localized resource file.
hgs
parents:
diff changeset
   160
        */
hgs
parents:
diff changeset
   161
        void OpenLocalizedResourceFileL(
hgs
parents:
diff changeset
   162
            const TDesC& aResourceFileName,
hgs
parents:
diff changeset
   163
            RConeResourceLoader& aResourceLoader );
hgs
parents:
diff changeset
   164
            
hgs
parents:
diff changeset
   165
        /**
hgs
parents:
diff changeset
   166
        * Resets all Active Connections, If Any.
hgs
parents:
diff changeset
   167
        */
hgs
parents:
diff changeset
   168
        void ResetActiveConnectionsL();
hgs
parents:
diff changeset
   169
        
hgs
parents:
diff changeset
   170
       /*
hgs
parents:
diff changeset
   171
        *
hgs
parents:
diff changeset
   172
        * Indexes of HSDPA on/off items in a listbox are not the same as 
hgs
parents:
diff changeset
   173
        * aPDataHSDPState value. Therefore matching between these two is 
hgs
parents:
diff changeset
   174
        * required.
hgs
parents:
diff changeset
   175
       */
hgs
parents:
diff changeset
   176
        TBool ShowHSDPASettingPageL( TInt& aHsdpaState );
hgs
parents:
diff changeset
   177
hgs
parents:
diff changeset
   178
        /**
hgs
parents:
diff changeset
   179
        * Leaving version of GetValue()
hgs
parents:
diff changeset
   180
        */
hgs
parents:
diff changeset
   181
        void GetValueL( TDes& aValue );
hgs
parents:
diff changeset
   182
        
hgs
parents:
diff changeset
   183
        /**
hgs
parents:
diff changeset
   184
        *  Updating parent view
hgs
parents:
diff changeset
   185
        */
hgs
parents:
diff changeset
   186
        void UpdateParentViewL();
hgs
parents:
diff changeset
   187
    
hgs
parents:
diff changeset
   188
    private: // From MGSSettingPSObserver
hgs
parents:
diff changeset
   189
        /**
hgs
parents:
diff changeset
   190
        * Callback from MGSSettingPSObserver
hgs
parents:
diff changeset
   191
        */
hgs
parents:
diff changeset
   192
        void HandleNotifyPSL( const TUid aUid, const TInt& aKey, 
hgs
parents:
diff changeset
   193
                              const TRequestStatus& aStatus );
hgs
parents:
diff changeset
   194
hgs
parents:
diff changeset
   195
    protected: // Data
hgs
parents:
diff changeset
   196
hgs
parents:
diff changeset
   197
        // PDataHSDPA model.
hgs
parents:
diff changeset
   198
        CGSPDataHSDPAModel* iModel;
hgs
parents:
diff changeset
   199
hgs
parents:
diff changeset
   200
        // Resource loader.
hgs
parents:
diff changeset
   201
        RConeResourceLoader iResources;
hgs
parents:
diff changeset
   202
        
hgs
parents:
diff changeset
   203
        //PubSub object for NW mode state listener
hgs
parents:
diff changeset
   204
        CGSPubSubsListener* iNwModeListener;
hgs
parents:
diff changeset
   205
        
hgs
parents:
diff changeset
   206
        MProfileEngine* iProfileEngine;
hgs
parents:
diff changeset
   207
        MProEngNotifyHandler* iNotifyHandler;
hgs
parents:
diff changeset
   208
        
hgs
parents:
diff changeset
   209
        TInt iNetworkMode;
hgs
parents:
diff changeset
   210
        
hgs
parents:
diff changeset
   211
        TBool iHSDPASettingSupport;
hgs
parents:
diff changeset
   212
    };
hgs
parents:
diff changeset
   213
hgs
parents:
diff changeset
   214
#endif // GSPDATAHSDPAPLUGIN_H
hgs
parents:
diff changeset
   215
// End of File