1.1 --- /dev/null Thu Jan 01 00:00:00 1970 +0000 1.2 +++ b/intl/lwbrk/public/nsIWordBreaker.h Wed Dec 31 06:09:35 2014 +0100 1.3 @@ -0,0 +1,41 @@ 1.4 +/* -*- Mode: C++; tab-width: 2; 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 nsIWordBreaker_h__ 1.9 +#define nsIWordBreaker_h__ 1.10 + 1.11 +#include "nsISupports.h" 1.12 + 1.13 +#include "nscore.h" 1.14 + 1.15 +#define NS_WORDBREAKER_NEED_MORE_TEXT -1 1.16 + 1.17 +// {E86B3379-BF89-11d2-B3AF-00805F8A6670} 1.18 +#define NS_IWORDBREAKER_IID \ 1.19 +{ 0xe86b3379, 0xbf89, 0x11d2, \ 1.20 + { 0xb3, 0xaf, 0x0, 0x80, 0x5f, 0x8a, 0x66, 0x70 } } 1.21 + 1.22 +typedef struct { 1.23 + uint32_t mBegin; 1.24 + uint32_t mEnd; 1.25 +} nsWordRange; 1.26 + 1.27 +class nsIWordBreaker : public nsISupports 1.28 +{ 1.29 +public: 1.30 + NS_DECLARE_STATIC_IID_ACCESSOR(NS_IWORDBREAKER_IID) 1.31 + 1.32 + virtual bool BreakInBetween(const char16_t* aText1 , uint32_t aTextLen1, 1.33 + const char16_t* aText2 , 1.34 + uint32_t aTextLen2) = 0; 1.35 + virtual nsWordRange FindWord(const char16_t* aText1 , uint32_t aTextLen1, 1.36 + uint32_t aOffset) = 0; 1.37 + virtual int32_t NextWord(const char16_t* aText, uint32_t aLen, 1.38 + uint32_t aPos) = 0; 1.39 + 1.40 +}; 1.41 + 1.42 +NS_DEFINE_STATIC_IID_ACCESSOR(nsIWordBreaker, NS_IWORDBREAKER_IID) 1.43 + 1.44 +#endif /* nsIWordBreaker_h__ */