1999-09-27 18:44:28 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
1999-11-15 12:01:38 +00:00
|
|
|
* ======================================================
|
1999-11-04 01:40:20 +00:00
|
|
|
*
|
|
|
|
* LyX, The Document Processor
|
|
|
|
*
|
|
|
|
* Copyright 1995 Matthias Ettrich
|
2000-02-04 09:38:32 +00:00
|
|
|
* Copyright 1995-2000 The LyX Team.
|
1999-11-04 01:40:20 +00:00
|
|
|
*
|
|
|
|
* ====================================================== */
|
|
|
|
|
|
|
|
#ifndef LyXView_H
|
|
|
|
#define LyXView_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2000-10-30 08:14:36 +00:00
|
|
|
#include <config.h>
|
1999-09-27 18:44:28 +00:00
|
|
|
#include FORMS_H_LOCATION
|
1999-11-04 01:40:20 +00:00
|
|
|
|
2000-09-14 17:53:12 +00:00
|
|
|
#include "LString.h"
|
2000-06-08 23:16:16 +00:00
|
|
|
#include "Timeout.h"
|
2000-10-02 00:55:02 +00:00
|
|
|
#include <boost/utility.hpp>
|
2000-09-28 02:59:25 +00:00
|
|
|
#include "layout.h"
|
2000-07-24 13:53:19 +00:00
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
class LyXFunc;
|
|
|
|
class Toolbar;
|
|
|
|
class MiniBuffer;
|
|
|
|
class Intl;
|
2000-04-08 17:02:02 +00:00
|
|
|
class Buffer;
|
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;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
2000-07-04 20:32:37 +00:00
|
|
|
#ifdef SIGC_CXX_NAMESPACES
|
|
|
|
using SigC::Object;
|
|
|
|
#endif
|
|
|
|
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/**
|
|
|
|
This class is the form containing the view of the buffer. The actual buffer
|
|
|
|
view is supposed (at least IMHO) to be another class, that shows its output
|
|
|
|
in one or more LyXView's.
|
|
|
|
*/
|
2000-08-01 17:33:32 +00:00
|
|
|
class LyXView : public Object, public noncopyable {
|
1999-09-27 18:44:28 +00:00
|
|
|
public:
|
|
|
|
/// constructor
|
|
|
|
LyXView(int w, int h);
|
|
|
|
|
|
|
|
/// destructor
|
|
|
|
~LyXView();
|
|
|
|
|
|
|
|
/// Where to place the form.
|
|
|
|
void setPosition(int, int);
|
|
|
|
|
|
|
|
/// Show the main form.
|
2000-09-14 17:53:12 +00:00
|
|
|
void show(int, int, string const & t = string("LyX"));
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
|
|
/// init (should probably be removed later) (Lgb)
|
|
|
|
void init();
|
|
|
|
|
|
|
|
/// Redraw the main form.
|
|
|
|
void redraw();
|
|
|
|
|
|
|
|
/// 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
|
|
|
|
|
|
|
/// returns a pointer to the form.
|
2000-04-08 17:02:02 +00:00
|
|
|
FL_FORM * getForm() 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
|
2000-09-27 18:13:30 +00:00
|
|
|
void setLayout(LyXTextClass::size_type layout);
|
2000-07-24 13:53:19 +00:00
|
|
|
|
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
|
|
|
|
|
|
|
///
|
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();
|
|
|
|
private:
|
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
LyXFunc * lyxfunc;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Toolbar * toolbar;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
MiniBuffer * minibuffer;
|
2000-07-24 13:53:19 +00:00
|
|
|
///
|
|
|
|
Menubar * menubar;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
1999-11-04 01:40:20 +00:00
|
|
|
Intl * intl;
|
2000-06-12 11:27:15 +00:00
|
|
|
///
|
|
|
|
Dialogs * dialogs_;
|
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;
|
1999-09-27 18:44:28 +00:00
|
|
|
///
|
|
|
|
void invalidateLayoutChoice();
|
1999-10-25 14:18:30 +00:00
|
|
|
public:
|
1999-09-27 18:44:28 +00:00
|
|
|
/** This callback is run when a close event is sent from the
|
|
|
|
window manager. */
|
|
|
|
static int atCloseMainFormCB(FL_FORM *, void *);
|
|
|
|
/// A callback
|
2000-04-11 22:55:29 +00:00
|
|
|
void AutoSave();
|
1999-10-25 14:18:30 +00:00
|
|
|
private:
|
2000-06-08 23:16:16 +00:00
|
|
|
///
|
|
|
|
Timeout autosave_timeout;
|
1999-10-25 14:18:30 +00:00
|
|
|
/// makes the main form.
|
1999-12-19 22:35:36 +00:00
|
|
|
void create_form_form_main(int width, int height);
|
1999-09-27 18:44:28 +00:00
|
|
|
/// A pointer to the form.
|
2000-04-08 17:02:02 +00:00
|
|
|
FL_FORM * form_;
|
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
|