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