]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/FormToc.h
John's cleanup KDE-TOC patch
[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 "support/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();
43         /// close the connections
44         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         /// hierarchical tree
58         int FormToc::doTree(vector < Buffer::TocItem>::const_iterator & , int, int, int);
59         /// update the Toc
60         void updateToc(void);
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
94 #endif