serviceproviders/sapi_applicationmanager/appmanagerservice/inc/appmanagercommon.h
changeset 5 989d2f495d90
child 46 5146369cfdc9
equal deleted inserted replaced
1:a36b1e19a461 5: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:  It contains the declarations of interface classes and filter param class
       
    15 *				 				 
       
    16 *
       
    17 */
       
    18 
       
    19 
       
    20 
       
    21 #ifndef __APPMANAGERCOMMON_H__
       
    22 #define __APPMANAGERCOMMON_H__
       
    23 
       
    24 #include <e32cmn.h> // TDesC
       
    25 #include <e32base.h> // CBase
       
    26 #include <f32file.h> // Rfile
       
    27 #include <e32des16.h>
       
    28 #include <e32des8.h>
       
    29 
       
    30 class CLauncherObserver;
       
    31 const TInt KArrayGranularity = 5;
       
    32 
       
    33 _LIT(KForeground ,"Foreground");
       
    34 _LIT(KStandalone,"Standalone");
       
    35 /**
       
    36 * This is an interface class which provides the information about the installed application or package as per 
       
    37 * content type.
       
    38 *
       
    39 * @since  Series60 v3.2
       
    40 */
       
    41 
       
    42 class MInfoMap
       
    43 	{
       
    44 
       
    45 	public :
       
    46 
       
    47 		 /**
       
    48 		* Finds the value as per key.
       
    49 		* @since  Series60 v3.2
       
    50 		* @param  akey  Descriptor defining key to findout.
       
    51 		* @param  aVal  On return it contains the value as per key 
       
    52 		* @return TBool If key argument is correct then returns ETrue or else EFalse
       
    53 		*/
       
    54 		
       
    55 		
       
    56 		virtual TBool FindL(const TDesC8& akey ,TPtrC& aVal)=0;
       
    57 
       
    58 		 /**
       
    59 		* Gives the total number of keys.
       
    60 		* @since  Series60 v3.2
       
    61 		* @param  void
       
    62 		* @return TInt Number of keys
       
    63 		*/
       
    64 		virtual TInt Count()const =0 ;
       
    65 
       
    66 		 /**
       
    67 		* Gives the key present at a given index.
       
    68 		* @since  Series60 v3.2
       
    69 		* @param  aIndex   Index value 
       
    70 		* @param  aKeyVal  Value present at the given index.	
       
    71 		* @return TBool    Returns ETrue if valid index is given otherwise returns EFalse
       
    72 		*/
       
    73 		virtual TBool AtL(TInt aIndex, TDes8& aFndKey)=0;
       
    74 
       
    75 		 /**
       
    76 		* Destructor.
       
    77 		* @since  Series60 v3.2
       
    78 		*/
       
    79 		virtual ~MInfoMap();
       
    80 
       
    81 	};
       
    82 
       
    83 /**
       
    84 * This is an interface class which provides the iterator 
       
    85 *
       
    86 * @since  Series60 v3.2
       
    87 
       
    88 */
       
    89 class MIterator 
       
    90 	{
       
    91 	public: 
       
    92 	
       
    93 		/**
       
    94 		* Destructor.
       
    95 		* @since  Series60 v3.2
       
    96 		*/
       
    97 		virtual ~MIterator();
       
    98 		
       
    99 		 /**
       
   100 		* Gives the next apllication info map, on the iterator list
       
   101 		* @since  Series60 v3.2
       
   102 		* @param  aMap     Instance of MInfoMap 
       
   103 		* @return TBool    Returns ETrue if next application is present in the on the iterator list else 
       
   104 		*				   returns EFalse.
       
   105 		*/
       
   106 		virtual TBool NextL(MInfoMap*& aMap)=0;
       
   107 
       
   108 	
       
   109 		
       
   110 		/**
       
   111         * Resets the iterator. 
       
   112         *
       
   113         */
       
   114         virtual void Reset() = 0 ;
       
   115 
       
   116 	};
       
   117 
       
   118 
       
   119 /**
       
   120 * This class is filter parameter for GetList operation  
       
   121 *
       
   122 * @since  Series60 v3.2
       
   123 */
       
   124 
       
   125 class CFilterParam : public CBase
       
   126 	{
       
   127 
       
   128 	public :
       
   129 
       
   130 		 /**
       
   131 		* Returns the instance of CFilterParam.
       
   132 		* @since  Series60 v3.2
       
   133 		* @return CFilterParam* return the instance of CFilterParam class
       
   134 		*/
       
   135 		IMPORT_C static  CFilterParam* NewL(); 
       
   136 
       
   137 		 /**
       
   138 		* Sets the document name.
       
   139 		* @since  Series60 v3.2
       
   140 		* @param  aDocName   document name
       
   141 		* @return void
       
   142 		*/
       
   143 		IMPORT_C void SetDocName(const TDesC& aDocName) ;
       
   144 
       
   145 		 /**
       
   146 		* Gives the document name
       
   147 		* @since  Series60 v3.2
       
   148 		* @param  void
       
   149 		* @return TPtrC points to the document name.
       
   150 		*/
       
   151 		IMPORT_C TPtrC DocName() const ;
       
   152 		
       
   153 		 /**
       
   154 		* Sets the mimetype.
       
   155 		* @since  Series60 v3.2
       
   156 		* @param  aMimeType   mimetype
       
   157 		* @return void
       
   158 		*/
       
   159 		IMPORT_C void SetmimeType(const TDesC8& aMimeType) ;
       
   160 
       
   161 
       
   162 		 /**
       
   163 		* Gives the mimetype
       
   164 		* @since  Series60 v3.2
       
   165 		* @param  void
       
   166 		* @return TPtrC8 points to the document name.
       
   167 		*/
       
   168 		IMPORT_C TPtrC8 MimeType() const;
       
   169 
       
   170 	private :
       
   171 		
       
   172         /**
       
   173     	* Constructor.
       
   174     	*/
       
   175 		CFilterParam();
       
   176         /**
       
   177     	* Destructor.
       
   178     	*/
       
   179 		~CFilterParam();
       
   180 
       
   181 	private :
       
   182 
       
   183         /**
       
   184         * Document name
       
   185         */  
       
   186 		HBufC* iDocumentName;
       
   187 
       
   188         /**
       
   189         * MimeType
       
   190         */  
       
   191 		HBufC8* iMimeType;
       
   192 
       
   193 	};
       
   194 
       
   195 /**
       
   196 * This Class is used to contain the Document to launch in any form
       
   197 * 
       
   198 * @since  Series60 v3.2
       
   199 */
       
   200 
       
   201 class TDocument
       
   202 {
       
   203     public:
       
   204         /**
       
   205         * Constructor
       
   206         * @since  Series60 v3.2
       
   207         */
       
   208         TDocument():iPath( KNullDesC )
       
   209         {
       
   210 
       
   211     	}
       
   212 
       
   213     public:	
       
   214 
       
   215         RFile iHandle;
       
   216 	   	TPtrC iPath;
       
   217 
       
   218 };
       
   219 
       
   220 
       
   221 /**
       
   222 * This Class is used to contain the options for launching application
       
   223 * e.g its postion,launching mode, document to send to launcing 
       
   224 * application 
       
   225 * 
       
   226 * @since  Series60 v3.2
       
   227 */
       
   228 
       
   229 class TOptions
       
   230 {
       
   231 
       
   232     public:
       
   233         /**
       
   234         * Constructor
       
   235         * @since  Series60 v3.2
       
   236         */
       
   237         TOptions():iDocument( KNullDesC),
       
   238         		   iMode( KStandalone ),
       
   239         		   iPostion( KForeground )
       
   240         {
       
   241 
       
   242     	}
       
   243 
       
   244     public:	
       
   245 
       
   246         TPtrC iDocument;
       
   247 		TPtrC iMode;
       
   248 		TPtrC iPostion;
       
   249 };
       
   250 
       
   251 
       
   252 /**
       
   253  * Structure for storing transaction id and associated active object.
       
   254 */
       
   255 class TAsyncRequestInfo
       
   256 	{
       
   257 	
       
   258 	
       
   259 	 public:
       
   260         /**
       
   261         * Constructor
       
   262         * @since  Series60 v3.2
       
   263         * @param void
       
   264         * @return void
       
   265         */
       
   266         TAsyncRequestInfo():iTransactionId( 0 ),
       
   267         		            iAsyncObj( NULL )
       
   268         {
       
   269 
       
   270     	}
       
   271 
       
   272     /**
       
   273      * TransactionId
       
   274     */
       
   275 	TInt32 iTransactionId;
       
   276 
       
   277     /**
       
   278      * Active object pointer
       
   279     */
       
   280 	CLauncherObserver* iAsyncObj;
       
   281 	};	
       
   282 	
       
   283 	
       
   284 	
       
   285 enum TAppOperationEvent
       
   286     {
       
   287     // Operation is completed
       
   288     EAppComplete = 0x0,
       
   289     
       
   290     // Operation is canceled
       
   291     EAppCancel = 0x1
       
   292     };
       
   293 
       
   294 #endif