]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt4/QLToolbar.h
Transfer Text::drawSelection() from InsetText::drawSelection() to InsetText::draw...
[lyx.git] / src / frontends / qt4 / QLToolbar.h
index c1c22eab64c478683318ec871fd5563f94141579..f2f97ce74148c152a274650ebef8ed4716d7e2e0 100644 (file)
 #define QLTOOLBAR_H
 
 #include "frontends/Toolbars.h"
+#include "Session.h"
+
+#include <QToolBar>
+
 #include <boost/scoped_ptr.hpp>
 
-#include <QObject>
 #include <vector>
 
 class QComboBox;
-class QToolBar;
 
 namespace lyx {
+class FuncRequest;
 namespace frontend {
 
+class QCommandBuffer;
 class QLayoutBox;
-class QtView;
-class QLAction;
+class GuiView;
+class Action;
 
 
 class QLayoutBox : public QObject, public LayoutBox {
        Q_OBJECT
 public:
-       QLayoutBox(QToolBar *, QtView &);
+       QLayoutBox(QToolBar *, GuiView &);
 
        /// select the right layout in the combox.
-       void set(std::string const & layout);
+       void set(docstring const & layout);
        /// Populate the layout combox.
        void update();
        /// Erase the layout list.
@@ -49,39 +53,47 @@ public:
        ///
        void setEnabled(bool);
 
-private slots:
+private Q_SLOTS:
        void selected(const QString & str);
 
 private:
        QComboBox * combo_;
-       QtView & owner_;
+       GuiView & owner_;
 };
 
 
-class QLToolbar : public QObject, public Toolbar {
+class QLToolbar : public QToolBar, public Toolbar {
        Q_OBJECT
 public:
-       QLToolbar(ToolbarBackend::Toolbar const &, LyXView &);
-       
+       QLToolbar(ToolbarInfo const &, GuiView &);
+
        //~QLToolbar();
 
-       void add(FuncRequest const & func, std::string const & tooltip);
+       void add(ToolbarItem const & item);
        void hide(bool);
        void show(bool);
+       bool isVisible() const;
+       void saveInfo(ToolbarSection::ToolbarInfo & info);
        void update();
        LayoutBox * layout() const { return layout_.get(); }
+       ///
+       void focusCommandBuffer();
+
+Q_SIGNALS:
+       void updated();
 
 private:
-       
-       std::vector<QLAction *> ActionVector;
-       QtView & owner_;
-       QToolBar * toolbar_;
+       QCommandBuffer * command_buffer_;
+
+       std::vector<Action *> ActionVector;
+       GuiView & owner_;
 
        boost::scoped_ptr<QLayoutBox> layout_;
-       
-       Qt::ToolBarArea tba;
 };
 
+/// return a full path of an XPM for the given action
+std::string const getIcon(FuncRequest const & f, bool unknown = true);
+
 } // namespace frontend
 } // namespace lyx