]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/qt2/QToc.h
Some string(widget->text()) fixes. Weirdness
[lyx.git] / src / frontends / qt2 / QToc.h
index 62edfb5a0804bb81256d3a901d4136ac32a8cd79..d3a8caf5f612b9f488b92cf7ac0c1c82d602abeb 100644 (file)
@@ -1,78 +1,61 @@
 // -*- C++ -*-
 /**
  * \file QToc.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 John Levon
- * \author Kalle Dalheimer <kalle@klaralvdalens-datakonsult.se> 
+ * \author Kalle Dalheimer
+ *
+ * Full author contact details are available in file CREDITS
  */
 
 #ifndef QTOC_H
 #define QTOC_H
 
-#include "DialogBase.h"
-#include "LString.h"
-#include "boost/utility.hpp"
-#include "insets/insetcommand.h"
-#include "buffer.h"
+#ifdef __GNUG__
+#pragma interface
+#endif
+
+#include "Qt2Base.h"
+#include "toc.h"
 
-class Dialogs;
+class ControlToc;
 class QTocDialog;
 
-class QToc : public DialogBase {
+class QToc :
+       public Qt2CB<ControlToc, Qt2DB<QTocDialog> >
+{
 public:
-       QToc(LyXView *, Dialogs *);
-       ~QToc();
-
-       // Build the dialog
-       virtual void build();
-       /// Update the dialog before showing it.
-       virtual void update();
-       /// close the connections
-       virtual void close();
+       friend class QTocDialog;
 
+       QToc();
 private:
-       /// Create the dialog if necessary, update it and display it.
-       void show();
-       /// Hide the dialog.
-       void hide();
+       /// update the listview
+       void updateToc(int newdepth);
+
+       /// update the float types
+       void updateType();
+
+       /// select an entry
+       void select(string const & text);
 
-       /// create a Toc inset
-       void createTOC(string const &);
-       /// view a Toc inset
-       void showTOC(InsetCommand * const);
-       
-       /// update the Toc
-       void updateToc(int);
+       /// set the depth
+       void set_depth(int depth);
 
-       /// Real GUI implementation.
-       QTocDialog * dialog_;
+       virtual void apply() {}
 
-       /// the LyXView we belong to
-       LyXView * lv_;
+       /// update dialog
+       virtual void update_contents();
 
-       /** Which Dialogs do we belong to?
-           Used so we can get at the signals we have to connect to.
-       */
-       Dialogs * d_;
-       /// pointer to the inset if any
-       InsetCommand * inset_;
-       /// insets params
-       InsetCommandParams params;
-       
-       /// Hide connection.
-       SigC::Connection h_;
-       /// Update connection.
-       SigC::Connection u_;
-       /// Inset hide connection.
-       SigC::Connection ih_;
+       /// build dialog
+       virtual void build_dialog();
 
        /// the toc list
-       //std::vector <Buffer::TocItem> toclist;
+       toc::Toc toclist;
 
        /// depth of list shown
-       int depth;
+       int depth_;
 };
 
 #endif // QTOC_H