]> git.lyx.org Git - lyx.git/blobdiff - src/frontends/controllers/ControlExternal.h
Some helper functions for the augmented dialogs.
[lyx.git] / src / frontends / controllers / ControlExternal.h
index cb486061e62e6e0c2fe068e628955a39fa129277..f1db7bd9588a87c8f327fa9084d6c7eb8045bf87 100644 (file)
@@ -1,61 +1,89 @@
-/* This file is part of
- * ====================================================== 
- *
- *           LyX, The Document Processor
- *
- *           Copyright 2001 The LyX Team.
- *
- * ======================================================
- *
+// -*- C++ -*-
+/**
  * \file ControlExternal.h
+ * This file is part of LyX, the document processor.
+ * Licence details can be found in the file COPYING.
+ *
  * \author Asger Alstrup
  * \author John Levon
- * \author Angus Leeming, a.leeming@ic.ac.uk
+ * \author Angus Leeming
+ *
+ * Full author contact details are available in file CREDITS.
  */
 
 #ifndef CONTROLEXTERNAL_H
 #define CONTROLEXTERNAL_H
 
-#ifdef __GNUG__
-#pragma interface
-#endif
+#include "Dialog.h"
+
+#include "support/types.h"
+
+#include <boost/scoped_ptr.hpp>
+
+#include <string>
+#include <vector>
+
+
+class InsetExternalParams;
+
+namespace lyx {
+namespace external {
+
+class Template;
+class RotationDataType;
 
-#include "ControlInset.h"
-#include "insets/insetexternal.h"
+} // namespace external
+} // namespace lyx
 
-/** A controller for External dialogs.
- */ 
-class ControlExternal
-       : public ControlInset<InsetExternal, InsetExternal::Params>
-{
+
+class ControlExternal : public Dialog::Controller {
 public:
        ///
-       ControlExternal(LyXView &, Dialogs &);
+       ControlExternal(Dialog &);
+       ///
+       virtual bool initialiseParams(std::string const & data);
+       /// clean-up on hide.
+       virtual void clearParams();
+       /// clean-up on hide.
+       virtual void dispatchParams();
+       ///
+       virtual bool isBufferDependent() const { return true; }
 
        ///
-       void editExternal();
+       InsetExternalParams const & params() const;
        ///
-       void viewExternal();
+       void setParams(InsetExternalParams const &);
+
        ///
-       void updateExternal();
+       void editExternal();
        ///
-       std::vector<string> const getTemplates() const;
+       std::vector<std::string> const getTemplates() const;
        ///
-       int getTemplateNumber(string const &) const;
+       int getTemplateNumber(std::string const &) const;
        ///
-       ExternalTemplate getTemplate(int) const;
+       lyx::external::Template getTemplate(int) const;
        ///
-       string const Browse(string const &) const;
+       std::string const Browse(std::string const &) const;
 
+       /// Read the Bounding Box from a eps or ps-file
+       std::string const readBB(std::string const & file);
+       ///
+       void bbChanged(bool val) { bb_changed_ = val; }
+       bool bbChanged() const { return bb_changed_; }
 private:
-       /// 
-       virtual void applyParamsToInset();
-       /// not needed.
-       virtual void applyParamsNoInset() {}
-       /// get the parameters from the string passed to createInset.
-       virtual InsetExternal::Params const getParams(string const &);
-       /// get the parameters from the inset passed to showInset.
-       virtual InsetExternal::Params const getParams(InsetExternal const &);
+       ///
+       boost::scoped_ptr<InsetExternalParams> params_;
+       bool bb_changed_;
 };
 
+
+namespace lyx {
+namespace external {
+
+std::vector<RotationDataType> const & all_origins();
+std::string const origin_gui_str(lyx::size_type i);
+
+} // namespace external
+} // namespace lyx
+
 #endif // CONTROLEXTERNAL_H