Update ooo320-m1
[ooovba.git] / binfilter / inc / bf_sw / acmplwrd.hxx
blob6610ca4fd95f32c0a2c728eabc3fbaa47542a1d1
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: acmplwrd.hxx,v $
10 * $Revision: 1.6 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef _ACMPLWRD_HXX
31 #define _ACMPLWRD_HXX
34 #define _SVSTDARR_STRINGSISORTDTOR
35 #include <bf_svtools/svstdarr.hxx>
36 namespace binfilter {
38 class SwDoc;
39 class SwAutoCompleteWord_Impl;
40 class SwAutoCompleteClient;
42 class SwAutoCompleteWord
44 friend class SwAutoCompleteClient;
46 SvStringsISortDtor aWordLst; // contains extended strings carrying source information
47 SvPtrarr aLRULst;
49 SwAutoCompleteWord_Impl* pImpl;
50 USHORT nMaxCount, nMinWrdLen;
51 BOOL bLockWordLst;
53 void DocumentDying(const SwDoc& rDoc);
54 public:
55 SwAutoCompleteWord( USHORT nWords = 500, USHORT nMWrdLen = 10 );
56 ~SwAutoCompleteWord();
58 BOOL InsertWord( const String& rWord, SwDoc& rDoc );
62 USHORT Count() const { return aWordLst.Count(); }
64 const String& operator[]( USHORT n ) const { return *aWordLst[ n ]; }
66 BOOL IsLockWordLstLocked() const { return bLockWordLst; }
67 void SetLockWordLstLocked( BOOL bFlag ) { bLockWordLst = bFlag; }
69 USHORT GetMaxCount() const { return nMaxCount; }
71 USHORT GetMinWordLen() const { return nMinWrdLen; }
73 const SvStringsISortDtor& GetWordList() const { return aWordLst; }
77 } //namespace binfilter
78 #endif