appfw/apparchitecture/apgrfx/apgrecog.cpp
changeset 48 2222076f5c60
parent 0 2e3d3ce01487
equal deleted inserted replaced
40:951aeeb3da43 48:2222076f5c60
     1 // Copyright (c) 1997-2009 Nokia Corporation and/or its subsidiary(-ies).
     1 // Copyright (c) 1997-2010 Nokia Corporation and/or its subsidiary(-ies).
     2 // All rights reserved.
     2 // All rights reserved.
     3 // This component and the accompanying materials are made available
     3 // This component and the accompanying materials are made available
     4 // under the terms of "Eclipse Public License v1.0"
     4 // under the terms of "Eclipse Public License v1.0"
     5 // which accompanies this distribution, and is available
     5 // which accompanies this distribution, and is available
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
     6 // at the URL "http://www.eclipse.org/legal/epl-v10.html".
   401 //RApaLsSession
   401 //RApaLsSession
   402 //
   402 //
   403 
   403 
   404 /** Gets the data (MIME) type of data passed by buffer.
   404 /** Gets the data (MIME) type of data passed by buffer.
   405 
   405 
   406 @param aBuffer A buffer containing data 
   406 @param aBuffer A buffer containing data; Provide preferred size of buffer. 
       
   407 If MIME type could not be recognized using this buffer, provide a buffer of 
       
   408 larger size.
   407 @param aDataType On return, contains the result of the attempt to recognize 
   409 @param aDataType On return, contains the result of the attempt to recognize 
   408 data. 
   410 data. 
   409 @return KErrNone, if successful; otherwise one of the other system-wide error 
   411 @return KErrNone, if successful; otherwise one of the other system-wide error 
   410 codes. 
   412 codes. 
       
   413 
       
   414 @see RApaLsSession::GetPreferredBufSize()
   411 */
   415 */
   412 EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const
   416 EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const
   413     {
   417     {
   414     return RecognizeData(KNullDesC,aBuffer,aDataType);
   418     return RecognizeData(KNullDesC,aBuffer,aDataType);
   415     }
   419     }
   416 
   420 
   417 /** Gets the data (MIME) type for data taken from a file with a specified name.
   421 /** Gets the data (MIME) type for data taken from a file with a specified name.
   418 
   422 
   419 @param aName The full filename, including drive and path, of the file containing the data.
   423 @param aName The full filename, including drive and path, of the file containing the data.
   420 @param aBuffer A buffer containing data taken from the specified file; typically 
   424 @param aBuffer A buffer containing data taken from the specified file; Provide preferred size of buffer 
   421 the data is read from the beginning of the file.
   425 from beginning of the file. If MIME type could not be recognized using this buffer, provide a buffer of 
       
   426 larger size.
   422 @param aDataType On return, contains the result of the attempt to recognize 
   427 @param aDataType On return, contains the result of the attempt to recognize 
   423 data. 
   428 data. 
   424 @return KErrNone, if successful; otherwise one of the other system-wide error 
   429 @return KErrNone, if successful; otherwise one of the other system-wide error 
   425 codes. 
   430 codes. 
       
   431 
       
   432 @see RApaLsSession::GetPreferredBufSize()
   426 */
   433 */
   427 EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const
   434 EXPORT_C TInt RApaLsSession::RecognizeData(const TDesC& aName, const TDesC8& aBuffer, TDataRecognitionResult& aDataType) const
   428 	{
   435 	{
   429 	TPckg<TDataRecognitionResult> result(aDataType);
   436 	TPckg<TDataRecognitionResult> result(aDataType);
   430 	return SendReceiveWithReconnect(EAppListServRecognizeData,TIpcArgs(&result, &aName, &aBuffer));
   437 	return SendReceiveWithReconnect(EAppListServRecognizeData,TIpcArgs(&result, &aName, &aBuffer));
   454 
   461 
   455 /** Tests whether data taken from a named file has the specified 
   462 /** Tests whether data taken from a named file has the specified 
   456 data (MIME) type.
   463 data (MIME) type.
   457 
   464 
   458 @param aName The name of the file containing the data.
   465 @param aName The name of the file containing the data.
   459 @param aBuffer A buffer containing data taken from the specified file; typically 
   466 @param aBuffer A buffer containing data taken from the specified file; Provide preferred size of buffer 
   460 the data is read from the beginning of the file.
   467 from beginning of the file. If MIME type could not be recognized using this buffer, provide a buffer of 
       
   468 larger size.
   461 @param aDataType The data (MIME) type.
   469 @param aDataType The data (MIME) type.
   462 @param aResult On return, contains the result of the test.
   470 @param aResult On return, contains the result of the test.
   463 @return KErrNone, if successful; otherwise one of the other system-wide error 
   471 @return KErrNone, if successful; otherwise one of the other system-wide error 
   464 codes. 
   472 codes. 
       
   473 
       
   474 @see RApaLsSession::GetPreferredBufSize()
   465 */
   475 */
   466 EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const
   476 EXPORT_C TInt RApaLsSession::RecognizeSpecificData(const TDesC& aName, const TDesC8& aBuffer, const TDataType& aDataType, TBool& aResult) const
   467 	{
   477 	{
   468 	const TPckgC<TDataType> dataType(aDataType);
   478 	const TPckgC<TDataType> dataType(aDataType);
   469 	const TInt returnValue=SendReceiveWithReconnect(EAppListServRecognizeSpecificData,TIpcArgs(&dataType, &aName, &aBuffer));
   479 	const TInt returnValue=SendReceiveWithReconnect(EAppListServRecognizeSpecificData,TIpcArgs(&dataType, &aName, &aBuffer));