// -*- C++ -*- /** * \file QDocument.h * This file is part of LyX, the document processor. * Licence details can be found in the file COPYING. * * \author Edwin Leuven * * Full author contact details are available in file CREDITS. */ #ifndef QDOCUMENT_H #define QDOCUMENT_H #include "QDialogView.h" #include "BulletsModule.h" #include "ui/DocumentUi.h" #include "ui/FontUi.h" #include "ui/TextLayoutUi.h" #include "ui/MathsUi.h" #include "ui/LaTeXUi.h" #include "ui/PageLayoutUi.h" #include "ui/LanguageUi.h" #include "ui/BiblioUi.h" #include "ui/NumberingUi.h" #include "ui/MarginsUi.h" // For the Preamble module #include "ui/PreambleUi.h" #include #include #include #include class FloatPlacement; template class UiWidget: public QWidget, public UI { public: UiWidget(QWidget * parent = 0) : QWidget(parent) { UI::setupUi(this); } }; namespace lyx { namespace frontend { class QBranches; class QDocument; class PreambleModule; class QDocumentDialog : public QDialog, public Ui::QDocumentUi { Q_OBJECT public: friend class QDocument; QDocumentDialog(QDocument *); void updateParams(BufferParams const & params); void apply(BufferParams & params); void updateFontsize(std::string const &, std::string const &); void updatePagestyle(std::string const &, std::string const &); void showPreamble(); public Q_SLOTS: void updateNumbering(); void change_adaptor(); void validate_listings_params(); void saveDefaultClicked(); void useDefaultsClicked(); protected Q_SLOTS: void setLSpacing(int); void setMargins(bool); void setCustomPapersize(int); void setCustomMargins(bool); void romanChanged(int); void sansChanged(int); void ttChanged(int); void setSkip(int); void enableSkip(bool); void portraitChanged(); void classChanged(); protected: void closeEvent(QCloseEvent * e); private: UiWidget *textLayoutModule; UiWidget *fontModule; UiWidget *pageLayoutModule; UiWidget *marginsModule; UiWidget *langModule; UiWidget *numberingModule; UiWidget *biblioModule; UiWidget *mathsModule; UiWidget *latexModule; PreambleModule *preambleModule; QBranches *branchesModule; BulletsModule * bulletsModule; FloatPlacement * floatModule; QDocument * form_; /// FIXME std::vector lang_; }; class ControlDocument; class QDocument : public QController > { public: friend class QDocumentDialog; QDocument(Dialog &); void showPreamble(); private: /// Apply changes void apply(); /// update void update_contents(); /// build the dialog void build_dialog(); /// save as default template void saveDocDefault(); /// reset to default params void useClassDefaults(); }; typedef void const * BufferId; class PreambleModule : public UiWidget { Q_OBJECT public: PreambleModule(); void update(BufferParams const & params, BufferId id); void apply(BufferParams & params); Q_SIGNALS: /// signal that something's changed in the Widget. void changed(); protected: void closeEvent(QCloseEvent *); void on_preambleTE_textChanged() { changed(); } private: typedef std::map > Coords; Coords preamble_coords_; BufferId current_id_; }; } // namespace frontend } // namespace lyx #endif // QDOCUMENT_H