email/alwaysonlineemailplugin/inc/AlwaysOnlineEmailEMNResolver.h
changeset 0 72b543305e3a
equal deleted inserted replaced
-1:000000000000 0:72b543305e3a
       
     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: Handles OMA Email Notification messages.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef ALWAYSONLINEEMAILEMNRESOLVER_H
       
    20 #define ALWAYSONLINEEMAILEMNRESOLVER_H
       
    21 
       
    22 // INCLUDES
       
    23 #include <e32base.h>
       
    24 #include "AlwaysOnlineEmailAgentBase.h"
       
    25 
       
    26 /**
       
    27 *  This class handles OMA Email Notification messages.
       
    28 *
       
    29 *  @since S60 v3.1
       
    30 */
       
    31 class CAlwaysOnlineEmailEMNResolver : public CBase
       
    32     {
       
    33     public:  // Constructors and destructor
       
    34 
       
    35         /**
       
    36         * Creates object from CAlwaysOnlineEmailEMNResolver and leaves it to 
       
    37         * cleanup stack
       
    38         * @since S60 v3.1
       
    39         * @return, Constructed object
       
    40         */
       
    41         static CAlwaysOnlineEmailEMNResolver* NewLC();
       
    42 
       
    43         /**
       
    44         * Creates object from CAlwaysOnlineEmailEMNResolver
       
    45         * @since S60 v3.1
       
    46         * @return, Constructed object
       
    47         */
       
    48         static CAlwaysOnlineEmailEMNResolver* NewL();
       
    49 
       
    50         /**
       
    51         * Destructor
       
    52         * @since S60 v3.1
       
    53         */
       
    54         virtual ~CAlwaysOnlineEmailEMNResolver();
       
    55 
       
    56     public: // New functions
       
    57     
       
    58         /**
       
    59         * @since S60 v3.1
       
    60         * @return mailbox agent, NULL if not found
       
    61         */
       
    62         CAlwaysOnlineEmailAgentBase* FindEMNMailbox( TDesC& aMailboxURI, 
       
    63             CAOEmailAgentArray& aMailAgentArray );
       
    64             
       
    65         /**
       
    66         * Dispatches TEMNElement struct
       
    67         * @since S60 v3.1
       
    68         * @param aParameters Received mailbox URI and timestamp
       
    69         * @param aElement Dispatched mailbox URI and timestamp
       
    70         * @return KErrNone, if dispatching is ok
       
    71         */
       
    72         TInt ParameterDispatchTEMNElement( 
       
    73             const TDesC8& aParameters,
       
    74             TEMNElement& aElement ) const;
       
    75 
       
    76     protected:  // Constructors
       
    77 
       
    78         /**
       
    79         * Default constructor for class CAlwaysOnlineEmailEMNResolver
       
    80         * @since S60 v3.1
       
    81         * @return, Constructed object
       
    82         */
       
    83         CAlwaysOnlineEmailEMNResolver();
       
    84 
       
    85         /**
       
    86         * Symbian 2-phase constructor
       
    87         * @since S60 v3.1
       
    88         */
       
    89         void ConstructL();
       
    90 
       
    91     private:  // New functions
       
    92         
       
    93         /**
       
    94         * Checks whether the given username and server is found from given URI
       
    95         * @since S60 v3.1
       
    96         * @param aURI, mailbox URI
       
    97         * @param aUsername
       
    98         * @param aServer
       
    99         * @return TBool, if aUsername and aServer is found from aURI
       
   100         */
       
   101         TBool HandleEmnImapUserURI(
       
   102             const TDesC& aURI,
       
   103             const TDesC8& aUsername,
       
   104             const TDesC& aServer ) const;
       
   105 
       
   106         /**
       
   107         * Checks whether the given username and server is found from given URI
       
   108         * @since S60 v3.1
       
   109         * @param aURI, mailbox URI
       
   110         * @param aUsername
       
   111         * @param aServer
       
   112         * @return TBool, if aUsername and aServer is found from aURI
       
   113         */
       
   114         TBool HandleEmnPopUserURI(
       
   115             const TDesC& aURI,
       
   116             const TDesC8& aUsername,
       
   117             const TDesC& aServer ) const;
       
   118 
       
   119         /**
       
   120         * Checks whether the given username and server is found from given URI
       
   121         * @since S60 v3.1
       
   122         * @param aURI, mailbox URI
       
   123         * @param aUsername
       
   124         * @param aServer
       
   125         * @return TBool, if aUsername and aServer is found from aURI
       
   126         */
       
   127         TBool HandleEmnPopNoAuthURI( 
       
   128             const TDesC& aURI,
       
   129             const TDesC8& aUsername,
       
   130             const TDesC& aServer ) const;
       
   131             
       
   132     };
       
   133 
       
   134 #endif //  ALWAYSONLINEEMAILEMNRESOLVER_H