Line data Source code
1 : /* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 : /* This Source Code Form is subject to the terms of the Mozilla Public
3 : * License, v. 2.0. If a copy of the MPL was not distributed with this
4 : * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
5 : #ifndef nsIStringCharsetDetector_h__
6 : #define nsIStringCharsetDetector_h__
7 :
8 : #include "nsISupports.h"
9 : #include "nsDetectionConfident.h"
10 :
11 : // {12BB8F15-2389-11d3-B3BF-00805F8A6670}
12 : #define NS_ISTRINGCHARSETDETECTOR_IID \
13 : { 0x12bb8f15, 0x2389, 0x11d3, { 0xb3, 0xbf, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } }
14 :
15 :
16 : #define NS_STRCDETECTOR_CONTRACTID_BASE "@mozilla.org/intl/stringcharsetdetect;1?type="
17 :
18 : /*
19 : This interface is similar to nsICharsetDetector
20 : The difference is it is for line base detection instead of block based
21 : detectection.
22 : */
23 :
24 :
25 0 : class nsIStringCharsetDetector : public nsISupports {
26 : public:
27 :
28 : NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTRINGCHARSETDETECTOR_IID)
29 : /*
30 : Perform the charset detection
31 :
32 : aBytesArray- the bytes
33 : aLen- the length of the bytes
34 : oCharset- the charset answer
35 : oConfident - the confidence of the answer
36 : */
37 : NS_IMETHOD DoIt(const char* aBytesArray, uint32_t aLen,
38 : const char** oCharset, nsDetectionConfident &oConfident) = 0;
39 : };
40 :
41 : NS_DEFINE_STATIC_IID_ACCESSOR(nsIStringCharsetDetector,
42 : NS_ISTRINGCHARSETDETECTOR_IID)
43 :
44 : #endif /* nsIStringCharsetDetector_h__ */
|