]> git.lyx.org Git - lyx.git/blob - src/frontends/xforms/FormToc.h
Merging BRANCH_MVC back into HEAD.
[lyx.git] / src / frontends / xforms / FormToc.h
1 // -*- C++ -*-
2 /* This file is part of
3  * ====================================================== 
4  *
5  *           LyX, The Document Processor
6  *
7  *           Copyright 2000 The LyX Team.
8  *
9  * ======================================================
10  */
11
12 #ifndef FORMTOC_H
13 #define FORMTOC_H
14
15 #include <boost/smart_ptr.hpp>
16
17 #ifdef __GNUG__
18 #pragma interface
19 #endif
20
21 #include "FormInset.h"
22 #include "buffer.h"
23 #include "xformsBC.h"
24
25 struct FD_form_toc;
26
27 /** This class provides an XForms implementation of the FormToc Dialog.
28  */
29 class FormToc : public FormCommand {
30 public:
31         ///
32         FormToc(LyXView *, Dialogs *);
33 private:
34         /// Pointer to the actual instantiation of the ButtonController.
35         virtual xformsBC & bc();
36         /// Disconnect signals. Also perform any necessary housekeeping.
37         virtual void disconnect();
38
39         /// Build the dialog
40         virtual void build();
41         /// bool indicates if a buffer switch took place
42         virtual void updateSlot(bool) { update(); }
43         /// Update dialog before showing it
44         virtual void update();
45         /// Filter the inputs on callback from xforms
46         virtual bool input( FL_OBJECT *, long);
47         /// Pointer to the actual instantiation of the xforms form
48         virtual FL_FORM * form() const;
49         ///
50         void updateToc();
51         ///
52         FD_form_toc * build_toc();
53
54         ///
55         Buffer::SingleList toclist;
56         /// Real GUI implementation.
57         boost::scoped_ptr<FD_form_toc> dialog_;
58         /// The ButtonController
59         ButtonController<OkCancelPolicy, xformsBC> bc_;
60 };
61
62
63 inline
64 xformsBC & FormToc::bc()
65 {
66         return bc_;
67 }
68 #endif