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