3 * \file PersonalWordList.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
9 * Full author contact details are available in file CREDITS.
12 #ifndef PERSONAL_WORD_LIST_H
13 #define PERSONAL_WORD_LIST_H
15 #include "support/strfwd.h"
16 #include "support/docstring_list.h"
17 #include "support/FileName.h"
23 /// A PersonalWordList holds a word list with persistent state
24 class PersonalWordList {
26 /// the word list has an associated language
27 PersonalWordList(std::string const & lang) : lang_(lang), dirty_(false) {}
28 /// the location of the file to hold to word list
29 lyx::support::FileName dictfile() const;
30 /// (re)load the word list from file
32 /// save word list to file
34 /// check for presence of given word
35 bool exists(docstring const & word) const;
36 /// add given word to list
37 void insert(docstring const & word);
38 /// remove given word from list
39 void remove(docstring const & word);
40 /// is word list modified after load/save?
41 bool isDirty() const { return dirty_; }
42 /// first item in word list
43 docstring_list::const_iterator begin() const;
45 docstring_list::const_iterator end() const;
48 docstring_list words_;
54 bool equalwords(docstring const & w1, docstring const & w2) const;
56 std::string header() const { return "# personal word list"; }
58 void dirty(bool flag) { dirty_ = flag; }
63 #endif // PERSONAL_WORD_LIST_H