localisation/apparchitecture/apgrfx/apgrecog.cpp
author Maciej Seroka <maciejs@symbian.org>
Tue, 03 Aug 2010 14:51:01 +0100
branchSymbian3
changeset 58 7a02f8565ef5
parent 57 b8d18c84f71c
permissions -rw-r--r--
Implemented Language-setting smoke test for ATS4
Ignore whitespace changes - Everywhere: Within whitespace: At end of lines:
57
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     1
// Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     2
// All rights reserved.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     3
// This component and the accompanying materials are made available
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     4
// under the terms of "Eclipse Public License v1.0"
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     5
// which accompanies this distribution, and is available
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     6
// at the URL "http://www.eclipse.org/legal/epl-v10.html".
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     7
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     8
// Initial Contributors:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
     9
// Nokia Corporation - initial contribution.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    10
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    11
// Contributors:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    12
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    13
// Description:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    14
// apgrecog.cpp
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    15
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    16
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    17
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    18
#include "../apserv/APSCLSV.H"
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    19
#include "APGCLI.H"
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    20
#include "APGPRIV.H"
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    21
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    22
class CAsyncFileRecognition;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    23
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    24
_LIT8(KAllDataTypes,"*");
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    25
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    26
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    27
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    28
This class is an extension class for RApaLsSession. It was added to reduce the need
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    29
of BC breaks in later releases.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    30
@internalComponent
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    31
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    32
NONSHARABLE_CLASS(CApaLsSessionExtension) : public CBase
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    33
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    34
public:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    35
	CApaLsSessionExtension(RApaLsSession& aSession);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    36
	~CApaLsSessionExtension();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    37
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    38
	void SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    39
	TInt SendReceive(TInt aFunction,const TIpcArgs& aArgs) const;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    40
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    41
	// file recognition functions
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    42
	void RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    43
	void CancelRecognizeFiles();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    44
	void FilesRecognized(const TDesC& aPath, TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, const TRequestStatus& aErrorCode);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    45
	TBool RecognitionActive() const;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    46
private:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    47
	RApaLsSession& iSession;	// we are a friend of this class!
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    48
	CAsyncFileRecognition* iAsyncFileRecognition;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    49
	};
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    50
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    51
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    52
This class is used to simplify the usage of the asynchronous RApaLsSession::RecognizeFilesL() function.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    53
@internalComponent
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    54
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    55
NONSHARABLE_CLASS(CAsyncFileRecognition) : public CActive
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    56
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    57
public:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    58
	CAsyncFileRecognition(CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, CApaLsSessionExtension& aSession);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    59
	~CAsyncFileRecognition();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    60
	void Start(const TDesC& aPath, const TDesC8& aDataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    61
private:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    62
	void RunL();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    63
	void DoCancel();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    64
private: // data
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    65
	TPckgBuf<TUint> iRequiredBufferSizePckg;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    66
	CDataRecognitionResultArray& iResult;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    67
	TRequestStatus& iUsersRequestStatus;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    68
	CApaLsSessionExtension& iSession;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    69
	const TDesC* iPath;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    70
	const TDesC8* iDataType;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    71
	};
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    72
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    73
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    74
An entry of a CDataRecognitionResultArray object. Stores TDataRecognitionResult and the file name
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    75
in a compact format.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    76
@internalComponent
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    77
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    78
NONSHARABLE_CLASS(CDataRecognitionResultArray::CItem) : public CBase
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    79
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    80
public:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    81
	CItem(HBufC* aFileName, HBufC8* aDataType, TUid aUid, TInt aConfidence);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    82
	~CItem();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    83
	void GetDataRecognitionResult(TDataRecognitionResult& aResult) const;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    84
	const TDesC& FileName() const;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    85
private:
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    86
	HBufC* iFileName;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    87
	HBufC8* iDataType;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    88
	TUid iUid;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    89
	TInt iConfidence;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    90
	};
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    91
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    92
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    93
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    94
// CApaLsSessionExtension
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    95
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    96
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    97
CApaLsSessionExtension::CApaLsSessionExtension(RApaLsSession& aSession)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    98
	: iSession(aSession),
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
    99
	  iAsyncFileRecognition(NULL)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   100
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   101
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   102
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   103
CApaLsSessionExtension::~CApaLsSessionExtension()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   104
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   105
	delete iAsyncFileRecognition;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   106
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   107
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   108
void CApaLsSessionExtension::SendReceive(TInt aFunction,const TIpcArgs& aArgs,TRequestStatus& aStatus) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   109
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   110
	iSession.SendReceive(aFunction,aArgs,aStatus); //lint !e1060 Suppress protected member is not accessible to non-member non-friend
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   111
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   112
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   113
TInt CApaLsSessionExtension::SendReceive(TInt aFunction,const TIpcArgs& aArgs) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   114
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   115
	return iSession.SendReceive(aFunction,aArgs); //lint !e1060 Suppress protected member is not accessible to non-member non-friend
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   116
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   117
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   118
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   119
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   120
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   121
// CAsyncFileRecognition
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   122
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   123
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   124
CAsyncFileRecognition::CAsyncFileRecognition(CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, CApaLsSessionExtension& aSession)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   125
	: CActive(EPriorityStandard),
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   126
	  iResult(aResult),
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   127
	  iUsersRequestStatus(aUsersRequestStatus),
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   128
	  iSession(aSession)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   129
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   130
	CActiveScheduler::Add(this);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   131
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   132
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   133
void CAsyncFileRecognition::Start(const TDesC& aPath, const TDesC8& aDataType)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   134
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   135
	iPath = &aPath;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   136
	iDataType = &aDataType;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   137
	iStatus = KRequestPending;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   138
	iSession.SendReceive(EAppListServRecognizeFilesAsync,TIpcArgs(&aPath,&iRequiredBufferSizePckg,&aDataType),iStatus);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   139
	SetActive();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   140
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   141
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   142
CAsyncFileRecognition::~CAsyncFileRecognition()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   143
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   144
	Cancel();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   145
	iPath = NULL;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   146
	iDataType = NULL;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   147
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   148
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   149
void CAsyncFileRecognition::RunL()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   150
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   151
	iSession.FilesRecognized(*iPath, iRequiredBufferSizePckg(), iResult, iUsersRequestStatus, iStatus);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   152
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   153
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   154
void CAsyncFileRecognition::DoCancel()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   155
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   156
	iSession.SendReceive(ECancelRecognizeFiles,TIpcArgs(TIpcArgs::ENothing));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   157
	TRequestStatus* status = &iUsersRequestStatus;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   158
	User::RequestComplete( status, KErrCancel );
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   159
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   160
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   161
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   162
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   163
Asynchronous recognition of a directory.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   164
Function uses an internal CAsyncFileRecognition object to hide the 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   165
second server message (transferring the data to the client) from the user.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   166
When the path is not correct or the server is already busy with another 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   167
recognition request, the function completes the request with an error.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   168
@internalComponent
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   169
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   170
void CApaLsSessionExtension::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   171
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   172
	_LIT(KBackslash,"\\");
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   173
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   174
	if(aPath.Right(1) != KBackslash)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   175
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   176
		TRequestStatus* status = &aStatus;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   177
		User::RequestComplete(status,KErrPathNotFound);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   178
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   179
	
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   180
	aResult.SetPath(aPath);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   181
	aStatus = KRequestPending;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   182
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   183
	if(!iAsyncFileRecognition)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   184
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   185
		iAsyncFileRecognition = new (ELeave) CAsyncFileRecognition(aResult, aStatus, *this);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   186
		iAsyncFileRecognition->Start(aPath, aDataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   187
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   188
	else
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   189
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   190
		TRequestStatus* status = &aStatus;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   191
		User::RequestComplete(status,KErrInUse);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   192
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   193
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   194
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   195
TBool CApaLsSessionExtension::RecognitionActive() const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   196
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   197
	return iAsyncFileRecognition ? ETrue : EFalse;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   198
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   199
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   200
void CApaLsSessionExtension::CancelRecognizeFiles()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   201
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   202
	if(iAsyncFileRecognition)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   203
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   204
		iAsyncFileRecognition->Cancel();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   205
		delete iAsyncFileRecognition;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   206
		iAsyncFileRecognition = NULL;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   207
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   208
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   209
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   210
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   211
Callback function called by an CAsyncFileRecognition object, when an asynchronous
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   212
recognition has finished. If the recognition was successful, the data is transferred
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   213
to the client-side.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   214
@internalComponent
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   215
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   216
void CApaLsSessionExtension::FilesRecognized(const TDesC& aPath, TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult, TRequestStatus& aUsersRequestStatus, const TRequestStatus& aErrorCode)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   217
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   218
	TRequestStatus* status = &aUsersRequestStatus;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   219
	if(aErrorCode == KErrNone)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   220
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   221
		// transfer the result
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   222
		TRAPD(error,iSession.TransferAndInternalizeDataL(aPath, aRequiredBufferSize, aResult));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   223
		User::RequestComplete(status, error);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   224
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   225
	else
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   226
		User::RequestComplete(status, aErrorCode.Int());
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   227
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   228
	delete iAsyncFileRecognition;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   229
	iAsyncFileRecognition = 0;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   230
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   231
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   232
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   233
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   234
// CItem
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   235
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   236
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   237
CDataRecognitionResultArray::CItem::CItem(HBufC* aFileName, HBufC8* aDataType, TUid aUid, TInt aConfidence)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   238
	: iFileName(aFileName), 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   239
	  iDataType(aDataType), 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   240
	  iUid(aUid), 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   241
	  iConfidence(aConfidence)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   242
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   243
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   244
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   245
CDataRecognitionResultArray::CItem::~CItem()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   246
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   247
	delete iFileName;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   248
	delete iDataType;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   249
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   250
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   251
void CDataRecognitionResultArray::CItem::GetDataRecognitionResult(TDataRecognitionResult& aResult) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   252
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   253
	TDataRecognitionResult result;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   254
	if(iDataType->Length() != 0)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   255
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   256
		TDataType dataType(*iDataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   257
		result.iDataType = dataType;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   258
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   259
	else
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   260
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   261
		TDataType dataType(iUid);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   262
		result.iDataType = dataType;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   263
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   264
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   265
	result.iConfidence = iConfidence;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   266
	aResult = result;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   267
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   268
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   269
const TDesC& CDataRecognitionResultArray::CItem::FileName() const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   270
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   271
	if (iFileName == NULL)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   272
		return KNullDesC;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   273
	else
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   274
		return *iFileName;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   275
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   276
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   277
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   278
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   279
// CDataRecognitionResultArray
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   280
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   281
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   282
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   283
Constructor
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   284
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   285
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   286
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   287
EXPORT_C CDataRecognitionResultArray::CDataRecognitionResultArray()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   288
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   289
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   290
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   291
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   292
Destructor
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   293
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   294
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   295
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   296
EXPORT_C CDataRecognitionResultArray::~CDataRecognitionResultArray()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   297
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   298
	iItems.ResetAndDestroy();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   299
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   300
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   301
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   302
Returns the path of the recognition results.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   303
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   304
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   305
@return The path of the recognition results
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   306
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   307
EXPORT_C const TFileName& CDataRecognitionResultArray::Path() const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   308
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   309
	return iPath;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   310
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   311
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   312
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   313
Returns the number of entries in the CDataRecognitionResultArray.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   314
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   315
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   316
@return The number of entries in the CDataRecognitionResultArray.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   317
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   318
EXPORT_C TUint CDataRecognitionResultArray::Count() const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   319
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   320
	return iItems.Count();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   321
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   322
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   323
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   324
Returns the recognition result of the given index.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   325
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   326
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   327
@param aResult On successful completion, this parameter contains the recognition result at the given index.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   328
@param aIndex The index of the recognition result to be returned. An invalid index causes
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   329
the function to leave with KErrNotFound.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   330
@return The requested TDataRecognitionResult object
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   331
@leave KErrNotFound An invalid index is passed
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   332
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   333
EXPORT_C void CDataRecognitionResultArray::GetDataRecognitionResultL(TDataRecognitionResult& aResult, const TUint aIndex) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   334
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   335
	if( aIndex >= iItems.Count() )
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   336
		User::Leave(KErrNotFound);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   337
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   338
	iItems[aIndex]->GetDataRecognitionResult(aResult);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   339
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   340
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   341
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   342
Returns the file name of the object at the given index.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   343
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   344
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   345
@param aFileName On successful completion, this parameter contains the file name of the object at the given index. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   346
@param aIndex Specifies which file name to be returned. An invalid index causes
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   347
the function to leave with KErrNotFound.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   348
@return The requested file name
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   349
@leave KErrNotFound An invalid index is passed
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   350
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   351
EXPORT_C void CDataRecognitionResultArray::GetFileNameL(TFileName& aFileName, const TUint aIndex) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   352
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   353
	if( aIndex >= iItems.Count() )
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   354
		User::Leave(KErrNotFound);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   355
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   356
	aFileName.Zero();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   357
	aFileName.Copy( (iItems[aIndex]->FileName()) );
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   358
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   359
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   360
TUint CDataRecognitionResultArray::InternalizeL(const CBufFlat& aBuffer)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   361
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   362
	RBufReadStream readStream;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   363
	
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   364
	readStream.Open(aBuffer);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   365
	const TInt count=readStream.ReadUint32L();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   366
	for (TInt i=0; i<count; ++i)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   367
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   368
		const TInt fileNameLength = readStream.ReadUint8L();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   369
		HBufC* const fileName = HBufC::NewLC(fileNameLength);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   370
		TPtr fileNamePtr = fileName->Des();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   371
		readStream.ReadL(fileNamePtr,fileNameLength);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   372
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   373
		const TInt dataTypeLength = readStream.ReadUint8L();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   374
		HBufC8* const dataType = HBufC8::NewLC(dataTypeLength);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   375
		TPtr8 dataTypePtr = dataType->Des();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   376
		readStream.ReadL(dataTypePtr,dataTypeLength);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   377
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   378
		TUid uid;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   379
		uid.iUid = readStream.ReadInt32L();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   380
		
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   381
		TInt const confidence = readStream.ReadInt32L();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   382
		
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   383
		CItem* entry = new (ELeave) CItem(fileName,dataType,uid,confidence);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   384
		iItems.Append(entry);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   385
		
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   386
		CleanupStack::Pop(dataType);	// ownership was transferred to "entry"
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   387
		CleanupStack::Pop(fileName);	// ownership was transferred to "entry"
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   388
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   389
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   390
	readStream.Close();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   391
		
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   392
	return KErrNone;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   393
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   394
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   395
void CDataRecognitionResultArray::SetPath(const TFileName& aPath)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   396
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   397
	iPath.Copy(aPath);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   398
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   399
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   400
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   401
//RApaLsSession
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   402
//
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   403
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   404
/** Gets the data (MIME) type of data passed by buffer.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   405
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   406
@param aBuffer A buffer containing data; Provide preferred size of buffer. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   407
If MIME type could not be recognized using this buffer, provide a buffer of 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   408
larger size.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   409
@param aDataType On return, contains the result of the attempt to recognize 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   410
data. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   411
@return KErrNone, if successful; otherwise one of the other system-wide error 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   412
codes. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   413
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   414
@see RApaLsSession::GetPreferredBufSize()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   415
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   416
EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   417
    {
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   418
    return RecognizeData(KNullDesC,aBuffer,aDataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   419
    }
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   420
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   421
/** Gets the data (MIME) type for data taken from a file with a specified name.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   422
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   423
@param aName The full filename, including drive and path, of the file containing the data.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   424
@param aBuffer A buffer containing data taken from the specified file; Provide preferred size of buffer 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   425
from beginning of the file. If MIME type could not be recognized using this buffer, provide a buffer of 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   426
larger size.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   427
@param aDataType On return, contains the result of the attempt to recognize 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   428
data. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   429
@return KErrNone, if successful; otherwise one of the other system-wide error 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   430
codes. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   431
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   432
@see RApaLsSession::GetPreferredBufSize()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   433
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   434
EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   435
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   436
	TPckg<TDataRecognitionResult> result(aDataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   437
	return SendReceiveWithReconnect(EAppListServRecognizeData,TIpcArgs(&result, &aName, &aBuffer));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   438
	} //lint !e1764: Suppress reference parameter could be declared const ref
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   439
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   440
/** Gets the data (MIME) type for data in a file passed by handle.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   441
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   442
@param aFile The file containing the data. Before this function can be called,
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   443
the file server session which owns this file handle must first be marked as shareable by 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   444
calling RFs::ShareProtected().
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   445
@param aDataType On return, contains the result of the attempt to recognize 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   446
data. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   447
@return KErrNone, if successful; otherwise one of the other system-wide error 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   448
codes. */
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   449
EXPORT_C TInt RApaLsSession::RecognizeData(const RFile& aFile, TDataRecognitionResult& aDataType) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   450
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   451
	TPckg<TDataRecognitionResult> result(aDataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   452
	TIpcArgs ipcArgs(&result);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   453
	const TInt error = aFile.TransferToServer(ipcArgs, 1, 2);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   454
	if (error)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   455
		return error;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   456
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   457
	return SendReceiveWithReconnect(EAppListServRecognizeDataPassedByFileHandle,ipcArgs);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   458
	} //lint !e1764 Suppress reference parameter 'aDataType' could be declared const ref
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   459
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   460
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   461
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   462
/** Tests whether data taken from a named file has the specified 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   463
 * data (MIME) type.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   464
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   465
@param aName The name of the file containing the data.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   466
@param aBuffer A buffer containing data taken from the specified file; Provide preferred size of buffer 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   467
from beginning of the file. If MIME type could not be recognized using this buffer, provide a buffer of 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   468
larger size.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   469
@param aDataType The data (MIME) type.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   470
@param aResult On return, contains the result of the test.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   471
@return KErrNone, if successful; otherwise one of the other system-wide error 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   472
codes. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   473
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   474
@see RApaLsSession::GetPreferredBufSize()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   475
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   476
EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   477
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   478
	const TPckgC<TDataType> dataType(aDataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   479
	const TInt returnValue=SendReceiveWithReconnect(EAppListServRecognizeSpecificData,TIpcArgs(&dataType, &aName, &aBuffer));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   480
	if (returnValue<0)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   481
		return returnValue;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   482
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   483
	aResult = returnValue;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   484
	return KErrNone;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   485
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   486
	
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   487
/** 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   488
Gets the data (MIME) type for files in a specified directory. Because this call may take a long
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   489
time to complete, the asynchronous version is strongly recommended. Furthermore, it is not possible
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   490
to use this synchronous function while an asynchronous request is still active.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   491
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   492
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   493
@param aPath A valid path. Note that the path must end with a backslash.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   494
@param aResult If the call was successful, this parameter contains the recognition result.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   495
@return KErrNone, if successful; otherwise one of the other system-wide error codes.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   496
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   497
EXPORT_C TInt RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   498
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   499
	return RecognizeFilesL(aPath, KAllDataTypes, aResult);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   500
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   501
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   502
/** 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   503
Gets the data (MIME) type for files in a specified directory. Because this call may take a long
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   504
time to complete, the asynchronous version is strongly recommended. Furthermore, it is not possible
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   505
to use this synchronous function while an asynchronous request is still active.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   506
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   507
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   508
@param aPath A valid path. Note that the path must end with a backslash.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   509
@param aDataType A data type filter. Wildcards are allowed. For example, "text*" would also
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   510
add "text/plain" data types to the result.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   511
@param aResult If the call was successful, this parameter contains the recognition result.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   512
@return KErrNone, if successful; otherwise one of the other system-wide error codes.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   513
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   514
EXPORT_C TInt RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   515
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   516
	if(iExtension && iExtension->RecognitionActive())
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   517
		return KErrInUse;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   518
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   519
	_LIT(KBackslash,"\\");
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   520
	if(aPath.Right(1) != KBackslash)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   521
		return KErrPathNotFound;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   522
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   523
	TPckgBuf<TUint> requiredBufferSizePckg;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   524
	aResult.SetPath(aPath);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   525
	TInt error = SendReceiveWithReconnect(EAppListServRecognizeFiles,TIpcArgs(&aPath,&requiredBufferSizePckg,&aDataType));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   526
	if(!error)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   527
		error=TransferAndInternalizeDataL(aPath, requiredBufferSizePckg(), aResult);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   528
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   529
	return error;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   530
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   531
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   532
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   533
/** 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   534
Gets the data (MIME) type for files in a specified directory.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   535
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   536
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   537
@param aPath A valid path. Note that the path must end with a backslash.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   538
@param aResult If the call was successful, this parameter contains the recognition result.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   539
@param aStatus A request status object.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   540
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   541
EXPORT_C void RApaLsSession::RecognizeFilesL(const TDesC& aPath, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   542
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   543
	RecognizeFilesL(aPath,KAllDataTypes,aResult,aStatus);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   544
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   545
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   546
/** 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   547
Gets the data (MIME) type for files in a specified directory.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   548
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   549
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   550
@param aPath A valid path. Note that the path must end with a backslash.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   551
@param aDataType A data type filter. Wildcards are allowed. For example, "text*" would also
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   552
add "text/plain" data types to the result.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   553
@param aResult If the call was successful, this parameter contains the recognition result.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   554
@param aStatus A request status object
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   555
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   556
EXPORT_C void RApaLsSession::RecognizeFilesL(const TDesC& aPath, const TDesC8& aDataType, CDataRecognitionResultArray& aResult, TRequestStatus& aStatus)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   557
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   558
	if(!iExtension)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   559
		iExtension = new (ELeave) CApaLsSessionExtension(*this);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   560
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   561
	iExtension->RecognizeFilesL(aPath, aDataType, aResult, aStatus);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   562
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   563
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   564
/**
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   565
This function transfers the data to the client-side and "fills" the CDataRecognitionResultArray object. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   566
@internalComponent
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   567
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   568
TInt RApaLsSession::TransferAndInternalizeDataL(const TDesC& aPath, const TInt aRequiredBufferSize, CDataRecognitionResultArray& aResult) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   569
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   570
	CBufFlat* const buffer = CBufFlat::NewL(aRequiredBufferSize);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   571
	CleanupStack::PushL(buffer);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   572
	buffer->ExpandL(0,aRequiredBufferSize);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   573
	TPtr8 bufPtr=buffer->Ptr(0);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   574
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   575
	// transfer recognition buffer
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   576
	TInt error = SendReceiveWithReconnect(EAppListServTransferRecognitionResult,TIpcArgs(&aPath,&bufPtr,aRequiredBufferSize));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   577
	if(!error)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   578
		error = aResult.InternalizeL(*buffer);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   579
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   580
	CleanupStack::PopAndDestroy(buffer);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   581
	return error;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   582
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   583
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   584
/** 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   585
Cancels any outstanding asynchronous recognition requests.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   586
@publishedAll
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   587
@released
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   588
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   589
EXPORT_C void RApaLsSession::CancelRecognizeFiles()
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   590
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   591
	if(iExtension)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   592
		iExtension->CancelRecognizeFiles();
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   593
	
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   594
	delete iExtension;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   595
	iExtension = NULL;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   596
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   597
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   598
/** Tests whether data taken from a file passed by handle has the specified 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   599
data (MIME) type.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   600
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   601
@param aFile The file containing the data. Before this function can be called,
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   602
the file server session which owns this file handle must first be marked as shareable by 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   603
calling RFs::ShareProtected().
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   604
@param aDataType The data (MIME) type.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   605
@param aResult On return, contains the result of the test.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   606
@return KErrNone, if successful; otherwise one of the other system-wide error 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   607
codes. */
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   608
EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const RFile& aFile, const TDataType& aDataType, TBool& aResult) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   609
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   610
	const TPckgC<TDataType> dataType(aDataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   611
	TIpcArgs ipcArgs(&dataType);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   612
	TInt returnValue = aFile.TransferToServer(ipcArgs, 1, 2);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   613
	if (returnValue == KErrNone)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   614
		returnValue = SendReceiveWithReconnect(EAppListServRecognizeSpecificDataPassedByFileHandle,ipcArgs);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   615
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   616
	if (returnValue < KErrNone)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   617
		return returnValue;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   618
		
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   619
	aResult = returnValue;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   620
	return KErrNone;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   621
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   622
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   623
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   624
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   625
/** Gets the confidence threshold for successful data recognition.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   626
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   627
This is the minimum acceptable confidence level that must be reported by a 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   628
data recognizer for data to be accepted as of a given type.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   629
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   630
@param aConfidence On return, the confidence threshold. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   631
@return KErrNone, if successful; otherwise one of the other system-wide error 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   632
codes. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   633
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   634
EXPORT_C TInt RApaLsSession::GetAcceptedConfidence(TInt& aConfidence) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   635
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   636
	TPckg<TInt> confidence(aConfidence);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   637
	return SendReceiveWithReconnect(EAppListServGetConfidence,TIpcArgs(&confidence));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   638
	} //lint !e1764 Suppress reference parameter could be declared const ref
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   639
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   640
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   641
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   642
/** Sets the confidence threshold for successful data recognition.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   643
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   644
This is the minimum acceptable confidence level that must be reported by a 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   645
data recognizer for data to be accepted as of a given type.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   646
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   647
@param aConfidence The confidence threshold. Although this is an integer value, 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   648
data recognizers use the discrete values defined by the CApaDataRecognizerType::TRecognitionConfidence 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   649
enumeration.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   650
@return KErrNone, if successful; otherwise one of the other system-wide error 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   651
codes. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   652
@capability WriteDeviceData 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   653
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   654
EXPORT_C TInt RApaLsSession::SetAcceptedConfidence(TInt aConfidence)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   655
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   656
	return SendReceiveWithReconnect(EAppListServSetConfidence,TIpcArgs(aConfidence));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   657
	} //lint !e1762 Suppress member function could be made const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   658
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   659
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   660
/** Gets a list of recognized data(MIME) types by all recognizers.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   661
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   662
@param aDataTypes The array of data (MIME) types.
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   663
@return KErrNone, if successful; otherwise one of the other system-wide error 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   664
codes. 
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   665
*/
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   666
EXPORT_C TInt RApaLsSession::GetSupportedDataTypesL(CDataTypeArray& aDataTypes) const
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   667
	{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   668
	// gets the datatype count in terms of buffer length; negative value means one of the system-wide error
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   669
	TInt ret = SendReceiveWithReconnect(EAppListServGetDataTypesPhase1,TIpcArgs());
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   670
	if (ret>0)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   671
		{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   672
		CBufFlat* const buf=CBufFlat::NewL(ret);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   673
		CleanupStack::PushL(buf);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   674
		buf->ExpandL(0,ret);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   675
		TPtr8 ptr=buf->Ptr(0);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   676
		ret=SendReceiveWithReconnect(EAppListServGetDataTypesPhase2,TIpcArgs(&ptr));
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   677
		if (ret==KErrNone)
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   678
			{
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   679
			RBufReadStream readStream(*buf);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   680
			readStream >> aDataTypes;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   681
			}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   682
			
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   683
		CleanupStack::PopAndDestroy(buf);
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   684
		}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   685
		
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   686
	return ret;
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   687
	}
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   688
b8d18c84f71c Re-enabled smoke test for Language-setting
Maciej Seroka <maciejs@symbian.org>
parents:
diff changeset
   689