2006-03-05 17:24:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
2007-03-12 14:23:44 +00:00
|
|
|
* \file TocWidget.h
|
2006-03-05 17:24:44 +00:00
|
|
|
* 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.
|
|
|
|
*/
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
#ifndef TOC_WIDGET_H
|
|
|
|
#define TOC_WIDGET_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
#include "ui/QTocUi.h"
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
#include <QWidget>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class QToc;
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
class TocWidget : public QWidget, public Ui::QTocUi {
|
2006-03-05 17:24:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2007-03-12 15:45:08 +00:00
|
|
|
TocWidget(QToc * form, QWidget * parent = 0);
|
2006-04-18 09:57:47 +00:00
|
|
|
|
|
|
|
/// Update the display of the dialog whilst it is still visible.
|
|
|
|
void update();
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
protected Q_SLOTS:
|
2006-04-22 18:48:28 +00:00
|
|
|
/// Update Gui of the display.
|
|
|
|
void updateGui();
|
2006-03-31 13:17:44 +00:00
|
|
|
///
|
2007-03-16 14:14:55 +00:00
|
|
|
void setTocModel(size_t type);
|
|
|
|
///
|
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_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-17 17:19:43 +00:00
|
|
|
///
|
|
|
|
int getIndexDepth(QModelIndex const & index, int depth = -1);
|
2006-11-25 22:16:22 +00:00
|
|
|
///
|
2007-03-12 14:23:44 +00:00
|
|
|
void setTreeDepth(int depth);
|
2006-03-29 16:57:47 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
private:
|
2007-03-12 14:23:44 +00:00
|
|
|
/// Reconnects the selection model change signal when TOC changed.
|
|
|
|
void reconnectSelectionModel();
|
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
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
#endif // TOC_WIDGET_H
|