2006-03-05 17:24:44 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
|
|
|
|
* \file QLToolbar.h
|
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
|
|
|
|
*
|
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author John Levon
|
|
|
|
|
* \author Jean-Marc Lasgouttes
|
|
|
|
|
* \author Angus Leeming
|
|
|
|
|
* \author Abdelrazak Younes
|
|
|
|
|
*
|
|
|
|
|
* Full author contact details are available in file CREDITS.
|
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef QLTOOLBAR_H
|
|
|
|
|
#define QLTOOLBAR_H
|
|
|
|
|
|
|
|
|
|
#include "frontends/Toolbars.h"
|
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
|
2006-09-10 11:03:21 +00:00
|
|
|
|
#include <QToolBar>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include <vector>
|
2006-11-02 16:01:36 +00:00
|
|
|
|
#include "session.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
class QComboBox;
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2007-04-19 19:43:15 +00:00
|
|
|
|
class FuncRequest;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
|
|
class QLayoutBox;
|
2006-06-20 09:33:01 +00:00
|
|
|
|
class GuiView;
|
2006-06-17 09:14:58 +00:00
|
|
|
|
class Action;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
|
|
|
|
class QLayoutBox : public QObject, public LayoutBox {
|
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2006-06-20 09:33:01 +00:00
|
|
|
|
QLayoutBox(QToolBar *, GuiView &);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// select the right layout in the combox.
|
|
|
|
|
void set(std::string const & layout);
|
|
|
|
|
/// Populate the layout combox.
|
|
|
|
|
void update();
|
|
|
|
|
/// Erase the layout list.
|
|
|
|
|
void clear();
|
|
|
|
|
/// Display the layout list.
|
|
|
|
|
void open();
|
|
|
|
|
///
|
|
|
|
|
void setEnabled(bool);
|
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
|
private Q_SLOTS:
|
2006-03-05 17:24:44 +00:00
|
|
|
|
void selected(const QString & str);
|
|
|
|
|
|
|
|
|
|
private:
|
|
|
|
|
QComboBox * combo_;
|
2006-06-20 09:33:01 +00:00
|
|
|
|
GuiView & owner_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2006-09-10 11:03:21 +00:00
|
|
|
|
class QLToolbar : public QToolBar, public Toolbar {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2007-04-19 19:43:15 +00:00
|
|
|
|
QLToolbar(ToolbarInfo const &, GuiView &);
|
2006-04-05 23:56:29 +00:00
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
//~QLToolbar();
|
|
|
|
|
|
2007-04-19 19:43:15 +00:00
|
|
|
|
void add(ToolbarItem const & item);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
void hide(bool);
|
|
|
|
|
void show(bool);
|
2006-11-02 16:01:36 +00:00
|
|
|
|
void saveInfo(ToolbarSection::ToolbarInfo & info);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
void update();
|
|
|
|
|
LayoutBox * layout() const { return layout_.get(); }
|
|
|
|
|
|
2006-09-10 11:03:21 +00:00
|
|
|
|
|
|
|
|
|
|
2006-06-30 14:37:33 +00:00
|
|
|
|
Q_SIGNALS:
|
2006-05-31 12:53:05 +00:00
|
|
|
|
void updated();
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
private:
|
2006-04-05 23:56:29 +00:00
|
|
|
|
|
2006-06-17 09:14:58 +00:00
|
|
|
|
std::vector<Action *> ActionVector;
|
2006-06-20 09:33:01 +00:00
|
|
|
|
GuiView & owner_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
boost::scoped_ptr<QLayoutBox> layout_;
|
|
|
|
|
};
|
|
|
|
|
|
2007-04-19 19:43:15 +00:00
|
|
|
|
/// return a full path of an XPM for the given action
|
2007-04-19 20:29:27 +00:00
|
|
|
|
std::string const getIcon(FuncRequest const & f, bool unknown = true);
|
2007-04-19 19:43:15 +00:00
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
|
|
|
|
#endif // NOT QLTOOLBAR_H
|