1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
2003-07-25 21:34:45 +00:00
|
|
|
|
* \file XFormsToolbar.h
|
2002-09-05 15:14:23 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
1999-12-01 00:57:31 +00:00
|
|
|
|
*
|
2002-09-05 14:10:50 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
2003-07-25 18:10:34 +00:00
|
|
|
|
* \author Jean-Marc Lasgouttes
|
2002-09-05 14:10:50 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-03-11 17:00:41 +00:00
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2003-07-25 18:10:34 +00:00
|
|
|
|
#ifndef XFORMSTOOLBAR_H
|
|
|
|
|
#define XFROMSTOOLBAR_H
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
2004-04-28 17:22:05 +00:00
|
|
|
|
#include "LayoutEngine.h"
|
2004-04-29 09:54:59 +00:00
|
|
|
|
#include "XFormsView.h"
|
2004-04-28 17:22:05 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
#include "frontends/Toolbars.h"
|
|
|
|
|
|
|
|
|
|
#include <boost/scoped_ptr.hpp>
|
|
|
|
|
#include <vector>
|
2001-03-15 13:37:04 +00:00
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
namespace frontend {
|
2004-04-29 09:54:59 +00:00
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
|
class Tooltips;
|
2004-04-29 09:54:59 +00:00
|
|
|
|
class XFormsToolbar;
|
2001-07-03 15:19:04 +00:00
|
|
|
|
class XFormsView;
|
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
|
|
|
|
|
class XLayoutBox: public LayoutBox {
|
1999-09-27 18:44:28 +00:00
|
|
|
|
public:
|
2004-04-29 09:54:59 +00:00
|
|
|
|
XLayoutBox(LyXView & owner, XFormsToolbar & toolbar);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
/// 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();
|
2003-07-25 18:10:34 +00:00
|
|
|
|
///
|
2004-04-29 09:54:59 +00:00
|
|
|
|
void setEnabled(bool);
|
|
|
|
|
///
|
|
|
|
|
void selected();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
private:
|
2003-04-09 19:53:10 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
FL_OBJECT * combox_;
|
|
|
|
|
LyXView & owner_;
|
|
|
|
|
};
|
2002-07-22 20:52:40 +00:00
|
|
|
|
|
2003-04-10 14:08:06 +00:00
|
|
|
|
|
2000-02-15 14:28:15 +00:00
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
/** 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);
|
2004-10-05 10:11:42 +00:00
|
|
|
|
void update();
|
2004-04-29 09:54:59 +00:00
|
|
|
|
LayoutBox * layout() const { return layout_.get(); }
|
1999-10-25 14:18:30 +00:00
|
|
|
|
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// an item on the toolbar
|
1999-09-27 18:44:28 +00:00
|
|
|
|
struct toolbarItem
|
|
|
|
|
{
|
2000-07-21 18:47:54 +00:00
|
|
|
|
toolbarItem();
|
2002-07-22 20:52:40 +00:00
|
|
|
|
|
2000-07-21 18:47:54 +00:00
|
|
|
|
~toolbarItem();
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2000-07-21 18:47:54 +00:00
|
|
|
|
toolbarItem & operator=(toolbarItem const & ti);
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2004-04-30 17:30:19 +00:00
|
|
|
|
void generateInactivePixmaps();
|
|
|
|
|
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// deallocate icon
|
|
|
|
|
void kill_icon();
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2003-09-21 18:57:15 +00:00
|
|
|
|
/// lyx action
|
|
|
|
|
FuncRequest func;
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// icon for this item
|
|
|
|
|
FL_OBJECT * icon;
|
2004-04-30 17:30:19 +00:00
|
|
|
|
///
|
|
|
|
|
Pixmap unused_pixmap;
|
|
|
|
|
Pixmap active_pixmap;
|
|
|
|
|
Pixmap inactive_pixmap;
|
2004-05-03 15:41:16 +00:00
|
|
|
|
Pixmap mask;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
2004-04-29 09:54:59 +00:00
|
|
|
|
///
|
|
|
|
|
XFormsView::Position position_;
|
2004-04-28 17:22:05 +00:00
|
|
|
|
///
|
2004-05-19 15:11:37 +00:00
|
|
|
|
Box * toolbar_;
|
2004-04-28 17:22:05 +00:00
|
|
|
|
///
|
2004-05-19 15:11:37 +00:00
|
|
|
|
BoxList * toolbar_buttons_;
|
2004-04-28 17:22:05 +00:00
|
|
|
|
///
|
2004-05-19 15:11:37 +00:00
|
|
|
|
WidgetMap widgets_;
|
2004-04-28 17:22:05 +00:00
|
|
|
|
|
2003-09-21 18:57:15 +00:00
|
|
|
|
typedef std::vector<FuncRequest> Funcs;
|
|
|
|
|
|
|
|
|
|
Funcs funcs;
|
|
|
|
|
|
2000-07-20 11:39:14 +00:00
|
|
|
|
typedef std::vector<toolbarItem> ToolbarList;
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2000-07-20 11:39:14 +00:00
|
|
|
|
/// The list containing all the buttons
|
2002-07-22 20:52:40 +00:00
|
|
|
|
ToolbarList toollist_;
|
|
|
|
|
/// owning view
|
2004-04-29 09:54:59 +00:00
|
|
|
|
XFormsView & owner_;
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// tooltips manager
|
2004-04-29 09:54:59 +00:00
|
|
|
|
boost::scoped_ptr<Tooltips> tooltip_;
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// layout combo
|
2004-04-29 09:54:59 +00:00
|
|
|
|
boost::scoped_ptr<XLayoutBox> layout_;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
|
} // namespace frontend
|
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2003-09-09 18:27:24 +00:00
|
|
|
|
#endif
|