]> git.lyx.org Git - lyx.git/blob - src/lyxtextclasslist.h
Helge's infamous brackets bug
[lyx.git] / src / lyxtextclasslist.h
1 // -*- C++ -*-
2 /**
3  * \file lyxtextclasslist.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author Lars Gullik Bjønnes
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef LYXTEXTCLASSLIST_H
13 #define LYXTEXTCLASSLIST_H
14
15 #include "lyxtextclass.h"
16
17 #include "support/types.h"
18
19 #include <boost/utility.hpp>
20
21 #include <string>
22 #include <vector>
23
24 class LyXLayout;
25
26 /// Reads the style files
27 extern void LyXSetStyle();
28
29 ///
30 class LyXTextClassList : boost::noncopyable {
31 public:
32         ///
33         typedef std::vector<LyXTextClass> ClassList;
34         ///
35         typedef ClassList::const_iterator const_iterator;
36         ///
37         const_iterator begin() const { return classlist_.begin(); }
38         ///
39         const_iterator end() const { return classlist_.end(); }
40
41         /// Gets textclass number from name, -1 if textclass name does not exist
42         std::pair<bool, lyx::textclass_type> const
43         NumberOfClass(std::string const & textclass) const;
44
45         ///
46         LyXTextClass const & operator[](lyx::textclass_type textclass) const;
47
48         /// Read textclass list.  Returns false if this fails.
49         bool Read();
50 private:
51         ///
52         mutable ClassList classlist_;
53 };
54
55 ///
56 extern LyXTextClassList textclasslist;
57
58 #endif