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
|
|
|
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_TocUi.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2008-05-30 11:33:24 +00:00
|
|
|
#include <QWidget>
|
|
|
|
|
|
|
|
class QModelIndex;
|
2008-05-02 12:09:51 +00:00
|
|
|
class QString;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2008-05-30 11:33:24 +00:00
|
|
|
class GuiView;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
2007-09-03 20:28:26 +00:00
|
|
|
class TocWidget : public QWidget, public Ui::TocUi
|
|
|
|
{
|
2006-03-05 17:24:44 +00:00
|
|
|
Q_OBJECT
|
|
|
|
public:
|
2008-05-30 11:33:24 +00:00
|
|
|
///
|
|
|
|
TocWidget(GuiView & gui_view, QWidget * parent = 0);
|
2008-05-02 12:09:51 +00:00
|
|
|
|
|
|
|
/// Initialise GUI.
|
|
|
|
void init(QString const & str);
|
2006-04-18 09:57:47 +00:00
|
|
|
|
2008-04-27 22:24:20 +00:00
|
|
|
public Q_SLOTS:
|
2006-04-18 09:57:47 +00:00
|
|
|
/// Update the display of the dialog whilst it is still visible.
|
2007-09-08 17:28:14 +00:00
|
|
|
void updateView();
|
2006-04-18 09:57:47 +00:00
|
|
|
|
2008-02-12 07:47:16 +00:00
|
|
|
protected Q_SLOTS:
|
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);
|
|
|
|
///
|
2008-05-17 17:03:53 +00:00
|
|
|
void goTo(QModelIndex const &);
|
2006-04-18 09:57:47 +00:00
|
|
|
|
2008-05-17 17:03:53 +00:00
|
|
|
void on_tocTV_activated(QModelIndex const &);
|
|
|
|
void on_tocTV_clicked(QModelIndex const &);
|
2007-05-04 17:37:05 +00:00
|
|
|
void on_updateTB_clicked();
|
2006-03-31 13:17:44 +00:00
|
|
|
void on_depthSL_valueChanged(int depth);
|
2007-05-10 16:25:11 +00:00
|
|
|
void on_typeCO_currentIndexChanged(int value);
|
2007-05-04 17:37:05 +00:00
|
|
|
void on_moveUpTB_clicked();
|
|
|
|
void on_moveDownTB_clicked();
|
|
|
|
void on_moveInTB_clicked();
|
|
|
|
void on_moveOutTB_clicked();
|
2006-03-29 16:57:47 +00:00
|
|
|
|
2008-05-02 12:09:51 +00:00
|
|
|
private:
|
2006-04-18 09:57:47 +00:00
|
|
|
///
|
2007-04-17 10:27:53 +00:00
|
|
|
void enableControls(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);
|
2008-05-30 11:59:57 +00:00
|
|
|
///
|
|
|
|
void outline(int func_code);
|
2006-04-05 23:56:29 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
/// depth of list shown
|
|
|
|
int depth_;
|
2007-09-05 20:33:29 +00:00
|
|
|
///
|
2008-05-30 11:33:24 +00:00
|
|
|
GuiView & gui_view_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
#endif // TOC_WIDGET_H
|