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-09-05 20:33:29 +00:00
|
|
|
#include "GuiDialog.h"
|
2007-10-06 20:54:31 +00:00
|
|
|
#include "GuiToc.h"
|
2007-08-11 15:48:15 +00:00
|
|
|
#include "ui_TocUi.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
class GuiToc;
|
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:
|
2007-09-08 17:28:14 +00:00
|
|
|
TocWidget(GuiToc & form, QWidget * parent = 0);
|
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
|
|
|
|
2006-04-22 18:48:28 +00:00
|
|
|
/// Update Gui of the display.
|
2008-02-12 07:47:16 +00:00
|
|
|
void updateGui(int selected_type);
|
|
|
|
|
|
|
|
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);
|
|
|
|
///
|
|
|
|
void selectionChanged(const QModelIndex & current,
|
|
|
|
const QModelIndex & previous);
|
|
|
|
|
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();
|
2008-03-04 21:45:54 +00:00
|
|
|
void setTreeDepth() { setTreeDepth(depth_); }
|
2006-03-29 16:57:47 +00:00
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
protected:
|
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);
|
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();
|
2007-05-15 11:26:24 +00:00
|
|
|
/// Disconnects the selection model.
|
|
|
|
//This is a workaround for a problem of signals blocking.
|
|
|
|
void disconnectSelectionModel();
|
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
|
|
|
///
|
2007-09-08 17:28:14 +00:00
|
|
|
GuiToc & form_;
|
2006-03-05 17:24:44 +00:00
|
|
|
};
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2007-03-12 14:23:44 +00:00
|
|
|
#endif // TOC_WIDGET_H
|