]> git.lyx.org Git - lyx.git/blob - src/FloatList.h
Lots of changes for update of TextInsets, still some problems!
[lyx.git] / src / FloatList.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ======================================================
4  * 
5  *           LyX, The Document Processor
6  *
7  *           Copyright 1998-2000 The LyX Team.
8  *
9  * ======================================================
10  */
11
12 #ifndef FLOATLIST_H
13 #define FLOATLIST_H
14
15 #ifdef __GNUG__
16 #pragma interface
17 #endif
18
19 #include <map>
20
21 #include "LString.h"
22 #include "Floating.h"
23
24 ///
25 class FloatList {
26 public:
27         ///
28         typedef std::map<string, Floating> List;
29         ///
30         FloatList() {
31                 // Insert the latex builtin float-types
32                 Floating table;
33                 table.type = "table";
34                 table.placement = "";
35                 table.ext = "lot";
36                 table.within = "";
37                 table.style = "";
38                 table.name = "";
39                 table.builtin = true;
40                 list[table.type] = table;
41                 Floating figure;
42                 figure.type = "figure";
43                 figure.placement = "";
44                 figure.ext = "lof";
45                 figure.within = "";
46                 figure.style = "";
47                 figure.name = "";
48                 figure.builtin = true;
49                 list[figure.type] = figure;
50                 // And we add algorithm too since LyX has
51                 // supported that for a long time
52                 Floating algorithm;
53                 algorithm.type = "algorithm";
54                 algorithm.placement = "htbp";
55                 algorithm.ext = "loa";
56                 algorithm.within = "";
57                 algorithm.style = "ruled";
58                 algorithm.name = "Algorithm";
59                 algorithm.builtin = false;
60                 list[algorithm.type] = algorithm;
61         }
62         ///
63         void newFloat(Floating const & fl) {
64                 list[fl.type] = fl;
65         }
66         ///
67         string defaultPlacement(string const & t) const {
68                 List::const_iterator cit = list.find(t);
69                 if (cit != list.end())
70                         return (*cit).second.placement;
71                 return string();
72         }
73         
74 private:
75         ///
76         List list;
77 };
78
79 extern FloatList floatList;
80
81 #endif