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"
16 // This class is now mostly finished, except one thing, it is a global
17 // object. This will not do. The user (and layout files) are free to
18 // create floats and modify them to fit into a certain document. So it is
19 // pretty clear that each layout needs its own list, as do documents.
20 // However this is also not enough since we really want the user to be
21 // able to create "presistent" floats, in the sense that a user created
22 // float can be used across sessions and across documents. So we need a
23 // global¹ floatlist as well. The interaction between these are not quite
24 // clear, but it seems natural that the definition found in the document
26 // We also have the issue about what get stored _in_ the lyx file.
28 // ¹ not absolutely global but somewhere where documents,layouts and
29 // the bufferview can have access to it.
33 FloatList::FloatList()
38 FloatList::const_iterator FloatList::begin() const
44 FloatList::const_iterator FloatList::end() const
50 void FloatList::newFloat(Floating const & fl)
56 string const FloatList::defaultPlacement(string const & t) const
58 List::const_iterator cit = list.find(t);
59 if (cit != list.end())
60 return cit->second.placement();
65 bool FloatList::typeExist(string const & t) const
67 List::const_iterator cit = list.find(t);
68 return cit != list.end();
72 Floating const & FloatList::getType(string const & t) const
74 // I wish we could use exceptions
75 List::const_iterator cit = list.find(t);
76 if (cit != list.end())
78 #ifdef HAVE_EXCEPTIONS
79 throw UnknownFloatType(t);
81 static Floating empty_float;
87 void FloatList::erase(string const & t)
93 FloatList::const_iterator FloatList::operator[](string const & t) const