]> git.lyx.org Git - lyx.git/blob - src/TextClassList.h
Fixed some lines that were too long. It compiled afterwards.
[lyx.git] / src / TextClassList.h
1 // -*- C++ -*-
2 /**
3  * \file TextClassList.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 "TextClass.h"
16
17 #include "support/types.h"
18
19 #include <boost/utility.hpp>
20
21 #include <string>
22 #include <vector>
23
24
25 namespace lyx {
26
27 class Layout;
28
29 /// Reads the style files
30 extern bool LyXSetStyle();
31
32 ///
33 class TextClassList : boost::noncopyable {
34 public:
35         ///
36         typedef std::vector<TextClass> ClassList;
37         ///
38         typedef ClassList::const_iterator const_iterator;
39         ///
40         const_iterator begin() const { return classlist_.begin(); }
41         ///
42         const_iterator end() const { return classlist_.end(); }
43
44         /// Gets textclass number from name, -1 if textclass name does not exist
45         std::pair<bool, textclass_type> const
46         numberOfClass(std::string const & textclass) const;
47
48         ///
49         TextClass const & operator[](textclass_type textclass) const;
50
51         /// Read textclass list.  Returns false if this fails.
52         bool read();
53
54         /// add a textclass from user local directory.
55         /// Return ture/false, and textclass number
56         std::pair<bool, textclass_type> const
57         addTextClass(std::string const & textclass, std::string const & path);
58
59 private:
60         ///
61         mutable ClassList classlist_;
62 };
63
64 ///
65 extern TextClassList textclasslist;
66
67
68 } // namespace lyx
69
70 #endif