3 * \file TextClassList.h
4 * This file is part of LyX, the document processor.
5 * Licence details can be found in the file COPYING.
7 * \author Lars Gullik Bjønnes
9 * Full author contact details are available in file CREDITS.
12 #ifndef LYXTEXTCLASSLIST_H
13 #define LYXTEXTCLASSLIST_H
15 #include "TextClass.h"
17 #include "support/types.h"
19 #include <boost/noncopyable.hpp>
29 /// Reads the style files
30 extern bool LyXSetStyle();
33 class TextClassList : boost::noncopyable {
36 typedef std::vector<TextClass> ClassList;
38 typedef ClassList::const_iterator const_iterator;
40 const_iterator begin() const { return classlist_.begin(); }
42 const_iterator end() const { return classlist_.end(); }
44 bool empty() const { return classlist_.empty(); }
46 /// Gets textclass number from name, -1 if textclass name does not exist
47 std::pair<bool, textclass_type> const
48 numberOfClass(std::string const & textclass) const;
51 TextClass const & operator[](textclass_type textclass) const;
53 /// Read textclass list. Returns false if this fails.
56 /// Clears the textclass so as to force it to be reloaded
57 void reset(textclass_type const textclass);
59 /// add a textclass from user local directory.
60 /// Return ture/false, and textclass number
61 std::pair<bool, textclass_type> const
62 addTextClass(std::string const & textclass, std::string const & path);
66 mutable ClassList classlist_;
70 extern TextClassList textclasslist;