epoc32/include/mw/cmapplicationsettingsui.h
author William Roberts <williamr@symbian.org>
Wed, 31 Mar 2010 12:33:34 +0100
branchSymbian3
changeset 4 837f303aceeb
parent 2 2fe1408b6811
permissions -rw-r--r--
Current Symbian^3 public API header files (from PDK 3.0.h)
This is the epoc32/include tree with the "platform" subtrees removed, and
all but a selected few mbg and rsg files removed.
williamr@2
     1
/*
williamr@2
     2
* Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). 
williamr@2
     3
* All rights reserved.
williamr@2
     4
* This component and the accompanying materials are made available
williamr@4
     5
* under the terms of "Eclipse Public License v1.0"
williamr@2
     6
* which accompanies this distribution, and is available
williamr@4
     7
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
williamr@2
     8
*
williamr@2
     9
* Initial Contributors:
williamr@2
    10
* Nokia Corporation - initial contribution.
williamr@2
    11
*
williamr@2
    12
* Contributors:
williamr@2
    13
*
williamr@2
    14
* Description:  
williamr@2
    15
*
williamr@2
    16
*/
williamr@2
    17
williamr@2
    18
#ifndef C_CMAPPLICATIONSETTINGSUI_H
williamr@2
    19
#define C_CMAPPLICATIONSETTINGSUI_H
williamr@2
    20
williamr@4
    21
#include <e32def.h>
williamr@2
    22
#include <e32base.h>
williamr@2
    23
williamr@2
    24
class CCmConnSettingsUiImpl;
williamr@2
    25
namespace CMManager
williamr@2
    26
    {
williamr@2
    27
    
williamr@2
    28
    /**
williamr@2
    29
    * CCmApplicationSettingsUi::RunApplicationSettingsL leaves with this 
williamr@2
    30
    * error code if the selection dialog would have zero elements caused 
williamr@2
    31
    * by filtering out all the Connection Methods with the aFilterArray
williamr@2
    32
    * and not requesting other list elements by the aListItems bitfield.
williamr@2
    33
    * See the comment of the RunApplicationSettingsL method for more 
williamr@2
    34
    * detailes.
williamr@2
    35
    * This error code is supported by the error resolver. 
williamr@2
    36
    */
williamr@2
    37
    const TInt KErrConnectionNotFound = -32700;
williamr@2
    38
    
williamr@2
    39
    /** 
williamr@2
    40
    * The selection type of a list item in application settings UI
williamr@2
    41
    */
williamr@2
    42
    enum TCmSettingSelectionMode
williamr@2
    43
        {
williamr@2
    44
        EAlwaysAsk,         /**<
williamr@2
    45
                            * The user selected Always ask 
williamr@2
    46
                            */
williamr@2
    47
        EDestination,       /**<
williamr@2
    48
                            * The user selected a destination
williamr@2
    49
                            */
williamr@2
    50
        EConnectionMethod,  /**<
williamr@2
    51
                            * The user selected a connection method
williamr@2
    52
                            */
williamr@2
    53
        EDefaultConnection // The user selected Default Connection 
williamr@2
    54
williamr@2
    55
        };
williamr@2
    56
        
williamr@2
    57
    
williamr@2
    58
    /** 
williamr@2
    59
    * These bitmasks controls what items does the selection UI containes.
williamr@2
    60
    * Bitmasks not listed in the enum are reserved for future usage and they
williamr@2
    61
    * are disabled by default. So extending these bitmasks does not cause 
williamr@2
    62
    * BC break later.
williamr@2
    63
    */
williamr@2
    64
    enum TCmSelectionDialogItems
williamr@2
    65
        {
williamr@2
    66
        EShowAlwaysAsk = 0x01,          /**<
williamr@2
    67
                                        * AlwaysAsk is added to the 
williamr@2
    68
                                        * selection UI.
williamr@2
    69
                                        */                                
williamr@2
    70
        EShowDefaultConnection = 0x02,  /**<
williamr@2
    71
                                        * DefaultConnection is added to the 
williamr@2
    72
                                        * selection UI.
williamr@2
    73
                                        */           
williamr@2
    74
        
williamr@2
    75
        /**
williamr@2
    76
        * The following enumerations controls how destinations and 
williamr@2
    77
        * Connection Methods are presented in the selection UI.
williamr@2
    78
        * EShowDestinations is set and EShowConnectionMethods is set:
williamr@2
    79
        *   Destination list is added to the selection UI and a Connection
williamr@2
    80
        *   Method can be selected inside a Destination.
williamr@2
    81
        * EShowDestinations is set and EShowConnectionMethods is not set:
williamr@2
    82
        *   Destination list is added to the selection UI and no Connection
williamr@2
    83
        *   Method can be selected inside a Destination. 
williamr@2
    84
        * EShowDestinations is not set and EShowConnectionMethods is set:
williamr@2
    85
        *   Connection Method list is added to the selection UI. Connection
williamr@2
    86
        *   Methods are ordered according to the global bearer type 
williamr@2
    87
        *   priorities. Destination cannot be selected.
williamr@2
    88
        * EShowDestinations is not set and EShowConnectionMethods is not set:
williamr@2
    89
        *   The selection UI will not contain any Destination or Connection 
williamr@2
    90
        *   Method. E.g. If EShowAlwaysAsk and EShowDefaultConnection was set
williamr@2
    91
        *   then the selection UI will contain two entries (AlwaysAsk and 
williamr@2
    92
        *   DefaultConnection).
williamr@2
    93
        */
williamr@2
    94
        EShowDestinations = 0x04,       /**<
williamr@2
    95
                                        * Destination list is added to the 
williamr@2
    96
                                        * selection UI. Destinations which
williamr@2
    97
                                        * does not contain any Connection
williamr@2
    98
                                        * Methods are not shown.
williamr@2
    99
                                        */
williamr@2
   100
        EShowConnectionMethods = 0x08,  /**<
williamr@2
   101
                                        * If EShowDestinations is set:
williamr@2
   102
                                        *   Connection Method can be selected
williamr@2
   103
                                        *   inside a destination.
williamr@2
   104
                                        * If EShowDestinations is not set:
williamr@2
   105
                                        *   Connection Method list is added to 
williamr@2
   106
                                        *   the selection UI.
williamr@2
   107
                                        */                                  
williamr@2
   108
        };    
williamr@2
   109
        
williamr@2
   110
    }// namespace CMManger
