1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
2001-07-03 15:19:04 +00:00
|
|
|
|
|
|
|
#ifndef LYXVIEW_BASE_H
|
|
|
|
#define LYXVIEW_BASE_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-07-03 15:19:04 +00:00
|
|
|
#include <boost/utility.hpp>
|
|
|
|
#include <sigc++/signal_system.h>
|
1999-11-04 01:40:20 +00:00
|
|
|
|
2000-09-14 17:53:12 +00:00
|
|
|
#include "LString.h"
|
2001-11-29 17:12:21 +00:00
|
|
|
#include "support/types.h"
|
2000-07-24 13:53:19 +00:00
|
|
|
|
2001-07-03 15:19:04 +00:00
|
|
|
class Buffer;
|
1999-09-27 18:44:28 +00:00
|
|
|
class Toolbar;
|
|
|
|
class MiniBuffer;
|
|
|
|
class Intl;
|
2000-07-24 13:53:19 +00:00
|
|
|
class Menubar;
|
|
|
|
|
2000-04-08 17:02:02 +00:00
|
|
|
class BufferView;
|
2000-06-12 11:27:15 +00:00
|
|
|
class Dialogs;
|
2001-07-03 15:19:04 +00:00
|
|
|
class LyXFunc;
|
2002-02-18 19:13:48 +00:00
|
|
|
class Timeout;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-07-03 15:19:04 +00:00
|
|
|
///
|
2001-04-17 15:15:59 +00:00
|
|
|
class LyXView : public SigC::Object, boost::noncopyable {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
2001-07-03 15:19:04 +00:00
|
|
|
///
|
|
|
|
LyXView();
|
|
|
|
///
|
|
|
|
virtual ~LyXView();
|
|
|
|
///
|
|
|
|
virtual void init() = 0;
|
|
|
|
///
|
|
|
|
virtual void setPosition(int, int) = 0;
|
|
|
|
///
|
|
|
|
virtual void show(int, int, string const &) = 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Redraw the main form.
|
2001-07-03 15:19:04 +00:00
|
|
|
virtual void redraw() = 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-06-25 00:06:33 +00:00
|
|
|
/// Resize all BufferViews in this LyXView (because the width changed)
|
|
|
|
void resize();
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// returns the buffer currently shown in the main form.
|
2000-04-08 17:02:02 +00:00
|
|
|
Buffer * buffer() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
BufferView * view() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// return a pointer to the toolbar
|
2000-04-08 17:02:02 +00:00
|
|
|
Toolbar * getToolbar() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
/// sets the layout in the toolbar layout combox
|
2002-03-02 16:39:54 +00:00
|
|
|
void setLayout(string const & layout);
|
2000-07-25 10:46:18 +00:00
|
|
|
/// update the toolbar
|
|
|
|
void updateToolbar();
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// return a pointer to the lyxfunc
|
2000-04-08 17:02:02 +00:00
|
|
|
LyXFunc * getLyXFunc() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// return a pointer to the minibuffer
|
2000-04-08 17:02:02 +00:00
|
|
|
MiniBuffer * getMiniBuffer() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2001-04-17 15:15:59 +00:00
|
|
|
///
|
|
|
|
void message(string const &);
|
|
|
|
///
|
|
|
|
void messagePush(string const & str);
|
|
|
|
///
|
|
|
|
void messagePop();
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-07-24 13:53:19 +00:00
|
|
|
Menubar * getMenubar() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-07-24 13:53:19 +00:00
|
|
|
///
|
|
|
|
void updateMenubar();
|
2000-09-14 17:53:12 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2000-04-08 17:02:02 +00:00
|
|
|
Intl * getIntl() const;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
|
|
|
Dialogs * getDialogs() { return dialogs_; }
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void updateLayoutChoice();
|
|
|
|
|
|
|
|
/// Updates the title of the window
|
|
|
|
void updateWindowTitle();
|
|
|
|
|
2000-07-20 11:39:14 +00:00
|
|
|
/// Show state (toolbar and font in minibuffer)
|
|
|
|
void showState();
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
/// Reset autosave timer
|
|
|
|
void resetAutosaveTimer();
|
2000-07-24 13:53:19 +00:00
|
|
|
///
|
2001-07-03 15:19:04 +00:00
|
|
|
virtual void prohibitInput() const = 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-03 15:19:04 +00:00
|
|
|
virtual void allowInput() const = 0;
|
|
|
|
protected:
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
2001-07-03 15:19:04 +00:00
|
|
|
Menubar * menubar;
|
|
|
|
///
|
|
|
|
Toolbar * toolbar;
|
1999-09-27 18:44:28 +00:00
|
|
|
/** This is supposed to be a pointer or a list of pointers to the
|
|
|
|
BufferViews currently being shown in the LyXView. So far
|
|
|
|
this is not used, but that should change pretty soon. (Lgb) */
|
1999-11-04 01:40:20 +00:00
|
|
|
BufferView * bufferview;
|
2001-07-03 15:19:04 +00:00
|
|
|
///
|
|
|
|
MiniBuffer * minibuffer;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
2001-07-03 15:19:04 +00:00
|
|
|
Intl * intl;
|
|
|
|
///
|
2002-02-18 19:13:48 +00:00
|
|
|
Timeout * autosave_timeout;
|
1999-09-27 18:44:28 +00:00
|
|
|
/// A callback
|
2000-04-11 22:55:29 +00:00
|
|
|
void AutoSave();
|
2001-07-03 15:19:04 +00:00
|
|
|
///
|
|
|
|
void invalidateLayoutChoice();
|
1999-10-25 14:18:30 +00:00
|
|
|
private:
|
2001-07-03 15:19:04 +00:00
|
|
|
///
|
|
|
|
LyXFunc * lyxfunc;
|
2000-06-08 23:16:16 +00:00
|
|
|
///
|
2001-07-03 15:19:04 +00:00
|
|
|
Dialogs * dialogs_;
|
|
|
|
///
|
2002-01-03 03:14:40 +00:00
|
|
|
virtual void setWindowTitle(string const &, string const &) = 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
/** The last textclass layout list in the layout choice selector
|
|
|
|
This should probably be moved to the toolbar, but for now it's
|
|
|
|
here. (Asger) */
|
|
|
|
int last_textclass;
|
|
|
|
};
|
|
|
|
#endif
|