1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/chardet/public/nsIStringCharsetDetector.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,44 @@ 1.4 +/* -*- Mode: C; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 2 -*- */ 1.5 +/* This Source Code Form is subject to the terms of the Mozilla Public 1.6 + * License, v. 2.0. If a copy of the MPL was not distributed with this 1.7 + * file, You can obtain one at http://mozilla.org/MPL/2.0/. */ 1.8 +#ifndef nsIStringCharsetDetector_h__ 1.9 +#define nsIStringCharsetDetector_h__ 1.10 + 1.11 +#include "nsISupports.h" 1.12 +#include "nsDetectionConfident.h" 1.13 + 1.14 +// {12BB8F15-2389-11d3-B3BF-00805F8A6670} 1.15 +#define NS_ISTRINGCHARSETDETECTOR_IID \ 1.16 +{ 0x12bb8f15, 0x2389, 0x11d3, { 0xb3, 0xbf, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } } 1.17 + 1.18 + 1.19 +#define NS_STRCDETECTOR_CONTRACTID_BASE "@mozilla.org/intl/stringcharsetdetect;1?type=" 1.20 + 1.21 +/* 1.22 + This interface is similar to nsICharsetDetector 1.23 + The difference is it is for line base detection instead of block based 1.24 + detectection. 1.25 + */ 1.26 + 1.27 + 1.28 +class nsIStringCharsetDetector : public nsISupports { 1.29 +public: 1.30 + 1.31 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_ISTRINGCHARSETDETECTOR_IID) 1.32 + /* 1.33 + Perform the charset detection 1.34 + 1.35 + aBytesArray- the bytes 1.36 + aLen- the length of the bytes 1.37 + oCharset- the charset answer 1.38 + oConfident - the confidence of the answer 1.39 + */ 1.40 + NS_IMETHOD DoIt(const char* aBytesArray, uint32_t aLen, 1.41 + const char** oCharset, nsDetectionConfident &oConfident) = 0; 1.42 +}; 1.43 + 1.44 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIStringCharsetDetector, 1.45 + NS_ISTRINGCHARSETDETECTOR_IID) 1.46 + 1.47 +#endif /* nsIStringCharsetDetector_h__ */