]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QDocument.h
better selection and scrolling behaviour
[lyx.git] / src / frontends / qt2 / QDocument.h
index f8aa0265a7158dc5dd00071a3385c93f53516a79..62432a88c2dc6f465e896b6665011682df4dd50b 100644 (file)
 // -*- C++ -*-
 /**
  * \file QDocument.h
- * Copyright 2001 the LyX Team
- * Read the file COPYING
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se>
+ * \author Edwin Leuven
+ *
+ * Full author contact details are available in file CREDITS
  */
 
+
 #ifndef QDOCUMENT_H
 #define QDOCUMENT_H
 
-#include <vector>
-#include <boost/smart_ptr.hpp>
+#ifdef __GNUG__
+#pragma interface
+#endif
 
 #include "Qt2Base.h"
 #include "Qt2BC.h"
-#include "QtLyXView.h" 
 
-#ifdef __GNUG_
-#pragma interface
-#endif
+#include <boost/scoped_ptr.hpp>
 
 class ControlDocument;
 class QDocumentDialog;
-class BufferParams;
-class LyXView;
-class Dialogs;
 
 class QDocument
-       //FIXME !!!!! : public Qt2CB<ControlDocument, Qt2DB<QDocumentDialog> >
+       : public Qt2CB<ControlDocument, Qt2DB<QDocumentDialog> >
 {
 public:
-       // FIXME!!!!!!! 
-       QDocument(LyXView *, Dialogs *) {};
-private:
-       ///
-       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 dialog.
-       virtual void update_contents();
-       /// Apply from dialog
-       virtual void apply();
-       /// Cancel from dialog
-       virtual void cancel();
-
-//     ///
-//     virtual QDialog* form() const;
 
-#if 0
-       ///
-       bool CheckDocumentInput(QWidget* ob, long);
-       ///
-       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);
+       friend class QDocumentDialog;
 
-       ///
-       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 &);
-
-       ///
-       void paper_apply();
-       ///
-       bool class_apply();
-       ///
-       bool language_apply();
-       ///
-       bool options_apply();
-       ///
-       void bullets_apply();
-
-       /// 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();
-#endif
-       /// Real GUI implementation.
-       boost::scoped_ptr<QDocumentDialog> 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_;
+       QDocument();
+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();
+
+       /// FIXME
+       std::vector<string> lang_;
 };
 
-
-inline
-Qt2BC & QDocument::bc()
-{
-       return bc_;
-}
-
 #endif // QDOCUMENT_H