1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #ifndef LATINLOOKUPTREE_HXX
21 #define LATINLOOKUPTREE_HXX
23 #include <editeng/LookupTree.hxx>
24 #include <editeng/TreeHead.hxx>
25 #include <editeng/editengdllapi.h>
28 * LatinLookupTree implements a tree that is optimized for storing and looking
29 * up words that mainly consist of roman characters, although any other
30 * language can be handled, too.
32 class EDITENG_DLLPUBLIC LatinLookupTree
: public LookupTree
, public TreeHead
36 explicit LatinLookupTree(OUString sLanguage
);
40 /* =================== Implemented Virtuals From LookupTree =================== */
42 void gotoNode(OUString sNode
);
43 void advance(const sal_Unicode a
);
45 void insert(OUString sKey
, const int nProbability
= 1);
46 void insert(const int nProbability
= 1);
47 void remove(OUString sKey
);
48 OUString
suggestAutoCompletion() const;
51 /* =================== Implemented Virtuals From Node =================== */
52 bool isSeparatedlyHandled(const sal_Unicode cKey
) const;
53 Node
*& getChildRef(const sal_Unicode cKey
, bool bCreatePlaceholder
= false);
54 void evaluateSeparateStorage(int& nSuggest
, Node
*& pSuggest
) const;
58 /* =================== Implemented Virtual From TreeHead =================== */
59 Node
* newNode(Node
* pParent
, const sal_Unicode cKey
, const int nProbability
= 0);
61 /* =================== Member Variables =================== */
62 // position of lower case letter 'a' within the selected char encoding.
63 static const unsigned int our_nLowerCaseA
;
65 // position of upper case letter 'A' within the selected char encoding.
66 static const unsigned int our_nUpperCaseA
;
69 Node
* m_pLeaves
[52]; // handles [a-z] and [A-Z]
72 #endif // LATINLOOKUPTREE_HXX
74 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */