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>
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#include FORMS_H_LOCATION
|
2001-03-15 13:37:04 +00:00
|
|
|
|
|
|
|
|
|
#include "frontends/Toolbar.h"
|
|
|
|
|
|
2000-07-21 18:47:54 +00:00
|
|
|
|
#include "commandtags.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
#include "combox.h"
|
2000-07-24 13:53:19 +00:00
|
|
|
|
#include "ToolbarDefaults.h"
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2001-03-15 13:37:04 +00:00
|
|
|
|
#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;
|
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 *);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-07-24 13:53:19 +00:00
|
|
|
|
Pimpl(LyXView * o, int x, int y);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2002-03-11 09:54:42 +00:00
|
|
|
|
~Pimpl();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
/// (re)sets the toolbar
|
1999-12-01 00:57:31 +00:00
|
|
|
|
void set(bool doingmain = false);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
|
|
/** this is to be the entry point to the toolbar
|
2000-08-14 15:31:16 +00:00
|
|
|
|
frame, where you can change the toolbar realtime.
|
|
|
|
|
*/
|
1999-09-27 18:44:28 +00:00
|
|
|
|
void edit();
|
|
|
|
|
/// add a new button to the toolbar.
|
2000-09-26 13:54:57 +00:00
|
|
|
|
void add(int, bool doclean = true);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// invokes the n'th icon in the toolbar
|
|
|
|
|
void push(int);
|
|
|
|
|
/// activates the toolbar
|
|
|
|
|
void activate();
|
|
|
|
|
/// deactivates the toolbar
|
|
|
|
|
void deactivate();
|
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
|
|
|
|
|
void layoutSelected();
|
1999-10-25 14:18:30 +00:00
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
|
|
|
|
struct toolbarItem
|
|
|
|
|
{
|
|
|
|
|
///
|
|
|
|
|
int action;
|
|
|
|
|
///
|
1999-12-01 00:57:31 +00:00
|
|
|
|
FL_OBJECT * icon;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-07-21 18:47:54 +00:00
|
|
|
|
toolbarItem();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2000-07-21 18:47:54 +00:00
|
|
|
|
void clean();
|
2000-07-20 11:39:14 +00:00
|
|
|
|
///
|
2000-07-21 18:47:54 +00:00
|
|
|
|
~toolbarItem();
|
|
|
|
|
///
|
|
|
|
|
toolbarItem & operator=(toolbarItem const & ti);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
|
2000-07-20 11:39:14 +00:00
|
|
|
|
/// typedef to simplify things
|
|
|
|
|
typedef std::vector<toolbarItem> ToolbarList;
|
|
|
|
|
/// The list containing all the buttons
|
|
|
|
|
ToolbarList toollist;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2001-07-03 15:19:04 +00:00
|
|
|
|
XFormsView * owner;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
2002-03-11 09:54:42 +00:00
|
|
|
|
Tooltips * tooltip_;
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
|
|
|
|
Combox * combox;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
/// Starting position
|
2000-08-14 15:31:16 +00:00
|
|
|
|
int sxpos;
|
|
|
|
|
///
|
|
|
|
|
int sypos;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
///
|
|
|
|
|
int xpos;
|
|
|
|
|
///
|
|
|
|
|
int ypos;
|
|
|
|
|
///
|
|
|
|
|
bool cleaned;
|
|
|
|
|
|
|
|
|
|
/// removes all toolbar buttons from the toolbar.
|
|
|
|
|
void clean();
|
|
|
|
|
|
2000-08-14 15:31:16 +00:00
|
|
|
|
/// more...
|
2000-07-21 18:47:54 +00:00
|
|
|
|
void reset();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2000-08-14 15:31:16 +00:00
|
|
|
|
/// more...
|
2000-07-24 13:53:19 +00:00
|
|
|
|
void lightReset();
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
|
|
|
|
#endif
|