mobilemessaging/unieditor/application/inc/UniSendingSettingsDialog.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2006,2007 Nokia Corporation and/or its subsidiary(-ies).
       
     3 * All rights reserved.
       
     4 * This component and the accompanying materials are made available
       
     5 * under the terms of "Eclipse Public License v1.0"
       
     6 * which accompanies this distribution, and is available
       
     7 * at the URL "http://www.eclipse.org/legal/epl-v10.html".
       
     8 *
       
     9 * Initial Contributors:
       
    10 * Nokia Corporation - initial contribution.
       
    11 *
       
    12 * Contributors:
       
    13 *
       
    14 * Description:   CUniSendingSettingsDialog class definition.      
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef UNISENDINGSETTINGSDIALOG_H
       
    21 #define UNISENDINGSETTINGSDIALOG_H
       
    22 
       
    23 //  INCLUDES
       
    24 
       
    25 #include <AknForm.h>
       
    26 #include <msvapi.h> //for MMsvSessionObserver
       
    27 #include <eiklbo.h> // MEikListBoxObserver
       
    28 #include <ConeResLoader.h>              // ResLoader
       
    29 
       
    30 #include <mmsconst.h> // MmsMessageDeliveryReport
       
    31 #include <muiusettingsarray.h>
       
    32 
       
    33 #include "UniSendingSettings.h"
       
    34 
       
    35 // CONSTANTS
       
    36 
       
    37 const TUint KColumnListSpace = ' ';//For getting the line on the listbox
       
    38 const TInt KUniSettingsSendRetryCount = 3;
       
    39 const TInt KUniSettingsSendRetryInterval = 600;
       
    40 const TInt KSettingsGranularity = 4;
       
    41 const TInt KUniUiLongestSettingLength = 100;
       
    42 
       
    43 // MACROS
       
    44 
       
    45 // DATA TYPES
       
    46 typedef TBuf<KUniUiLongestSettingLength> TUniSettingsText;
       
    47 
       
    48 // Enumerations for sending (=message) settings listbox
       
    49 enum
       
    50     {
       
    51     EUniSendingSettingsMessageType = 0,
       
    52     EUniSendingSettingsCharSupport
       
    53     };
       
    54 
       
    55 enum
       
    56     {
       
    57     EUniSettingsPriorityHigh = 0,
       
    58     EUniSettingsPriorityNormal,
       
    59     EUniSettingsPriorityLow
       
    60     };
       
    61 
       
    62 enum
       
    63     {
       
    64     EUniSettingsYes = 0,
       
    65     EUniSettingsNo
       
    66     };
       
    67 
       
    68 enum
       
    69     {
       
    70     EUniSettingsCharSupportFull = 0,
       
    71     EUniSettingsCharSupportReduced
       
    72     };
       
    73 
       
    74 enum
       
    75     {
       
    76     EUniSettingsMessageTypeAutomatic = 0,
       
    77     EUniSettingsMessageTypeText,
       
    78     EUniSettingsMessageTypeMultimedia,
       
    79     EUniSettingsMessageTypeFax,
       
    80     EUniSettingsMessageTypePaging
       
    81     };
       
    82 
       
    83 enum
       
    84     {
       
    85     EUniSettingsValidityPeriod1h = 0,
       
    86     EUniSettingsValidityPeriod6h,
       
    87     EUniSettingsValidityPeriod24h,
       
    88     EUniSettingsValidityPeriod3d,
       
    89     EUniSettingsValidityPeriodWeek,
       
    90     EUniSettingsValidityPeriodMaximum
       
    91     };
       
    92 
       
    93 enum
       
    94     {
       
    95     EUniSettingsContentNeedsMms       = 0x01, // Show only MMS + Auto
       
    96     EUniSettingsPermanentSms          = 0x02, // Show only SMS + conversions
       
    97     EUniSettingsPermanentMms          = 0x04, // Show only MMS
       
    98     EUniSettingsCSPBitsOn             = 0x08, // Hide also conversions
       
    99     EUniSettingsHideCharSet           = 0x10, // Hide whole char set support
       
   100 	EUniSettingsHideMessageTypeOption = 0x20  // Hide message type option 
       
   101     };
       
   102 
       
   103 // FORWARD DECLARATIONS
       
   104 class CAknNavigationControlContainer;
       
   105 class CAknTitlePane;
       
   106 class CEikTextListBox;
       
   107 
       
   108 // CLASS DECLARATIONS
       
   109 
       
   110 /**
       
   111  * Class CUniSettingsDialog
       
   112  * Creates a dialog for editing uni sending settings. Values are from loc
       
   113  * files. The actual setting values come from TUniSendingSettings.
       
   114  * @since 3.1
       
   115  */
       
   116 
       
   117 class CUniSendingSettingsDialog : public CAknDialog, 
       
   118                                   public MEikListBoxObserver
       
   119     {
       
   120     public:
       
   121         enum TUniExitCode
       
   122             {
       
   123             EUniExit = 0,
       
   124             EUniBack,
       
   125             EUniExternalInterrupt,
       
   126             EUniExitWithSave
       
   127             };
       
   128 
       
   129     public:
       
   130         /**
       
   131          * Constructor
       
   132          * @param aClientMtm - client mtm instance. Note: context must be set 
       
   133          *                     to Uni service & LoadMessageL() called!
       
   134          * @param aExitCode out - which command closed the dialog
       
   135          */
       
   136         CUniSendingSettingsDialog(
       
   137             TInt aSettingsFlags,
       
   138             TUniSendingSettings& aSendingSettings,
       
   139             TUniExitCode& aExitCode,
       
   140             CAknTitlePane& aTitlePane );
       
   141             
       
   142         /**
       
   143          * Destructor
       
   144          */
       
   145         ~CUniSendingSettingsDialog();
       
   146 
       
   147     protected:
       
   148         
       
   149         /**
       
   150          * From CAknDialog
       
   151          */
       
   152         void ProcessCommandL( TInt aCommandId ) ;   
       
   153         
       
   154         /** 
       
   155         * From CEikDialog
       
   156         */
       
   157         TBool OkToExitL( TInt aKeyCode );
       
   158 
       
   159         /** 
       
   160          * From CEikDialog
       
   161          */
       
   162         TKeyResponse OfferKeyEventL( const TKeyEvent& aKeyEvent, TEventCode aType );
       
   163 
       
   164         /**
       
   165          * From MEikListBoxObserver 
       
   166          */
       
   167         void HandleListBoxEventL( CEikListBox* aListBox, TListBoxEvent aEventType );
       
   168         
       
   169         /**
       
   170         * From MEikMenuObserver Initializes items on the menu
       
   171         *
       
   172         * @param aMenuId    Current menu's resource Id
       
   173         * @param aMenuPane  Pointer to menupane
       
   174         */
       
   175         void DynInitMenuPaneL(TInt aMenuId, CEikMenuPane* aMenuPane);
       
   176         
       
   177     private:
       
   178         
       
   179         /** 
       
   180          * From CEikDialog
       
   181          * Sets the layout for the dialog. Called just before the dialog
       
   182          * is activated
       
   183          */
       
   184         void PreLayoutDynInitL();
       
   185         
       
   186         /**
       
   187          * Gets the values for the uni message specific settings and store
       
   188          * them to listbox.
       
   189          */
       
   190         void GetSendingSettingsValues();
       
   191 
       
   192         /**
       
   193          * Sets one listbox item to settings array.
       
   194          * @param aIndex - index of the item
       
   195          * @param aCurrentNumber - value of the item
       
   196          */
       
   197         void SetArrayItem( TInt aIndex, TInt aCurrentNumber );
       
   198 
       
   199         /**
       
   200          * Sets one listbox item to settings array.
       
   201          * @param aIndex - index of the item
       
   202          * @param aCurrentNumber - value of the item
       
   203          * @param aUserText - formatted UI text
       
   204          */
       
   205         void SetArrayItem( TInt aIndex, TInt aCurrentNumber, const TDesC& aUserText );
       
   206 
       
   207         /**
       
   208          * Handles which settings is selected
       
   209          * @param aIndex - index of the item
       
   210          * @param aEnterPressed
       
   211          */
       
   212         void HandleEditRequestL( TInt aIndex, TBool aEnterPressed );
       
   213 
       
   214         /**
       
   215          * Edits the values of the 
       
   216          */
       
   217         void EditMessagePriorityL();
       
   218 
       
   219         /**
       
   220          * Sets the values of the 
       
   221          */
       
   222         void SetMessagePriorityL( TInt aPriority );
       
   223 
       
   224         /**
       
   225          * Edits the values of the 
       
   226          */
       
   227         void EditDeliveryReportL( TBool aEnterPressed );
       
   228 
       
   229         /**
       
   230          * Edits the values of the 
       
   231          */
       
   232         void EditMessageTypeL();
       
   233 
       
   234         /**
       
   235          * Sets the values of the 
       
   236          */
       
   237         void SetMessageTypeL( TInt aMessageType );
       
   238 
       
   239         /**
       
   240          * Edits the values of the 
       
   241          */
       
   242         void EditCharacterSupportL( TBool aEnterPressed );
       
   243 
       
   244         /**
       
   245          * Sets the values of the 
       
   246          */
       
   247         void SetCharacterSupportL( TInt aCharSetSupport );
       
   248 
       
   249         /**
       
   250          * Edits the values of the 
       
   251          */
       
   252         void EditValidityPeriodL();
       
   253 
       
   254         /**
       
   255          * Edits the values of the 
       
   256          */
       
   257         void SetValidityPeriodL( TInt aMessageValidity );
       
   258 
       
   259         /**
       
   260          * Edits the values of the 
       
   261          */
       
   262         void EditReplyViaSameCentreL( TBool aEnterPressed );
       
   263 
       
   264         /**
       
   265          * Sets the title text
       
   266          */
       
   267         void SetTitleTextL();
       
   268         
       
   269         /**
       
   270          * Finishing operations when closing the dialog.
       
   271          * @return ETrue if save is not wanted
       
   272          *         EFalse if OK to save settings
       
   273          */
       
   274         TBool ClosingDialogL();
       
   275 
       
   276         /**
       
   277          * Does the exit operation for all
       
   278          */
       
   279         void ExitDialogL();
       
   280 
       
   281         /**
       
   282          * From CCoeControl, returns help context
       
   283          */
       
   284         void GetHelpContext( TCoeHelpContext& aContext ) const; 
       
   285         
       
   286         /** 
       
   287          * Launches help application
       
   288          */
       
   289         void LaunchHelpL();
       
   290 
       
   291         /** 
       
   292          * Show information note
       
   293          */
       
   294         void ShowInformationNoteL( TInt aResourceId );
       
   295         
       
   296         /** 
       
   297          * Checks which items are currently invisible and
       
   298          * recalculates the index according to that
       
   299          */
       
   300         TInt OriginalIndexToVisibleIndex( TInt aOriginalIndex );
       
   301 
       
   302         /** 
       
   303          * Checks which items are currently invisible and
       
   304          * recalculates the index according to that
       
   305          */
       
   306         TInt VisibleIndexToOriginalIndex( TInt aVisibleIndex );
       
   307 
       
   308         TInt InvisibleItems( TInt aIndex );
       
   309 
       
   310         void UpdateMskL();
       
   311         
       
   312         /**
       
   313          * Executes settings page dialog 
       
   314          */
       
   315         TBool ExecuteSettingsPageDialogL( CDesCArrayFlat* items, 
       
   316                                           TInt& aCurrentItem,
       
   317                                           const TDesC& aLabelText );
       
   318 
       
   319     private:
       
   320 
       
   321         enum TSettingsDialogFlags
       
   322             {
       
   323             EShouldExit                    = 0x0001,
       
   324             EGoingToExit                   = 0x0002,
       
   325             EExitSelected                  = 0x0004,
       
   326             ESwitchToExit                  = 0x0008,
       
   327             EHelpFeatureSupported          = 0x0010,
       
   328             EDefaultNaviPane               = 0x0040
       
   329             };
       
   330 
       
   331         CAknNavigationControlContainer* iNaviPane; //not owned
       
   332         CMuiuSettingsArray*             iItems;
       
   333         HBufC*                          iPreviousTitleText;
       
   334         CAknTitlePane&                  iTitlePane;
       
   335         TUniExitCode&                   iExitCode;  // pass exit code to caller
       
   336         TUniSendingSettings&            iSendingSettings;
       
   337         CEikTextListBox*                iListbox;
       
   338         TInt                            iSettingsDialogFlags;
       
   339         TInt                            iSettingsFlags;
       
   340         TMuiuSettingsItem               iCharacterSettings;
       
   341         TMuiuSettingsItem               iMessageTypeSettings;
       
   342     };
       
   343 
       
   344 #endif    //UNISENDINGSETTINGSDIALOG_H
       
   345             
       
   346 // End of File