]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlTexinfo.h
fix crash due to invalidated iterator
[lyx.git] / src / frontends / controllers / ControlTexinfo.h
index 849e41fd6233ea0abd35c3ea35c3765a8ad833cb..0b000e197a9ea3f84db15e767e884edae59454c1 100644 (file)
@@ -1,48 +1,61 @@
 // -*- C++ -*-
-/* This file is part of
- * ====================================================== 
- *
- *           LyX, The Document Processor
- *
- *           Copyright 2001 The LyX Team.
+/**
+ * \file ControlTexinfo.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
  *
- * ======================================================
+ * \author Herbert Voß
  *
- * \file ControlTexinfo.h
- * \author Herbert Voss <voss@perce.de>
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef CONTROLTEXINFO_H
 #define CONTROLTEXINFO_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
 
-#include "ControlDialog_impl.h"
-#include "LString.h"
+#include "Dialog.h"
+#include "tex_helpers.h"
+
+namespace lyx {
+namespace frontend {
 
 /** A controller for Texinfo dialogs. */
 
-class ControlTexinfo : public ControlDialogBI {
+class ControlTexinfo : public Dialog::Controller {
 public:
-       /// the file extensions
-       enum texFileSuffix {cls, sty, bst};
        ///
-       ControlTexinfo(LyXView &, Dialogs &);
+       ControlTexinfo(Dialog &);
+       /// Nothing to initialise in this case.
+       virtual bool initialiseParams(std::string const &) { return true; }
        ///
-       void viewFile(string const filename) const;
+       virtual void clearParams() {}
        ///
-       void rescanStyles() const;
+       virtual void dispatchParams() {}
        ///
-       void runTexhash() const;
-       ///
-       string const getContents(texFileSuffix type, bool withPath) const;
+       virtual bool isBufferDependent() const { return false; }
 
 
+       /// the file extensions
+       enum texFileSuffix {cls, sty, bst};
+       /// show contents af a file
+       void viewFile(std::string const & filename) const;
+       /// show all classoptions
+       std::string const getClassOptions(std::string const & filename) const;
+       /// return file type as string
+       std::string const getFileType(ControlTexinfo::texFileSuffix type) const;
 private:
        ///
        virtual void apply() {}
 };
 
+
+/** Fill \c contents from one of the three texfiles.
+ *  Each entry in the file list is returned as a pair<name_with_path, name_only>
+ */
+void getTexFileList(ControlTexinfo::texFileSuffix type,
+                   std::vector<std::string> & contents, bool withPath);
+
+} // namespace frontend
+} // namespace lyx
+
 #endif // CONTROLTEXINFO_H