fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / include / editeng / Trie.hxx
blob2ac76aee380c7ddd8eafbd07e25a942a6c505f0f
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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/.
8 */
10 #ifndef TRIE_HXX
11 #define TRIE_HXX
13 #include <sal/types.h>
14 #include <rtl/ustring.hxx>
15 #include <vector>
16 #include <editeng/editengdllapi.h>
18 namespace editeng
21 struct TrieNode
23 static const int LATIN_ARRAY_SIZE = 26;
25 sal_Unicode mCharacter;
26 bool mMarker;
27 std::vector<TrieNode*> mChildren;
28 TrieNode* mLatinArray[LATIN_ARRAY_SIZE];
31 TrieNode(sal_Unicode aCharacter = '\0');
32 virtual ~TrieNode();
34 void markWord();
35 TrieNode* findChild(sal_Unicode aCharacter);
36 TrieNode* traversePath(OUString sPath);
37 void addNewChild(TrieNode* pChild);
38 void collectSuggestions(OUString sPath, std::vector<OUString>& rSuggestionList);
41 class EDITENG_DLLPUBLIC Trie
43 private:
44 TrieNode* mRoot;
46 public:
47 Trie();
48 virtual ~Trie();
50 void insert(OUString sInputString) const;
51 void findSuggestions(OUString sWordPart, std::vector<OUString>& rSuggesstionList) const;
57 #endif // TRIE_HXX
59 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */