PolycodeEditor.h 675 B

1234567891011121314151617181920212223242526272829303132333435363738
  1. #pragma once
  2. #include "Polycode.h"
  3. using namespace Polycode;
  4. class PolycodeEditor : public ScreenEntity {
  5. public:
  6. PolycodeEditor(bool _isReadOnly);
  7. virtual ~PolycodeEditor();
  8. virtual bool openFile(string filePath){ this->filePath = filePath; }
  9. virtual void Resize(int x, int y) = 0;
  10. string getFilePath() { return filePath; }
  11. bool isReadOnly() { return _isReadOnly; }
  12. protected:
  13. string filePath;
  14. bool _isReadOnly;
  15. };
  16. class PolycodeEditorFactory {
  17. public:
  18. PolycodeEditorFactory();
  19. virtual ~PolycodeEditorFactory();
  20. virtual PolycodeEditor *createEditor() = 0;
  21. bool canHandleExtension(string extension);
  22. protected:
  23. vector<string> extensions;
  24. };