2001-03-23 06:31:30 +00:00
|
|
|
// -*- C++ -*-
|
|
|
|
/* This file is part of
|
|
|
|
* ======================================================
|
2001-03-29 15:02:19 +00:00
|
|
|
*
|
2001-03-23 06:31:30 +00:00
|
|
|
* LyX, The Document Processor
|
2001-03-29 15:02:19 +00:00
|
|
|
*
|
2001-03-23 06:31:30 +00:00
|
|
|
* Copyright (C) 2000 The LyX Team.
|
|
|
|
*
|
2001-03-29 15:02:19 +00:00
|
|
|
* @author Kalle Dalheimer
|
2001-03-23 06:31:30 +00:00
|
|
|
*
|
|
|
|
*======================================================*/
|
|
|
|
|
|
|
|
#ifndef FORM_DOCUMENT_H
|
|
|
|
#define FORM_DOCUMENT_H
|
|
|
|
|
|
|
|
#include <vector>
|
2001-03-29 15:02:19 +00:00
|
|
|
#include <boost/smart_ptr.hpp>
|
|
|
|
|
|
|
|
#include "Qt2Base.h"
|
|
|
|
#include "qt2BC.h"
|
|
|
|
#undef emit
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
#ifdef __GNUG_
|
|
|
|
#pragma interface
|
|
|
|
#endif
|
|
|
|
|
2001-03-29 15:02:19 +00:00
|
|
|
class ControlDocument;
|
|
|
|
class FormDocumentDialogImpl;
|
|
|
|
class BufferParams;
|
2001-03-23 06:31:30 +00:00
|
|
|
class LyXView;
|
|
|
|
class Dialogs;
|
|
|
|
|
|
|
|
/** This class provides an Qt2 implementation of the FormDocument Popup.
|
|
|
|
The table-layout-form here changes values for latex-tabulars
|
2001-03-29 15:02:19 +00:00
|
|
|
@author Kalle Dalheimer
|
2001-03-23 06:31:30 +00:00
|
|
|
*/
|
2001-03-29 15:02:19 +00:00
|
|
|
class FormDocument
|
|
|
|
: public Qt2CB<ControlDocument, Qt2DB<FormDocumentDialogImpl> >
|
|
|
|
{
|
2001-03-23 06:31:30 +00:00
|
|
|
public:
|
2001-03-29 15:02:19 +00:00
|
|
|
/// #FormDocument x(Communicator ..., Popups ...);#
|
|
|
|
FormDocument(LyXView *, Dialogs *);
|
|
|
|
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.
|
|
|
|
virtual qt2BC & bc();
|
|
|
|
/// Build the dialog
|
|
|
|
virtual void build();
|
|
|
|
// /// Filter the inputs
|
|
|
|
// virtual bool input( FL_OBJECT *, long );
|
|
|
|
/// Update the popup.
|
|
|
|
virtual void update();
|
|
|
|
/// Apply from popup
|
|
|
|
virtual void apply();
|
|
|
|
/// Cancel from popup
|
|
|
|
virtual void cancel();
|
|
|
|
|
|
|
|
// ///
|
|
|
|
// virtual QDialog* form() const;
|
|
|
|
|
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-03-23 06:31:30 +00:00
|
|
|
|
2001-03-29 15:02:19 +00:00
|
|
|
/// Real GUI implementation.
|
|
|
|
boost::scoped_ptr<FormDocumentDialogImpl> dialog_;
|
|
|
|
///
|
|
|
|
int ActCell;
|
|
|
|
///
|
|
|
|
int Confirmed;
|
|
|
|
///
|
|
|
|
int current_bullet_panel;
|
|
|
|
///
|
|
|
|
int current_bullet_depth;
|
|
|
|
// ///
|
|
|
|
// FL_OBJECT * fbullet;
|
|
|
|
// ///
|
|
|
|
// boost::scoped_ptr<Combox> combo_language;
|
|
|
|
// ///
|
|
|
|
// boost::scoped_ptr<Combox> combo_doc_class;
|
|
|
|
/// The ButtonController
|
|
|
|
ButtonController<NoRepeatedApplyReadOnlyPolicy, qt2BC> bc_;
|
|
|
|
};
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
|
2001-03-29 15:02:19 +00:00
|
|
|
inline
|
|
|
|
qt2BC & FormDocument::bc()
|
|
|
|
{
|
|
|
|
return bc_;
|
|
|
|
}
|
2001-03-23 06:31:30 +00:00
|
|
|
|
|
|
|
#endif
|