lyx_mirror/src/frontends/qt4/GuiToc.h
André Pönitz e8f16a9bcb frontend cosmetics
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23516 a592a061-630c-0410-9148-cb99ea01b6c8
2008-03-06 19:39:52 +00:00

117 lines
2.1 KiB
C++

// -*- C++ -*-
/**
* \file GuiToc.h
* This file is part of LyX, the document processor.
* Licence details can be found in the file COPYING.
*
* \author John Levon
* \author Kalle Dalheimer
* \author Angus Leeming
* \author Abdelrazak Younes
*
* Full author contact details are available in file CREDITS.
*/
#ifndef GUITOC_H
#define GUITOC_H
#include "DockView.h"
#include "insets/InsetCommandParams.h"
#include "TocBackend.h"
#include <QStandardItemModel>
#include <vector>
namespace lyx {
namespace frontend {
class TocModel;
class TocWidget;
class GuiToc : public DockView
{
Q_OBJECT
public:
///
GuiToc(
GuiView & parent, ///< the main window where to dock.
Qt::DockWidgetArea area = Qt::LeftDockWidgetArea, ///< Position of the dock (and also drawer)
Qt::WindowFlags flags = 0);
~GuiToc();
///
bool initialiseParams(std::string const & data);
///
void updateView();
/// Test if outlining operation is possible
bool canOutline(int type) const;
QStandardItemModel * tocModel(int type);
///
QModelIndex currentIndex(int type) const;
///
void goTo(int type, QModelIndex const & index);
///
int getType();
///
int getTocDepth(int type);
Q_SIGNALS:
/// Signal that the internal toc_models_ has been reset.
void modelReset();
private:
///
TocWidget * widget_;
///
std::vector<TocModel *> toc_models_;
///
void clearTocModels();
public:
///
TocList const & tocs() const;
/// Return the list of types available
QStringList const & typeNames() const { return type_names_; }
/// Return the first TocItem before the cursor
TocIterator currentTocItem(int type) const;
/// Apply the selected outlining operation
void outlineUp();
///
void outlineDown();
///
void outlineIn();
///
void outlineOut();
///
void updateBackend();
/// Return the guiname from a given cmdName of the TOC param
docstring guiName(std::string const & type) const;
/// clean-up on hide.
void clearParams() {}
///
void dispatchParams();
///
bool isBufferDependent() const { return true; }
///
QStringList types_;
///
QStringList type_names_;
};
} // namespace frontend
} // namespace lyx
#endif // GUITOC_H