email/mail/UtilsSrc/MsgMailPreferences.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2002 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: 
       
    15 *     Declares storage class for mail preferences
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 #ifndef MSGMAILPREFERENCES_H
       
    21 #define MSGMAILPREFERENCES_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include <msvstd.h>
       
    26 #include <MsgEditor.hrh>
       
    27 
       
    28 // FORWARD DECLARATIONS
       
    29 class CMsvSession;
       
    30 class TMsvEmailEntry;
       
    31 class CImSmtpSettings;
       
    32 
       
    33 // CONSTANTS
       
    34 enum EHeaderStatus
       
    35 	{
       
    36 	EHeaderHidden,
       
    37 	EHeaderVisible,
       
    38 	EHeaderOnlySave
       
    39 	};
       
    40 
       
    41 class TAdditionalHeaderStatus
       
    42     {
       
    43     public:
       
    44     TAdditionalHeaderStatus();
       
    45     TAdditionalHeaderStatus(TMsgControlId aControlID);
       
    46     TMsgControlId iHeaderValue;
       
    47 	EHeaderStatus iStatus;
       
    48 	TBool iHasContent;
       
    49     };
       
    50 
       
    51 // CLASS DECLARATION
       
    52 
       
    53 /**
       
    54 *  Storage class for sending related mail settings. 
       
    55 *  This class is used to store user-configurable information about sending.
       
    56 *  These include the remote mailbox to be used, whether the message should
       
    57 *  be sent immediately or upon next connection. 
       
    58 */
       
    59 class CMsgMailPreferences : public CBase
       
    60     {
       
    61     public: // Enumerations
       
    62 
       
    63         /** 
       
    64         * Possible mail scheduling values. 
       
    65         */
       
    66         enum TMsgMailScheduling {
       
    67             EMsgMailSchedulingNow,
       
    68             EMsgMailSchedulingNextConn
       
    69         }; 
       
    70 
       
    71     public: // Constructors and destructor
       
    72         /**
       
    73         * Constructor.
       
    74         * Sets default values.
       
    75         */
       
    76         IMPORT_C CMsgMailPreferences();
       
    77 
       
    78     public: // New functions
       
    79         /**
       
    80         * Retrieves Character set ID for outgoing mails.
       
    81         * @return Character set ID.
       
    82         */
       
    83         TUid SendingCharacterSet() const;
       
    84         
       
    85         /**
       
    86         * Set Sending character set id
       
    87         * @param aSendingCharacterSet Character set id
       
    88         */
       
    89         void SetSendingCharacterSet(TUid aSendingCharacterSet);
       
    90         
       
    91         /**
       
    92         * Retrieves remote mailbox ID.
       
    93         * @return Service ID of the remote mailbox.
       
    94         */
       
    95         TMsvId ServiceId() const;
       
    96 
       
    97         /**
       
    98         * Retrieves mail scheduling value.
       
    99         * @return Mail scheduling value.
       
   100         */
       
   101         TMsgMailScheduling MessageScheduling() const;
       
   102 
       
   103         /**
       
   104         * Sets remote mailbox service ID.
       
   105         * @param Remote mailbox service ID.
       
   106         */
       
   107         void SetServiceId(TMsvId aServiceId);
       
   108 
       
   109         /**
       
   110         * Sets mail scheduling value.
       
   111         * @param aScheduling New mail scheduling value.
       
   112         */
       
   113         void SetMessageScheduling(TMsgMailScheduling aScheduling);
       
   114 
       
   115         /**
       
   116         * inline
       
   117         * Sets encoding supported flag.
       
   118         * @param aSupported ETrue if encoding setting is supported.
       
   119         */
       
   120         void SetEncodingSupport( TBool aSupported );
       
   121                 
       
   122         /**
       
   123         * Gets default preferences from account settings.
       
   124         * @param aServiceId Remote mailbox service ID from where the settings
       
   125         * will be retrieved. If it is KMsvUnknownServiceIndexEntryId, class
       
   126         * defaults will be used. 
       
   127         * @param aSession Session to Message Server for fetching settings
       
   128         */
       
   129         IMPORT_C void DefaultAccountSettingsL(const TMsvId aServiceId, 
       
   130                                      CMsvSession& aSession);
       
   131 
       
   132         /**
       
   133         * Exports current preferences.
       
   134         * @param aEntry Email service entry where the 
       
   135 		* current setting will be exported.
       
   136         */
       
   137         IMPORT_C void ExportSendOptionsL(const TMsvEmailEntry& aEntry);
       
   138 
       
   139         /**
       
   140         * Imports current preferences.
       
   141         * @param aEntry Email service entry from 
       
   142 		* where the settings will be read.
       
   143         */
       
   144         IMPORT_C void ImportSendOptionsL(TMsvEmailEntry& aEntry);
       
   145 
       
   146         IMPORT_C void SetAdditionalHeaders(TInt aValue);
       
   147 
       
   148         IMPORT_C EHeaderStatus GetAdditionalHeaderVisibility( TMsgControlId aHeader);
       
   149     
       
   150     private: // implementation
       
   151         TUid SolveCharacterSet(const CImSmtpSettings& aSmtpSettings ) const;
       
   152 
       
   153     private: // Data   
       
   154         /// The message scheduling type
       
   155         TMsgMailScheduling      iScheduling;       
       
   156 
       
   157         /// The service ID of remote mailbox to be used in sending.
       
   158         TMsvId                  iServiceId;
       
   159 		
       
   160 		/// Additional headers settings
       
   161      	TInt iHeaderResults;
       
   162 	
       
   163 	    // Character set for outgoing mails
       
   164 	    TUid iSendingCharacterSet;
       
   165 	    
       
   166 	    // Encoding setting supported
       
   167 	    TBool iEncodingSupported;
       
   168 
       
   169     };
       
   170 
       
   171 #include "MsgMailPreferences.inl" // inline functions
       
   172 
       
   173 #endif // MSGMAILPREFERENCES_H   
       
   174             
       
   175 // End of File