williamr@2: // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies). williamr@2: // All rights reserved. williamr@2: // This component and the accompanying materials are made available williamr@2: // under the terms of the License "Symbian Foundation License v1.0" to Symbian Foundation members and "Symbian Foundation End User License Agreement v1.0" to non-members williamr@2: // which accompanies this distribution, and is available williamr@2: // at the URL "http://www.symbianfoundation.org/legal/licencesv10.html". williamr@2: // williamr@2: // Initial Contributors: williamr@2: // Nokia Corporation - initial contribution. williamr@2: // williamr@2: // Contributors: williamr@2: // williamr@2: // Description: williamr@2: // williamr@2: williamr@2: #ifndef __APAID_H__ williamr@2: #define __APAID_H__ williamr@2: williamr@2: #if !defined(__E32BASE_H__) williamr@2: #include williamr@2: #endif williamr@2: #if !defined(__APADEF_H__) williamr@2: #include williamr@2: #endif williamr@2: williamr@2: #include "apmstd.h" williamr@2: williamr@2: williamr@2: // classes defined: williamr@2: class TApaAppIdentifier; williamr@2: class TApaAppEntry; williamr@2: class CApaAppFinder; williamr@2: // williamr@2: // classes referenced: williamr@2: class RReadStream; williamr@2: class RWriteStream; williamr@2: class RFs; williamr@2: // williamr@2: williamr@2: williamr@2: class TApaAppIdentifier williamr@2: /** The identity of an application. williamr@2: williamr@2: An object of this type contains two pieces of information: williamr@2: williamr@2: The application specific UID williamr@2: williamr@2: The file name and extension of the application DLL williamr@2: williamr@2: All persisted documents associated with this application have a stream containing williamr@2: this information. williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see CApaProcess::ReadRootStreamLC() williamr@2: @see CApaProcess::WriteRootStreamL() williamr@2: @see CApaProcess::ReadAppIdentifierL() williamr@2: @see CApaProcess::WriteAppIdentifierL() */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C TApaAppIdentifier(); williamr@2: IMPORT_C TApaAppIdentifier(TUid aAppUidType,const TFileName& aDllName); williamr@2: IMPORT_C void ExternalizeL(RWriteStream& aStream)const; williamr@2: IMPORT_C void InternalizeL(RReadStream& aStream); williamr@2: williamr@2: public: williamr@2: /** The application-specific UID. */ williamr@2: TUid iAppUid; williamr@2: /** The full path name of the application DLL. */ williamr@2: TFileName iFullName; williamr@2: williamr@2: private: williamr@2: TInt iTApaAppIdentifier_Reserved1; williamr@2: }; williamr@2: williamr@2: williamr@2: class TApaAppEntry williamr@2: /** An application entry. williamr@2: williamr@2: An object of this type contains two pieces of information: williamr@2: williamr@2: the full path name of the application DLL williamr@2: williamr@2: the UID type (or compound identifier) of the application DLL. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C TApaAppEntry(); williamr@2: IMPORT_C TApaAppEntry(const TUidType& aAppUidType,const TFileName& aDllName); williamr@2: IMPORT_C void ExternalizeL(RWriteStream& aStream)const; williamr@2: IMPORT_C void InternalizeL(RReadStream& aStream); williamr@2: public: williamr@2: /** The UID type (or compound identifier) of the application DLL. */ williamr@2: TUidType iUidType; williamr@2: /** The full path name of the application DLL. */ williamr@2: TFileName iFullName; williamr@2: private: williamr@2: TInt iTApaAppEntry_Reserved1; williamr@2: }; williamr@2: williamr@2: williamr@2: class TApaAppInfo williamr@2: /** Application information. williamr@2: williamr@2: An object of this type contains four pieces of information: williamr@2: williamr@2: the application specific UID williamr@2: williamr@2: the full path name of the application DLL williamr@2: williamr@2: the application's caption williamr@2: williamr@2: a short caption; how this is used is up to the UI williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C TApaAppInfo(); williamr@2: IMPORT_C TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption); williamr@2: IMPORT_C TApaAppInfo(TUid aAppUid,const TFileName& aDllName,const TApaAppCaption& aCaption,const TApaAppCaption& aShortCaption); williamr@2: IMPORT_C void ExternalizeL(RWriteStream& aStream)const; williamr@2: IMPORT_C void InternalizeL(RReadStream& aStream); williamr@2: public: williamr@2: /** The application specific UID. */ williamr@2: TUid iUid; williamr@2: /** The full path name of the application DLL. */ williamr@2: TFileName iFullName; williamr@2: /** The caption for the application. */ williamr@2: TApaAppCaption iCaption; williamr@2: /** The short caption for the application. */ williamr@2: TApaAppCaption iShortCaption; williamr@2: williamr@2: private: williamr@2: TInt iTApaAppInfo_Reserved1; williamr@2: }; williamr@2: williamr@2: williamr@2: class TApaAppViewInfo williamr@2: /** Contains the basic information about an application view. williamr@2: williamr@2: An object of this type contains two pieces of information: williamr@2: williamr@2: The UID that identifies the view williamr@2: williamr@2: The application's caption. williamr@2: williamr@2: Objects of this type are returned in an array populated by a call to RApaLsSession::GetAppViews(). williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: @see CApaAppViewArray williamr@2: @see TUid */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C TApaAppViewInfo(); williamr@2: IMPORT_C TApaAppViewInfo(TUid aViewUid,const TApaAppCaption& aViewCaption,TInt aScreenMode); williamr@2: IMPORT_C void ExternalizeL(RWriteStream& aStream)const; williamr@2: IMPORT_C void InternalizeL(RReadStream& aStream); williamr@2: public: williamr@2: /** The UID identifying the view. */ williamr@2: TUid iUid; williamr@2: /** The application caption. */ williamr@2: TApaAppCaption iViewCaption; williamr@2: TInt iScreenMode; williamr@2: private: williamr@2: TInt iTApaAppViewInfo_Reserved1; williamr@2: }; williamr@2: williamr@2: williamr@2: /** Defines an array of TApaAppViewInfo objects contained within a flat dynamic williamr@2: buffer. williamr@2: williamr@2: An array of this type is populated with TApaAppViewInfo objects in a call williamr@2: to RApaLsSession::GetAppViews(). williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: typedef CArrayFixFlat CApaAppViewArray; williamr@2: williamr@2: williamr@2: class TApaAppCapability williamr@2: // expandable class - add new members to the end, add them to the end of int/ext also, and increment the version no. williamr@2: // default value for all data members must be 0 williamr@2: /** Application capabilities. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: { williamr@2: public: williamr@2: IMPORT_C static void CopyCapability(TDes8& aDest,const TDesC8& aSource); williamr@2: IMPORT_C void InternalizeL(RReadStream& aStream); williamr@2: IMPORT_C void Internalize7_0L(RReadStream& aStream); // deprecated williamr@2: IMPORT_C void ExternalizeL(RWriteStream& aStream) const; williamr@2: private: williamr@2: IMPORT_C void Externalize7_0L(RWriteStream& aStream) const; // deprecated williamr@2: void DoInternalizeL(RReadStream& aStream, TBool& aLaunchInBackground, TApaAppGroupName& aGroupName); williamr@2: public: williamr@2: // williamr@2: /** Defines an application's support for embeddability. */ williamr@2: enum TEmbeddability { williamr@2: /** An application cannot be embedded. */ williamr@2: ENotEmbeddable=0, williamr@2: /** An application can be run embedded or standalone and can read/write embedded document-content. */ williamr@2: EEmbeddable=1, williamr@2: /** An application can only be run embedded and can read/write embedded document-content. */ williamr@2: EEmbeddableOnly=2, williamr@2: /** An application can be run embedded or standalone and cannot read/write embedded document-content. */ williamr@2: EEmbeddableUiOrStandAlone=5, williamr@2: /** An application can only be run embedded and cannot read/write embedded document-content. */ williamr@2: EEmbeddableUiNotStandAlone=6 }; williamr@2: /** Defines an application's attributes as a set of bit flags. */ williamr@2: enum TCapabilityAttribute williamr@2: { williamr@2: /** If set, the application was built as a DLL, otherwise it was built as an EXE. */ williamr@2: EBuiltAsDll = 0x00000001, williamr@2: /** If set, the application provides control panel functionality. */ williamr@2: EControlPanelItem = 0x00000002, williamr@2: /** If set, the application is not a native executable, and hence the "path" and "extension" (as well as the "name") must be provided in the app_file field of the APP_REGISTRATION_INFO resource. */ williamr@2: ENonNative = 0x00000004 williamr@2: }; williamr@2: public: williamr@2: /** Indicates the extent to which the application can be embedded. */ williamr@2: TEmbeddability iEmbeddability; williamr@2: /** Indicates whether the application is document-based and supports being asked williamr@2: to create a new file. */ williamr@2: TBool iSupportsNewFile; williamr@2: /** Indicates whether the existence of the application should be advertised to the williamr@2: user. If this is set to ETrue, the application does not appear on the Extras williamr@2: Bar (or equivalent). */ williamr@2: TBool iAppIsHidden; // not shown in the Shell etc. williamr@2: /** Allows the application to be launched in the foreground (when set to EFalse) williamr@2: or in the background (when set to ETrue). */ williamr@2: TBool iLaunchInBackground; // Series 60 extension to allow apps to be launched in the background williamr@2: /** Stores the application's logical group name. */ williamr@2: TApaAppGroupName iGroupName; // Series 60 extension to allow apps to be categorized according a logical group name, e.g. 'games' williamr@2: /** Indicates the application attributes. One or more values from TCapabilityAttribute may be specified. */ williamr@2: TUint iAttributes; williamr@2: private: williamr@2: enum { EVersion=4 }; williamr@2: private: williamr@2: TInt iTApaAppCapability_Reserved1; williamr@2: }; williamr@2: williamr@2: /** Packages the TApaAppCapability class. williamr@2: williamr@2: @publishedAll williamr@2: @released */ williamr@2: typedef TPckgBuf TApaAppCapabilityBuf; williamr@2: williamr@2: williamr@2: /** Filter used to define the subset of applications returned by RApaLsSession::GetNextApp() williamr@2: williamr@2: @publishedAll williamr@2: @released williamr@2: */ williamr@2: class TApaEmbeddabilityFilter williamr@2: { williamr@2: public: williamr@2: IMPORT_C TApaEmbeddabilityFilter(); williamr@2: IMPORT_C void AddEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability); williamr@2: IMPORT_C TBool MatchesEmbeddability(TApaAppCapability::TEmbeddability aEmbeddability) const; williamr@2: private: williamr@2: TUint iEmbeddabilityFlags; williamr@2: private: williamr@2: TInt iTApaEmbeddabilityFilter_Reserved1; williamr@2: }; williamr@2: williamr@2: williamr@2: class CApaAppFinder : public CBase williamr@2: /** williamr@2: @publishedPartner williamr@2: @deprecated williamr@2: */ williamr@2: { williamr@2: public: williamr@2: virtual void FindAllAppsL()=0; // sets up a scan for all apps williamr@2: virtual TBool NextL(TApaAppEntry& aEntry)=0; // increments a scan for all apps williamr@2: virtual TFileName FindAppL(const TDesC& aFileName,TUid aFileUid)=0; // searches for a particular app - should support wildcards in aFileName williamr@2: // williamr@2: virtual TFileName DefaultAppInfoFileName()const=0; // should return the full name, path and drive of the default icon file williamr@2: protected: williamr@2: IMPORT_C CApaAppFinder(); williamr@2: williamr@2: private: williamr@2: IMPORT_C virtual void CApaAppFinder_Reserved1(); williamr@2: IMPORT_C virtual void CApaAppFinder_Reserved2(); williamr@2: }; williamr@2: williamr@2: /** williamr@2: The uid for the Open service. williamr@2: williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: const TUid KOpenServiceUid = { 0x10208DCA }; williamr@2: williamr@2: /** Application service information. williamr@2: williamr@2: Encapsulates a service UID and associated opaque data. williamr@2: williamr@2: An instance of this class provides information about williamr@2: a specific implementation of the service identified by williamr@2: the encapsulated service UID. williamr@2: williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: class TApaAppServiceInfo williamr@2: { williamr@2: public: williamr@2: TApaAppServiceInfo(); williamr@2: TApaAppServiceInfo(TUid aUid, CArrayFixFlat* aDataTypes, williamr@2: HBufC8* aOpaqueData); williamr@2: void ExternalizeL(RWriteStream& aStream) const; williamr@2: void InternalizeL(RReadStream& aStream); williamr@2: void Release(); williamr@2: CArrayFixFlat& DataTypes(); williamr@2: IMPORT_C TUid Uid() const; williamr@2: IMPORT_C const CArrayFixFlat& DataTypes() const; williamr@2: IMPORT_C const TDesC8& OpaqueData() const; williamr@2: private: williamr@2: TUid iUid; williamr@2: CArrayFixFlat* iDataTypes; williamr@2: HBufC8* iOpaqueData; williamr@2: TInt iTApaAppServiceInfo; williamr@2: }; williamr@2: williamr@2: /** Application service information array. williamr@2: williamr@2: Owns an array of TApaAppServiceInfo objects. williamr@2: williamr@2: @see TApaAppServiceInfo williamr@2: @publishedPartner williamr@2: @released williamr@2: */ williamr@2: class CApaAppServiceInfoArray : public CBase williamr@2: { williamr@2: protected: williamr@2: CApaAppServiceInfoArray(); williamr@2: public: williamr@2: /** Provides access to the encapsulated array of williamr@2: TApaAppServiceInfo objects. williamr@2: williamr@2: @return A generic array of TApaAppServiceInfo objects. */ williamr@2: virtual TArray Array()=0; williamr@2: williamr@2: private: williamr@2: IMPORT_C virtual void CApaAppServiceInfoArray_Reserved1(); williamr@2: IMPORT_C virtual void CApaAppServiceInfoArray_Reserved2(); williamr@2: williamr@2: private: williamr@2: TInt iCApaAppServiceInfoArray_Reserved1; williamr@2: }; williamr@2: williamr@2: #endif