2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QTocDialog.h
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
*
|
|
|
|
* \author John Levon
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QTOCDIALOG_H
|
|
|
|
#define QTOCDIALOG_H
|
|
|
|
|
|
|
|
#include "ui/QTocUi.h"
|
|
|
|
#include "controllers/ControlToc.h"
|
|
|
|
|
|
|
|
#include <QDialog>
|
|
|
|
|
2006-04-18 09:57:47 +00:00
|
|
|
class QTreeViewItem;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class QToc;
|
|
|
|
|
2006-04-18 09:57:47 +00:00
|
|
|
class QTocDialog : public QDialog, public Ui::QTocUi, public Dialog::View {
|
2006-03-05 17:24:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2006-04-18 09:57:47 +00:00
|
|
|
QTocDialog(Dialog &, QToc * form);
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
~QTocDialog();
|
|
|
|
|
2006-04-18 09:57:47 +00:00
|
|
|
virtual void apply();
|
|
|
|
|
|
|
|
/// Hide the dialog from sight
|
|
|
|
void hide();
|
|
|
|
|
|
|
|
/// Redraw the dialog (e.g. if the colors have been remapped).
|
|
|
|
void redraw() {}
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-04-18 09:57:47 +00:00
|
|
|
/// Create the dialog if necessary, update it and display it.
|
|
|
|
void show();
|
|
|
|
|
|
|
|
/// Update the display of the dialog whilst it is still visible.
|
|
|
|
void update();
|
|
|
|
|
2006-04-22 18:48:28 +00:00
|
|
|
/// Update Gui of the display.
|
|
|
|
void updateGui();
|
|
|
|
|
2006-04-18 09:57:47 +00:00
|
|
|
/// \return true if the dialog is visible.
|
|
|
|
bool isVisible() const;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
protected Q_SLOTS:
|
2006-03-31 13:17:44 +00:00
|
|
|
///
|
2006-04-18 09:57:47 +00:00
|
|
|
void select(QModelIndex const & index);
|
|
|
|
///
|
|
|
|
void selectionChanged(const QModelIndex & current,
|
|
|
|
const QModelIndex & previous);
|
|
|
|
|
2006-03-31 13:17:44 +00:00
|
|
|
void on_closePB_clicked();
|
|
|
|
void on_updatePB_clicked();
|
|
|
|
void on_depthSL_valueChanged(int depth);
|
|
|
|
void on_typeCO_activated(int value);
|
2006-03-29 16:57:47 +00:00
|
|
|
void on_moveUpPB_clicked();
|
|
|
|
void on_moveDownPB_clicked();
|
|
|
|
void on_moveInPB_clicked();
|
|
|
|
void on_moveOutPB_clicked();
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
protected:
|
2006-04-18 09:57:47 +00:00
|
|
|
///
|
2006-03-29 16:57:47 +00:00
|
|
|
void enableButtons(bool enable = true);
|
2006-11-16 12:37:55 +00:00
|
|
|
/// Reconnects the selection model change signal when TOC changed.
|
|
|
|
void reconnectSelectionModel();
|
2006-03-29 16:57:47 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
2006-04-05 23:56:29 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
QToc * form_;
|
|
|
|
|
|
|
|
/// depth of list shown
|
|
|
|
int depth_;
|
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
#endif // QTOCDIALOG_H
|