2 /* This file is part of
3 * ======================================================
5 * LyX, The Document Processor
7 * Copyright 1995 Matthias Ettrich
8 * Copyright 1995-2001 The LyX Team.
10 * ====================================================== */
12 #ifndef LYXTEXTCLASSLIST_H
13 #define LYXTEXTCLASSLIST_H
19 #include "support/types.h"
21 #include <boost/utility.hpp>
30 /// Reads the style files
31 extern void LyXSetStyle();
34 class LyXTextClassList : boost::noncopyable {
37 typedef std::vector<LyXTextClass> ClassList;
39 typedef ClassList::const_iterator const_iterator;
41 const_iterator begin() const { return classlist.begin(); }
43 const_iterator end() const { return classlist.end(); }
45 /// Gets layout structure from layout number and textclass number
46 LyXLayout const & Style(lyx::textclass_type textclass,
47 lyx::layout_type layout) const;
49 /// Gets layout number from textclass number and layout name
50 std::pair<bool, lyx::layout_type> const
51 NumberOfLayout(lyx::textclass_type textclass, string const & name) const;
53 /// Gets a layout name from layout number and textclass number
55 NameOfLayout(lyx::textclass_type textclass, lyx::layout_type layout) const;
57 /** Gets textclass number from name.
58 Returns -1 if textclass name does not exist
60 std::pair<bool, lyx::textclass_type> const
61 NumberOfClass(string const & textclass) const;
64 string const & NameOfClass(lyx::textclass_type number) const;
67 string const & LatexnameOfClass(lyx::textclass_type number) const;
70 string const & DescOfClass(lyx::textclass_type number) const;
73 LyXTextClass const & TextClass(lyx::textclass_type textclass) const;
75 /** Read textclass list.
76 Returns false if this fails
81 Returns false if this fails
83 bool Load(lyx::textclass_type number) const;
86 mutable ClassList classlist;
88 void Add (LyXTextClass const &);
92 extern LyXTextClassList textclasslist;