mirror of
https://git.lyx.org/repos/lyx.git
synced 2024-09-24 00:50:29 +00:00
2b3bd7b5f4
At this point, there are no simple TextClass objects in the main LyX code, and it is impossible to create them, since the TextClass constructor is protected. Only LayoutFile and DocumentClass objects can be constructed, and for the most part these are constructed only by their respective containers: BaseClassList and DocumentClassBundle. There is an exception: LayoutFile does have a public default constructor, but if anyone knows how to make it go away, please do. There will be one or two more commits along these lines, but these will be simple renamings. For example, BaseClassList should be LayoutFileList. git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@23343 a592a061-630c-0410-9148-cb99ea01b6c8
96 lines
1.8 KiB
C++
96 lines
1.8 KiB
C++
// -*- C++ -*-
|
|
/**
|
|
* \file GuiToolbar.h
|
|
* This file is part of LyX, the document processor.
|
|
* Licence details can be found in the file COPYING.
|
|
*
|
|
* \author Lars Gullik Bjønnes
|
|
* \author John Levon
|
|
* \author Jean-Marc Lasgouttes
|
|
* \author Angus Leeming
|
|
* \author Abdelrazak Younes
|
|
*
|
|
* Full author contact details are available in file CREDITS.
|
|
*/
|
|
|
|
#ifndef GUITOOLBAR_H
|
|
#define GUITOOLBAR_H
|
|
|
|
#include "Session.h"
|
|
|
|
#include <QList>
|
|
#include <QToolBar>
|
|
#include <QComboBox>
|
|
|
|
namespace lyx {
|
|
|
|
class Inset;
|
|
class DocumentClass;
|
|
class ToolbarItem;
|
|
|
|
namespace frontend {
|
|
|
|
class GuiCommandBuffer;
|
|
class GuiView;
|
|
class Action;
|
|
|
|
|
|
class GuiLayoutBox : public QComboBox
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
GuiLayoutBox(GuiView &);
|
|
|
|
/// select the right layout in the combobox.
|
|
void set(docstring const & layout);
|
|
/// Populate the layout combobox.
|
|
void updateContents(bool reset);
|
|
/// Add Item to Layout box according to sorting settings from preferences
|
|
void addItemSort(QString const & item, bool sorted);
|
|
|
|
private Q_SLOTS:
|
|
void selected(const QString & str);
|
|
|
|
private:
|
|
GuiView & owner_;
|
|
DocumentClass const * text_class_;
|
|
Inset const * inset_;
|
|
};
|
|
|
|
|
|
class GuiToolbar : public QToolBar
|
|
{
|
|
Q_OBJECT
|
|
public:
|
|
GuiToolbar(ToolbarInfo const &, GuiView &);
|
|
|
|
/// Add a button to the bar.
|
|
void add(ToolbarItem const & item);
|
|
/** update toolbar information
|
|
* ToolbarInfo will then be saved by session
|
|
*/
|
|
void saveInfo(ToolbarSection::ToolbarInfo & info);
|
|
/// Refresh the contents of the bar.
|
|
void updateContents();
|
|
///
|
|
GuiCommandBuffer * commandBuffer() { return command_buffer_; }
|
|
|
|
Action * addItem(ToolbarItem const & item);
|
|
|
|
Q_SIGNALS:
|
|
void updated();
|
|
|
|
private:
|
|
|
|
QList<Action *> actions_;
|
|
GuiView & owner_;
|
|
|
|
GuiLayoutBox * layout_;
|
|
GuiCommandBuffer * command_buffer_;
|
|
};
|
|
|
|
} // namespace frontend
|
|
} // namespace lyx
|
|
|
|
#endif // GUITOOLBAR_H
|