williamr@2: /* williamr@2: * Copyright (c) 2006 Nokia Corporation and/or its subsidiary(-ies). williamr@2: * All rights reserved. williamr@2: * This component and the accompanying materials are made available williamr@2: * under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: * which accompanies this distribution, and is available williamr@2: * at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: * williamr@2: * Initial Contributors: williamr@2: * Nokia Corporation - initial contribution. williamr@2: * williamr@2: * Contributors: williamr@2: * williamr@2: * Description: williamr@2: * williamr@2: */ williamr@2: williamr@2: #ifndef C_CMAPPLICATIONSETTINGSUI_H williamr@2: #define C_CMAPPLICATIONSETTINGSUI_H williamr@2: williamr@2: #include williamr@2: #include williamr@2: williamr@2: class CCmConnSettingsUiImpl; williamr@2: namespace CMManager williamr@2: { williamr@2: williamr@2: /** williamr@2: * CCmApplicationSettingsUi::RunApplicationSettingsL leaves with this williamr@2: * error code if the selection dialog would have zero elements caused williamr@2: * by filtering out all the Connection Methods with the aFilterArray williamr@2: * and not requesting other list elements by the aListItems bitfield. williamr@2: * See the comment of the RunApplicationSettingsL method for more williamr@2: * detailes. williamr@2: * This error code is supported by the error resolver. williamr@2: */ williamr@2: const TInt KErrConnectionNotFound = -32700; williamr@2: williamr@2: /** williamr@2: * The selection type of a list item in application settings UI williamr@2: */ williamr@2: enum TCmSettingSelectionMode williamr@2: { williamr@2: EAlwaysAsk, /**< williamr@2: * The user selected Always ask williamr@2: */ williamr@2: EDestination, /**< williamr@2: * The user selected a destination williamr@2: */ williamr@2: EConnectionMethod, /**< williamr@2: * The user selected a connection method williamr@2: */ williamr@2: EDefaultConnection // The user selected Default Connection williamr@2: williamr@2: }; williamr@2: williamr@2: williamr@2: /** williamr@2: * These bitmasks controls what items does the selection UI containes. williamr@2: * Bitmasks not listed in the enum are reserved for future usage and they williamr@2: * are disabled by default. So extending these bitmasks does not cause williamr@2: * BC break later. williamr@2: */ williamr@2: enum TCmSelectionDialogItems williamr@2: { williamr@2: EShowAlwaysAsk = 0x01, /**< williamr@2: * AlwaysAsk is added to the williamr@2: * selection UI. williamr@2: */ williamr@2: EShowDefaultConnection = 0x02, /**< williamr@2: * DefaultConnection is added to the williamr@2: * selection UI. williamr@2: */ williamr@2: williamr@2: /** williamr@2: * The following enumerations controls how destinations and williamr@2: * Connection Methods are presented in the selection UI. williamr@2: * EShowDestinations is set and EShowConnectionMethods is set: williamr@2: * Destination list is added to the selection UI and a Connection williamr@2: * Method can be selected inside a Destination. williamr@2: * EShowDestinations is set and EShowConnectionMethods is not set: williamr@2: * Destination list is added to the selection UI and no Connection williamr@2: * Method can be selected inside a Destination. williamr@2: * EShowDestinations is not set and EShowConnectionMethods is set: williamr@2: * Connection Method list is added to the selection UI. Connection williamr@2: * Methods are ordered according to the global bearer type williamr@2: * priorities. Destination cannot be selected. williamr@2: * EShowDestinations is not set and EShowConnectionMethods is not set: williamr@2: * The selection UI will not contain any Destination or Connection williamr@2: * Method. E.g. If EShowAlwaysAsk and EShowDefaultConnection was set williamr@2: * then the selection UI will contain two entries (AlwaysAsk and williamr@2: * DefaultConnection). williamr@2: */ williamr@2: EShowDestinations = 0x04, /**< williamr@2: * Destination list is added to the williamr@2: * selection UI. Destinations which williamr@2: * does not contain any Connection williamr@2: * Methods are not shown. williamr@2: */ williamr@2: EShowConnectionMethods = 0x08, /**< williamr@2: * If EShowDestinations is set: williamr@2: * Connection Method can be selected williamr@2: * inside a destination. williamr@2: * If EShowDestinations is not set: williamr@2: * Connection Method list is added to williamr@2: * the selection UI. williamr@2: */ williamr@2: }; williamr@2: williamr@2: }// namespace CMManger williamr@2: williamr@2: williamr@2: // Structs williamr@2: williamr@2: /** williamr@2: * Stores the details of a setting selection williamr@2: * williamr@2: * @lib cmmanager.lib williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: NONSHARABLE_STRUCT( TCmSettingSelection ) williamr@2: { williamr@2: /** williamr@2: * Selection mode, refers to the type of the list item which is selected williamr@2: */ williamr@2: CMManager::TCmSettingSelectionMode iResult; williamr@2: williamr@2: /** williamr@2: * Id of the selected destination or connection method williamr@2: */ williamr@2: TUint iId; williamr@2: }; williamr@2: williamr@2: /** williamr@2: * Typedef of the bearer filter array. williamr@2: * This type of array is used to filter Connection Methods williamr@2: * by bearer types. williamr@2: * williamr@2: * The array elements are bearer IDs. The IDs are defined in the bearer williamr@2: * type specific cmplugin...def.h files. E.g. the ID of the CSD bearer williamr@2: * type (KUidCSDBearerType) can be found in the cmplugincsddef.h header. williamr@2: */ williamr@2: typedef RArray TBearerFilterArray; williamr@2: williamr@2: /** williamr@2: * For launching the Application Settings UI williamr@2: * williamr@2: * Displays a radio button page for an application used to select williamr@2: * a destination or connection method williamr@2: * williamr@2: * @lib cmmanager.lib williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: NONSHARABLE_CLASS( CCmApplicationSettingsUi ) : public CBase williamr@2: { williamr@2: williamr@2: public: // construction/destruction williamr@2: williamr@2: /** Epoc constructor */ williamr@2: IMPORT_C static CCmApplicationSettingsUi* NewL(); williamr@2: williamr@2: /** Epoc constructor williamr@2: * Pushes the object on the cleanup stack williamr@2: */ williamr@2: IMPORT_C static CCmApplicationSettingsUi* NewLC(); williamr@2: williamr@2: /** Destructor. */ williamr@2: virtual ~CCmApplicationSettingsUi(); williamr@2: williamr@2: //======================================================================= williamr@2: // UI API williamr@2: // williamr@2: public: williamr@2: williamr@2: /** williamr@2: * Launches the 'easy to use' Settings UI provided for applications williamr@2: * for handling Destinations and Connection Methods. williamr@2: * This function call launches the same selection dialog as the williamr@2: * the extended RunApplicationSettingsL do (see below) with the williamr@2: * list items Default Connection, Destinations and Connection Methods williamr@2: * without any filtering. williamr@2: * williamr@2: * @since 3.2 williamr@2: * @param aSelection If initialised to a valid value, sets the higlight to the williamr@2: * corresponding list item at startup. If a list of Destinations is displayed, and williamr@2: * the initial highlight is set to a Connection Method, the parent Destination williamr@2: * gets highlighted. On return, holds user selection. williamr@2: * @return TBool seleceted or not. williamr@2: */ williamr@2: IMPORT_C TBool RunApplicationSettingsL( williamr@2: TCmSettingSelection& aSelection ); williamr@2: williamr@2: /** williamr@2: * Launches the 'easy to use' Settings UI provided for applications williamr@2: * for handling Destinations and Connection Methods williamr@2: * williamr@2: * @since 3.2 williamr@2: * @param aSelection If initialised to a valid value, sets the higlight to the williamr@2: * corresponding list item at startup. If a list of Destinations is displayed, and williamr@2: * the initial highlight is set to a Connection Method, the parent Destination williamr@2: * gets highlighted. On return, holds user selection. williamr@2: * @param aListItems A bit field which indicates which items shoud be williamr@2: * shown in the selection dialog. The bitmasks are williamr@2: * defined in the TCmSelectionDialogItems enum. williamr@2: * williamr@2: * The function leaves with KErrNotSupported if all the items which williamr@2: * were set to be shown are not supported/enabled. williamr@2: * E.g. Default Connection availability/support is controlled by the williamr@2: * Feature Manager so if only EShowDefaultConnection is set and the williamr@2: * Default Connection feature is not enabled than the function leaves williamr@2: * with KErrNotSupported. williamr@2: * williamr@2: * In other cases (when an item or items are not supported/enabled but williamr@2: * not all) the selected but not supported/enabled items are not added williamr@2: * to the list. The request to show such an item is silently ignored. williamr@2: * williamr@2: * williamr@2: * Special note about the EShowDestinations and EShowConnectionMethods williamr@2: * bitmasks: williamr@2: * The following enumerations controls how how destinations and williamr@2: * Connection Methods are presented in the selection UI. williamr@2: * General rule about the EShowDestinations: williamr@2: * Destinations which does not contain any Connection Methods are williamr@2: * not shown in the selection dialog. The same rule is applied if williamr@2: * the Destination containes Connection Methods but all of them williamr@2: * are filtered out by the filtering criteria. williamr@2: * EShowDestinations is set and EShowConnectionMethods is set: williamr@2: * Destination list is added to the selection UI and a Connection williamr@2: * Method can be selected inside a Destination. williamr@2: * EShowDestinations is set and EShowConnectionMethods is not set: williamr@2: * Destination list is added to the selection UI and no Connection williamr@2: * Method can be selected inside a Destination. williamr@2: * EShowDestinations is not set and EShowConnectionMethods is set: williamr@2: * Connection Method list is added to the selection UI. Connection williamr@2: * Methods are ordered according to the global bearer type williamr@2: * priorities. Destination cannot be selected. williamr@2: * EShowDestinations is not set and EShowConnectionMethods is not set: williamr@2: * The selection UI will not contain any Destination or Connection williamr@2: * Method. E.g. If EShowAlwaysAsk and EShowDefaultConnection was williamr@2: * set then the selection UI will contain two entries (AlwaysAsk williamr@2: * and DefaultConnection). williamr@2: * williamr@2: * @param aFilterArray Only Connection Methods with bearer types from williamr@2: * the aFilterArray will be shown. williamr@2: * All Connection Methods will be listed if the williamr@2: * array has no element. williamr@2: * @return TBool seleceted or not. williamr@2: * williamr@2: * @leave KErrArgument If the selection dialog would have zero williamr@2: * elements based on the aListItems bitmask williamr@2: * (aListItems is equal to zero). williamr@2: * williamr@2: * @leave KErrNotSupported williamr@2: * If the selection dialog would have zero williamr@2: * elements based on the aListItems bitmask williamr@2: * (all the selected elements in aListItems williamr@2: * are not supported/disabled). williamr@2: * E.g. aListItems = EShowDefaultConnection but williamr@2: * Default Connection feature is not enabled. williamr@2: * williamr@2: * @leave KErrConnectionNotFound williamr@2: * If the selection dialog would have zero williamr@2: * elements caused by filtering out all the williamr@2: * Connection Methods with the aFilterArray williamr@2: * and not requesting other list elements by williamr@2: * the aListItems bitfield than the function williamr@2: * call leaves with KErrConnectionNotFound williamr@2: * error code. A corresponding error note can williamr@2: * be shown using the error resolver. williamr@2: * E.g. williamr@2: * - aListItems = EShowConnectionMethods williamr@2: * but all Connection Methods are filtered williamr@2: * out by the aFilterArray. williamr@2: */ williamr@2: IMPORT_C TBool RunApplicationSettingsL( williamr@2: TCmSettingSelection& aSelection, williamr@2: TUint aListItems, williamr@2: TBearerFilterArray& aFilterArray); williamr@2: williamr@2: private: williamr@2: williamr@2: /** C++ constructor */ williamr@2: CCmApplicationSettingsUi(); williamr@2: williamr@2: /** williamr@2: * Epoc 2nd phase constructor williamr@2: * williamr@2: * @since S60 3.2 williamr@2: */ williamr@2: void ConstructL(); williamr@2: williamr@2: private: // data williamr@2: williamr@2: /** williamr@2: * implementation of the class williamr@2: */ williamr@2: CCmConnSettingsUiImpl* iImpl; williamr@2: }; williamr@2: williamr@2: #endif // C_CMAPPLICATIONSETTINGSUI_H