SvgImporterInit.js 827 B

12345678910111213141516171819202122232425262728
  1. function SvgImporterFactory() {
  2. RFileImporterFactoryAdapter.call(this);
  3. }
  4. SvgImporterFactory.prototype = new RFileImporterFactoryAdapter();
  5. SvgImporterFactory.includeBasePath = includeBasePath;
  6. SvgImporterFactory.prototype.getFilterStrings = function() {
  7. return [ qsTr("SVG Files %1").arg("(*.svg)") ];
  8. };
  9. SvgImporterFactory.prototype.canImport = function(fileName, nameFilter) {
  10. var fi = new QFileInfo(fileName);
  11. if (fi.suffix().toLowerCase()==="svg") {
  12. return 1;
  13. }
  14. return -1;
  15. };
  16. SvgImporterFactory.prototype.instantiate = function(document, messageHandler, progressHandler) {
  17. include(SvgImporterFactory.includeBasePath + "/SvgImporter.js");
  18. return new SvgImporter(document);
  19. };
  20. function init(basePath) {
  21. RFileImporterRegistry.registerFileImporter(new SvgImporterFactory());
  22. }