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 TEXTCLASSLIST_H
13 #define TEXTCLASSLIST_H
15 #include "TextClass.h"
17 #include "support/strfwd.h"
26 /// Reads the style files
27 extern bool LyXSetStyle();
35 typedef std::vector<TextClass> ClassList;
37 typedef ClassList::const_iterator const_iterator;
39 const_iterator begin() const { return classlist_.begin(); }
41 const_iterator end() const { return classlist_.end(); }
43 bool empty() const { return classlist_.empty(); }
45 /// Gets textclass number from name, -1 if textclass name does not exist
46 std::pair<bool, BaseClassIndex> const
47 numberOfClass(std::string const & textclass) const;
50 TextClass const & operator[](BaseClassIndex textclass) const;
52 /// Read textclass list. Returns false if this fails.
55 /// Clears the textclass so as to force it to be reloaded
56 void reset(BaseClassIndex const textclass);
58 /// add a textclass from user local directory.
59 /// Return ture/false, and textclass number
60 std::pair<bool, BaseClassIndex> const
61 addTextClass(std::string const & textclass, std::string const & path);
65 TextClassList(TextClassList const &);
67 void operator=(TextClassList const &);
70 mutable ClassList classlist_;
74 extern TextClassList textclasslist;
76 BaseClassIndex defaultTextclass();