YCLIMP
Yandex Command Line Interface Music Player
Loading...
Searching...
No Matches
SWHolder.hpp
1#pragma once
2
3#include "HotKeyComponent.hpp"
4#include "SubWindow.hpp"
5#include "Utility.hpp"
6
7#include <memory>
8#include <vector>
9
10// each swHolder belongs to some position
11enum class PositionType
12{
13 None = -1,
14 Top,
15 MidOnly, //
16 Left,
17 Right,
18 Central,
19};
20
34class SWHolder
35{
36public:
37 SWHolder(SWHolderType holderType, Recti bounds, PositionType posType);
38
39 void HoldSubWindow(SubWindow::Ptr subWindow);
40 void HandleResizeEvent(Recti newRect);
41 void UpdateRectSize(Recti newRect);
42
43 void SetNewPosNBounds(PositionType posType, Recti bounds);
44 void EnableAndSelect();
45 void DisableAndDeselect();
46 void Select();
47 void Deselect();
48
49 void SelectSubWindow(ESWTypes swType);
50
51 bool IsSelected() const;
52 bool IsVisible() const;
53 PositionType GetPosType() const;
54 const Recti& GetBounds() const;
55
56private:
57 SWHolderType mHolderType;
58 PositionType mPosType;
59 Recti mBounds;
60 std::vector<SubWindow::Ptr> mSubWindows;
61 SubWindow::Ptr mSelectedSW;
62 bool mIsHolderSelected;
63};
Utility function list.