1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-03-11 17:00:41 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file Toolbar_pimpl.h
|
|
|
|
|
* Copyright 2002 the LyX Team
|
|
|
|
|
* Copyright 1996-2001 Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* Read the file COPYING
|
1999-12-01 00:57:31 +00:00
|
|
|
|
*
|
2002-03-11 17:00:41 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes, larsbj@lyx.org
|
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
|
#ifndef TOOLBAR_PIMPL_H
|
|
|
|
|
#define TOOLBAR_PIMPL_H
|
|
|
|
|
|
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"
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
#pragma interface
|
|
|
|
|
#endif
|
|
|
|
|
|
2001-07-03 15:19:04 +00:00
|
|
|
|
class XFormsView;
|
2002-03-11 09:54:42 +00:00
|
|
|
|
class Tooltips;
|
2002-07-21 21:21:06 +00:00
|
|
|
|
class Combox;
|
2001-07-03 15:19:04 +00:00
|
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
|
/** The LyX xforms toolbar class
|
1999-09-27 18:44:28 +00:00
|
|
|
|
*/
|
2000-07-24 13:53:19 +00:00
|
|
|
|
struct Toolbar::Pimpl {
|
1999-09-27 18:44:28 +00:00
|
|
|
|
public:
|
2001-03-07 14:25:31 +00:00
|
|
|
|
/// called when user selects a layout from combox
|
|
|
|
|
static void layoutSelectedCB(int, void *, Combox *);
|
2002-07-22 20:52:40 +00:00
|
|
|
|
|
|
|
|
|
/// create an empty toolbar
|
2002-08-12 14:28:43 +00:00
|
|
|
|
Pimpl(LyXView * o, int x, int y);
|
2002-03-21 21:21:28 +00:00
|
|
|
|
|
2002-07-22 20:52:40 +00:00
|
|
|
|
~Pimpl();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
/// add a new button to the toolbar.
|
2002-07-22 20:52:40 +00:00
|
|
|
|
void add(int action);
|
|
|
|
|
|
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
|
2002-03-02 16:39:54 +00:00
|
|
|
|
void setLayout(string const & layout);
|
2000-07-24 13:53:19 +00:00
|
|
|
|
/// Populate the layout combox; re-do everything if force is true.
|
|
|
|
|
void updateLayoutList(bool force);
|
|
|
|
|
/// Drop down the layout list
|
|
|
|
|
void openLayoutList();
|
|
|
|
|
/// Erase the layout list
|
|
|
|
|
void clearLayoutList();
|
2001-09-06 12:42:47 +00:00
|
|
|
|
/// the non-static version of layoutSelectedCB
|
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-07-22 20:52:40 +00:00
|
|
|
|
|
2000-07-21 18:47:54 +00:00
|
|
|
|
toolbarItem & operator=(toolbarItem const & ti);
|
2002-07-22 20:52:40 +00:00
|
|
|
|
|
|
|
|
|
/// deallocate icon
|
|
|
|
|
void kill_icon();
|
|
|
|
|
|
|
|
|
|
/// lyx action number
|
|
|
|
|
int action;
|
|
|
|
|
/// icon for this item
|
|
|
|
|
FL_OBJECT * icon;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
2000-07-20 11:39:14 +00:00
|
|
|
|
typedef std::vector<toolbarItem> ToolbarList;
|
2002-07-22 20:52:40 +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
|
|
|
|
|
Combox * combox_;
|
|
|
|
|
/// 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-07-22 20:52:40 +00:00
|
|
|
|
|
|
|
|
|
#endif // TOOLBAR_PIMPL_H
|