]> git.lyx.org Git - lyx.git/blob - src/frontends/kde/tocdlg.h
try this for distinguishing inner and outer tabs
[lyx.git] / src / frontends / kde / tocdlg.h
1 /**
2  * \file tocdlg.h
3  * Copyright 2001 the LyX Team
4  * Read the file COPYING
5  *
6  * \author John Levon
7  */
8
9 #ifndef TOCDLG_H
10 #define TOCDLG_H
11
12 #include <config.h>
13 #include <gettext.h>
14
15 #include <debug.h>
16 #include <qlabel.h> 
17 #include <qdialog.h>
18 #include <qlayout.h>
19 #include <qpushbutton.h>
20 #include <qcombobox.h>
21 #include <qlistview.h>
22 #include <qslider.h>
23
24 #include "FormToc.h"
25
26 class TocDialog : public QDialog {
27         Q_OBJECT
28 public:
29         TocDialog(FormToc * form, QWidget * parent=0, char const * name=0,
30                             bool modal=false, WFlags f=0);
31         ~TocDialog();
32
33         // widgets
34
35         QComboBox * menu;
36         QListView * tree;
37         QPushButton * buttonUpdate;
38         QPushButton * buttonClose;
39         QSlider * depth;
40         QLabel * depthlabel; 
41
42 protected:
43         void closeEvent(QCloseEvent * e);
44
45 private:
46         FormToc * form_;
47
48         // layouts 
49
50         QHBoxLayout * topLayout;
51         QVBoxLayout * layout;
52         QHBoxLayout * buttonLayout;
53
54 private slots:
55         /// adaptor to FormToc::select
56         void select_adaptor(QListViewItem * item) {
57                 form_->select(item->text(0));
58         }
59
60         /// adaptor to FormToc::set_depth
61         void depth_adaptor(int depth) {
62                 form_->set_depth(depth);
63         }
64
65         /// adaptor to FormToc::update
66         void update_adaptor(void) {
67                 form_->update();
68         }
69
70         // adaptors to FormToc::set_type
71         void activate_adaptor(int index) {
72                 switch (index) {
73                         case 0:
74                                 form_->set_type(Buffer::TOC_TOC);
75                                 break;
76                         case 1:
77                                 form_->set_type(Buffer::TOC_LOF);
78                                 break;
79                         case 2:
80                                 form_->set_type(Buffer::TOC_LOT);
81                                 break;
82                         case 3:
83                                 form_->set_type(Buffer::TOC_LOA);
84                                 break;
85                         default:
86                                 lyxerr[Debug::GUI] << "Unknown TOC combo selection." << std::endl;
87                                 break;
88                 }
89         }
90
91         /// adaptor to FormToc::close
92         void close_adaptor(void) {
93                 form_->close();
94                 hide();
95         }
96 };
97
98 #endif // TOCDLG_H