2001-03-23 06:31:30 +00:00
|
|
|
// -*- C++ -*-
|
2001-08-19 13:25:15 +00:00
|
|
|
/**
|
|
|
|
* \file QDocument.h
|
|
|
|
* Copyright 2001 the LyX Team
|
|
|
|
* Read the file COPYING
|
2001-03-29 15:02:19 +00:00
|
|
|
*
|
2001-08-19 13:25:15 +00:00
|
|
|
* \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
|
|
|
|
*/
|
2001-03-23 06:31:30 +00:00
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#ifndef QDOCUMENT_H
|
|
|
|
#define QDOCUMENT_H
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
#include <vector>
|
2001-03-29 15:02:19 +00:00
|
|
|
#include <boost/smart_ptr.hpp>
|
|
|
|
|
|
|
|
#include "Qt2Base.h"
|
2001-08-23 21:21:50 +00:00
|
|
|
#include "Qt2BC.h"
|
2002-03-21 21:21:28 +00:00
|
|
|
#include "QtLyXView.h"
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG_
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-03-29 15:02:19 +00:00
|
|
|
class ControlDocument;
|
2001-08-19 13:25:15 +00:00
|
|
|
class QDocumentDialog;
|
2001-03-29 15:02:19 +00:00
|
|
|
class BufferParams;
|
2001-03-23 06:31:30 +00:00
|
|
|
class LyXView;
|
|
|
|
class Dialogs;
|
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
class QDocument
|
|
|
|
//FIXME !!!!! : public Qt2CB<ControlDocument, Qt2DB<QDocumentDialog> >
|
2001-03-29 15:02:19 +00:00
|
|
|
{
|
2001-03-23 06:31:30 +00:00
|
|
|
public:
|
2002-03-21 21:21:28 +00:00
|
|
|
// FIXME!!!!!!!
|
2001-08-29 15:37:39 +00:00
|
|
|
QDocument(LyXView *, Dialogs *);
|
2001-03-29 15:02:19 +00:00
|
|
|
private:
|
2001-03-23 06:31:30 +00:00
|
|
|
///
|
2001-03-29 15:02:19 +00:00
|
|
|
enum State {
|
|
|
|
///
|
|
|
|
INPUT,
|
|
|
|
///
|
|
|
|
CHECKCHOICECLASS,
|
|
|
|
///
|
|
|
|
CHOICEBULLETSIZE,
|
|
|
|
///
|
|
|
|
INPUTBULLETLATEX,
|
|
|
|
///
|
|
|
|
BULLETDEPTH1,
|
|
|
|
///
|
|
|
|
BULLETDEPTH2,
|
|
|
|
///
|
|
|
|
BULLETDEPTH3,
|
|
|
|
///
|
|
|
|
BULLETDEPTH4,
|
|
|
|
///
|
|
|
|
BULLETPANEL1,
|
|
|
|
///
|
|
|
|
BULLETPANEL2,
|
|
|
|
///
|
|
|
|
BULLETPANEL3,
|
|
|
|
///
|
|
|
|
BULLETPANEL4,
|
|
|
|
///
|
|
|
|
BULLETPANEL5,
|
|
|
|
///
|
|
|
|
BULLETPANEL6,
|
|
|
|
///
|
|
|
|
BULLETBMTABLE
|
|
|
|
};
|
|
|
|
/// Pointer to the actual instantiation of the ButtonController.
|
2001-08-23 21:21:50 +00:00
|
|
|
virtual Qt2BC & bc();
|
2001-03-29 15:02:19 +00:00
|
|
|
/// Build the dialog
|
2001-08-26 00:29:39 +00:00
|
|
|
virtual void build_dialog();
|
2002-03-21 21:21:28 +00:00
|
|
|
// /// Filter the inputs
|
|
|
|
// virtual bool input( FL_OBJECT *, long );
|
2001-04-03 14:30:58 +00:00
|
|
|
/// Update the dialog.
|
2001-08-25 20:04:15 +00:00
|
|
|
virtual void update_contents();
|
2001-04-03 14:30:58 +00:00
|
|
|
/// Apply from dialog
|
2001-03-29 15:02:19 +00:00
|
|
|
virtual void apply();
|
2001-04-03 14:30:58 +00:00
|
|
|
/// Cancel from dialog
|
2001-03-29 15:02:19 +00:00
|
|
|
virtual void cancel();
|
|
|
|
|
2002-03-21 21:21:28 +00:00
|
|
|
// ///
|
|
|
|
// virtual QDialog* form() const;
|
2001-03-29 15:02:19 +00:00
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#if 0
|
2001-03-23 06:31:30 +00:00
|
|
|
///
|
2001-03-29 15:02:19 +00:00
|
|
|
bool CheckDocumentInput(QWidget* ob, long);
|
2001-03-23 06:31:30 +00:00
|
|
|
///
|
2001-03-29 15:02:19 +00:00
|
|
|
void ChoiceBulletSize(QWidget* ob, long);
|
|
|
|
///
|
|
|
|
void InputBulletLaTeX(QWidget* ob, long);
|
|
|
|
///
|
|
|
|
void BulletDepth(QWidget* ob, State);
|
|
|
|
///
|
|
|
|
void BulletPanel(QWidget* ob, State);
|
|
|
|
///
|
|
|
|
void BulletBMTable(QWidget* ob, long);
|
|
|
|
///
|
|
|
|
void checkMarginValues();
|
|
|
|
///
|
|
|
|
void checkReadOnly();
|
|
|
|
///
|
|
|
|
void CheckChoiceClass(QWidget* ob, long);
|
|
|
|
///
|
|
|
|
void UpdateLayoutDocument(BufferParams const & params);
|
2001-03-23 06:31:30 +00:00
|
|
|
|
2001-03-29 15:02:19 +00:00
|
|
|
///
|
|
|
|
void paper_update(BufferParams const &);
|
|
|
|
///
|
|
|
|
void class_update(BufferParams const &);
|
|
|
|
///
|
|
|
|
void language_update(BufferParams const &);
|
|
|
|
///
|
|
|
|
void options_update(BufferParams const &);
|
|
|
|
///
|
|
|
|
void bullets_update(BufferParams const &);
|
2001-03-23 06:31:30 +00:00
|
|
|
|
2001-03-29 15:02:19 +00:00
|
|
|
///
|
|
|
|
void paper_apply();
|
|
|
|
///
|
|
|
|
bool class_apply();
|
|
|
|
///
|
|
|
|
bool language_apply();
|
|
|
|
///
|
|
|
|
bool options_apply();
|
|
|
|
///
|
|
|
|
void bullets_apply();
|
2001-03-23 06:31:30 +00:00
|
|
|
|
2001-03-29 15:02:19 +00:00
|
|
|
/// Fdesign generated methods
|
|
|
|
QDialog* build_tabbed_document();
|
|
|
|
///
|
|
|
|
QDialog* build_doc_paper();
|
|
|
|
///
|
|
|
|
QDialog* build_doc_class();
|
|
|
|
///
|
|
|
|
QDialog* build_doc_language();
|
|
|
|
///
|
|
|
|
QDialog* build_doc_options();
|
|
|
|
///
|
|
|
|
QDialog* build_doc_bullet();
|
2001-08-19 13:25:15 +00:00
|
|
|
#endif
|
2001-03-29 15:02:19 +00:00
|
|
|
/// Real GUI implementation.
|
2001-08-19 13:25:15 +00:00
|
|
|
boost::scoped_ptr<QDocumentDialog> dialog_;
|
2001-03-29 15:02:19 +00:00
|
|
|
///
|
|
|
|
int ActCell;
|
|
|
|
///
|
|
|
|
int Confirmed;
|
|
|
|
///
|
|
|
|
int current_bullet_panel;
|
|
|
|
///
|
|
|
|
int current_bullet_depth;
|
2002-03-21 21:21:28 +00:00
|
|
|
// ///
|
|
|
|
// FL_OBJECT * fbullet;
|
|
|
|
// ///
|
|
|
|
// boost::scoped_ptr<Combox> combo_language;
|
|
|
|
// ///
|
|
|
|
// boost::scoped_ptr<Combox> combo_doc_class;
|
2001-03-29 15:02:19 +00:00
|
|
|
/// The ButtonController
|
2001-08-23 21:21:50 +00:00
|
|
|
ButtonController<NoRepeatedApplyReadOnlyPolicy, Qt2BC> bc_;
|
2001-03-29 15:02:19 +00:00
|
|
|
};
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
|
2001-03-29 15:02:19 +00:00
|
|
|
inline
|
2001-08-23 21:21:50 +00:00
|
|
|
Qt2BC & QDocument::bc()
|
2001-03-29 15:02:19 +00:00
|
|
|
{
|
|
|
|
return bc_;
|
|
|
|
}
|
2001-03-23 06:31:30 +00:00
|
|
|
|
2001-08-19 13:25:15 +00:00
|
|
|
#endif // QDOCUMENT_H
|