2002-06-19 03:38:44 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/**
|
|
|
|
* \file QtView.h
|
2002-09-24 13:57:09 +00:00
|
|
|
* This file is part of LyX, the document processor.
|
|
|
|
* Licence details can be found in the file COPYING.
|
2002-06-19 03:38:44 +00:00
|
|
|
*
|
2002-09-24 13:57:09 +00:00
|
|
|
* \author Lars Gullik Bjornes
|
|
|
|
* \author John Levon
|
|
|
|
*
|
|
|
|
* Full author contact details are available in file CREDITS
|
2002-06-19 03:38:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QTVIEW_H
|
|
|
|
#define QTVIEW_H
|
|
|
|
|
|
|
|
#ifdef __GNUG__
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
|
|
|
#include "frontends/LyXView.h"
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#include <qmainwindow.h>
|
2002-07-19 23:04:55 +00:00
|
|
|
#include <qtimer.h>
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-07-19 23:04:55 +00:00
|
|
|
class QCommandBuffer;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/**
|
|
|
|
* QtView - Qt implementation of LyXView
|
|
|
|
*
|
|
|
|
* Qt-private implementation of the main LyX window.
|
|
|
|
*/
|
|
|
|
class QtView : public QMainWindow, public LyXView {
|
|
|
|
Q_OBJECT
|
|
|
|
public:
|
|
|
|
/// create a main window of the given dimensions
|
|
|
|
QtView(unsigned int w, unsigned int h);
|
|
|
|
|
|
|
|
~QtView();
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/**
|
|
|
|
* show - display the top-level window
|
2002-07-12 01:59:01 +00:00
|
|
|
* @param x x position
|
|
|
|
* @param y y position
|
2002-06-19 03:38:44 +00:00
|
|
|
* @param title window title
|
|
|
|
*/
|
2002-07-12 01:59:01 +00:00
|
|
|
void show(int x, int y, string const & t = string("LyX"));
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/// start modal operation
|
|
|
|
virtual void prohibitInput() const;
|
|
|
|
/// end modal operation
|
|
|
|
virtual void allowInput() const;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-07-19 23:04:55 +00:00
|
|
|
/// display a status message
|
|
|
|
virtual void message(string const & str);
|
2002-06-19 03:38:44 +00:00
|
|
|
public slots:
|
|
|
|
/// menu item has been selected
|
|
|
|
void activated(int id);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-07-19 23:04:55 +00:00
|
|
|
/// idle timeout
|
|
|
|
void update_view_state_qt();
|
2002-06-19 03:38:44 +00:00
|
|
|
protected:
|
|
|
|
/// make sure we quit cleanly
|
|
|
|
virtual void closeEvent(QCloseEvent * e);
|
|
|
|
private:
|
2002-07-19 23:04:55 +00:00
|
|
|
/// focus the command buffer widget
|
|
|
|
void focus_command_widget();
|
|
|
|
|
2002-07-17 04:13:41 +00:00
|
|
|
/// update status bar
|
|
|
|
void update_view_state();
|
2002-09-24 13:57:09 +00:00
|
|
|
|
|
|
|
/**
|
2002-06-19 03:38:44 +00:00
|
|
|
* setWindowTitle - set title of window
|
|
|
|
* @param t main window title
|
|
|
|
* @param it iconified (short) title
|
|
|
|
*/
|
2002-12-17 20:37:13 +00:00
|
|
|
virtual void setWindowTitle(string const & t, string const & it);
|
2002-07-19 23:04:55 +00:00
|
|
|
|
|
|
|
/// idle timer
|
|
|
|
QTimer idle_timer_;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-07-19 23:04:55 +00:00
|
|
|
/// command buffer
|
|
|
|
QCommandBuffer * commandbuffer_;
|
2002-06-19 03:38:44 +00:00
|
|
|
};
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#endif // QTVIEW_H
|