// -*- C++ -*-
-/* This file is part of
- * ======================================================
- *
- * LyX, The Document Processor
- *
- * Copyright 2001 The LyX Team.
+/**
+ * \file ControlLog.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
*
- * ======================================================
+ * \author John Levon
+ * \author Angus Leeming
*
- * \file ControlLog.h
- * \author John Levon, moz@compsoc.man.ac.uk
- * \author Angus Leeming <a.leeming@ic.ac.uk>
+ * Full author contact details are available in file CREDITS.
*/
#ifndef CONTROLLOG_H
#define CONTROLLOG_H
-#include <utility>
+#include "Dialog.h"
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include "support/filename.h"
-#include "ControlConnections.h"
-#include "buffer.h" // Buffer::LogType
+namespace lyx {
+namespace frontend {
/**
* A controller for a read-only text browser.
*/
-class ControlLog : public ControlConnectBD {
+class ControlLog : public Dialog::Controller {
public:
///
- ControlLog(LyXView &, Dialogs &);
- ///
- std::pair<Buffer::LogType, string> const & logfile()
- { return logfile_; }
-
-protected:
- ///
- virtual void apply() {}
- /// Show the dialog.
- virtual void show();
- /// Update the dialog.
- virtual void update();
- /// Hide the dialog.
- virtual void hide();
-
-private:
- std::pair<Buffer::LogType, string> logfile_;
-};
-
-
-/** A class to instantiate and make available the GUI-specific
- ButtonController and View.
- */
-template <class GUIview, class GUIbc>
-class GUILog : public ControlLog {
-public:
+ ControlLog(Dialog &);
+ /** \param data should contain "<logtype> <logfile>"
+ * where <logtype> is one of "latex", "literate", "lyx2lyx", "vc".
+ */
+ virtual bool initialiseParams(std::string const & data);
///
- GUILog(LyXView &, Dialogs &);
+ virtual void clearParams();
///
- virtual ButtonControllerBase & bc() { return bc_; }
+ virtual void dispatchParams() {}
///
- virtual ViewBase & view() { return view_; }
+ virtual bool isBufferDependent() const { return true; }
+
+ /// The title displayed by the dialog reflects the \c LOGTYPE
+ lyx::docstring const title() const;
+ /// put the log file into the ostream
+ void getContents(std::ostream & ss) const;
private:
- ///
- ButtonController<OkCancelPolicy, GUIbc> bc_;
- ///
- GUIview view_;
+ /// Recognized log file-types
+ enum LOGTYPE {
+ LatexLog,
+ LiterateLog,
+ Lyx2lyxLog,
+ VCLog
+ };
+
+ LOGTYPE type_;
+ support::FileName logfile_;
};
-template <class GUIview, class GUIbc>
-GUILog<GUIview, GUIbc>::GUILog(LyXView & lv, Dialogs & d)
- : ControlLog(lv, d),
- view_(*this)
-{}
+} // namespace frontend
+} // namespace lyx
#endif // CONTROLLOG_H