syncmlfw/syncmlnotifier/inc/SyncMLNotifierBase.h
branchRCL_3
changeset 26 19bba8228ff0
parent 0 b497e44ab2fc
equal deleted inserted replaced
25:b183ec05bd8c 26:19bba8228ff0
       
     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:  Declares SyncML notifiers base class.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CSYNCMLNOTIFIERBASE_H
       
    21 #define CSYNCMLNOTIFIERBASE_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <SyncMLNotifier.h>
       
    25 
       
    26 // CONSTANTS
       
    27 // Channel for app starter notifier
       
    28 const TUid KSmlAppLaunchChannel = {0x101F8769};
       
    29 
       
    30 // Channel for server dialog notifier
       
    31 const TUid KSmlDlgChannel       = {0x101F876A};
       
    32 const TUid KSmlFwUpdChannel     = {0x102072BF}; // Channel for firmware update notifier
       
    33 
       
    34 // Number of notifiers
       
    35 const TInt KSmlNotifierArrayIncrement = 3;  // Number of notifiers
       
    36 
       
    37 // FORWARD DECLARATIONS
       
    38 class CEikonEnv;
       
    39 
       
    40 // CLASS DECLARATION
       
    41 
       
    42 /**
       
    43 * The base class for the SyncML notifiers.
       
    44 *
       
    45 *  @lib SyncMLNotifier
       
    46 *  @since Series 60 3.0
       
    47 */
       
    48 NONSHARABLE_CLASS( CSyncMLNotifierBase ) : public CActive,
       
    49                                            public MEikSrvNotifierBase2
       
    50     {
       
    51     public:  // Constructors and destructor
       
    52     
       
    53         /**
       
    54         * Destructor.
       
    55         */
       
    56         virtual ~CSyncMLNotifierBase();
       
    57 
       
    58 
       
    59     protected:  // New functions
       
    60         
       
    61         /**
       
    62         * Used in asynchronous notifier launch to store received parameters 
       
    63         * into members variables and make needed initializations.        
       
    64         * @since Series 60 3.0
       
    65         * @param aBuffer A buffer containing received parameters
       
    66         * @param aReturnVal The return value to be passed back.
       
    67         * @param aMessage Should be completed when the notifier is deactivated.
       
    68         * @return None.
       
    69         */
       
    70         virtual void GetParamsL(const TDesC8& aBuffer, 
       
    71                                       TInt aReplySlot, 
       
    72                                 const RMessagePtr2& aMessage) = 0;
       
    73 
       
    74         /**
       
    75         * A utility function for requesting the activation of lights.
       
    76         * @since Series 60 3.0
       
    77         * @param None.
       
    78         * @return None.
       
    79         */
       
    80         void TurnLightsOn();
       
    81 
       
    82         /**
       
    83         * A utility function for checking whether autolock is on.
       
    84         * @since Series 60 3.0
       
    85         * @param None.
       
    86         * @return A boolean according to autolock state.
       
    87         */
       
    88         TBool AutoLockOnL();
       
    89 
       
    90 		/**
       
    91 		* A function for checking the status of Apps key.
       
    92         * @since Series 60 3.0
       
    93 		* @param aEnable A Boolean according to Apps key status
       
    94 		* @return None.
       
    95 		*/
       
    96 		void SuppressAppSwitching( TBool aEnable );
       
    97 
       
    98         /**
       
    99         * By default Symbian 2nd phase constructor is private.
       
   100         */
       
   101         virtual void ConstructL();
       
   102 
       
   103     protected:  // Functions from base classes
       
   104 
       
   105         /**
       
   106         * From CActive Gets called when a request completes.
       
   107         * @param None.
       
   108         * @return None.
       
   109         */
       
   110         virtual void RunL() = 0;
       
   111 
       
   112         /**
       
   113         * From CActive Gets called when a leave occurres in RunL.
       
   114         * @param aError Symbian OS errorcode.
       
   115         * @return None.
       
   116         */
       
   117         virtual TInt RunError( TInt aError );
       
   118 
       
   119         /**
       
   120         * From MEikSrvNotifierBase2 Called when a notifier is first loaded 
       
   121         * to allow any initial construction that is required.
       
   122         * @param None.
       
   123         * @return A structure containing priority and channel info.
       
   124         */
       
   125         virtual TNotifierInfo RegisterL() = 0;
       
   126         
       
   127         /**
       
   128         * From MEikSrvNotifierBase2 The notifier has been deactivated 
       
   129         * so resources can be freed and outstanding messages completed.
       
   130         * @param None.
       
   131         * @return None.
       
   132         */
       
   133         virtual void Cancel();
       
   134 
       
   135     protected:
       
   136 
       
   137         /**
       
   138         * C++ default constructor.
       
   139         */
       
   140         CSyncMLNotifierBase();
       
   141 
       
   142     private: // Functions from base classes        
       
   143         
       
   144         /**
       
   145         * From MEikSrvNotifierBase2 Called when all resources allocated 
       
   146         * by notifiers should be freed.
       
   147         * @param None.
       
   148         * @return None.
       
   149         */
       
   150         virtual void Release();
       
   151 
       
   152         /**
       
   153         * From MEikSrvNotifierBase2 Return the priority a notifier takes 
       
   154         * and the channels it acts on.
       
   155         * @param None.
       
   156         * @return A structure containing priority and channel info.
       
   157         */
       
   158         virtual TNotifierInfo Info() const;
       
   159 
       
   160         /**
       
   161         * From MEikSrvNotifierBase2 Synchronic notifier launch.        
       
   162         * @param aBuffer Received parameter data.
       
   163         * @return A pointer to return value.
       
   164         */
       
   165         virtual TPtrC8 StartL( const TDesC8& aBuffer );
       
   166         
       
   167         /**
       
   168         * From MEikSrvNotifierBase2 Asynchronic notifier launch.
       
   169         * @param aBuffer A buffer containing received parameters
       
   170         * @param aReturnVal The return value to be passed back.
       
   171         * @param aMessage Should be completed when the notifier is deactivated.
       
   172         * @return A pointer to return value.
       
   173         */
       
   174         virtual void StartL( const TDesC8& aBuffer,
       
   175                                    TInt aReplySlot,
       
   176                              const RMessagePtr2& aMessage );
       
   177         
       
   178         /**
       
   179         * From MEikSrvNotifierBase2 Updates a currently active notifier.
       
   180         * @param aBuffer The updated data.
       
   181         * @return A pointer to return value.
       
   182         */
       
   183         virtual TPtrC8 UpdateL( const TDesC8& aBuffer );       
       
   184 
       
   185         /**
       
   186         * From CActive Gets called when a request is cancelled.
       
   187         * @param None.
       
   188         * @return None.
       
   189         */
       
   190         virtual void DoCancel();   
       
   191 		
       
   192     protected:  // Data
       
   193         // Received message
       
   194         RMessagePtr2    iMessage;
       
   195         
       
   196         // Reply slot
       
   197         TInt            iReplySlot;
       
   198 
       
   199         // Flag for releasing messages
       
   200         TBool           iNeedToCompleteMessage;
       
   201         
       
   202         // Notifier parameters structure
       
   203         TNotifierInfo   iInfo;
       
   204         
       
   205         // Local eikonenv
       
   206         CEikonEnv*      iEikEnv;
       
   207 
       
   208         // Apps key status 
       
   209         TBool           iAppsKeyBlocked;
       
   210 
       
   211         // Flag for eikon env.
       
   212         TInt            iResourceFileFlag;
       
   213     };
       
   214 
       
   215 #endif      // CSYNCMLNOTIFIERBASE_H
       
   216             
       
   217 // End of File