Symbian Developer Library

SYMBIAN OS V6.1 EDITION FOR C++

[Index] [Glossary] [Previous] [Next]



Location: apgcli.h
Link against: apgrfx.lib

Class RApaLsSession

RApaLsSession

Support

Supported from 5.0

Description

A session with the Application Architecture server.

This server provides system-wide access to a device's cached list of applications. If the device does not start the server, then all client attempts to connect fail.

Derivation

RApaLsSessionA session with the Application Architecture server
RHandleBaseHandle to an object
RSessionBaseClient-side handle to a session with a server

Defined in RApaLsSession:
ELaunchNewApp, AppCount(), AppForDataType(), AppForDocument(), Connect(), CreateDocument(), ESwitchFiles, ETemporarilyIconic, EmbeddableAppCount(), GetAcceptedConfidence(), GetAllApps(), GetAppCapability(), GetAppIcon(), GetAppIconSizes(), GetAppInfo(), GetAppOwnedFiles(), GetAppViewIcon(), GetAppViews(), GetEmbeddableApps(), GetMaxDataBufSize(), GetNextApp(), GetSupportedDataTypesL(), IsProgram(), RecognizeData(), RecognizeSpecificData(), SetAcceptedConfidence(), SetMaxDataBufSize(), StartApp(), StartDocument(), TLaunchType, Version()

Inherited from RHandleBase:
Close(), Duplicate(), Handle(), SetHandle()

Inherited from RSessionBase:
Attach(), CreateSession(), EAutoAttach, EExplicitAttach, Send(), SendReceive(), SetRetry(), Share(), TAttachMode


Server connection


Connect()

TInt Connect();

Description

Connects a client to the Application Architecture server, creating a session with that server.

Return value

TInt

KErrNone if successful; otherwise, one of the system-wide error codes.


Version()

TVersion Version() const;

Description

Gets the current version of the Application Architecture server.

Return value

TVersion

The version number.

[Top]


Application information


AppCount()

TInt AppCount(TInt& aCount) const;

Description

Gets the total number of applications.

Parameters

TInt& aCount

On return, the total number of applications.

Return value

TInt

KErrNone if successful, otherwise one of the system-wide error codes.


EmbeddableAppCount()

TInt EmbeddableAppCount(TInt& aCount) const;

Description

Gets the total number of embeddable applications.

Parameters

TInt& aCount

On return, the total number of embeddable applications.

Return value

TInt

KErrNone, if successful, otherwise one of the system-wide error codes.


GetAllApps()

TInt GetAllApps() const;

Description

Initialises the process of getting all applications in the cached list.

A call to this function is followed by subsequent and repeated calls to GetNextApp() to retrieve all applications in the cached list.

Return value

TInt

KErrNone, if successful, otherwise one of the system-wide error codes.


GetEmbeddableApps()

TInt GetEmbeddableApps() const;

Description

Initialises the process of getting all embeddable applications in the cached list.

A call to this function is followed by subsequent and repeated calls to GetNextApp() to retrieve all embeddable applications in the cached list.

Return value

TInt

KErrNone, if successful, otherwise one of the system-wide error codes.


GetNextApp()

TInt GetNextApp(TApaAppInfo& aInfo) const;

Description

Gets information about the next application or embeddable application from the cached list.

A sequence of calls to this function must always be preceded by a call to either GetAllApps() or GetEmbeddableApps().

Parameters

TApaAppInfo& aInfo

On return, contains application information.

Return value

TInt

KErrNone, if successful; ENoMoreAppsInList, if there are no more applications in the list; EAppListInvalid, if the list is corrupt; otherwise one of the system-wide error codes.


GetAppInfo()

TInt GetAppInfo(TApaAppInfo& aInfo,TUid aAppUid) const;

Description

Gets information about the application having the specified UID.

Parameters

TApaAppInfo& aInfo

On return, contains the application information, if an application having the specified UID is found. If no matching application is found, then this object is not changed.

TUid aAppUid

The application specific UID.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no matching application can be found; otherwise one of the other system wide error codes.


GetAppCapability()

TInt GetAppCapability(TDes8& aCapabilityBuf,TUid aAppUid) const;

Description

Gets the capabilities of the application having the specified UID.

Parameters

TDes8& aCapabilityBuf

A modifiable descriptor that, on return, contains the application's capability information. The data returned in the descriptor is mapped by the TApaAppCapability class. If no matching application is found, then the content of this descriptor is not changed.

TUid aAppUid

The application specific UID.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no matching application can be found; otherwise one of the other system wide error codes.


GetAppIcon()

TInt GetAppIcon(TUid aAppUid, TInt aSize, CApaMaskedBitmap& aAppBitmap) const;

Description

Gets one of the application icons for the application having the specified UID.

One of three icons can be fetched, representing the smallest to the largest icon for the application. The actual size of these icons is dependent on the implementation; no scaling is performed.

Deprecated from 6.0 onwards.

Parameters

TUid aAppUid

The application specific UID.

TInt aSize

