IMPSengine/imlauncher/inc/imlauncher.h
changeset 0 094583676ce7
equal deleted inserted replaced
-1:000000000000 0:094583676ce7
       
     1 /*
       
     2 * Copyright (c) 2004 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: Client application plugin loader.
       
    15 *
       
    16 */
       
    17 
       
    18 
       
    19 
       
    20 #ifndef CIMLAUNCHER_H
       
    21 #define CIMLAUNCHER_H
       
    22 
       
    23 //  INCLUDES
       
    24 #include <e32base.h>
       
    25 #include    "impsservercommon.h"
       
    26 
       
    27 // CONSTANTS
       
    28 _LIT( KLauncherPanic, "IM Launcher Panic" );
       
    29 
       
    30 // MACROS
       
    31 
       
    32 // DATA TYPES
       
    33 enum TLauncherPanic
       
    34     {
       
    35     ECreateTrapCleanup = 1
       
    36     };
       
    37 
       
    38 
       
    39 // FORWARD DECLARATIONS
       
    40 class CImLauncherPlugin;
       
    41 class CImLauncher;
       
    42 
       
    43 // CLASS DECLARATION
       
    44 
       
    45 class CImShutDownTimer : public CTimer
       
    46     {
       
    47     public:
       
    48         static CImShutDownTimer* NewL( CImLauncher* aLauncher, TInt aPriority );
       
    49 
       
    50         /**
       
    51         * Destructor
       
    52         */
       
    53         virtual ~CImShutDownTimer();
       
    54 
       
    55     protected:
       
    56 
       
    57         // From base class
       
    58         void RunL();
       
    59 
       
    60         /**
       
    61         * Constructor
       
    62         * @param aServer WV engine server
       
    63         * @param aPriority Active objects priority
       
    64         */
       
    65         CImShutDownTimer( CImLauncher* aLauncher, TInt aPriority );
       
    66 
       
    67         void ConstructL();
       
    68 
       
    69     protected:
       
    70         CImLauncher*    iLauncher;
       
    71     };
       
    72 
       
    73 
       
    74 
       
    75 /**
       
    76 *  Client application plugin loader
       
    77 *
       
    78 *  @since 2.6
       
    79 */
       
    80 class CImLauncher : public CActive
       
    81     {
       
    82     public:  // Constructors and destructor
       
    83 
       
    84         /**
       
    85         * Two-phased constructor.
       
    86         */
       
    87         static CImLauncher* NewL();
       
    88 
       
    89         /**
       
    90         * Destructor.
       
    91         */
       
    92         virtual ~CImLauncher();
       
    93 
       
    94     public: // New functions
       
    95 
       
    96         /**
       
    97         * Loads the client application pluging and start the application
       
    98         * @since 2.6
       
    99         * @param aParams (Application ID, SAP URL and User ID)
       
   100         */
       
   101         void StartL( TImpsLaunchParams& aThreadParams );
       
   102 
       
   103         static TInt ThreadFunction( TImpsLaunchParams& aThreadParams );
       
   104 
       
   105     protected:  // New functions
       
   106 
       
   107         /**
       
   108         * Custom panic funtion
       
   109         * @since 2.6
       
   110         * @param aPanicCode
       
   111         */
       
   112         static void Panic( TLauncherPanic aPanicCode );
       
   113 
       
   114 
       
   115         /**
       
   116         * TimeOut handler function
       
   117         * @since 2.6
       
   118         */
       
   119         void TimedOut();
       
   120 
       
   121     protected:  // Functions from base classes
       
   122         /**
       
   123         * From CActive
       
   124         */
       
   125         void DoCancel();
       
   126         void RunL();
       
   127         TInt RunError( TInt aError );
       
   128 
       
   129     private:
       
   130 
       
   131         /**
       
   132         * C++ default constructor.
       
   133         */
       
   134         CImLauncher();
       
   135 
       
   136         /**
       
   137         * By default Symbian 2nd phase constructor is private.
       
   138         */
       
   139         void ConstructL();
       
   140 
       
   141     private:    // Data
       
   142         CImLauncherPlugin*      iPlugin; // client application ECom plugin
       
   143         CImShutDownTimer*       iTimer; // shut down timer
       
   144         TInt                    iReturnValue; // retval to the thread starter
       
   145 
       
   146         friend class CImShutDownTimer;
       
   147     };
       
   148 
       
   149 #endif      // CIMLAUNCHER_H   
       
   150 
       
   151 // End of File