2000-07-24 13:53:19 +00:00
|
|
|
|
// -*- C++ -*-
|
|
|
|
|
/* This file is part of
|
|
|
|
|
* ======================================================
|
|
|
|
|
*
|
|
|
|
|
* LyX, The Document Processor
|
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
|
|
|
|
* Copyright 1995-2000 The LyX Team.
|
|
|
|
|
*
|
|
|
|
|
* This file is Copyright 1996-2000
|
|
|
|
|
* Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
*
|
|
|
|
|
* ====================================================== */
|
|
|
|
|
|
|
|
|
|
#ifndef MENUBAR_PIMPL_H
|
|
|
|
|
#define MENUBAR_PIMPL_H
|
|
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
|
#pragma interface
|
|
|
|
|
#endif
|
|
|
|
|
|
|
|
|
|
#include <vector>
|
|
|
|
|
#include "LString.h"
|
|
|
|
|
#include "frontends/Menubar.h"
|
2000-08-30 03:40:51 +00:00
|
|
|
|
#include "commandtags.h"
|
2000-07-24 13:53:19 +00:00
|
|
|
|
#include FORMS_H_LOCATION
|
|
|
|
|
class LyXView;
|
|
|
|
|
class MenuBackend;
|
|
|
|
|
class MenuItem;
|
|
|
|
|
|
|
|
|
|
#include "debug.h"
|
|
|
|
|
|
|
|
|
|
/** The LyX GUI independent menubar class
|
|
|
|
|
The GUI interface is implemented in the corresponding Menubar_pimpl class.
|
|
|
|
|
*/
|
|
|
|
|
struct Menubar::Pimpl {
|
|
|
|
|
public:
|
|
|
|
|
///
|
|
|
|
|
Pimpl(LyXView *, MenuBackend const &);
|
|
|
|
|
///
|
|
|
|
|
~Pimpl();
|
|
|
|
|
///
|
|
|
|
|
void set(string const &);
|
|
|
|
|
/// Opens a top-level submenu given its name
|
|
|
|
|
void openByName(string const &);
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
static void MenuCallback(FL_OBJECT *, long);
|
|
|
|
|
|
2000-08-14 15:31:16 +00:00
|
|
|
|
/** Add to "menu" the list of last opened files
|
|
|
|
|
(add "extra_label" to the last entry)
|
|
|
|
|
*/
|
2000-08-31 11:51:59 +00:00
|
|
|
|
void add_lastfiles(int menu, string const & extra_label);
|
2000-08-14 15:31:16 +00:00
|
|
|
|
/** Add to "menu" the list of opened documents
|
|
|
|
|
(add "extra_label" to the last entry)
|
|
|
|
|
*/
|
2000-08-31 11:51:59 +00:00
|
|
|
|
void add_documents(int menu, string const & extra_label);
|
2000-08-30 03:40:51 +00:00
|
|
|
|
/// Add to "menu" the list of exportable/viewable formats
|
|
|
|
|
/// (add "extra_label" to the last entry)
|
|
|
|
|
void add_formats(int menu, string const & extra_label,
|
|
|
|
|
kb_action action, bool viewable);
|
2000-07-24 13:53:19 +00:00
|
|
|
|
///
|
2000-08-31 11:51:59 +00:00
|
|
|
|
void add_toc(int menu, string const & extra_label,
|
|
|
|
|
std::vector<int> & smn, Window win);
|
|
|
|
|
///
|
|
|
|
|
void add_references(int menu, string const & extra_label,
|
|
|
|
|
std::vector<int> & smn, Window win);
|
|
|
|
|
///
|
|
|
|
|
int create_submenu(Window win, LyXView * view,
|
|
|
|
|
string const & menuname,
|
|
|
|
|
std::vector<int> & smn);
|
2000-07-24 13:53:19 +00:00
|
|
|
|
|
2000-08-09 13:51:59 +00:00
|
|
|
|
/// update the state of the menuitems
|
2000-08-14 15:31:16 +00:00
|
|
|
|
void update() {}
|
2000-07-24 13:53:19 +00:00
|
|
|
|
private:
|
|
|
|
|
///
|
|
|
|
|
FL_OBJECT * frame_;
|
|
|
|
|
///
|
|
|
|
|
LyXView * owner_;
|
|
|
|
|
///
|
|
|
|
|
MenuBackend const * menubackend_;
|
|
|
|
|
///
|
|
|
|
|
string current_menu;
|
|
|
|
|
///
|
|
|
|
|
struct ItemInfo {
|
|
|
|
|
///
|
|
|
|
|
ItemInfo(Menubar::Pimpl * p, MenuItem const * i,
|
|
|
|
|
FL_OBJECT * o)
|
|
|
|
|
: pimpl_(p), item_(i), obj_(o) {}
|
|
|
|
|
///
|
|
|
|
|
Menubar::Pimpl * pimpl_;
|
|
|
|
|
///
|
|
|
|
|
MenuItem const * item_;
|
|
|
|
|
///
|
|
|
|
|
FL_OBJECT * obj_;
|
|
|
|
|
};
|
|
|
|
|
|
|
|
|
|
///
|
|
|
|
|
typedef std::vector<ItemInfo *> ButtonList;
|
|
|
|
|
///
|
|
|
|
|
ButtonList buttonlist_;
|
|
|
|
|
};
|
|
|
|
|
#endif
|