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
|
|
|
|
|
2000-07-20 11:39:14 +00:00
|
|
|
|
#include <vector>
|
2002-06-13 13:43:51 +00:00
|
|
|
|
#include "forms_fwd.h"
|
2001-03-15 13:37:04 +00:00
|
|
|
|
|
|
|
|
|
#include "frontends/Toolbar.h"
|
2003-04-09 19:53:10 +00:00
|
|
|
|
#include "ToolbarBackend.h"
|
2001-03-15 13:37:04 +00:00
|
|
|
|
|
2001-07-03 15:19:04 +00:00
|
|
|
|
class XFormsView;
|
2002-03-11 09:54:42 +00:00
|
|
|
|
class Tooltips;
|
2001-07-03 15:19:04 +00:00
|
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
|
/** The LyX xforms toolbar class
|
2003-04-02 09:49:19 +00:00
|
|
|
|
*/
|
2003-07-25 18:10:34 +00:00
|
|
|
|
class XFormsToolbar : public Toolbar {
|
1999-09-27 18:44:28 +00:00
|
|
|
|
public:
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// create an empty toolbar
|
2003-07-25 18:10:34 +00:00
|
|
|
|
XFormsToolbar(LyXView * o, int x, int y);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
2003-07-25 18:10:34 +00:00
|
|
|
|
///
|
|
|
|
|
~XFormsToolbar();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2003-04-09 19:53:10 +00:00
|
|
|
|
/// add a new toolbar
|
|
|
|
|
void add(ToolbarBackend::Toolbar const & tb);
|
|
|
|
|
|
|
|
|
|
/// add an item to a toolbar
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void add(FuncRequest const &, std::string const & tooltip);
|
2002-07-22 20:52:40 +00:00
|
|
|
|
|
2003-04-10 14:08:06 +00:00
|
|
|
|
/// display toolbar, not implemented
|
2003-05-08 18:05:07 +00:00
|
|
|
|
void displayToolbar(ToolbarBackend::Toolbar const & tb, bool show);
|
2003-04-10 14:08:06 +00:00
|
|
|
|
|
2000-07-20 11:39:14 +00:00
|
|
|
|
/// update the state of the icons
|
|
|
|
|
void update();
|
2000-02-15 14:28:15 +00:00
|
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
|
/// select the right layout in the combox
|
2003-10-06 15:43:21 +00:00
|
|
|
|
void setLayout(std::string const & layout);
|
2003-07-25 18:10:34 +00:00
|
|
|
|
/// Populate the layout combox.
|
|
|
|
|
void updateLayoutList();
|
2000-07-24 13:53:19 +00:00
|
|
|
|
/// Drop down the layout list
|
|
|
|
|
void openLayoutList();
|
|
|
|
|
/// Erase the layout list
|
|
|
|
|
void clearLayoutList();
|
2003-04-02 14:20:30 +00:00
|
|
|
|
///
|
2002-03-21 21:21:28 +00:00
|
|
|
|
void layoutSelected();
|
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
|
|
|
|
|
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;
|
1999-09-27 18:44:28 +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
|
|
|
|
|
XFormsView * owner_;
|
|
|
|
|
/// tooltips manager
|
2002-03-11 09:54:42 +00:00
|
|
|
|
Tooltips * tooltip_;
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// layout combo
|
2003-04-02 14:20:30 +00:00
|
|
|
|
FL_OBJECT * combox_;
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// x position of end of toolbar
|
1999-09-27 18:44:28 +00:00
|
|
|
|
int xpos;
|
2002-07-22 20:52:40 +00:00
|
|
|
|
/// y position of end of toolbar
|
1999-09-27 18:44:28 +00:00
|
|
|
|
int ypos;
|
|
|
|
|
};
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2003-09-09 18:27:24 +00:00
|
|
|
|
#endif
|