An integer that can take one of the values 0,1 or 2, representing the smallest through to the largest icon respectively.

CApaMaskedBitmap& aAppBitmap

On return, the application icon.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no matching application can be found, or the specified icon cannot be found; otherwise one of the other system wide error codes.


GetAppIcon()

TInt GetAppIcon(TUid aAppUid, TSize aSize, CApaMaskedBitmap& aAppBitmap) const;

Support

Supported from 6.0

Description

Gets the nearest matching application icon for the application having the specified UID.

The function gets the icon whose size matches the specified size. If there is no exact match, then the function gets the closest smaller icon.

This function should be used in preference to the TInt GetAppIcon(TUid,TInt,CApaMaskedBitmap&); overload.

Parameters

TUid aAppUid

The application specific UID.

TSize aSize

The required size of the icon.

CApaMaskedBitmap& aAppBitmap

On return, the application icon.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no matching application can be found, or no icon equal to or smaller than the specified size can be found; otherwise one of the other system wide error codes.


GetAppIconSizes()

TInt GetAppIconSizes(TUid aAppUid, CArrayFixFlat<TSize>& aArrayToFill) const;

Support

Supported from 6.0

Description

Gets the available icon sizes for the application having the specified UID.

Parameters

TUid aAppUid

The application specific UID.

CArrayFixFlat<TSize>& aArrayToFill

On return, the array contains all of the available icon sizes.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no matching application can be found; otherwise one of the other system wide error codes.


GetAppViews()

TInt GetAppViews(CApaAppViewArray& aAppViews, TUid aAppUid) const;

Support

Supported from 6.1

Description

Gets the views published by the application that has the specified UID.

Information on each view is contained in a TApaAppViewInfo object, and this set of objects is put into the array supplied by the caller.

Parameters

CApaAppViewArray& aAppViews

On return, the array contains information on all of the views published by the specified application.

TUid aAppUid

The application specific UID.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no matching application can be found; otherwise one of the other system wide error codes.

See also:


GetAppViewIcon()

TInt GetAppViewIcon(TUid aAppUid, TUid aViewUid, const TSize& aSize, CApaMaskedBitmap& aViewBitmap) const;

Support

Supported from 6.1

Description

Gets the icon for the specified view published by the application that has the specified UID.

The icon returned is that which is closest in size to the specified size.

Parameters

TUid aAppUid

The application specific UID.

TUid aViewUid

The UID identifying the view.

const TSize& aSize

The requested size of the icon.

CApaMaskedBitmap& aViewBitmap

On return, the icon that is closest in size to the requested size.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no matching application nor matching view can be found; otherwise one of the other system wide error codes.


GetAppOwnedFiles()

TInt GetAppOwnedFiles(CDesCArray& aAppOwnedFiles, TUid aAppUid) const;

Support

Supported from 6.1

Description

Gets the list of file names for which the application having the specified UID claims ownership.

The list is written to a descriptor array supplied by the caller.

Note that if the function fails due to lack of memory, the array is left in an undefined state.

Parameters

CDesCArray& aAppOwnedFiles

On return, the descriptor array contains the file names.

TUid aAppUid

The application specific UID.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no matching application can be found; otherwise one of the other system wide error codes.

[Top]


Data recognition


RecognizeData()

TInt RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const;

Description

Gets the data (MIME) type for data taken from a file with a specified name.

Parameters

const TDesC& aName

The name of the file containing the data.

const TDesC8& aBuffer

A buffer containing data taken from the specified file; typically the data is read from the beginning of the file.

TDataRecognitionResult& aDataType

On return, contains the result of the attempt to recognize data.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.


RecognizeSpecificData()

TInt RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const;

Description

Tests whether data taken from a file with a specified name has the specified data (MIME) type.

Parameters

const TDesC& aName

The name of the file containing the data.

const TDesC8& aBuffer

A buffer containing data taken from the specified file; typically the data is read from the beginning of the file.

const TDataType& aDataType

The data (MIME) type.

TBool& aResult

On return, contains the result of the test.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.


AppForDataType()

TInt AppForDataType(const TDataType& aDataType, TUid& aAppUid) const;

Description

Gets the UID of an application that can handle the specified data (MIME) type.

If no application can be found, the function returns the UID of the preferred default handler. If none of the default handlers can handle the data type, then a NULL UID is returned.

Parameters

const TDataType& aDataType

The data (MIME) type.

TUid& aAppUid

On return, the UID of the application that can handle the data (MIME) type; this may be NULL.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.


AppForDocument()

TInt AppForDocument(const TDesC& aFileName, TUid& aUid, TDataType& aDataType) const;

Description

Gets the data (MIME) type of the data in the specified file and gets the UID of an application that can handle this type.

Parameters

const TDesC& aFileName

The name of the file containing the data.

TUid& aUid

On return, the UID of the application that can handle the data (MIME) type; this may be NULL.

TDataType& aDataType

On return, the data (MIME) type.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.


IsProgram()

TInt IsProgram(const TDesC& aFileName, TBool& aProgram) const;

Description

