]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/FormToc.h
426ddfd20365e20de60d0d3001c751236f36dde0
[lyx.git] / src / frontends / kde / FormToc.h
1 /**
2  * \file FormToc.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifndef FORMTOC_H
10 #define FORMTOC_H
11
12 #include "DialogBase.h"
13 #include "LString.h"
14 #include "boost/utility.hpp"
15 #include "insets/insetcommand.h"
16 #include "buffer.h"
17
18 class Dialogs;
19 class TocDialog;
20
21 class FormToc : public DialogBase, public noncopyable {
22 public:
23         FormToc(LyXView *, Dialogs *);
24  
25         ~FormToc();
26
27         /// Selected a tree item
28         void select(char const *);
29         /// Choose which type
30         void set_type(Buffer::TocType);
31         /// Update the dialog.
32         void update(bool = false);
33         /// change the depth shown
34         void set_depth(int);
35         /// close the connections
36         void close();
37
38 private:
39         /// Create the dialog if necessary, update it and display it.
40         void show();
41         /// Hide the dialog.
42         void hide();
43
44         /// create a Toc inset
45         void createTOC(string const &);
46         /// view a Toc inset
47         void showTOC(InsetCommand * const);
48         
49         /// update the Toc
50         void updateToc(int);
51
52         /// set the type
53         void setType(Buffer::TocType);
54
55         /// Real GUI implementation.
56         TocDialog * dialog_;
57
58         /// the LyXView we belong to
59         LyXView * lv_;
60
61         /// Dialogs object
62         Dialogs * d_;
63  
64         /// pointer to the inset if any
65         InsetCommand * inset_;
66         /// insets params
67         InsetCommandParams params;
68         
69         /// Hide connection.
70         Connection h_;
71         /// Update connection.
72         Connection u_;
73         /// Inset hide connection.
74         Connection ih_;
75
76         /// the toc list
77         std::vector <Buffer::TocItem> toclist;
78
79         /// type currently being shown
80         Buffer::TocType type;
81
82         /// depth of list shown
83         int depth;
84 };
85
86 #endif // FORMTOC_H