46
|
1 |
/*
|
|
2 |
* Copyright (c) 2003 Nokia Corporation and/or its subsidiary(-ies).
|
|
3 |
* All rights reserved.
|
|
4 |
* This component and the accompanying materials are made available
|
|
5 |
* under the terms of "Eclipse Public License v1.0"
|
|
6 |
* which accompanies this distribution, and is available
|
|
7 |
* at the URL "http://www.eclipse.org/legal/epl-v10.html".
|
|
8 |
*
|
|
9 |
* Initial Contributors:
|
|
10 |
* Nokia Corporation - initial contribution.
|
|
11 |
*
|
|
12 |
* Contributors:
|
|
13 |
*
|
|
14 |
* Description:
|
|
15 |
*
|
|
16 |
*/
|
|
17 |
|
|
18 |
|
|
19 |
|
|
20 |
#if !defined(__SVGRECOG_H__)
|
|
21 |
#define __SVGRECOG_H__
|
|
22 |
|
|
23 |
#if !defined(__APMREC_H__)
|
|
24 |
#include <apmrec.h>
|
|
25 |
#endif
|
|
26 |
|
|
27 |
const TInt KMimeSvgRecognizerValue = 0x101F8570;
|
|
28 |
const TUid KUidMimeSvgRecognizer =
|
|
29 |
{
|
|
30 |
KMimeSvgRecognizerValue
|
|
31 |
};
|
|
32 |
|
|
33 |
const TInt KImplementationValue = 0x101F8571;
|
|
34 |
const TUid KUidImplementation =
|
|
35 |
{
|
|
36 |
KImplementationValue
|
|
37 |
};
|
|
38 |
|
|
39 |
|
|
40 |
// minimum amount of file needed to determine a text file IF it's not called .TXT
|
|
41 |
const TInt KMinBufferLength = 42;
|
|
42 |
// maximum amount of buffer space we will ever use
|
|
43 |
const TInt KMaxBufferLength = 1024;
|
|
44 |
|
|
45 |
_LIT8( KDataTypeImageSvg, "image/svg+xml" );
|
|
46 |
|
|
47 |
/**
|
|
48 |
* A standard Symbian Recognizer for SVG MIME Type.
|
|
49 |
* Inherits from CApaDataRecognizerType
|
|
50 |
* Provides recognition for MIME Type 'image\svg+xml'
|
|
51 |
*
|
|
52 |
* @lib SVGEngine.lib
|
|
53 |
* @since 1.0
|
|
54 |
*/
|
|
55 |
class CSvgRecognizer : public CApaDataRecognizerType
|
|
56 |
{
|
|
57 |
public: // from CApaDataRecognizerType
|
|
58 |
|
|
59 |
/**
|
|
60 |
* Constructor
|
|
61 |
*
|
|
62 |
* @since 1.0
|
|
63 |
* @param
|
|
64 |
* @return
|
|
65 |
*/
|
|
66 |
CSvgRecognizer();
|
|
67 |
|
|
68 |
/**
|
|
69 |
* Return the preferred buffer size
|
|
70 |
*
|
|
71 |
* @since 1.0
|
|
72 |
* @param
|
|
73 |
* @return
|
|
74 |
*/
|
|
75 |
TUint PreferredBufSize();
|
|
76 |
|
|
77 |
/**
|
|
78 |
* Return the Supported Data Type
|
|
79 |
*
|
|
80 |
* @since 1.0
|
|
81 |
* @param
|
|
82 |
* @return
|
|
83 |
*/
|
|
84 |
TDataType SupportedDataTypeL( TInt /*aIndex*/ ) const;
|
|
85 |
private: // from CApaDataRecognizerType
|
|
86 |
|
|
87 |
/**
|
|
88 |
* Perform the required recognition process
|
|
89 |
*
|
|
90 |
* @since 1.0
|
|
91 |
* @param aName - A string buffer containing file name
|
|
92 |
* @param aBuffer - A binary buffer that has the contents of the file
|
|
93 |
* @return
|
|
94 |
*/
|
|
95 |
void DoRecognizeL( const TDesC& aName, const TDesC8& aBuffer );
|
|
96 |
|
|
97 |
public:
|
|
98 |
/**
|
|
99 |
* This is passes to the ECom Framework as an handle to the implementation
|
|
100 |
*
|
|
101 |
* @since 1.0
|
|
102 |
* @param
|
|
103 |
* @return
|
|
104 |
*/
|
|
105 |
static CApaDataRecognizerType* CreateRecognizerL();
|
|
106 |
};
|
|
107 |
|
|
108 |
#endif
|