Tests whether the file contains application code.

Parameters

const TDesC& aFileName

The name of the file containing the data.

TBool& aProgram

On return, true, if the file contains application code; false, otherwise.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.


SetMaxDataBufSize()

TInt SetMaxDataBufSize(TInt aBufSize);

Description

Sets the maximum size of the data that can be read from a file for the purpose of recognizing the data type.

The value is not used when the client explicitly supplies a buffer, for example in calls to RecognizeData() and RecognizeSpecificData(), but is used in the implementation of functions such as StartDocument() and CreateDocument().

Unless explicitly set, a default value of KApaAppListServMaxBuffer is used.

Parameters

TInt aBufSize

The maximum size of data to be read.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.

See also:


GetMaxDataBufSize()

TInt GetMaxDataBufSize(TInt& aBufSize) const;

Description

Gets the maximum size of the data that can be read from a file for the purpose of recognizing the data type.

Parameters

TInt& aBufSize

On return, contains the maximum size value.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.

See also:


SetAcceptedConfidence()

TInt SetAcceptedConfidence(TInt aConfidence);

Description

Sets the confidence threshold for successful data recognition.

This is the minimum acceptable confidence level that must be reported by a data recognizer for data to be accepted as of a given type.

Parameters

TInt aConfidence

The confidence threshold. Although this is an integer value, data recognizers use the discrete values defined by the CApaDataRecognizerType::TRecognitionConfidence enumeration.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.

See also:


GetAcceptedConfidence()

TInt GetAcceptedConfidence(TInt& aConfidence) const;

Description

Gets the confidence threshold for successful data recognition.

This is the minimum acceptable confidence level that must be reported by a data recognizer for data to be accepted as of a given type.

Parameters

TInt& aConfidence

On return, the confidence threshold.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.

[Top]


Launch applications


StartDocument()

TInt StartDocument(const TDesC& aFileName, TThreadId& aId, TLaunchType aLaunchType=ELaunchNewApp);

Description

Finds and launches an application to handle the document contained in the specified file.

Parameters

const TDesC& aFileName

The document name.

TThreadId& aId

On return, the id of the main thread started.

TLaunchType aLaunchType

Not used. Reserved for future use.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no suitable application can be found; otherwise one of the other system-wide error codes.


StartDocument()

TInt StartDocument(const TDesC& aFileName, const TDataType& aDataType, TThreadId& aId, TLaunchType aLaunchType=ELaunchNewApp);

Description

Launches an application that can handle the specified data (MIME) type.

The application handles the document contained in the specified file.

Parameters

const TDesC& aFileName

The document name.

const TDataType& aDataType

The data (MIME) type.

TThreadId& aId

On return, the id of the main thread started.

TLaunchType aLaunchType

Not used. Reserved for future use.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no suitable application can be found; otherwise one of the other system-wide error codes.


StartDocument()

TInt StartDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aId, TLaunchType aLaunchType=ELaunchNewApp);

Description

Launches the application identified by the specified UID.

The application handles the document contained in the specified file.

Parameters

const TDesC& aFileName

The document name.

TUid aAppUid

The application specific UID.

TThreadId& aId

On return, the id of the main thread started.

TLaunchType aLaunchType

Not used. Reserved for future use.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no suitable application can be found; otherwise one of the other system-wide error codes.


CreateDocument()

TInt CreateDocument(const TDesC& aFileName, TUid aAppUid, TThreadId& aId, TLaunchType aLaunchType=ELaunchNewApp);

Description

Launches the application identified by the specified UID and creates a new document.

Parameters

const TDesC& aFileName

The document name.

TUid aAppUid

The application specific UID.

TThreadId& aId

On return, the id of the main thread started.

TLaunchType aLaunchType

Not used. Reserved for future use.

Return value

TInt

KErrNone, if successful; KErrNotFound, if no suitable application can be found; otherwise one of the other system-wide error codes.


StartApp()

TInt StartApp(const CApaCommandLine& aCommandLine);

Description

Starts an application defined by the specified command line information.

This is only recommended for non document based applications.

This should NOT be used for view based applications.

Parameters

const CApaCommandLine& aCommandLine

The command line.

Return value

TInt

KErrNone, if successful; KErrNotFound, if the application cannot be found; otherwise one of the other system-wide error codes.

[Top]


Information about data types


GetSupportedDataTypesL()

TInt GetSupportedDataTypesL(CDataTypeArray& aDataTypes) const;

Description

Gets a list of all supported data (MIME) types.

Parameters

CDataTypeArray& aDataTypes

The array of data (MIME) types.

Return value

TInt

KErrNone, if successful; otherwise one of the other system-wide error codes.

[Top]


Enumerations


Enum TLaunchType

TLaunchType

Description

Defines the way an application is launched.

ELaunchNewApp

Launches a new instance of the application.

ESwitchFiles

Launches a new instance of the application if no existing instance of the application is running. If an instance of the application is already running, then it is brought to the foreground.

ETemporarilyIconic

The representation is a glass door but has been temporarily switched to an icon.