2001-02-12 14:09:09 +00:00
|
|
|
/**
|
|
|
|
* \file tocdlg.h
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
|
|
|
*
|
|
|
|
* \author John Levon
|
2000-09-12 15:13:19 +00:00
|
|
|
*/
|
|
|
|
|
2000-10-17 08:27:35 +00:00
|
|
|
#ifndef TOCDLG_H
|
|
|
|
#define TOCDLG_H
|
2000-09-12 15:13:19 +00:00
|
|
|
|
|
|
|
#include <config.h>
|
|
|
|
#include <gettext.h>
|
|
|
|
|
2000-09-15 15:32:07 +00:00
|
|
|
#include <debug.h>
|
|
|
|
#include <qlabel.h>
|
2000-09-12 15:13:19 +00:00
|
|
|
#include <qdialog.h>
|
|
|
|
#include <qlayout.h>
|
|
|
|
#include <qpushbutton.h>
|
|
|
|
#include <qcombobox.h>
|
2000-09-13 09:49:50 +00:00
|
|
|
#include <qlistview.h>
|
2000-09-15 15:32:07 +00:00
|
|
|
#include <qslider.h>
|
|
|
|
|
2000-09-12 15:13:19 +00:00
|
|
|
#include "FormToc.h"
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
class TocDialog : public QDialog {
|
|
|
|
Q_OBJECT
|
2000-09-12 15:13:19 +00:00
|
|
|
public:
|
2001-02-12 14:09:09 +00:00
|
|
|
TocDialog(FormToc * form, QWidget * parent=0, char const * name=0,
|
2000-09-12 15:13:19 +00:00
|
|
|
bool modal=false, WFlags f=0);
|
2000-10-17 08:27:35 +00:00
|
|
|
~TocDialog();
|
2000-09-12 15:13:19 +00:00
|
|
|
|
|
|
|
// widgets
|
2000-09-15 15:32:07 +00:00
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
QComboBox * menu;
|
|
|
|
QListView * tree;
|
|
|
|
QPushButton * buttonUpdate;
|
|
|
|
QPushButton * buttonClose;
|
|
|
|
QSlider * depth;
|
|
|
|
QLabel * depthlabel;
|
2000-09-12 15:13:19 +00:00
|
|
|
|
|
|
|
protected:
|
2001-02-12 14:09:09 +00:00
|
|
|
void closeEvent(QCloseEvent * e);
|
2000-09-15 15:32:07 +00:00
|
|
|
|
2000-09-12 15:13:19 +00:00
|
|
|
private:
|
2001-02-12 14:09:09 +00:00
|
|
|
FormToc * form_;
|
2000-09-12 15:13:19 +00:00
|
|
|
|
2000-09-15 15:32:07 +00:00
|
|
|
// layouts
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
QHBoxLayout * topLayout;
|
|
|
|
QVBoxLayout * layout;
|
|
|
|
QHBoxLayout * buttonLayout;
|
2000-09-15 15:32:07 +00:00
|
|
|
|
2000-09-12 15:13:19 +00:00
|
|
|
private slots:
|
2000-09-13 09:49:50 +00:00
|
|
|
/// adaptor to FormToc::select
|
2001-02-12 14:09:09 +00:00
|
|
|
void select_adaptor(QListViewItem * item) {
|
2000-09-13 09:49:50 +00:00
|
|
|
form_->select(item->text(0));
|
2000-09-12 15:13:19 +00:00
|
|
|
}
|
|
|
|
|
2000-09-15 15:32:07 +00:00
|
|
|
/// adaptor to FormToc::set_depth
|
|
|
|
void depth_adaptor(int depth) {
|
|
|
|
form_->set_depth(depth);
|
|
|
|
}
|
|
|
|
|
2000-09-12 15:13:19 +00:00
|
|
|
/// adaptor to FormToc::update
|
|
|
|
void update_adaptor(void) {
|
|
|
|
form_->update();
|
|
|
|
}
|
2000-09-15 15:32:07 +00:00
|
|
|
|
2000-09-12 15:13:19 +00:00
|
|
|
// adaptors to FormToc::set_type
|
|
|
|
void activate_adaptor(int index) {
|
|
|
|
switch (index) {
|
2000-09-15 15:32:07 +00:00
|
|
|
case 0:
|
2000-09-12 15:13:19 +00:00
|
|
|
form_->set_type(Buffer::TOC_TOC);
|
|
|
|
break;
|
2000-09-15 15:32:07 +00:00
|
|
|
case 1:
|
2000-09-12 15:13:19 +00:00
|
|
|
form_->set_type(Buffer::TOC_LOF);
|
|
|
|
break;
|
2000-09-15 15:32:07 +00:00
|
|
|
case 2:
|
2000-09-12 15:13:19 +00:00
|
|
|
form_->set_type(Buffer::TOC_LOT);
|
|
|
|
break;
|
2000-09-15 15:32:07 +00:00
|
|
|
case 3:
|
2000-09-12 15:13:19 +00:00
|
|
|
form_->set_type(Buffer::TOC_LOA);
|
|
|
|
break;
|
|
|
|
default:
|
2000-09-19 13:50:47 +00:00
|
|
|
lyxerr[Debug::GUI] << "Unknown TOC combo selection." << std::endl;
|
2000-09-12 15:13:19 +00:00
|
|
|
break;
|
|
|
|
}
|
|
|
|
}
|
2000-09-15 15:32:07 +00:00
|
|
|
|
2000-09-12 15:13:19 +00:00
|
|
|
/// adaptor to FormToc::close
|
|
|
|
void close_adaptor(void) {
|
|
|
|
form_->close();
|
|
|
|
hide();
|
|
|
|
}
|
|
|
|
};
|
|
|
|
|
2001-02-12 14:09:09 +00:00
|
|
|
#endif // TOCDLG_H
|