emailservices/emailserver/cmailhandlerplugin/inc/fsmailauthenticationhandler.h
changeset 0 8466d47a6819
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 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: This file defines class CFSMailAuthenticationHandler.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 #ifndef __FSMAIL_AUTHENTICATION_HANDLER_H__
       
    20 #define __FSMAIL_AUTHENTICATION_HANDLER_H__
       
    21 
       
    22 #include "fsnotificationhandlerbase.h"
       
    23 #include "fsnotificationhandlernotifierinitiator.h"
       
    24 #include "fsnotificationhandlernotifierinitiatorobserver.h"
       
    25 
       
    26 
       
    27 /**
       
    28  *  Class to handle showing of authentication query in case
       
    29  *  needed.
       
    30  *
       
    31  *  @code
       
    32  *   ?good_class_usage_example(s)
       
    33  *  @endcode
       
    34  *
       
    35  *  @lib ?library
       
    36  *  @since S60 ?S60_version *** for example, S60 v3.0
       
    37  */
       
    38 class CFSMailAuthenticationHandler :
       
    39     public CFSNotificationHandlerBase,
       
    40     public MFSNotificationHandlerNotifierInitiatorObserver
       
    41     {
       
    42 public:
       
    43 
       
    44     /**
       
    45      * Two-phased constructor.
       
    46      * @param aOwner Owner and manager of this handler.
       
    47      */	
       
    48     static CFSMailAuthenticationHandler* NewL(
       
    49         MFSNotificationHandlerMgr& aOwner );
       
    50     /**
       
    51     * Destructor.
       
    52     */
       
    53     virtual ~CFSMailAuthenticationHandler();
       
    54 
       
    55 public: // From base class MFSNotificationHandlerNotifieriInitiatorObserver
       
    56 
       
    57     void NotifierInitiatorDoneL(
       
    58         CFSNotificationHandlerNotifierInitiator* aInitiator );
       
    59 
       
    60 protected:
       
    61 
       
    62 
       
    63 // from base class CFSNotificationHandlerBase  
       
    64 
       
    65     /**
       
    66      * From CFSNotificationHandlerBase.
       
    67      * Implementation of CapabilitiesToContinueL.
       
    68      *
       
    69      * @see CFSNotificationHandlerBase::CapabilitiesToContinueL 
       
    70      *
       
    71      * @since S60 ?S60_version
       
    72      */
       
    73     virtual TBool CapabilitiesToContinueL(
       
    74         TFSMailEvent aEvent,
       
    75         TFSMailMsgId aMailbox,
       
    76         TAny* aParam1,
       
    77         TAny* aParam2,
       
    78         TAny* aParam3 ) const;
       
    79 
       
    80     /**
       
    81      * Function that does the actual event handling.
       
    82      *
       
    83      * @see CFSNotificationHandlerBase::EventL
       
    84      *
       
    85      * @since S60 ?S60_version
       
    86      */ 
       
    87     virtual void HandleEventL(
       
    88         TFSMailEvent aEvent,
       
    89         TFSMailMsgId aMailbox,
       
    90         TAny* aParam1,
       
    91         TAny* aParam2,
       
    92         TAny* aParam3 );
       
    93     
       
    94 private:
       
    95 
       
    96     /**
       
    97      * Constructor.
       
    98      *
       
    99      * @since S60 ?S60_version
       
   100      * @param aOwner Owner and manager of this handler.
       
   101      */ 
       
   102     CFSMailAuthenticationHandler( MFSNotificationHandlerMgr& aOwner );
       
   103     void ConstructL();
       
   104 
       
   105     /**
       
   106      * Shows an authentication query.
       
   107      *
       
   108      * @since S60 ?S60_version
       
   109      * @param aMailboxName The name of the mailbox.
       
   110      */ 
       
   111     void ShowAuthenticationQueryL( TFSMailMsgId aMailbox );
       
   112 
       
   113 
       
   114     /**
       
   115      * Searches for a initiator among initiators that
       
   116      * has the same pointer as given parameter.
       
   117      *
       
   118      * @since S60 ?S60_version
       
   119      * @param aInitiator Pointer to searched initiator.
       
   120      * @return Index for found initiator in initiators list.
       
   121      *         KErrNotFound if not found.
       
   122      */ 
       
   123     TInt FindInitiator(
       
   124         CFSNotificationHandlerNotifierInitiator* aInitiator ) const;
       
   125 
       
   126     /**
       
   127      * Searches for a initiator among initiators that
       
   128      * is related to the same mailbox as given as a parameter.
       
   129      *
       
   130      * @since S60 ?S60_version
       
   131      * @param aMailBoxId Mailbox id that the searched initiator
       
   132      *                   is related to.
       
   133      * @return Index for found initiator in initiators list.
       
   134      *         KErrNotFound if not found.
       
   135      */ 
       
   136     TInt FindInitiator( TFSMailMsgId aMailBoxId ) const;
       
   137 
       
   138 
       
   139 // from base class CFSNotificationHandlerBase         
       
   140     virtual void TurnNotificationOn();
       
   141     virtual void TurnNotificationOff();
       
   142 
       
   143 private: // data
       
   144 
       
   145     /**
       
   146      * Active objects handling asynchronous calls to FreestyleEmailNotifier.
       
   147      * Own.
       
   148      */
       
   149 	RPointerArray<CFSNotificationHandlerNotifierInitiator>
       
   150 	    iNotifierInitiators;
       
   151 	
       
   152     };
       
   153 
       
   154 
       
   155 #endif  //__FSMAIL_AUTHENTICATION_HANDLER_H__