ipsservices/ipssosplugin/inc/ipsplgsettingsobserver.h
changeset 0 8466d47a6819
child 18 578830873419
equal deleted inserted replaced
-1:000000000000 0:8466d47a6819
       
     1 /*
       
     2 * Copyright (c) 2007-2008 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:  Email settings observer class
       
    15 *
       
    16 */
       
    17 
       
    18 #ifndef IPSPLGSETTINGSOBSERVER_H
       
    19 #define IPSPLGSETTINGSOBSERVER_H
       
    20 
       
    21 //  INCLUDES
       
    22 
       
    23 
       
    24 // FORWARD DECLARATIONS
       
    25 class CRepository;
       
    26 class MFSMailEventObserver;
       
    27 class MIpsPlgSettingsObserverCallback;
       
    28 
       
    29 const TUid KCRUidExtendedSettings   = {0x102071F1};
       
    30 
       
    31 // CLASS DECLARATION
       
    32 
       
    33 /**
       
    34 * MIpsPlgSettingsObserverCallback
       
    35 */
       
    36 class MIpsPlgSettingsObserverCallback
       
    37     {
       
    38 public:    
       
    39     virtual void SettingsChangedL( TFSMailMsgId aAccount )=0;
       
    40     };
       
    41 
       
    42 /**
       
    43 * CIpsPlgSettingsObserver
       
    44 */
       
    45 class CIpsPlgSettingsObserver : public CActive
       
    46     {
       
    47 public:  // Constructors and destructor
       
    48     
       
    49     /**
       
    50     * Two-phased constructor.
       
    51     *
       
    52     */
       
    53     static CIpsPlgSettingsObserver* NewL( 
       
    54         TFSMailMsgId aAccount,
       
    55         CRepository& aCenRep,
       
    56         MIpsPlgSettingsObserverCallback& aIPSCallback );
       
    57     
       
    58     /**
       
    59     * Destructor.
       
    60     */
       
    61     virtual ~CIpsPlgSettingsObserver();
       
    62 
       
    63     /**
       
    64     *
       
    65     */
       
    66     void SetKeyAndActivateL( 
       
    67         TUint32 aKey, 
       
    68         const RPointerArray<MFSMailEventObserver>& aObservers );
       
    69     
       
    70     /**
       
    71     *
       
    72     */
       
    73     void UnActivate( );    
       
    74     
       
    75     /**
       
    76     *
       
    77     */
       
    78     TFSMailMsgId MailboxId();
       
    79 
       
    80 private:
       
    81 
       
    82     /**
       
    83     * Private C++ constructor.
       
    84     *
       
    85     */
       
    86     CIpsPlgSettingsObserver( 
       
    87         TFSMailMsgId aAccount,
       
    88         CRepository& aCenRep,
       
    89         MIpsPlgSettingsObserverCallback& aIPSCallback );
       
    90 
       
    91 private:
       
    92 
       
    93     void ConstructL();
       
    94 
       
    95     /**
       
    96     * From CActive
       
    97     */
       
    98     void RunL();
       
    99 
       
   100     /**
       
   101     * From CActive
       
   102     */
       
   103     void DoCancel();
       
   104     
       
   105     /**
       
   106 	* Function to handle error during running the operation
       
   107 	* @since Series60 2.6
       
   108 	* @return KErrNone, when error has been handled
       
   109 	*/
       
   110 	virtual TInt RunError( TInt aError );
       
   111 
       
   112     /**
       
   113     * 
       
   114     */	
       
   115 	void Activate();
       
   116     
       
   117 private: // Data
       
   118 
       
   119     CRepository&            iCenRep;        
       
   120     TUint32                 iKey;
       
   121     TFSMailMsgId            iAccount;
       
   122     
       
   123     // pointers not ovned
       
   124     RPointerArray<MFSMailEventObserver>  iFSObservers;
       
   125     MIpsPlgSettingsObserverCallback&     iIPSCallback;
       
   126         
       
   127     };
       
   128 
       
   129 #endif      // IPSPLGSETTINGSOBSERVER_H
       
   130             
       
   131 // End of File