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
|
|
|
|
|
2007-08-14 09:54:59 +00:00
|
|
|
|
#include "Session.h"
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-28 22:53:00 +00:00
|
|
|
|
#include <QList>
|
2006-09-10 11:03:21 +00:00
|
|
|
|
#include <QToolBar>
|
2007-10-01 22:19:39 +00:00
|
|
|
|
#include <QComboBox>
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
namespace lyx {
|
2007-08-31 05:53:55 +00:00
|
|
|
|
|
2007-11-20 22:03:56 +00:00
|
|
|
|
class TextClass;
|
2007-10-01 21:51:06 +00:00
|
|
|
|
class ToolbarItem;
|
2007-08-31 05:53:55 +00:00
|
|
|
|
|
2006-03-05 17:24:44 +00:00
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2007-10-15 22:43:55 +00:00
|
|
|
|
class GuiCommandBuffer;
|
2007-11-05 13:52:37 +00:00
|
|
|
|
class GuiView;
|
2006-06-17 09:14:58 +00:00
|
|
|
|
class Action;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
|
|
|
|
|
2007-10-01 21:26:25 +00:00
|
|
|
|
class GuiLayoutBox : public QComboBox
|
2007-09-05 20:33:29 +00:00
|
|
|
|
{
|
2006-03-05 17:24:44 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2007-11-05 13:52:37 +00:00
|
|
|
|
GuiLayoutBox(GuiView &);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-28 21:41:56 +00:00
|
|
|
|
/// select the right layout in the combobox.
|
2007-07-11 13:39:08 +00:00
|
|
|
|
void set(docstring const & layout);
|
2007-10-15 22:43:55 +00:00
|
|
|
|
/// Populate the layout combobox.
|
2007-11-20 22:03:56 +00:00
|
|
|
|
void updateContents(bool reset);
|
2007-11-10 00:21:42 +00:00
|
|
|
|
/// Add Item to Layout box according to sorting settings from preferences
|
|
|
|
|
void addItemSort(QString const & item, bool sorted);
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
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:
|
2007-11-05 13:52:37 +00:00
|
|
|
|
GuiView & owner_;
|
2007-11-20 22:03:56 +00:00
|
|
|
|
TextClass const * text_class_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
2007-10-01 20:45:50 +00:00
|
|
|
|
class GuiToolbar : public QToolBar
|
2007-09-05 20:33:29 +00:00
|
|
|
|
{
|
2006-03-05 17:24:44 +00:00
|
|
|
|
Q_OBJECT
|
|
|
|
|
public:
|
2007-11-05 13:52:37 +00:00
|
|
|
|
GuiToolbar(ToolbarInfo const &, GuiView &);
|
2006-04-05 23:56:29 +00:00
|
|
|
|
|
2007-10-01 20:45:50 +00:00
|
|
|
|
/// Add a button to the bar.
|
2007-04-19 19:43:15 +00:00
|
|
|
|
void add(ToolbarItem const & item);
|
2007-10-01 20:45:50 +00:00
|
|
|
|
/** update toolbar information
|
|
|
|
|
* ToolbarInfo will then be saved by session
|
|
|
|
|
*/
|
2006-11-02 16:01:36 +00:00
|
|
|
|
void saveInfo(ToolbarSection::ToolbarInfo & info);
|
2007-10-01 20:45:50 +00:00
|
|
|
|
/// Refresh the contents of the bar.
|
|
|
|
|
void updateContents();
|
2007-10-02 06:59:02 +00:00
|
|
|
|
///
|
|
|
|
|
GuiCommandBuffer * commandBuffer() { return command_buffer_; }
|
2006-09-10 11:03:21 +00:00
|
|
|
|
|
2008-01-16 18:27:24 +00:00
|
|
|
|
Action * addItem(ToolbarItem const & item);
|
|
|
|
|
|
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
|
|
|
|
|
2007-09-28 22:53:00 +00:00
|
|
|
|
QList<Action *> actions_;
|
2007-11-05 13:52:37 +00:00
|
|
|
|
GuiView & owner_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
|
2007-09-28 22:53:00 +00:00
|
|
|
|
GuiLayoutBox * layout_;
|
|
|
|
|
GuiCommandBuffer * command_buffer_;
|
2006-03-05 17:24:44 +00:00
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2007-08-31 22:16:11 +00:00
|
|
|
|
#endif // GUITOOLBAR_H
|