6 // This class is now mostly finished, except one thing, it is a global
7 // object. This will not do. The user (and layout files) are free to
8 // create floats and modify them to fit into a certain document. So it is
9 // pretty clear that each layout needs its own list, as do documents.
10 // However this is also not enough since we really want the user to be
11 // able to create "presistent" floats, in the sense that a user created
12 // float can be used across sessions and across documents. So we need a
13 // global¹ floatlist as well. The interaction between these are not quite
14 // clear, but it seems natural that the definition found in the document
16 // We also have the issue about what get stored _in_ the lyx file.
18 // ¹ not absolutely global but somewhere where documents,layouts and
19 // the bufferview can have access to it.
23 FloatList::FloatList()
28 FloatList::const_iterator FloatList::begin() const
34 FloatList::const_iterator FloatList::end() const
40 void FloatList::newFloat(Floating const & fl)
46 string const FloatList::defaultPlacement(string const & t) const
48 List::const_iterator cit = list.find(t);
49 if (cit != list.end())
50 return cit->second.placement();
55 bool FloatList::typeExist(string const & t) const
57 List::const_iterator cit = list.find(t);
58 return cit != list.end();
62 Floating const & FloatList::getType(string const & t) const
64 // I wish we could use exceptions
65 List::const_iterator cit = list.find(t);
66 if (cit != list.end())
68 #ifdef HAVE_EXCEPTIONS
69 throw UnknownFloatType(t);
71 static Floating empty_float;
77 void FloatList::erase(string const & t)
83 FloatList::const_iterator FloatList::operator[](string const & t) const