]> git.lyx.org Git - lyx.git/blob - src/insets/insettoc.C
prepare for 1.1.6pre2
[lyx.git] / src / insets / insettoc.C
1 #include <config.h>
2
3 #ifdef __GNUG__
4 #pragma implementation
5 #endif
6
7 #include "gettext.h"
8 #include "insettoc.h"
9 #include "BufferView.h"
10 #include "LyXView.h"
11 #include "frontends/Dialogs.h"
12 #include "debug.h"
13
14 using std::ostream;
15
16
17 string const InsetTOC::getScreenLabel() const 
18 {
19         string cmdname( getCmdName() );
20         if (cmdname == "tableofcontents" )
21                 return _("Table of Contents");
22         else if (cmdname == "listofalgorithms" )
23                 return _("List of Algorithms");
24         else if (cmdname == "listoffigures" )
25                 return _("List of Figures");
26         else
27                 return _("List of Tables");
28 }
29
30
31 Inset::Code InsetTOC::LyxCode() const
32 {
33         string cmdname( getCmdName() );
34         if (cmdname == "tableofcontents" )
35                 return Inset::TOC_CODE;
36         else if (cmdname == "listofalgorithms" )
37                 return Inset::LOA_CODE;
38         else if (cmdname == "listoffigures" )
39                 return Inset::LOF_CODE; 
40         else
41                 return Inset::LOT_CODE;
42 }
43
44
45 void InsetTOC::Edit(BufferView * bv, int, int, unsigned int)
46 {
47         bv->owner()->getDialogs()->showTOC( this );
48 }
49
50
51 int InsetTOC::Linuxdoc(Buffer const *, ostream & os) const
52 {
53         if (getCmdName() == "tableofcontents" )
54                 os << "<toc>";
55         return 0;
56 }
57
58
59 int InsetTOC::DocBook(Buffer const *, ostream & os) const
60 {
61         if (getCmdName() == "tableofcontents" )
62                 os << "<toc></toc>";
63         return 0;
64 }