ResourceEditor.h 1.4 KB

123456789101112131415161718192021222324252627282930313233343536373839404142434445464748495051525354555657585960
  1. // Copyright (c) 2014-2015, THUNDERBEAST GAMES LLC All rights reserved
  2. // Please see LICENSE.md in repository root for license information
  3. // https://github.com/AtomicGameEngine/AtomicGameEngine
  4. #pragma once
  5. #include <Atomic/Core/Object.h>
  6. #include <TurboBadger/tb_tab_container.h>
  7. using namespace Atomic;
  8. using namespace tb;
  9. namespace AtomicEditor
  10. {
  11. class EditorTabLayout;
  12. class ResourceEditor: public Object
  13. {
  14. OBJECT(ResourceEditor);
  15. public:
  16. ResourceEditor(Context* context, const String& fullpath, TBTabContainer* container);
  17. virtual ~ResourceEditor();
  18. TBButton* GetButton() { return button_; }
  19. virtual bool HasUnsavedModifications() { return false; }
  20. virtual void SetFocus() {}
  21. virtual void Close(bool navigateToAvailabeResource = true);
  22. virtual bool OnEvent(const TBWidgetEvent &ev) { return false; }
  23. virtual bool FindText(const String& text, unsigned flags) { return false; }
  24. virtual void FindTextClose() { }
  25. virtual bool RequiresInspector() { return false; }
  26. const String& GetFullPath() { return fullpath_; }
  27. TBWidget* GetRootContentWidget() { return rootContentWidget_; }
  28. protected:
  29. String fullpath_;
  30. TBTabContainer* container_;
  31. EditorTabLayout* editorTabLayout_;
  32. TBWidget* rootContentWidget_;
  33. TBButton* button_;
  34. private:
  35. void HandleFileChanged(StringHash eventType, VariantMap& eventData);
  36. };
  37. }