Scrollable.hpp 582 B

1234567891011121314151617181920212223242526272829303132
  1. #ifndef FREESHOP_SCROLLABLE_HPP
  2. #define FREESHOP_SCROLLABLE_HPP
  3. #include <cpp3ds/System/Vector2.hpp>
  4. namespace FreeShop {
  5. class ScrollBar;
  6. class Scrollable {
  7. friend class ScrollBar;
  8. public:
  9. Scrollable();
  10. ~Scrollable();
  11. virtual void setScroll(float position) = 0;
  12. virtual float getScroll() = 0;
  13. virtual const cpp3ds::Vector2f &getScrollSize() = 0;
  14. protected:
  15. void attachScrollbar(ScrollBar *scrollbar);
  16. void detachScrollbar();
  17. void updateScrollSize();
  18. private:
  19. float m_scrollVal;
  20. ScrollBar *m_scrollBar;
  21. };
  22. } // namespace FreeShop
  23. #endif // FREESHOP_SCROLLABLE_HPP