williamr@2
   111
williamr@2
   112
williamr@2
   113
    // Structs
williamr@2
   114
    
williamr@2
   115
/**
williamr@2
   116
 * Stores the details of a setting selection
williamr@2
   117
 *
williamr@2
   118
 *  @lib cmmanager.lib
williamr@2
   119
 *  @since S60 3.2
williamr@2
   120
 */
williamr@2
   121
NONSHARABLE_STRUCT( TCmSettingSelection )
williamr@2
   122
    {
williamr@2
   123
    /**
williamr@2
   124
    * Selection mode, refers to the type of the list item which is selected
williamr@2
   125
    */
williamr@2
   126
    CMManager::TCmSettingSelectionMode iResult;
williamr@2
   127
    
williamr@2
   128
    /**
williamr@2
   129
    * Id of the selected destination or connection method
williamr@2
   130
    */
williamr@2
   131
    TUint iId;
williamr@2
   132
    };
williamr@2
   133
williamr@2
   134
/**
williamr@2
   135
* Typedef of the bearer filter array.
williamr@2
   136
* This type of array is used to filter Connection Methods
williamr@2
   137
* by bearer types.
williamr@2
   138
*
williamr@2
   139
* The array elements are bearer IDs. The IDs are defined in the bearer
williamr@2
   140
* type specific cmplugin...def.h files. E.g. the ID of the CSD bearer
williamr@2
   141
* type (KUidCSDBearerType) can be found in the cmplugincsddef.h header.
williamr@2
   142
*/
williamr@2
   143
typedef RArray<TUint32> TBearerFilterArray;
williamr@2
   144
williamr@2
   145
/**
williamr@2
   146
 * For launching the Application Settings UI
williamr@2
   147
 *
williamr@2
   148
 * Displays a radio button page for an application used to select
williamr@2
   149
 * a destination or connection method
williamr@2
   150
 *
williamr@2
   151
 *  @lib cmmanager.lib
williamr@2
   152
 *  @since S60 3.2
williamr@2
   153
 */
williamr@2
   154
