2002-06-19 03:38:44 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
2003-10-08 11:31:51 +00:00
|
|
|
|
* \file QLToolbar.h
|
2002-09-24 13:57:09 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-06-19 03:38:44 +00:00
|
|
|
|
*
|
2002-09-24 13:57:09 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2003-07-25 18:10:34 +00:00
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Jean-Marc Lasgouttes
|
2004-04-29 09:54:59 +00:00
|
|
|
|
* \author Angus Leeming
|
2002-09-24 13:57:09 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-19 03:38:44 +00:00
|
|
|
|
*/
|
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
#ifndef QLTOOLBAR_H
|
2003-07-25 18:10:34 +00:00
|
|
|
|
#define QLTOOLBAR_H
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
#include "frontends/Toolbars.h"
|
2002-09-24 13:57:09 +00:00
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
2003-09-07 21:25:37 +00:00
|
|
|
|
|
2002-11-26 01:52:51 +00:00
|
|
|
|
#include <qobject.h>
|
|
|
|
|
|
2003-09-07 21:25:37 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
class QComboBox;
|
2002-06-19 03:38:44 +00:00
|
|
|
|
class QToolBar;
|
2004-04-29 09:54:59 +00:00
|
|
|
|
class QToolButton;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
class QtView;
|
|
|
|
|
class QLayoutBox;
|
|
|
|
|
class QLToolbar;
|
2002-07-22 21:43:27 +00:00
|
|
|
|
|
2003-04-10 14:08:06 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
class QLayoutBox : public QObject, public LayoutBox {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
QLayoutBox(QWidget *, QtView &);
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
/// select the right layout in the combox.
|
|
|
|
|
void set(std::string const & layout);
|
2003-07-25 18:10:34 +00:00
|
|
|
|
/// Populate the layout combox.
|
2004-04-29 09:54:59 +00:00
|
|
|
|
void update();
|
|
|
|
|
/// Erase the layout list.
|
|
|
|
|
void clear();
|
|
|
|
|
/// Display the layout list.
|
|
|
|
|
void open();
|
|
|
|
|
///
|
|
|
|
|
void setEnabled(bool);
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
private slots:
|
|
|
|
|
void selected(const QString & str);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
private:
|
|
|
|
|
QComboBox * combo_;
|
|
|
|
|
QtView & owner_;
|
|
|
|
|
};
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
class QLToolbar : public QObject, public Toolbar {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
|
|
|
|
QLToolbar(ToolbarBackend::Toolbar const &, LyXView &);
|
|
|
|
|
void add(FuncRequest const & func, std::string const & tooltip);
|
|
|
|
|
void hide(bool);
|
|
|
|
|
void show(bool);
|
|
|
|
|
void update();
|
|
|
|
|
LayoutBox * layout() const { return layout_.get(); }
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
private slots:
|
|
|
|
|
void clicked();
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
private:
|
2003-09-21 18:57:15 +00:00
|
|
|
|
typedef std::map<QToolButton *, FuncRequest> ButtonMap;
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
QtView & owner_;
|
|
|
|
|
QToolBar * toolbar_;
|
2002-06-19 03:38:44 +00:00
|
|
|
|
ButtonMap map_;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
boost::scoped_ptr<QLayoutBox> layout_;
|
2002-06-19 03:38:44 +00:00
|
|
|
|
};
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
#endif // NOT QLTOOLBAR_H
|