3 * This file is part of LyX, the document processor.
4 * Licence details can be found in the file COPYING.
6 * \author Lars Gullik Bjønnes
8 * Full author contact details are available in file CREDITS.
13 #include "FloatList.h"
21 // This class is now mostly finished, except one thing, it is a global
22 // object. This will not do. The user (and layout files) are free to
23 // create floats and modify them to fit into a certain document. So it is
24 // pretty clear that each layout needs its own list, as do documents.
25 // However this is also not enough since we really want the user to be
26 // able to create "presistent" floats, in the sense that a user created
27 // float can be used across sessions and across documents. So we need a
28 // global¹ floatlist as well. The interaction between these are not quite
29 // clear, but it seems natural that the definition found in the document
31 // We also have the issue about what get stored _in_ the lyx file.
33 // ¹ not absolutely global but somewhere where documents,layouts and
34 // the bufferview can have access to it.
38 FloatList::FloatList()
43 FloatList::const_iterator FloatList::begin() const
49 FloatList::const_iterator FloatList::end() const
55 void FloatList::newFloat(Floating const & fl)
61 string const FloatList::defaultPlacement(string const & t) const
63 List::const_iterator cit = list.find(t);
64 if (cit != list.end())
65 return cit->second.placement();
70 bool FloatList::typeExist(string const & t) const
72 List::const_iterator cit = list.find(t);
73 return cit != list.end();
77 Floating const & FloatList::getType(string const & t) const
79 // I wish we could use exceptions
80 List::const_iterator cit = list.find(t);
81 if (cit != list.end())
83 #ifdef HAVE_EXCEPTIONS
84 throw UnknownFloatType(t);
86 static Floating empty_float;
92 void FloatList::erase(string const & t)
98 FloatList::const_iterator FloatList::operator[](string const & t) const