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
|
|
|
|
*
|
2003-08-23 00:17:00 +00:00
|
|
|
* Full author contact details are available in file CREDITS.
|
2002-06-19 03:38:44 +00:00
|
|
|
*/
|
|
|
|
|
|
|
|
#ifndef QTVIEW_H
|
|
|
|
#define QTVIEW_H
|
|
|
|
|
2003-05-08 18:05:07 +00:00
|
|
|
// Must be here because of moc.
|
|
|
|
#include <config.h>
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
|
|
#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
|
|
|
|
2003-09-21 18:57:15 +00:00
|
|
|
class FuncRequest;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
namespace lyx {
|
|
|
|
namespace frontend {
|
|
|
|
|
|
|
|
class QCommandBuffer;
|
|
|
|
|
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
|
coding style and readability corrections
Index: frontends/qt3/lyx_gui.C
===================================================================
--- frontends/qt3/lyx_gui.C (revision 14088)
+++ frontends/qt3/lyx_gui.C (working copy)
@@ -222,12 +222,12 @@
void start(string const & batch, vector<string> const & files,
- unsigned int width, unsigned int height, int posx, int posy, bool isMax)
+ unsigned int width, unsigned int height, int posx, int posy, bool maximize)
{
// this can't be done before because it needs the Languages object
initEncodings();
- boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
+ boost::shared_ptr<QtView> view_ptr(new QtView(width, height, maximize));
LyX::ref().addLyXView(view_ptr);
QtView & view = *view_ptr.get();
Index: frontends/qt3/QtView.C
===================================================================
--- frontends/qt3/QtView.C (revision 14088)
+++ frontends/qt3/QtView.C (working copy)
@@ -55,12 +55,12 @@
-QtView::QtView(unsigned int width, unsigned int height, bool isMax)
+QtView::QtView(unsigned int width, unsigned int height, bool maximize)
: QMainWindow(), LyXView(), commandbuffer_(0)
{
resize(width, height);
- if(isMax)
+ if (maximize)
this->setWindowState(WindowMaximized);
qApp->setMainWidget(this);
@@ -164,7 +164,7 @@
void QtView::closeEvent(QCloseEvent *)
{
LyX::ref().session().saveSessionInfo("WindowIsMaximized", (this->isMaximized() ? "yes" : "no"));
- //don't save maximized values
+ // don't save maximized values
this->showNormal();
// save windows size and position
LyX::ref().session().saveSessionInfo("WindowWidth", convert<string>(width()));
Index: frontends/qt3/QtView.h
===================================================================
--- frontends/qt3/QtView.h (revision 14088)
+++ frontends/qt3/QtView.h (working copy)
@@ -37,7 +37,7 @@
Q_OBJECT
public:
/// create a main window of the given dimensions
- QtView(unsigned int w, unsigned int h, bool isMax);
+ QtView(unsigned int w, unsigned int h, bool maximize);
~QtView();
Index: frontends/qt4/lyx_gui.C
===================================================================
--- frontends/qt4/lyx_gui.C (revision 14088)
+++ frontends/qt4/lyx_gui.C (working copy)
@@ -228,12 +228,12 @@
void start(string const & batch, vector<string> const & files,
- unsigned int width, unsigned int height, int posx, int posy, bool isMax)
+ unsigned int width, unsigned int height, int posx, int posy, bool maximize)
{
// this can't be done before because it needs the Languages object
initEncodings();
- boost::shared_ptr<QtView> view_ptr(new QtView(width, height, isMax));
+ boost::shared_ptr<QtView> view_ptr(new QtView(width, height, maximize));
LyX::ref().addLyXView(view_ptr);
QtView & view = *view_ptr.get();
Index: frontends/qt4/QtView.C
===================================================================
--- frontends/qt4/QtView.C (revision 14088)
+++ frontends/qt4/QtView.C (working copy)
@@ -70,12 +70,12 @@
} // namespace anon
-QtView::QtView(unsigned int width, unsigned int height, bool isMax)
+QtView::QtView(unsigned int width, unsigned int height, bool maximize)
: QMainWindow(), LyXView(), commandbuffer_(0)
{
resize(width, height);
- if(isMax)
+ if (maximize)
this->setWindowState(Qt::WindowMaximized);
mainWidget_ = this;
Index: frontends/qt4/QtView.h
===================================================================
--- frontends/qt4/QtView.h (revision 14088)
+++ frontends/qt4/QtView.h (working copy)
@@ -47,7 +47,7 @@
Q_OBJECT
public:
/// create a main window of the given dimensions
- QtView(unsigned int w, unsigned int h, bool isMax);
+ QtView(unsigned int w, unsigned int h, bool maximize);
~QtView();
Index: frontends/lyx_gui.h
===================================================================
--- frontends/lyx_gui.h (revision 14088)
+++ frontends/lyx_gui.h (working copy)
@@ -57,7 +57,7 @@
* batch commands, and loading the given documents
*/
void start(std::string const & batch, std::vector<std::string> const & files,
- unsigned int width, unsigned int height, int posx, int posy, bool isMax);
+ unsigned int width, unsigned int height, int posx, int posy, bool maximize);
/**
* Enter the main event loop (\sa LyX::exec2)
Index: lyx_main.C
===================================================================
--- lyx_main.C (revision 14088)
+++ lyx_main.C (working copy)
@@ -307,7 +307,7 @@
// initial geometry
unsigned int width = 690;
unsigned int height = 510;
- bool isMax = false;
+ bool maximize = false;
// first try lyxrc
if (lyxrc.geometry_width != 0 && lyxrc.geometry_height != 0 ) {
width = lyxrc.geometry_width;
@@ -322,7 +322,7 @@
if (!val.empty())
height = convert<unsigned int>(val);
if (session().loadSessionInfo("WindowIsMaximized") == "yes")
- isMax = true;
+ maximize = true;
}
// if user wants to restore window position
int posx = -1;
@@ -335,7 +335,7 @@
if (!val.empty())
posy = convert<int>(val);
}
- lyx_gui::start(batch_command, files, width, height, posx, posy, isMax);
+ lyx_gui::start(batch_command, files, width, height, posx, posy, maximize);
} else {
// Something went wrong above
quitLyX(false);
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@14089 a592a061-630c-0410-9148-cb99ea01b6c8
2006-06-13 08:24:43 +00:00
|
|
|
QtView(unsigned int w, unsigned int h, bool maximize);
|
2002-06-19 03:38:44 +00:00
|
|
|
|
|
|
|
~QtView();
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2003-01-05 22:38:42 +00:00
|
|
|
/// show - display the top-level window
|
|
|
|
void show();
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2003-02-14 14:49:51 +00:00
|
|
|
/// show busy cursor
|
|
|
|
virtual void busy(bool) const;
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2002-07-19 23:04:55 +00:00
|
|
|
/// display a status message
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual void message(std::string const & str);
|
2003-04-07 16:57:38 +00:00
|
|
|
|
|
|
|
/// clear status message
|
|
|
|
virtual void clearMessage();
|
|
|
|
|
2003-04-15 01:06:13 +00:00
|
|
|
/// add the command buffer
|
|
|
|
void addCommandBuffer(QWidget * parent);
|
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
/// menu item has been selected
|
2003-09-21 18:57:15 +00:00
|
|
|
void activated(FuncRequest const &);
|
2002-09-24 13:57:09 +00:00
|
|
|
|
2004-11-16 10:46:23 +00:00
|
|
|
// returns true if this view has the focus.
|
|
|
|
virtual bool hasFocus() const;
|
|
|
|
|
2003-09-21 18:57:15 +00:00
|
|
|
public slots:
|
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
|
|
|
|
*/
|
2003-10-06 15:43:21 +00:00
|
|
|
virtual void setWindowTitle(std::string const & t, std::string const & it);
|
2002-07-19 23:04:55 +00:00
|
|
|
|
2003-04-07 05:20:07 +00:00
|
|
|
QTimer statusbar_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
|
|
|
|
2004-05-19 15:11:37 +00:00
|
|
|
} // namespace frontend
|
|
|
|
} // namespace lyx
|
|
|
|
|
2002-06-19 03:38:44 +00:00
|
|
|
#endif // QTVIEW_H
|