1999-09-27 18:44:28 +00:00
|
|
|
|
// -*- C++ -*-
|
2002-06-12 02:54:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* \file LyXView.h
|
2002-09-05 15:14:23 +00:00
|
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-06-12 02:54:19 +00:00
|
|
|
|
*
|
2002-12-01 22:59:25 +00:00
|
|
|
|
* \author Lars Gullik Bj<EFBFBD>nnes
|
|
|
|
|
* \author John Levon
|
2002-09-05 14:10:50 +00:00
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-12 02:54:19 +00:00
|
|
|
|
*/
|
|
|
|
|
|
|
|
|
|
#ifndef LYXVIEW_H
|
|
|
|
|
#define LYXVIEW_H
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2007-11-12 23:23:19 +00:00
|
|
|
|
#include "support/strfwd.h"
|
2007-08-23 16:31:58 +00:00
|
|
|
|
|
2006-10-21 00:16:43 +00:00
|
|
|
|
namespace lyx {
|
|
|
|
|
|
2006-12-02 16:07:15 +00:00
|
|
|
|
namespace support { class FileName; }
|
|
|
|
|
|
2001-07-03 15:19:04 +00:00
|
|
|
|
class Buffer;
|
2000-04-08 17:02:02 +00:00
|
|
|
|
class BufferView;
|
2007-11-19 20:56:05 +00:00
|
|
|
|
class FuncStatus;
|
2007-08-14 09:54:59 +00:00
|
|
|
|
class FuncRequest;
|
|
|
|
|
class Inset;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2006-06-20 08:39:16 +00:00
|
|
|
|
namespace frontend {
|
|
|
|
|
|
2002-06-12 02:54:19 +00:00
|
|
|
|
/**
|
|
|
|
|
* LyXView - main LyX window
|
|
|
|
|
*
|
|
|
|
|
* This class represents the main LyX window and provides
|
|
|
|
|
* accessor functions to its content.
|
|
|
|
|
*
|
|
|
|
|
* The eventual intention is that LyX will support a number
|
|
|
|
|
* of containing LyXViews. Currently a lot of code still
|
|
|
|
|
* relies on there being a single top-level view.
|
|
|
|
|
*
|
|
|
|
|
* Additionally we would like to support multiple views
|
|
|
|
|
* in a single LyXView.
|
|
|
|
|
*/
|
2007-11-12 22:35:43 +00:00
|
|
|
|
class LyXView
|
2007-10-02 18:27:20 +00:00
|
|
|
|
{
|
1999-09-27 18:44:28 +00:00
|
|
|
|
public:
|
2007-09-19 21:28:11 +00:00
|
|
|
|
///
|
2007-11-18 23:30:41 +00:00
|
|
|
|
LyXView() {}
|
2007-09-19 21:28:11 +00:00
|
|
|
|
///
|
2007-11-13 09:52:28 +00:00
|
|
|
|
virtual ~LyXView() {}
|
2007-09-19 21:28:11 +00:00
|
|
|
|
///
|
2007-11-18 23:30:41 +00:00
|
|
|
|
virtual int id() const = 0;
|
2007-09-19 21:28:11 +00:00
|
|
|
|
///
|
2006-10-23 16:29:24 +00:00
|
|
|
|
virtual void close() = 0;
|
2006-09-29 23:10:17 +00:00
|
|
|
|
|
2003-02-14 14:49:51 +00:00
|
|
|
|
/// show busy cursor
|
2007-10-23 21:41:17 +00:00
|
|
|
|
virtual void setBusy(bool) = 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2002-06-12 11:34:13 +00:00
|
|
|
|
//@{ generic accessor functions
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2007-08-21 07:33:46 +00:00
|
|
|
|
/// \return the current buffer view.
|
2007-11-12 23:23:19 +00:00
|
|
|
|
virtual BufferView * view() = 0;
|
2000-07-25 10:46:18 +00:00
|
|
|
|
|
2007-08-21 07:33:46 +00:00
|
|
|
|
/// \return the buffer currently shown in this window
|
2007-11-12 23:23:19 +00:00
|
|
|
|
virtual Buffer * buffer() = 0;
|
|
|
|
|
virtual Buffer const * buffer() const = 0;
|
|
|
|
|
/// set a buffer to the current workarea.
|
|
|
|
|
virtual void setBuffer(Buffer * b) = 0; ///< \c Buffer to set.
|
2007-12-04 22:21:25 +00:00
|
|
|
|
///
|
|
|
|
|
virtual bool closeBuffer() = 0;
|
2008-02-06 23:02:57 +00:00
|
|
|
|
|
|
|
|
|
/// load a document into the current workarea.
|
|
|
|
|
virtual Buffer * loadDocument(
|
|
|
|
|
support::FileName const & name, ///< File to load.
|
|
|
|
|
bool tolastfiles = true ///< append to the "Open recent" menu?
|
|
|
|
|
) = 0;
|
2007-12-07 11:57:13 +00:00
|
|
|
|
///
|
|
|
|
|
virtual void newDocument(std::string const & filename,
|
|
|
|
|
bool fromTemplate) = 0;
|
1999-09-27 18:44:28 +00:00
|
|
|
|
|
2002-06-12 11:34:13 +00:00
|
|
|
|
//@}
|
|
|
|
|
|
|
|
|
|
/// display a message in the view
|
2006-10-21 00:16:43 +00:00
|
|
|
|
virtual void message(docstring const &) = 0;
|
2002-06-18 15:44:30 +00:00
|
|
|
|
|
2007-11-19 20:56:05 +00:00
|
|
|
|
///
|
|
|
|
|
virtual FuncStatus getStatus(FuncRequest const & cmd) = 0;
|
2007-11-23 09:44:02 +00:00
|
|
|
|
/// dispatch command.
|
2007-11-26 14:36:50 +00:00
|
|
|
|
/// \return true if the \c FuncRequest has been dispatched.
|
2007-11-26 22:45:17 +00:00
|
|
|
|
virtual bool dispatch(FuncRequest const & cmd) = 0;
|
2002-12-01 22:59:25 +00:00
|
|
|
|
|
2007-11-13 09:52:28 +00:00
|
|
|
|
///
|
|
|
|
|
virtual void restartCursor() = 0;
|
2002-06-12 02:54:19 +00:00
|
|
|
|
|
1999-10-25 14:18:30 +00:00
|
|
|
|
private:
|
2007-11-12 22:35:43 +00:00
|
|
|
|
/// noncopyable
|
|
|
|
|
LyXView(LyXView const &);
|
|
|
|
|
void operator=(LyXView const &);
|
1999-09-27 18:44:28 +00:00
|
|
|
|
};
|
2002-06-12 02:54:19 +00:00
|
|
|
|
|
2007-08-14 09:54:59 +00:00
|
|
|
|
} // namespace frontend
|
2006-10-21 00:16:43 +00:00
|
|
|
|
} // namespace lyx
|
|
|
|
|
|
2002-06-12 02:54:19 +00:00
|
|
|
|
#endif // LYXVIEW_H
|