#ifndef XFORMSTOOLBAR_H
#define XFROMSTOOLBAR_H
+#include "LayoutEngine.h"
+#include "XFormsView.h"
+
+#include "frontends/Toolbars.h"
+
+#include <boost/scoped_ptr.hpp>
#include <vector>
-#include "forms_fwd.h"
-#include "frontends/Toolbar.h"
-#include "ToolbarBackend.h"
+namespace lyx {
+namespace frontend {
-class XFormsView;
class Tooltips;
+class XFormsToolbar;
+class XFormsView;
-/** The LyX xforms toolbar class
- */
-class XFormsToolbar : public Toolbar {
+
+class XLayoutBox: public LayoutBox {
public:
- /// create an empty toolbar
- XFormsToolbar(LyXView * o, int x, int y);
+ XLayoutBox(LyXView & owner, XFormsToolbar & toolbar);
+ /// 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();
///
- ~XFormsToolbar();
+ void setEnabled(bool);
+ ///
+ void selected();
- /// add a new toolbar
- void add(ToolbarBackend::Toolbar const & tb);
+private:
- /// add an item to a toolbar
- void add(FuncRequest const &, string const & tooltip);
+ FL_OBJECT * combox_;
+ LyXView & owner_;
+};
- /// display toolbar, not implemented
- void displayToolbar(ToolbarBackend::Toolbar const & tb, bool show);
- /// update the state of the icons
- void update();
- /// select the right layout in the combox
- void setLayout(string const & layout);
- /// Populate the layout combox.
- void updateLayoutList();
- /// Drop down the layout list
- void openLayoutList();
- /// Erase the layout list
- void clearLayoutList();
- ///
- void layoutSelected();
+/** The LyX xforms toolbar class
+ */
+class XFormsToolbar : public Toolbar {
+ friend class XLayoutBox;
+
+public:
+ XFormsToolbar(ToolbarBackend::Toolbar const & tbb, LyXView & o);
+ ~XFormsToolbar();
+
+ void add(FuncRequest const & func, std::string const & tooltip);
+ void hide(bool);
+ void show(bool);
+ void update();
+ LayoutBox * layout() const { return layout_.get(); }
/// an item on the toolbar
struct toolbarItem
toolbarItem & operator=(toolbarItem const & ti);
+ void generateInactivePixmaps();
+
/// deallocate icon
void kill_icon();
FuncRequest func;
/// icon for this item
FL_OBJECT * icon;
+ ///
+ Pixmap unused_pixmap;
+ Pixmap active_pixmap;
+ Pixmap inactive_pixmap;
+ Pixmap mask;
};
+ ///
+ XFormsView::Position position_;
+ ///
+ boost::shared_ptr<Box> toolbar_;
+ ///
+ BoxList * toolbar_buttons_;
+ ///
+ WidgetMap widgets_;
+
typedef std::vector<FuncRequest> Funcs;
Funcs funcs;
/// The list containing all the buttons
ToolbarList toollist_;
/// owning view
- XFormsView * owner_;
+ XFormsView & owner_;
/// tooltips manager
- Tooltips * tooltip_;
+ boost::scoped_ptr<Tooltips> tooltip_;
/// layout combo
- FL_OBJECT * combox_;
- /// x position of end of toolbar
- int xpos;
- /// y position of end of toolbar
- int ypos;
+ boost::scoped_ptr<XLayoutBox> layout_;
};
+} // namespace frontend
+} // namespace lyx
+
#endif