]> git.lyx.org Git - lyx.git/commitdiff
Introduce namespace lyx::external.
authorAngus Leeming <leeming@lyx.org>
Wed, 1 Oct 2003 10:16:00 +0000 (10:16 +0000)
committerAngus Leeming <leeming@lyx.org>
Wed, 1 Oct 2003 10:16:00 +0000 (10:16 +0000)
git-svn-id: svn://svn.lyx.org/lyx/lyx-devel/trunk@7843 a592a061-630c-0410-9148-cb99ea01b6c8

src/frontends/controllers/ChangeLog
src/frontends/controllers/ControlExternal.C
src/frontends/controllers/ControlExternal.h
src/frontends/qt2/ChangeLog
src/frontends/qt2/QExternal.C
src/frontends/xforms/ChangeLog
src/frontends/xforms/FormExternal.C
src/insets/ChangeLog
src/insets/ExternalTemplate.C
src/insets/ExternalTemplate.h
src/insets/insetexternal.C

index c2a6497c312d729b823b4de485e1a25bdb1839e5..97d2e00b7510d645e1d19bcc3d4633e3639e7cde 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-01  Angus Leeming  <leeming@lyx.org>
+
+       * ControlExternal.[Ch]: changes due to the introduction of
+       namespace lyx::external.
+
 2003-09-25  Angus Leeming  <leeming@lyx.org>
 
        * ControlExternal.C (getTemplatePtr): simplify, due to change in
 2003-09-25  Angus Leeming  <leeming@lyx.org>
 
        * ControlExternal.C (getTemplatePtr): simplify, due to change in
index d59d13d939d7aed64e8767260a1c1a07f38698c7..253bdfc5584ed42b611fa76e8761cd135105ba94 100644 (file)
@@ -20,6 +20,8 @@
 
 #include "insets/ExternalTemplate.h"
 
 
 #include "insets/ExternalTemplate.h"
 
+namespace external = lyx::external;
+
 using std::vector;
 
 
 using std::vector;
 
 
