]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/FormToc.h
Angus's FormInset work; Dekel's languages patch; my reworking of Angus's stuff +...
[lyx.git] / src / frontends / kde / FormToc.h
1 /* FormToc.h
2  * (C) 2000 LyX Team
3  * John Levon, moz@compsoc.man.ac.uk
4  */
5
6 /***************************************************************************
7  *                                                                         *
8  *   This program is free software; you can redistribute it and/or modify  *
9  *   it under the terms of the GNU General Public License as published by  *
10  *   the Free Software Foundation; either version 2 of the License, or     *
11  *   (at your option) any later version.                                   *
12  *                                                                         *
13  ***************************************************************************/
14
15 #ifndef FORMTOC_H
16 #define FORMTOC_H
17
18 #include "DialogBase.h"
19 #include "LString.h"
20 #include "boost/utility.hpp"
21 #include "insets/insetcommand.h"
22 #include "buffer.h"
23
24 class Dialogs;
25 class FormTocDialog;
26
27 class FormToc : public DialogBase, public noncopyable {
28 public:
29         /**@name Constructors and Destructors */
30         //@{
31         ///
32         FormToc(LyXView *, Dialogs *);
33         ///
34         ~FormToc();
35         //@}
36
37         /// Selected a tree item
38         void select(const char *);
39         /// Choose which type
40         void set_type(Buffer::TocType);
41         /// Update the dialog.
42         void update(bool = false);
43         /// change the depth shown
44         void set_depth(int);
45         /// close the connections
46         void close();
47
48 private:
49         /// Create the dialog if necessary, update it and display it.
50         void show();
51         /// Hide the dialog.
52         void hide();
53
54         /// create a Toc inset
55         void createTOC(string const &);
56         /// view a Toc inset
57         void showTOC(InsetCommand * const);
58         
59         /// update the Toc
60         void updateToc(int);
61
62         /// set the type
63         void setType(Buffer::TocType);
64
65         /// Real GUI implementation.
66         FormTocDialog * dialog_;
67
68         /// the LyXView we belong to
69         LyXView * lv_;
70
71         /** Which Dialogs do we belong to?
72             Used so we can get at the signals we have to connect to.
73         */
74         Dialogs * d_;
75         /// pointer to the inset if any
76         InsetCommand * inset_;
77         /// insets params
78         InsetCommandParams params;
79         
80         /// Hide connection.
81         Connection h_;
82         /// Update connection.
83         Connection u_;
84         /// Inset hide connection.
85         Connection ih_;
86
87         /// the toc list
88         std::vector <Buffer::TocItem> toclist;
89
90         /// type currently being shown
91         Buffer::TocType type;
92
93         /// depth of list shown
94         int depth;
95 };
96
97 #endif