2006-03-05 17:24:44 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/**
|
2007-08-31 05:53:55 +00:00
|
|
|
|
* \file GuiToolbar.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 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.
|
|
|
|
|
*/
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
#ifndef GUITOOLBAR_H
|
|
|
|
|
#define GUITOOLBAR_H
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
#include "frontends/Toolbars.h"
|
2007-08-14 09:54:59 +00:00
|
|
|
|
#include "Session.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2006-09-10 11:03:21 +00:00
|
|
|
|
#include <QToolBar>
|
2007-08-14 09:54:59 +00:00
|
|
|
|
|
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
#include <vector>
|
|
|
|
|
|
|
|
|
|
class QComboBox;
|
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2007-08-31 05:53:55 +00:00
|
|
|
|
|
2007-04-19 19:43:15 +00:00
|
|
|
|
class FuncRequest;
|
2007-08-31 05:53:55 +00:00
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
class GuiCommandBuffer;
|
|
|
|
|
class GuiLayoutBox;
|
|
|
|
|
class GuiViewBase;
|
2006-06-17 09:14:58 +00:00
|
|
|
|
class Action;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
class GuiLayoutBox : public QObject, public LayoutBox {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiLayoutBox(QToolBar *, GuiViewBase &);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
/// select the right layout in the combox.
|
2007-07-11 13:39:08 +00:00
|
|
|
|
void set(docstring const & layout);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
/// 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_;
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiViewBase & owner_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
class GuiToolbar : public QToolBar, public Toolbar {
|
2006-03-05 17:24:44 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiToolbar(ToolbarInfo const &, GuiViewBase &);
|
2006-04-05 23:56:29 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
//~GuiToolbar();
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
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);
|
2007-05-23 22:08:07 +00:00
|
|
|
|
bool isVisible() const;
|
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(); }
|
2007-08-24 07:13:07 +00:00
|
|
|
|
///
|
|
|
|
|
void focusCommandBuffer();
|
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:
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiCommandBuffer * command_buffer_;
|
2006-04-05 23:56:29 +00:00
|
|
|
|
|
2006-06-17 09:14:58 +00:00
|
|
|
|
std::vector<Action *> ActionVector;
|
2007-08-31 05:53:55 +00:00
|
|
|
|
GuiViewBase & owner_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-08-31 05:53:55 +00:00
|
|
|
|
boost::scoped_ptr<GuiLayoutBox> layout_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
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
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
#endif // GUITOOLBAR_H
|