]> git.lyx.org Git - lyx.git/blob - src/lyxtextclasslist.h
layout as string
[lyx.git] / src / lyxtextclasslist.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *       
7  *           Copyright 1995 Matthias Ettrich
8  *           Copyright 1995-2001 The LyX Team.
9  *
10  * ====================================================== */
11
12 #ifndef LYXTEXTCLASSLIST_H
13 #define LYXTEXTCLASSLIST_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include "support/types.h"
20
21 #include <boost/utility.hpp>
22
23 #include "LString.h"
24
25 #include <vector>
26
27 class LyXTextClass;
28 class LyXLayout;
29
30 /// Reads the style files
31 extern void LyXSetStyle();
32
33 ///
34 class LyXTextClassList : boost::noncopyable {
35 public:
36         ///
37         typedef std::vector<LyXTextClass> ClassList;
38         ///
39         typedef ClassList::const_iterator const_iterator;
40         ///
41         const_iterator begin() const { return classlist.begin(); }
42         ///
43         const_iterator end() const { return classlist.end(); }
44
45         /** Gets textclass number from name.
46             Returns -1 if textclass name does not exist
47         */
48         std::pair<bool, lyx::textclass_type> const
49         NumberOfClass(string const & textclass) const;
50
51         ///
52         LyXTextClass const & operator[](lyx::textclass_type textclass) const;
53
54         /** Read textclass list.
55             Returns false if this fails
56         */
57         bool Read();
58 private:
59         ///
60         mutable ClassList classlist;
61         ///
62         void Add(LyXTextClass const &);
63 };
64
65 /// 
66 extern LyXTextClassList textclasslist;
67
68 #endif