NONSHARABLE_CLASS( CCmApplicationSettingsUi ) : public CBase
williamr@2
   155
    {
williamr@2
   156
williamr@2
   157
    public: // construction/destruction
williamr@2
   158
williamr@2
   159
        /** Epoc constructor */
williamr@2
   160
        IMPORT_C static CCmApplicationSettingsUi* NewL();
williamr@2
   161
williamr@2
   162
        /** Epoc constructor 
williamr@2
   163
        * Pushes the object on the cleanup stack
williamr@2
   164
        */
williamr@2
   165
        IMPORT_C static CCmApplicationSettingsUi* NewLC();
williamr@2
   166
williamr@2
   167
        /** Destructor. */
williamr@2
   168
        virtual ~CCmApplicationSettingsUi();
williamr@2
   169
williamr@2
   170
    //=======================================================================
williamr@2
   171
    // UI API
williamr@2
   172
    //
williamr@2
   173
    public:
williamr@2
   174
williamr@2
   175
        /**
williamr@2
   176
        * Launches the 'easy to use' Settings UI provided for applications
williamr@2
   177
        * for handling Destinations and Connection Methods.
williamr@2
   178
        * This function call launches the same selection dialog as the 
williamr@2
   179
        * the extended RunApplicationSettingsL do (see below) with the
williamr@2
   180
        * list items Default Connection, Destinations and  Connection Methods 
williamr@2
   181
        * without any filtering.
williamr@2
   182
        *
williamr@2
   183
        * @since 3.2
williamr@2
   184
        * @param aSelection If initialised to a valid value, sets the higlight to the
williamr@2
   185
        * corresponding list item at startup. If a list of Destinations is displayed, and
williamr@2
   186
        * the initial highlight is set to a Connection Method, the parent Destination
williamr@2
   187
        * gets highlighted. On return, holds user selection.
williamr@2
   188
        * @return TBool seleceted or not.
williamr@2
   189
        */
williamr@2
   190
        IMPORT_C TBool RunApplicationSettingsL( 
williamr@2
   191
                                        TCmSettingSelection& aSelection );
williamr@2
   192
williamr@2
   193
        /**
williamr@2
   194
        * Launches the 'easy to use' Settings UI provided for applications
williamr@2
   195
        * for handling Destinations and Connection Methods
williamr@2
   196
        *
williamr@2
   197
        * @since 3.2
williamr@2
   198
        * @param aSelection If initialised to a valid value, sets the higlight to the
williamr@2
   199
        * corresponding list item at startup. If a list of Destinations is displayed, and
williamr@2
   200
        * the initial highlight is set to a Connection Method, the parent Destination
williamr@2
   201
        * gets highlighted. On return, holds user selection.
williamr@2
   202
        * @param aListItems A bit field which indicates which items shoud be
williamr@2
   203
        *                   shown in the selection dialog. The bitmasks are 
williamr@2
   204
        *                   defined in the TCmSelectionDialogItems enum.
williamr@2
   205
        *
williamr@2
   206
        * The function leaves with KErrNotSupported  if all the items which 
williamr@2
   207
        * were set to be shown are not supported/enabled. 
williamr@2
   208
        * E.g. Default Connection availability/support is controlled by the 
williamr@2
   209
        * Feature Manager so if only EShowDefaultConnection is set and the 
williamr@2
   210
        * Default Connection feature is not enabled than the function leaves
williamr@2
   211
        * with KErrNotSupported.
williamr@2
   212
        *
williamr@2
   213
        * In other cases (when an item or items are not supported/enabled but
williamr@2
   214
        * not all) the selected but not supported/enabled items are not added
williamr@2
   215
        * to the list. The request to show such an item is silently ignored.
williamr@2
   216
        *
williamr@2
   217
        *
williamr@2
   218
        * Special note about the EShowDestinations and EShowConnectionMethods
williamr@2
   219
        * bitmasks:      
williamr@2
   220
        *   The following enumerations controls how how destinations and 
williamr@2
   221
        *   Connection Methods are presented in the selection UI.
williamr@2
   222
        *   General rule about the EShowDestinations:
williamr@2
   223
        *     Destinations which does not contain any Connection Methods are 
williamr@2
   224
        *     not shown in the selection dialog. The same rule is applied if
williamr@2
   225
        *     the Destination containes Connection Methods but all of them 
williamr@2
   226
        *     are filtered out by the filtering criteria.
williamr@2
   227
        *   EShowDestinations is set and EShowConnectionMethods is set:
williamr@2
   228
        *     Destination list is added to the selection UI and a Connection
williamr@2
   229
        *     Method can be selected inside a Destination.
williamr@2
   230
        *   EShowDestinations is set and EShowConnectionMethods is not set:
williamr@2
   231
        *     Destination list is added to the selection UI and no Connection
williamr@2
   232
        *     Method can be selected inside a Destination. 
williamr@2
   233
        *   EShowDestinations is not set and EShowConnectionMethods is set:
williamr@2
   234
        *     Connection Method list is added to the selection UI. Connection
williamr@2
   235
        *     Methods are ordered according to the global bearer type 
williamr@2
   236
        *     priorities. Destination cannot be selected.
williamr@2
   237
        *   EShowDestinations is not set and EShowConnectionMethods is not set:
williamr@2
   238
        *     The selection UI will not contain any Destination or Connection 
williamr@2
   239
        *     Method. E.g. If EShowAlwaysAsk and EShowDefaultConnection was 
williamr@2
   240
        *     set then the selection UI will contain two entries (AlwaysAsk
williamr@2
   241
        *     and DefaultConnection).
williamr@2
   242
        *
williamr@2
   243
        * @param aFilterArray Only Connection Methods with bearer types from
williamr@2
   244
        *                     the aFilterArray will be shown. 
williamr@2
   245
        *                     All Connection Methods will be listed if the 
williamr@2
   246
        *                     array has no element.
williamr@2
   247
        * @return TBool seleceted or not.
williamr@2
   248
        *
williamr@2
   249
        * @leave KErrArgument If the selection dialog would have zero 
williamr@2
   250
        *                     elements based on the aListItems bitmask
williamr@2
   251
        *                     (aListItems is equal to zero). 
williamr@2
   252
        *
williamr@2
   253
        * @leave KErrNotSupported 
williamr@2
   254
        *                     If the selection dialog would have zero 
williamr@2
   255
        *                     elements based on the aListItems bitmask
williamr@2
   256
        *                     (all the selected elements in aListItems  
williamr@2
   257
        *	                  are not supported/disabled).
williamr@2
   258
        *                     E.g. aListItems = EShowDefaultConnection but 
williamr@2
   259
        *                     Default Connection feature is not enabled.
williamr@2
   260
        *
williamr@2
   261
        * @leave KErrConnectionNotFound 
williamr@2
   262
        *                     If the selection dialog would have zero 
williamr@2
   263
        *                     elements caused by filtering out all the 
williamr@2
   264
        *                     Connection Methods with the aFilterArray
williamr@2
   265
        *                     and not requesting other list elements by 
williamr@2
   266
        *                     the aListItems bitfield than the function 
williamr@2
   267
        *                     call leaves with KErrConnectionNotFound 
williamr@2
   268
        *                     error code. A corresponding error note can
williamr@2
   269
        *                     be shown using the error resolver. 
williamr@2
   270
        *                     E.g. 
williamr@2
   271
        *                       - aListItems = EShowConnectionMethods
williamr@2
   272
        *                     but all Connection Methods are filtered 
williamr@2
   273
        *                     out by the aFilterArray.
williamr@2
   274
        */
williamr@2
   275
        IMPORT_C TBool RunApplicationSettingsL( 
williamr@2
   276
                                        TCmSettingSelection& aSelection, 
williamr@2
   277
                                        TUint aListItems,
williamr@2
   278
                                        TBearerFilterArray& aFilterArray);
williamr@2
   279
williamr@2
   280
    private:
williamr@2
   281
williamr@2
   282
        /** C++ constructor */
williamr@2
   283
        CCmApplicationSettingsUi();
williamr@2
   284
williamr@2
   285
        /**
williamr@2
   286
        * Epoc 2nd phase constructor
williamr@2
   287
        *
williamr@2
   288
        * @since S60 3.2        
williamr@2
   289
        */
williamr@2
   290
        void ConstructL();
williamr@2
   291
williamr@2
   292
    private: // data
williamr@2
   293
williamr@2
   294
        /**
williamr@2
   295
         * implementation of the class
williamr@2
   296
         */
williamr@2
   297
        CCmConnSettingsUiImpl* iImpl;    
williamr@2
   298
    };
williamr@2
   299
williamr@2
   300
#endif // C_CMAPPLICATIONSETTINGSUI_H