email/imum/Utils/Inc/ImumInternalApiImpl.h
branchRCL_3
changeset 27 7fdbb852d323
parent 0 72b543305e3a
equal deleted inserted replaced
26:ebe688cedc25 27:7fdbb852d323
       
     1 /*
       
     2 * Copyright (c) 2006 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:  ImumInternalApiImpl.h
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __CIMBEMAILFACTORY_H__
       
    20 #define __CIMBEMAILFACTORY_H__
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include <msvapi.h>                     // CMsvSession
       
    25 #include <ImumInternalApi.h>
       
    26 #include <cemailaccounts.h>             // CEmailAccounts
       
    27 
       
    28 #include "ImumInternalApiImpl.h"
       
    29 #include "ImumInHealthServicesImpl.h"
       
    30 #include "ImumMboxSettingsCtrl.h"
       
    31 #include "ImumMboxManager.h"
       
    32 #include <ConeResLoader.h>      // RConeResourceLoader
       
    33 
       
    34 // CONSTANTS
       
    35 // MACROS
       
    36 // FORWARD DECLARATIONS
       
    37 class CImumInMailboxUtilitiesImpl;
       
    38 class CImumInMailboxServicesImpl;
       
    39 class CMuiuFlags;
       
    40 class CMsvCommDbUtilities;
       
    41 
       
    42 // LOCAL FUNCTION PROTOTYPES
       
    43 // DATA TYPES
       
    44 
       
    45 /*
       
    46 * Center point of email API
       
    47 * @lib ImumUtils.lib
       
    48 * @since S60 v3.2
       
    49 */
       
    50 class CImumInternalApiImpl : public CImumInternalApi, public MMsvSessionObserver
       
    51 {
       
    52     private: // Enums
       
    53 
       
    54         enum TInternalApiFlags
       
    55             {
       
    56             ESessionOwned = 0,
       
    57             EObserverSet,
       
    58             EServicesReady,
       
    59             EHasUi
       
    60             };
       
    61 
       
    62     public:  // Constructors and destructor
       
    63 
       
    64         /**
       
    65          *
       
    66          * @since S60 v3.2
       
    67          */
       
    68         static CImumInternalApiImpl* NewL(
       
    69             CMsvSession* aMsvSession = NULL );
       
    70 
       
    71         /**
       
    72          *
       
    73          * @since S60 v3.2
       
    74          */
       
    75         static CImumInternalApiImpl* NewLC(
       
    76             CMsvSession* aMsvSession = NULL );
       
    77 
       
    78         /**
       
    79          *
       
    80          * @since S60 v3.2
       
    81          */
       
    82         virtual ~CImumInternalApiImpl();
       
    83 
       
    84     public: // New functions
       
    85 
       
    86         /**
       
    87          *
       
    88          * @since S60 v3.2
       
    89          */
       
    90         CEmailAccounts& EmailAccountsL();
       
    91 
       
    92         /**
       
    93          *
       
    94          * @since S60 v3.2
       
    95          */
       
    96         CImumInHealthServicesImpl& MailboxDoctorL();
       
    97 
       
    98         /**
       
    99          *
       
   100          * @since S60 v3.2
       
   101          */
       
   102         CImumMboxManager& SettingsManagerL();
       
   103 
       
   104         /**
       
   105          *
       
   106          * @since S60 v3.2
       
   107          */
       
   108         CImumMboxSettingsCtrl& SettingsStorerL();
       
   109 
       
   110         /**
       
   111          *
       
   112          *
       
   113          * @since S60 v3.2
       
   114          * @param
       
   115          * @return
       
   116          * @leave &(leavedesc)s
       
   117          */
       
   118         CImumInMailboxServicesImpl& MailboxServicesImplL();
       
   119 
       
   120         /**
       
   121          *
       
   122          *
       
   123          * @since S60 v3.2
       
   124          * @param
       
   125          * @return
       
   126          */
       
   127         const CMuiuFlags& Flags();
       
   128 
       
   129         /**
       
   130          *
       
   131          *
       
   132          * @since S60 v5.0
       
   133          * @param
       
   134          * @return
       
   135          * @leave
       
   136          */
       
   137         CMsvCommDbUtilities& CommDbUtilsL();
       
   138 
       
   139 
       
   140         /**
       
   141          * Throws an exception. Leaves in release mode, panic in debug.
       
   142          *
       
   143          * @since S60 v3.2
       
   144          * @param aErrorCode, error code to be used to indicate exception
       
   145          * @leave aErrorCode
       
   146          */
       
   147         void ServiceExceptionL(
       
   148             const TInt aErrorCode ) const;
       
   149 
       
   150     public: // Functions from base classes
       
   151 
       
   152 // From CImumInternalApi
       
   153 
       
   154         virtual CMsvSession& MsvSession();
       
   155 
       
   156         /**
       
   157          * Interface to handle information regarding the
       
   158          *
       
   159          * healthiness of the mailboxes
       
   160          * @since S60 v3.2
       
   161          * @return Mailbox Doctor Interface
       
   162          */
       
   163         virtual const MImumInHealthServices& HealthServicesL();
       
   164         virtual const MImumInHealthServices& HealthApiL();
       
   165 
       
   166         /**
       
   167          * Interface to mailbox utilities
       
   168          *
       
   169          * @since S60 3.2
       
   170          * @return Reference to utilities class
       
   171          */
       
   172         virtual const MImumInMailboxUtilities& MailboxUtilitiesL();
       
   173 
       
   174         virtual const MImumInMailboxServices& MailboxServicesL();
       
   175 
       
   176         /**
       
   177          * Function for checking mailbox flags and show information note.
       
   178          * If resource parameters are set blank no note will be displayed.
       
   179          *
       
   180          * @since S60 v3.2
       
   181          * @param Flag from the list TEmailFeatures.
       
   182          * @param aFeatureOnResource resource to be displayed if feature is on.
       
   183          * @param aFeatureOffResource resource to be displayed if feature is off.
       
   184          * @return ETrue if asked flag is active.
       
   185          */
       
   186         virtual TBool IsEmailFeatureSupportedL(
       
   187             const TEmailFeatures aFlag,
       
   188             const TUint aFeatureOnResource = 0,
       
   189             const TUint aFeatureOffResource = 0 );
       
   190 
       
   191 // MMsvSessionObserver
       
   192 
       
   193         void HandleSessionEventL(
       
   194             TMsvSessionEvent aEvent,
       
   195             TAny* aArg1,
       
   196             TAny* aArg2,
       
   197             TAny* aArg3 );
       
   198 
       
   199     protected:  // Constructors
       
   200 
       
   201         /**
       
   202          *
       
   203          * @since S60 v3.2
       
   204          */
       
   205         void ConstructL();
       
   206 
       
   207         /**
       
   208          *
       
   209          * @since S60 v3.2
       
   210          */
       
   211         CImumInternalApiImpl( CMsvSession* aMsvSession = NULL );
       
   212 
       
   213     protected:  // New virtual functions
       
   214     protected:  // New functions
       
   215     protected:  // Functions from base classes
       
   216 
       
   217     private:  // New virtual functions
       
   218     private:  // New functions
       
   219 
       
   220         /**
       
   221          * Resets the API objects and sets the default mailbox.
       
   222          *
       
   223          * @since S60 v3.2
       
   224          */
       
   225         void ReloadL();
       
   226 
       
   227         /**
       
   228          * Destroys objects and Message Server session
       
   229          *
       
   230          * @since S60 v3.2
       
   231          */
       
   232         void Reset();
       
   233 
       
   234         /**
       
   235          * Create session object to Message Server catching the leaves
       
   236          *
       
   237          * @since S60 v3.2
       
   238          * @return Object of Message Server session
       
   239          */
       
   240         CMsvSession* CreateMsvSession();
       
   241 
       
   242         /**
       
   243          * Create session object to Message Server
       
   244          *
       
   245          * @since S60 v3.2
       
   246          * @return Object of Message Server session
       
   247          * @leave KErrNoMemory when failing to create the object
       
   248          */
       
   249         CMsvSession* DoCreateMsvSessionL();
       
   250 
       
   251     private:  // Functions from base classes
       
   252 
       
   253     public:     // Data
       
   254     protected:  // Data
       
   255     private:    // Data
       
   256 
       
   257         // Owned;
       
   258         CMuiuFlags* iFlags;
       
   259         // Ownership depends on parameter
       
   260         CMsvSession* iMsvSession;
       
   261         // Owned:
       
   262         CImumMboxManager* iMailboxManager;
       
   263         // Owned:
       
   264         CImumInHealthServicesImpl* iHealthServices;
       
   265         // Owned:
       
   266         CImumMboxSettingsCtrl* iMboxSettingsCtrl;
       
   267         // Owned:
       
   268         CEmailAccounts* iAccounts;
       
   269         // Owned:
       
   270         CImumInMailboxUtilitiesImpl* iMailboxUtilities;
       
   271         // Owned:
       
   272         CImumInMailboxServicesImpl* iMailboxServices;
       
   273         // Owned: Object to load the resources
       
   274         RConeResourceLoader*         iResourceLoader;
       
   275         // Owned: Pointer to CommDb utils object
       
   276         CMsvCommDbUtilities*    iCommDbUtils;
       
   277 };
       
   278 
       
   279 #endif /* __CIMBEMAILFACTORY_H__ */