@@ -79,9 +81,9 @@ vector<string> const ControlExternal::getTemplates() const
 {
        vector<string> result;
 
 {
        vector<string> result;
 
-       ExternalTemplateManager::Templates::const_iterator i1, i2;
-       i1 = ExternalTemplateManager::get().getTemplates().begin();
-       i2 = ExternalTemplateManager::get().getTemplates().end();
+       external::TemplateManager::Templates::const_iterator i1, i2;
+       i1 = external::TemplateManager::get().getTemplates().begin();
+       i2 = external::TemplateManager::get().getTemplates().end();
 
        for (; i1 != i2; ++i1) {
                result.push_back(i1->second.lyxName);
 
        for (; i1 != i2; ++i1) {
                result.push_back(i1->second.lyxName);
@@ -92,9 +94,9 @@ vector<string> const ControlExternal::getTemplates() const
 
 int ControlExternal::getTemplateNumber(string const & name) const
 {
 
 int ControlExternal::getTemplateNumber(string const & name) const
 {
-       ExternalTemplateManager::Templates::const_iterator i1, i2;
-       i1 = ExternalTemplateManager::get().getTemplates().begin();
-       i2 = ExternalTemplateManager::get().getTemplates().end();
+       external::TemplateManager::Templates::const_iterator i1, i2;
+       i1 = external::TemplateManager::get().getTemplates().begin();
+       i2 = external::TemplateManager::get().getTemplates().end();
        for (int i = 0; i1 != i2; ++i1, ++i) {
                if (i1->second.lyxName == name)
                        return i;
        for (int i = 0; i1 != i2; ++i1, ++i) {
                if (i1->second.lyxName == name)
                        return i;
@@ -106,10 +108,10 @@ int ControlExternal::getTemplateNumber(string const & name) const
 }
 
 
 }
 
 
-ExternalTemplate ControlExternal::getTemplate(int i) const
+external::Template ControlExternal::getTemplate(int i) const
 {
 {
-       ExternalTemplateManager::Templates::const_iterator i1
-               = ExternalTemplateManager::get().getTemplates().begin();
+       external::TemplateManager::Templates::const_iterator i1
+               = external::TemplateManager::get().getTemplates().begin();
 
        std::advance(i1, i);
 
 
        std::advance(i1, i);
 
@@ -119,9 +121,10 @@ ExternalTemplate ControlExternal::getTemplate(int i) const
 
 namespace {
 
 
 namespace {
 
-ExternalTemplate const * getTemplatePtr(InsetExternal::Params const & params)
+external::Template const * getTemplatePtr(InsetExternal::Params const & params)
 {
 {
-       ExternalTemplateManager const & etm = ExternalTemplateManager::get();
+       external::TemplateManager const & etm =
+               external::TemplateManager::get();
        return etm.getTemplateByName(params.templatename());
 }
 
        return etm.getTemplateByName(params.templatename());
 }
 
@@ -136,7 +139,7 @@ string const ControlExternal::Browse(string const & input) const
 
        /// Determine the template file extension
        string pattern = "*";
 
        /// Determine the template file extension
        string pattern = "*";
-       ExternalTemplate const * const et_ptr = getTemplatePtr(params());
+       external::Template const * const et_ptr = getTemplatePtr(params());
        if (et_ptr)
                pattern = et_ptr->fileRegExp;
 
        if (et_ptr)
                pattern = et_ptr->fileRegExp;
 
index c46fa2605258f5907c1e6fdba796743148d4cc10..7d9e92417565c0dadc742110bf653f49b7304d6f 100644 (file)
 #include <boost/scoped_ptr.hpp>
 
 
 #include <boost/scoped_ptr.hpp>
 
 
-class ExternalTemplate;
+namespace lyx {
+namespace external {
+class Template;
+} // namespace external
+} // namespace lyx
 
 
 class ControlExternal : public Dialog::Controller {
 
 
 class ControlExternal : public Dialog::Controller {
@@ -48,7 +52,7 @@ public:
        ///
        int getTemplateNumber(string const &) const;
        ///
        ///
        int getTemplateNumber(string const &) const;
        ///
-       ExternalTemplate getTemplate(int) const;
+       lyx::external::Template getTemplate(int) const;
        ///
        string const Browse(string const &) const;
 private:
        ///
        string const Browse(string const &) const;
 private:
index 07b3aa790d06ffaa0c84c17e58fb0c70caebb9c9..679b11c5fffecb683c41471ad948e7f406680ba7 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-01  Angus Leeming  <leeming@lyx.org>
+
+       * QExternal.C (helpText): changes due to the introduction of
+       namespace lyx::external.
+
 2003-09-29  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * several .C files: add debug.h at top to avoid compilation
 2003-09-29  Lars Gullik Bjønnes  <larsbj@gullik.net>
 
        * several .C files: add debug.h at top to avoid compilation
index 493e0fd43d2152dc105eff0c6799692743e8158b..199a831487255b9f380d096f9b6581b7da8c4289 100644 (file)
@@ -94,7 +94,7 @@ void QExternal::update_contents()
 
 string const QExternal::helpText() const
 {
 
 string const QExternal::helpText() const
 {
-       ExternalTemplate templ =
+       lyx::external::Template templ =
                controller().getTemplate(dialog_->externalCO->currentItem());
        return templ.helpText;
 }
                controller().getTemplate(dialog_->externalCO->currentItem());
        return templ.helpText;
 }
index c2f37a722be404231152340755c6f1b7981ffdf3..3ff9055c845e90397d0e34bb6458b686fe5c0f36 100644 (file)
@@ -1,3 +1,8 @@
+2003-10-01  Angus Leeming  <leeming@lyx.org>
+
+       * FormExternal.C (updateComboChange): changes due to the
+       introduction of namespace lyx::external.
+
 2003-09-29  Angus Leeming  <leeming@lyx.org>
 
        * FormGraphics.C: remove incorrect comment.
 2003-09-29  Angus Leeming  <leeming@lyx.org>
 
        * FormGraphics.C: remove incorrect comment.
index 9c732778d5a6f1edadb4085fc96fd058cd34d23a..42392e8b50ecdf74a8dce53b19b4c04e4280a744 100644 (file)
@@ -180,7 +180,7 @@ ButtonPolicy::SMInput FormExternal::input(FL_OBJECT * ob, long)
 void FormExternal::updateComboChange()
 {
        int const choice = fl_get_choice(dialog_->choice_template) - 1;
 void FormExternal::updateComboChange()
 {
        int const choice = fl_get_choice(dialog_->choice_template) - 1;
-       ExternalTemplate templ = controller().getTemplate(choice);
+       lyx::external::Template templ = controller().getTemplate(choice);
 
        // Update the help text
        string const txt = formatted(templ.helpText,
 
        // Update the help text
        string const txt = formatted(templ.helpText,
index bbd36a96879213ac132603109c48a5002aa90a11..993e7f3ec6279ca8d5a431f42782884e477dc356 100644 (file)
@@ -1,3 +1,10 @@
+2003-10-01  Angus Leeming  <leeming@lyx.org>
+
+       * ExternalTemplace.[Ch]: introduce namespace lyx::external.
+
+       * insetexternal.[Ch]: changes due to the introduction of
+       namespace lyx::external.
+
 2003-09-30  Angus Leeming  <leeming@lyx.org>
 
        * insetexternal.[Ch] (Params::read, write): new member functions.
 2003-09-30  Angus Leeming  <leeming@lyx.org>
 
        * insetexternal.[Ch] (Params::read, write): new member functions.
index 49d9e3cf7f88a8234e46bc9e624232bc04e114b7..3c997c56baf1045b3d3d5e9c4bfe55662feae009 100644 (file)
@@ -33,18 +33,20 @@ using std::ostream;
 using std::vector;
 
 
 using std::vector;
 
 
-// We have to have dummy default commands for security reasons!
+namespace lyx {
+namespace external {
 
 
-ExternalTemplate::ExternalTemplate()
+// We have to have dummy default commands for security reasons!
+Template::Template()
        : inputFormat("*")
 {}
 
 
        : inputFormat("*")
 {}
 
 
-ExternalTemplate::FormatTemplate::FormatTemplate()
+Template::Format::Format()
 {}
 
 
 {}
 
 
-ExternalTemplateManager::ExternalTemplateManager()
+TemplateManager::TemplateManager()
 {
        readTemplates(support::user_lyxdir());
        if (lyxerr.debugging(Debug::EXTERNAL)) {
 {
        readTemplates(support::user_lyxdir());
        if (lyxerr.debugging(Debug::EXTERNAL)) {
@@ -57,7 +59,7 @@ ExternalTemplateManager::ExternalTemplateManager()
 
 class dumpPreambleDef {
 public:
 
 class dumpPreambleDef {
 public:
-       typedef ExternalTemplateManager::PreambleDefs::value_type value_type;
+       typedef TemplateManager::PreambleDefs::value_type value_type;
 
        dumpPreambleDef(ostream & o) : ost(o) {}
 
 
        dumpPreambleDef(ostream & o) : ost(o) {}
 
@@ -74,12 +76,12 @@ private:
 
 class dumpTemplate {
 public:
 
 class dumpTemplate {
 public:
-       typedef ExternalTemplateManager::Templates::value_type value_type;
+       typedef TemplateManager::Templates::value_type value_type;
 
        dumpTemplate(ostream & o) : ost(o) {}
 
        void operator()(value_type const & vt) {
 
        dumpTemplate(ostream & o) : ost(o) {}
 
        void operator()(value_type const & vt) {
-               ExternalTemplate const & et = vt.second;
+               Template const & et = vt.second;
 
                ost << "Template " << et.lyxName << '\n'
                    << "\tGuiName " << et.guiName << '\n'
 
                ost << "Template " << et.lyxName << '\n'
                    << "\tGuiName " << et.guiName << '\n'
@@ -101,12 +103,12 @@ private:
 
 class dumpFormat {
 public:
 
 class dumpFormat {
 public:
-       typedef ExternalTemplate::Formats::value_type value_type;
+       typedef Template::Formats::value_type value_type;
 
        dumpFormat(ostream & o) : ost(o) {}
 
        void operator()(value_type const & vt) const{
 
        dumpFormat(ostream & o) : ost(o) {}
 
        void operator()(value_type const & vt) const{
-               ExternalTemplate::FormatTemplate const & ft = vt.second;
+               Template::Format const & ft = vt.second;
                ost << "\tFormat " << vt.first << '\n'
                    << "\t\tProduct " << ft.product << '\n'
                    << "\t\tUpdateFormat " << ft.updateFormat << '\n'
                ost << "\tFormat " << vt.first << '\n'
                    << "\t\tProduct " << ft.product << '\n'
                    << "\t\tUpdateFormat " << ft.updateFormat << '\n'
@@ -126,47 +128,47 @@ private:
 };
 
 
 };
 
 
-void ExternalTemplate::dumpFormats(ostream & os) const
+void Template::dumpFormats(ostream & os) const
 {
        for_each(formats.begin(), formats.end(), dumpFormat(os));
 }
 
 
 {
        for_each(formats.begin(), formats.end(), dumpFormat(os));
 }
 
 
-void ExternalTemplateManager::dumpPreambleDefs(ostream & os) const
+void TemplateManager::dumpPreambleDefs(ostream & os) const
 {
        for_each(preambledefs.begin(), preambledefs.end(), dumpPreambleDef(os));
 }
 
 
 {
        for_each(preambledefs.begin(), preambledefs.end(), dumpPreambleDef(os));
 }
 
 
-void ExternalTemplateManager::dumpTemplates(ostream & os) const
+void TemplateManager::dumpTemplates(ostream & os) const
 {
        for_each(templates.begin(), templates.end(), dumpTemplate(os));
 }
 
 
 {
        for_each(templates.begin(), templates.end(), dumpTemplate(os));
 }
 
 
-ExternalTemplateManager & ExternalTemplateManager::get()
+TemplateManager & TemplateManager::get()
 {
 {
-       static ExternalTemplateManager externalTemplateManager;
+       static TemplateManager externalTemplateManager;
        return externalTemplateManager;
 }
 
 
        return externalTemplateManager;
 }
 
 
-ExternalTemplateManager::Templates &
-ExternalTemplateManager::getTemplates()
+TemplateManager::Templates &
+TemplateManager::getTemplates()
 {
        return templates;
 }
 
 
 {
        return templates;
 }
 
 
-ExternalTemplateManager::Templates const &
-ExternalTemplateManager::getTemplates() const
+TemplateManager::Templates const &
+TemplateManager::getTemplates() const
 {
        return templates;
 }
 
 
 {
        return templates;
 }
 
 
-ExternalTemplate const *
-ExternalTemplateManager::getTemplateByName(string const & name) const
+Template const *
+TemplateManager::getTemplateByName(string const & name) const
 {
        Templates::const_iterator it = templates.find(name);
        return (it == templates.end()) ? 0 : &it->second;
 {
        Templates::const_iterator it = templates.find(name);
        return (it == templates.end()) ? 0 : &it->second;
@@ -174,7 +176,7 @@ ExternalTemplateManager::getTemplateByName(string const & name) const
 
 
 string const
 
 
 string const
-ExternalTemplateManager::getPreambleDefByName(string const & name) const
+TemplateManager::getPreambleDefByName(string const & name) const
 {
        string const trimmed_name = support::trim(name);
        if (trimmed_name.empty())
 {
        string const trimmed_name = support::trim(name);
        if (trimmed_name.empty())
@@ -188,7 +190,7 @@ ExternalTemplateManager::getPreambleDefByName(string const & name) const
 }
 
 
 }
 
 
-void ExternalTemplateManager::readTemplates(string const & path)
+void TemplateManager::readTemplates(string const & path)
 {
        support::Path p(path);
 
 {
        support::Path p(path);
 
@@ -210,7 +212,7 @@ void ExternalTemplateManager::readTemplates(string const & path)
 
        string filename = support::LibFileSearch("", "external_templates");
        if (filename.empty() || !lex.setFile(filename)) {
 
        string filename = support::LibFileSearch("", "external_templates");
        if (filename.empty() || !lex.setFile(filename)) {
-               lex.printError("ExternalTemplateManager::readTemplates: "
+               lex.printError("external::TemplateManager::readTemplates: "
                               "No template file");
                return;
        }
                               "No template file");
                return;
        }
@@ -230,7 +232,7 @@ void ExternalTemplateManager::readTemplates(string const & path)
                case TM_TEMPLATE: {
                        lex.next();
                        string const name = lex.getString();
                case TM_TEMPLATE: {
                        lex.next();
                        string const name = lex.getString();
-                       ExternalTemplate & tmp = templates[name];
+                       Template & tmp = templates[name];
                        tmp.lyxName = name;
                        tmp.readTemplate(lex);
                }
                        tmp.lyxName = name;
                        tmp.readTemplate(lex);
                }
@@ -248,7 +250,7 @@ void ExternalTemplateManager::readTemplates(string const & path)
 }
 
 
 }
 
 
-void ExternalTemplate::readTemplate(LyXLex & lex)
+void Template::readTemplate(LyXLex & lex)
 {
        enum TemplateOptionTags {
                TO_GUINAME = 1,
 {
        enum TemplateOptionTags {
                TO_GUINAME = 1,
@@ -314,7 +316,7 @@ void ExternalTemplate::readTemplate(LyXLex & lex)
                        return;
 
                default:
                        return;
 
                default:
-                       lex.printError("ExternalTemplate::readTemplate: "
+                       lex.printError("external::Template::readTemplate: "
                                       "Wrong tag: $$Token");
                        BOOST_ASSERT(false);
                        break;
                                       "Wrong tag: $$Token");
                        BOOST_ASSERT(false);
                        break;
@@ -323,7 +325,7 @@ void ExternalTemplate::readTemplate(LyXLex & lex)
 }
 
 
 }
 
 
-void ExternalTemplate::FormatTemplate::readFormat(LyXLex & lex)
+void Template::Format::readFormat(LyXLex & lex)
 {
        enum FormatTags {
                FO_PRODUCT = 1,
 {
        enum FormatTags {
                FO_PRODUCT = 1,
@@ -377,3 +379,6 @@ void ExternalTemplate::FormatTemplate::readFormat(LyXLex & lex)
                }
        }
 }
                }
        }
 }
+
+} // namespace external
+} // namespace lyx
index 30b0af56d9776b4b2d992240de4e3a870b2b3665..518066abb57a8bcb18d4454b9d4acf614bbe0423 100644 (file)
@@ -12,6 +12,7 @@
 #ifndef EXTERNALTEMPLATE_H
 #define EXTERNALTEMPLATE_H
 
 #ifndef EXTERNALTEMPLATE_H
 #define EXTERNALTEMPLATE_H
 
+#include <boost/function.hpp>
 #include <boost/utility.hpp>
 #include "support/std_string.h"
 #include <iosfwd>
 #include <boost/utility.hpp>
 #include "support/std_string.h"
 #include <iosfwd>
 
 class LyXLex;
 
 
 class LyXLex;
 
+namespace lyx {
+namespace external {
 
 ///
 
 ///
-struct ExternalTemplate {
+struct Template {
+       /// We have to have default commands for safety reasons!
+       Template();
+       ///
+       void readTemplate(LyXLex &);
+       ///
+       void dumpFormats(std::ostream &) const;
+
        /// What is the name of this template in the LyX format?
        string lyxName;
        /// What will the button in the GUI say?
        /// What is the name of this template in the LyX format?
        string lyxName;
        /// What will the button in the GUI say?
@@ -30,8 +40,8 @@ struct ExternalTemplate {
        /// A short help text
        string helpText;
        /** The format of the input file. Can be "*", in which case we try and
        /// A short help text
        string helpText;
        /** The format of the input file. Can be "*", in which case we try and
-           ascertain the format from the contents of the file.
-       */
+        *   ascertain the format from the contents of the file.
+        */
        string inputFormat;
        /// A file extension regular expression for the file browser
        string fileRegExp;
        string inputFormat;
        /// A file extension regular expression for the file browser
        string fileRegExp;
@@ -39,8 +49,14 @@ struct ExternalTemplate {
        string editCommand;
        /// Should we do automatic production of the output?
        bool automaticProduction;
        string editCommand;
        /// Should we do automatic production of the output?
        bool automaticProduction;
+
        /// This is the information needed to support a specific output format
        /// This is the information needed to support a specific output format
-       struct FormatTemplate {
+       struct Format {
+               /// This constructor has to default a command for safety reasons!
+               Format();
+               ///
+               void readFormat(LyXLex &);
+
                /// The text that should be inserted into the exported file
                string product;
                /// The filename of the resulting file
                /// The text that should be inserted into the exported file
                string product;
                /// The filename of the resulting file
@@ -51,50 +67,39 @@ struct ExternalTemplate {
                string requirement;
                /// A collection of preamble snippets identified by name.
                std::vector<string> preambleNames;
                string requirement;
                /// A collection of preamble snippets identified by name.
                std::vector<string> preambleNames;
-               ///
-               void readFormat(LyXLex &);
-               /// This constructor has to default a command for safety reasons!
-               FormatTemplate();
        };
        ///
        };
        ///
-       void readTemplate(LyXLex &);
-       ///
-       typedef std::map<string, FormatTemplate> Formats;
+       typedef std::map<string, Format> Formats;
        ///
        Formats formats;
        ///
        Formats formats;
-       ///
-       void dumpFormats(std::ostream &) const;
-
-       /// We have to have default commands for safety reasons!
-       ExternalTemplate();
 };
 
 
 /**
    A singleton class that manages the external inset templates
 */
 };
 
 
 /**
    A singleton class that manages the external inset templates
 */
-class ExternalTemplateManager : boost::noncopyable {
+class TemplateManager : boost::noncopyable {
 public:
        /// Map from the LyX name of the template to the template structure
 public:
        /// Map from the LyX name of the template to the template structure
-       typedef std::map<string, ExternalTemplate> Templates;
+       typedef std::map<string, Template> Templates;
        /** Map from the LyX name of the preamble definition to the preamble
         *  definition itself.
         */
        typedef std::map<string, string> PreambleDefs;
 
        /** Map from the LyX name of the preamble definition to the preamble
         *  definition itself.
         */
        typedef std::map<string, string> PreambleDefs;
 
-       static ExternalTemplateManager & get();
+       static TemplateManager & get();
        Templates & getTemplates();
        Templates const & getTemplates() const;
        /** return the template by LyX name.
         *  If it isn't found, return 0.
         */
        Templates & getTemplates();
        Templates const & getTemplates() const;
        /** return the template by LyX name.
         *  If it isn't found, return 0.
         */
-       ExternalTemplate const * getTemplateByName(string const & name) const;
+       Template const * getTemplateByName(string const & name) const;
        /** return the preamble definition by LyX name.
         *  If it isn't found, return an empty string.
         */
        string const getPreambleDefByName(string const & name) const;
 private:
        /** return the preamble definition by LyX name.
         *  If it isn't found, return an empty string.
         */
        string const getPreambleDefByName(string const & name) const;
 private:
-       ExternalTemplateManager();
+       TemplateManager();
        void readTemplates(string const & path);
        void dumpTemplates(std::ostream &) const;
        void dumpPreambleDefs(std::ostream &) const;
        void readTemplates(string const & path);
        void dumpTemplates(std::ostream &) const;
        void dumpPreambleDefs(std::ostream &) const;
@@ -103,4 +108,7 @@ private:
        PreambleDefs preambledefs;
 };
 
        PreambleDefs preambledefs;
 };
 
-#endif
+} // namespace external
+} // namespace lyx
+
+#endif // EXTERNALTEMPLATE_H
index d80fa0e62fae91ad61a83652c665de2684b5bec6..972b9df64aa25f5720db8d952804cbe6c2218657 100644 (file)
@@ -41,6 +41,7 @@
 #include <boost/bind.hpp>
 
 namespace support = lyx::support;
 #include <boost/bind.hpp>
 
 namespace support = lyx::support;
+namespace external = lyx::external;
 
 using std::endl;
 
 
 using std::endl;
 
@@ -72,16 +73,18 @@ string const doSubstitution(InsetExternal::Params const & params,
 void editExternal(InsetExternal::Params const & params, Buffer const & buffer);
 
 
 void editExternal(InsetExternal::Params const & params, Buffer const & buffer);
 
 
-ExternalTemplate const * getTemplatePtr(string const & name)
+external::Template const * getTemplatePtr(string const & name)
 {
 {
-       ExternalTemplateManager const & etm = ExternalTemplateManager::get();
+       external::TemplateManager const & etm =
+               external::TemplateManager::get();
        return etm.getTemplateByName(name);
 }
 
 
        return etm.getTemplateByName(name);
 }
 
 
-ExternalTemplate const * getTemplatePtr(InsetExternal::Params const & params)
+external::Template const * getTemplatePtr(InsetExternal::Params const & params)
 {
 {
-       ExternalTemplateManager const & etm = ExternalTemplateManager::get();
+       external::TemplateManager const & etm =
+               external::TemplateManager::get();
        return etm.getTemplateByName(params.templatename());
 }
 
        return etm.getTemplateByName(params.templatename());
 }
 
@@ -348,7 +351,7 @@ lyx::graphics::Params get_grfx_params(InsetExternal::Params const & eparams)
 string const getScreenLabel(InsetExternal::Params const & params,
                            Buffer const & buffer)
 {
 string const getScreenLabel(InsetExternal::Params const & params,
                            Buffer const & buffer)
 {
-       ExternalTemplate const * const ptr = getTemplatePtr(params);
+       external::Template const * const ptr = getTemplatePtr(params);
        if (!ptr)
                return support::bformat(_("External template %1$s is not installed"),
                                        params.templatename());
        if (!ptr)
                return support::bformat(_("External template %1$s is not installed"),
                                        params.templatename());
@@ -417,12 +420,12 @@ int InsetExternal::write(string const & format,
                         Buffer const & buf, ostream & os,
                         bool external_in_tmpdir) const
 {
                         Buffer const & buf, ostream & os,
                         bool external_in_tmpdir) const
 {
-       ExternalTemplate const * const et_ptr = getTemplatePtr(params_);
+       external::Template const * const et_ptr = getTemplatePtr(params_);
        if (!et_ptr)
                return 0;
        if (!et_ptr)
                return 0;
-       ExternalTemplate const & et = *et_ptr;
+       external::Template const & et = *et_ptr;
 
 
-       ExternalTemplate::Formats::const_iterator cit =
+       external::Template::Formats::const_iterator cit =
                et.formats.find(format);
        if (cit == et.formats.end()) {
                lyxerr[Debug::EXTERNAL]
                et.formats.find(format);
        if (cit == et.formats.end()) {
                lyxerr[Debug::EXTERNAL]
@@ -452,12 +455,12 @@ int InsetExternal::latex(Buffer const & buf, ostream & os,
        // If the template has specified a PDFLaTeX output, then we try and
        // use that.
        if (runparams.flavor == LatexRunParams::PDFLATEX) {
        // If the template has specified a PDFLaTeX output, then we try and
        // use that.
        if (runparams.flavor == LatexRunParams::PDFLATEX) {
-               ExternalTemplate const * const et_ptr = getTemplatePtr(params_);
+               external::Template const * const et_ptr = getTemplatePtr(params_);
                if (!et_ptr)
                        return 0;
                if (!et_ptr)
                        return 0;
-               ExternalTemplate const & et = *et_ptr;
+               external::Template const & et = *et_ptr;
 
 
-               ExternalTemplate::Formats::const_iterator cit =
+               external::Template::Formats::const_iterator cit =
                        et.formats.find("PDFLaTeX");
                if (cit != et.formats.end())
                        return write("PDFLaTeX", buf, os, external_in_tmpdir);
                        et.formats.find("PDFLaTeX");
                if (cit != et.formats.end())
                        return write("PDFLaTeX", buf, os, external_in_tmpdir);
@@ -487,19 +490,19 @@ int InsetExternal::docbook(Buffer const & buf, ostream & os, bool) const
 
 void InsetExternal::validate(LaTeXFeatures & features) const
 {
 
 void InsetExternal::validate(LaTeXFeatures & features) const
 {
-       ExternalTemplate const * const et_ptr = getTemplatePtr(params_);
+       external::Template const * const et_ptr = getTemplatePtr(params_);
        if (!et_ptr)
                return;
        if (!et_ptr)
                return;
-       ExternalTemplate const & et = *et_ptr;
+       external::Template const & et = *et_ptr;
 
 
-       ExternalTemplate::Formats::const_iterator cit = et.formats.find("LaTeX");
+       external::Template::Formats::const_iterator cit = et.formats.find("LaTeX");
        if (cit == et.formats.end())
                return;
 
        if (!cit->second.requirement.empty())
                features.require(cit->second.requirement);
 
        if (cit == et.formats.end())
                return;
 
        if (!cit->second.requirement.empty())
                features.require(cit->second.requirement);
 
-       ExternalTemplateManager & etm = ExternalTemplateManager::get();
+       external::TemplateManager & etm = external::TemplateManager::get();
 
        vector<string>::const_iterator it  = cit->second.preambleNames.begin();
        vector<string>::const_iterator end = cit->second.preambleNames.end();
 
        vector<string>::const_iterator it  = cit->second.preambleNames.begin();
        vector<string>::const_iterator end = cit->second.preambleNames.end();
@@ -515,20 +518,20 @@ void InsetExternal::updateExternal(string const & format,
                                   Buffer const & buf,
                                   bool external_in_tmpdir) const
 {
                                   Buffer const & buf,
                                   bool external_in_tmpdir) const
 {
-       ExternalTemplate const * const et_ptr = getTemplatePtr(params_);
+       external::Template const * const et_ptr = getTemplatePtr(params_);
        if (!et_ptr)
                return;
        if (!et_ptr)
                return;
-       ExternalTemplate const & et = *et_ptr;
+       external::Template const & et = *et_ptr;
 
        if (!et.automaticProduction)
                return;
 
 
        if (!et.automaticProduction)
                return;
 
-       ExternalTemplate::Formats::const_iterator cit =
+       external::Template::Formats::const_iterator cit =
                et.formats.find(format);
        if (cit == et.formats.end())
                return;
 
                et.formats.find(format);
        if (cit == et.formats.end())
                return;
 
-       ExternalTemplate::FormatTemplate const & outputFormat = cit->second;
+       external::Template::Format const & outputFormat = cit->second;
        if (outputFormat.updateResult.empty())
                return;
 
        if (outputFormat.updateResult.empty())
                return;
 
@@ -636,10 +639,10 @@ string const doSubstitution(InsetExternal::Params const & params,
 
 void editExternal(InsetExternal::Params const & params, Buffer const & buffer)
 {
 
 void editExternal(InsetExternal::Params const & params, Buffer const & buffer)
 {
-       ExternalTemplate const * const et_ptr = getTemplatePtr(params);
+       external::Template const * const et_ptr = getTemplatePtr(params);
        if (!et_ptr)
                return;
        if (!et_ptr)
                return;
-       ExternalTemplate const & et = *et_ptr;
+       external::Template const & et = *et_ptr;
 
        if (et.editCommand.empty())
                return;
 
        if (et.editCommand.empty())
                return;