]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/xforms/XFormsToolbar.h
Change glob() API to accept a dir parameter.
[lyx.git] / src / frontends / xforms / XFormsToolbar.h
index 3b62f7a778718d798a65801b2175e25ef1f45432..8e2c680e957a3a087fe5637fb37a26c8f3462ace 100644 (file)
 #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(int action, 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
@@ -64,29 +78,48 @@ public:
 
                toolbarItem & operator=(toolbarItem const & ti);
 
+               void generateInactivePixmaps();
+
                /// deallocate icon
                void kill_icon();
 
-               /// lyx action number
-               int action;
+               /// lyx action
+               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;
+
        typedef std::vector<toolbarItem> ToolbarList;
 
        /// 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_;
 };
 
-#endif 
+} // namespace frontend
+} // namespace lyx
+
+#endif