serviceproviders/sapi_applicationmanager/appmanagerservice/inc/appmanagerservice.h
changeset 19 989d2f495d90
equal deleted inserted replaced
14:a36b1e19a461 19:989d2f495d90
       
     1 /*
       
     2 * Copyright (c) 2007-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 the License "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 Class provides the core functionality to Application Manager
       
    15 *				 SAPI
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __APPMANAGERSERVICE_H
       
    22 #define __APPMANAGERSERVICE_H
       
    23 
       
    24 
       
    25 #include <apgcli.h>
       
    26 
       
    27 #include "appobserver.h"
       
    28 #include "appmanagercommon.h"
       
    29 
       
    30 
       
    31 class CLauncherObserver;
       
    32 class CLauncher;
       
    33 class CAsynchRequestManager;
       
    34  
       
    35 /**
       
    36 * This Class provides the core functionality of
       
    37 * Application Manager SAPI
       
    38 *
       
    39 * @since  Series60 v3.2
       
    40 */
       
    41 class CAppManagerService : public CBase
       
    42     {
       
    43 
       
    44     public:
       
    45 
       
    46     	/**
       
    47         * Returns the instance of CAppManagerService.
       
    48         * @since  Series60 v3.2
       
    49         * @param  void
       
    50         * @return CAppManagerService* return the instance of CAppManagerService class
       
    51         */
       
    52         IMPORT_C static CAppManagerService* NewL();
       
    53 
       
    54         /**
       
    55     	* Destructor.
       
    56     	*/
       
    57         virtual ~CAppManagerService();
       
    58 
       
    59      	/**
       
    60         * This function Launch the given Application
       
    61         * @since  Series60 v3.2
       
    62         * @param  aAppId String to identify the application 
       
    63         * @param  aCmdLine command line argument to send to launching application
       
    64         * @param  aOptions specify the various attribut of application e.g its launching mode,document and postion
       
    65         * @param  aObserver callback for getting the notifaction when the launched application dies        
       
    66         */
       
    67        	IMPORT_C void LaunchApplicationL( const TDesC& aAppId,
       
    68                                           const TDesC8& aCmdLine,
       
    69                                           const TOptions& aOptions,
       
    70                                           MAppObserver* aObserver = NULL,
       
    71                                           TInt32 aTransactionID = 0  );
       
    72 
       
    73        	/**
       
    74         * This function Launch the given content
       
    75         * succeed.
       
    76         * @since  Series60 v3.2
       
    77         * @param  aCriteria structure for identifying the application(it can contain Handle or Path of the doc) 
       
    78         * @param  aMimeType MimeType of Document
       
    79         * @param  aOptions specify the various attribute of application e.g its launching mode
       
    80         * @param  aFileName Filled by the api if creates the new document
       
    81         * @param  aObserver callback for getting the notifaction when the launched application dies.
       
    82         * @return void        
       
    83         */
       
    84        	IMPORT_C void LaunchDocumentL( TDocument& aCriteria,
       
    85        	                               const TDesC8& aMimeType,
       
    86        	                               const TOptions& aOptions ,
       
    87        	                               TDesC& aFileName,
       
    88        	                               MAppObserver* aObserver = NULL,
       
    89        	                               TInt32 aTransactionID = 0 );
       
    90 
       
    91          /**
       
    92         * This function gives the list of all application or installed packages
       
    93         * as per content type and filter parameter.
       
    94         * @since  Series60 v3.2
       
    95         * @param  aContent      It contains the Content type.
       
    96         * @param  aFilterParam  Filter parameter for finding the handler application
       
    97         * @return MIterator     Iterator interface provided by dll 
       
    98         */
       
    99 		IMPORT_C void  GetListL( MIterator*& aIterator, 
       
   100 		                         const TDesC& aContent, 
       
   101 		                         const CFilterParam*  aFilterParam =NULL  );
       
   102 
       
   103 
       
   104 
       
   105 
       
   106         /**
       
   107         * Cancel the pending asynchronous request
       
   108         * @since  Series60 v3.2
       
   109         * @param  aTransactionID  Unique number to identify the request
       
   110         * @return TInt System wide error code 
       
   111         */
       
   112         IMPORT_C TInt Cancel( TInt32 aTransactionID );
       
   113 
       
   114 
       
   115         /**
       
   116         * Validates the given filepath, this will leave if the file path is not valid
       
   117         * @param  aFilePath  a file path to validate
       
   118         */
       
   119         static void ValidateFilePathL(const TDesC& aFilePath); 
       
   120 
       
   121 
       
   122 
       
   123    	private:
       
   124 
       
   125 
       
   126    		/**
       
   127         * Two-phased constructor
       
   128         * @since  Series60 v3.2
       
   129         * @param  void
       
   130         * @return void
       
   131         */
       
   132         void ConstructL();
       
   133 
       
   134 
       
   135     private:
       
   136         /**
       
   137         * session for application architecture
       
   138         */
       
   139         RApaLsSession iApaLsSession;
       
   140 
       
   141         /**
       
   142         * instance of class which handles all launching request
       
   143         */
       
   144         CLauncher* iLauncher;
       
   145 
       
   146 
       
   147         /**
       
   148         * instance of class which handles Trans ID of all Asynch request
       
   149         */
       
   150         CAsynchRequestManager* iAsynchReqMngr;
       
   151         
       
   152         
       
   153      
       
   154     
       
   155       };
       
   156 
       
   157 #endif __APPMANAGERSERVICE_H