mobilemessaging/postcard/postcarduiinc/PostcardUi.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     1 /*
       
     2 * Copyright (c) 2005 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 *       CPstcardUi - UI part of the Postcard MTM type to Symbian OS Messaging
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef POSTCARDUI_H
       
    22 #define POSTCARDUI_H
       
    23 
       
    24 //  INCLUDES
       
    25 #include <mtmuibas.h>
       
    26 #include <MuiuMsgEditorLauncher.h> // for launch flags
       
    27 
       
    28 #include <mmsconst.h>
       
    29 
       
    30 #include <mmssettingshandler.h>
       
    31 
       
    32 // CONSTANTS
       
    33 // MACROS
       
    34 
       
    35 // DATA TYPES
       
    36 // Editor types used to launch the correct application
       
    37 enum TEditorType
       
    38     {
       
    39     EReadOnly,
       
    40     EEditExisting,
       
    41     ECreateNewMessage,
       
    42     ESpecialEditor
       
    43     };
       
    44 
       
    45 // FUNCTION PROTOTYPES
       
    46 
       
    47 // CLASS DECLARATION
       
    48 
       
    49 /**
       
    50 * CPostcardUi - UI part of the POCA MTM type to Symbian OS Messaging
       
    51 *
       
    52 * @since 0.9
       
    53 */
       
    54 class CPostcardUi : public CBaseMtmUi
       
    55     {
       
    56     public:  // Constructors and destructor
       
    57         
       
    58         /**
       
    59         * Symbian OS constructor
       
    60         * @param aBaseMtm client MTM
       
    61         * @param aRegisteredMtmDll registry dll
       
    62         * @return a new POCA MTM UI object.
       
    63         */
       
    64         static CPostcardUi* NewL(
       
    65             CBaseMtm& aBaseMtm,
       
    66             CRegisteredMtmDll& aRegisteredMtmDll );
       
    67         
       
    68         /**
       
    69         * Destructor.
       
    70         */
       
    71         ~CPostcardUi();
       
    72         
       
    73     public: // Functions from base classes
       
    74         
       
    75         /**
       
    76         * From CBaseMtmUi: Create a new entry. Launches MMS editor.
       
    77         * Asynchronous.
       
    78         * @param aEntry entry to be created
       
    79         * @param aParent parent entry
       
    80         * @param aStatus follows the operation progress
       
    81         * @return started operation
       
    82         */
       
    83         CMsvOperation* CreateL(
       
    84             const TMsvEntry& aEntry,
       
    85             CMsvEntry& aParent,
       
    86             TRequestStatus& aStatus );
       
    87         
       
    88         /**
       
    89         * From CBaseMtmUi:
       
    90         * Not supported (leaves with KErrNotSupported)
       
    91         */
       
    92         CMsvOperation* CancelL(
       
    93             TRequestStatus& aStatus,
       
    94             const CMsvEntrySelection& aSelection );
       
    95         
       
    96         /**
       
    97         * From CBaseMtmUi: 
       
    98         * Not supported (leaves with KErrNotSupported)
       
    99         */
       
   100         CMsvOperation* OpenL( TRequestStatus& aStatus );
       
   101         
       
   102         /**
       
   103         * From CBaseMtmUi:
       
   104         * Not supported (leaves with KErrNotSupported)
       
   105         */
       
   106         CMsvOperation* OpenL(
       
   107             TRequestStatus& aStatus,
       
   108             const CMsvEntrySelection& aSelection );
       
   109         
       
   110         /**
       
   111         * From CBaseMtmUi: not supported in Series 60
       
   112         */
       
   113         CMsvOperation* CloseL( TRequestStatus& aStatus );
       
   114         
       
   115         /**
       
   116         * From CBaseMtmUi: not supported in Series 60
       
   117         */
       
   118         CMsvOperation* CloseL(
       
   119             TRequestStatus& aStatus,
       
   120             const CMsvEntrySelection& aSelection );
       
   121         
       
   122         /**
       
   123         * From CBaseMtmUi: Opens MmsEditor for editing a message. If
       
   124         * service entry opens MMS Settings dialog for editing MMS settings.
       
   125         * @param aStatus follows the operation progress
       
   126         * @return started operation
       
   127         */
       
   128         CMsvOperation* EditL( TRequestStatus& aStatus );
       
   129         
       
   130         /**
       
   131         * From CBaseMtmUi: As the other EditL(), but gets the first entry in
       
   132         * a selection and edits it.
       
   133         */
       
   134         CMsvOperation* EditL(
       
   135             TRequestStatus& aStatus,
       
   136             const CMsvEntrySelection& aSelection );
       
   137         
       
   138         /**
       
   139         * From CBaseMtmUi: 
       
   140         * Not supported (leaves with KErrNotSupported)
       
   141         */
       
   142         CMsvOperation* ViewL( TRequestStatus& aStatus );
       
   143         
       
   144         /**
       
   145         * From CBaseMtmUi:
       
   146         * Not supported (leaves with KErrNotSupported)
       
   147         */
       
   148         CMsvOperation* ViewL(
       
   149             TRequestStatus& aStatus,
       
   150             const CMsvEntrySelection& aSelection );
       
   151         
       
   152         /**
       
   153         * From CBaseMtmUi:
       
   154         * Not supported (leaves with KErrNotSupported)
       
   155         */
       
   156         CMsvOperation* ReplyL(
       
   157             TMsvId aDestination,
       
   158             TMsvPartList aPartlist,
       
   159             TRequestStatus& aCompletionStatus );
       
   160         
       
   161         /**
       
   162         * From CBaseMtmUi: 
       
   163         * Not supported (leaves with KErrNotSupported)
       
   164         */
       
   165         CMsvOperation* ForwardL(
       
   166             TMsvId aDestination,
       
   167             TMsvPartList aPartList,
       
   168             TRequestStatus& aCompletionStatus );
       
   169         
       
   170     protected:  // New functions
       
   171     
       
   172         /**
       
   173         * Handles the actual launching of editor when editing a message.
       
   174         * @param aStatus follows the operation progress.
       
   175         * @param aSession Message server session to be used.
       
   176         * @param aEditorType Editor type used to launch the correct application. 
       
   177         *                    Defaults to EEditExisting.
       
   178         * @return started operation
       
   179         */        
       
   180         CMsvOperation* LaunchEditorApplicationL(
       
   181             TRequestStatus& aStatus,
       
   182             CMsvSession& aSession,
       
   183             TEditorType aEditorType = EEditExisting );
       
   184     
       
   185     protected:  // Functions from base classes
       
   186     
       
   187         /**
       
   188         * From CBaseMtmUi: Returns resource file
       
   189         * @param OUT aFileName Store resource file here
       
   190         */
       
   191         void GetResourceFileName( TFileName& aFileName ) const;
       
   192     
       
   193     private:
       
   194     
       
   195         /**
       
   196         * From CBaseMtmUi: construction.
       
   197         * @param
       
   198         * @return
       
   199         */
       
   200         void ConstructL();
       
   201     
       
   202         /**
       
   203         * From CBaseMtmUi: constructor.
       
   204         * @param aBaseMtm client MTM reference
       
   205         * @param aRegisteredMtmDll Registry DLL
       
   206         * @return
       
   207         */
       
   208         CPostcardUi( CBaseMtm& aBaseMtm, CRegisteredMtmDll& aRegisteredMtmDll );
       
   209     
       
   210         /**
       
   211         * Opens settings dialog for the MMS service.
       
   212         * @param aCompletionStatus follows the operation progress
       
   213         * @return started operation
       
   214         */
       
   215         CMsvOperation* OpenServiceSettingsDialogL(
       
   216             TRequestStatus& aCompletionStatus );
       
   217     
       
   218         /**
       
   219         * Checks whether or not MMS service settings are OK. Open settings
       
   220         * dialog if not.
       
   221         * @param aExitCode settings dialog exit code
       
   222         * @return are settings ok or not
       
   223         */
       
   224         TBool CheckSettingsL( CMmsSettingsDialog::TMmsExitCode& aExitCode ) const;
       
   225     
       
   226         /**
       
   227         * Creates completed operation after settings dialog closing with
       
   228         * appropriate parameters.
       
   229         * @param aCompletionStatus the operation progress
       
   230         * @param aExitCode settings dialog exit code
       
   231         * @return completed operation
       
   232         */
       
   233         CMsvOperation* CompleteSettingsOperationL(
       
   234             TRequestStatus& aCompletionStatus,
       
   235             const CMmsSettingsDialog::TMmsExitCode& aExitCode = CMmsSettingsDialog::EMmsExternalInterrupt );
       
   236     
       
   237         /**
       
   238         * Actual settings dialog launcher
       
   239         * @param aExitCode out: the exit code causing dialog to close
       
   240         */
       
   241         void LaunchSettingsDialogL(
       
   242             CMmsSettingsDialog::TMmsExitCode& aExitCode ) const;
       
   243 
       
   244         /**
       
   245         * Checks if ap exists
       
   246         * @param aAp, access point id
       
   247         */
       
   248         TBool ApExistsL( TUint32 aAp );
       
   249 
       
   250         /**
       
   251         * Checks if there's enough diskspace
       
   252         * If there is, just returns;
       
   253         * If there is not, leaves with KErrDiskFull
       
   254         */
       
   255         void CheckDiskSpaceL( );
       
   256 
       
   257     private:    // Data
       
   258         CMmsSettingsHandler*    iSettingsHandler;
       
   259         TUid                    iPocaAppId;
       
   260     };
       
   261     
       
   262 #endif      // PostcardUi_H
       
   263     
       
   264     // End of File
       
   265