1 | // Aseprite UI Library |
2 | // Copyright (C) 2001-2013, 2015 David Capello |
3 | // |
4 | // This file is released under the terms of the MIT license. |
5 | // Read LICENSE.txt for more information. |
6 | |
7 | #ifndef UI_SIZE_HINT_EVENT_H_INCLUDED |
8 | #define UI_SIZE_HINT_EVENT_H_INCLUDED |
9 | #pragma once |
10 | |
11 | #include "gfx/size.h" |
12 | #include "ui/event.h" |
13 | |
14 | namespace ui { |
15 | |
16 | class Widget; |
17 | |
18 | class SizeHintEvent : public Event { |
19 | public: |
20 | SizeHintEvent(Widget* source, const gfx::Size& fitIn); |
21 | virtual ~SizeHintEvent(); |
22 | |
23 | gfx::Size fitInSize() const; |
24 | int fitInWidth() const; |
25 | int fitInHeight() const; |
26 | |
27 | gfx::Size sizeHint() const; |
28 | void setSizeHint(const gfx::Size& sz); |
29 | void setSizeHint(int w, int h); |
30 | |
31 | private: |
32 | gfx::Size m_fitIn; |
33 | gfx::Size m_sizeHint; |
34 | }; |
35 | |
36 | } // namespace ui |
37 | |
38 | #endif |
39 | |