ResourceEditor.h 1.4 KB

12345678910111213141516171819202122232425262728293031323334353637383940414243444546474849505152535455565758596061626364
  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 <Atomic/UI/UIButton.h>
  7. #include <Atomic/UI/UITabContainer.h>
  8. using namespace Atomic;
  9. using namespace tb;
  10. namespace AtomicEditor
  11. {
  12. class EditorTabLayout;
  13. class ResourceEditor: public Object
  14. {
  15. OBJECT(ResourceEditor);
  16. public:
  17. ResourceEditor(Context* context, const String& fullpath, UITabContainer* container);
  18. virtual ~ResourceEditor();
  19. UIButton* GetButton() { return button_; }
  20. virtual bool HasUnsavedModifications() { return false; }
  21. virtual void SetFocus() {}
  22. virtual void Close(bool navigateToAvailableResource = true);
  23. virtual bool OnEvent(const TBWidgetEvent &ev) { return false; }
  24. virtual bool FindText(const String& text, unsigned flags) { return false; }
  25. virtual void FindTextClose() { }
  26. virtual bool RequiresInspector() { return false; }
  27. const String& GetFullPath() { return fullpath_; }
  28. UIWidget* GetRootContentWidget() { return rootContentWidget_; }
  29. protected:
  30. String fullpath_;
  31. EditorTabLayout* editorTabLayout_;
  32. SharedPtr<UITabContainer> container_;
  33. SharedPtr<UIWidget> rootContentWidget_;
  34. SharedPtr<UIButton> button_;
  35. private:
  36. void HandleFileChanged(StringHash eventType, VariantMap& eventData);
  37. };
  38. }