window_controller.h
1/*
2** ClanLib SDK
3** Copyright (c) 1997-2020 The ClanLib Team
4**
5** This software is provided 'as-is', without any express or implied
6** warranty. In no event will the authors be held liable for any damages
7** arising from the use of this software.
8**
9** Permission is granted to anyone to use this software for any purpose,
10** including commercial applications, and to alter it and redistribute it
11** freely, subject to the following restrictions:
12**
13** 1. The origin of this software must not be misrepresented; you must not
14** claim that you wrote the original software. If you use this software
15** in a product, an acknowledgment in the product documentation would be
16** appreciated but is not required.
17** 2. Altered source versions must be plainly marked as such, and must not be
18** misrepresented as being the original software.
19** 3. This notice may not be removed or altered from any source distribution.
20**
21** Note: Some of the libraries ClanLib may link to may have additional
22** requirements or restrictions.
23**
24** File Author(s):
25**
26** Magnus Norddahl
27*/
28
29#pragma once
30
31#include <memory>
32#include "../../Core/Signals/signal.h"
33
34namespace clan
35{
36 class View;
37 class WindowControllerImpl;
38
41 {
42 public:
45
47 const std::shared_ptr<View> &root_view() const;
48
50 void set_root_view(std::shared_ptr<View> root_view);
51
53 const std::string &title() const;
54
56 void set_title(const std::string &title);
57
59 void set_frame_size(const Sizef &size, bool resizable = true);
60
62 void set_content_size(const Sizef &size, bool resizable = true);
63
66
68 bool resizable();
69
71 void set_icon(const std::vector<std::string> &icon_images);
72
74 void dismiss();
75
78
81
82 private:
83 WindowController(const WindowController &) = delete;
84 WindowController &operator=(const WindowController &) = delete;
85
86 std::unique_ptr<WindowControllerImpl> impl;
87 friend class WindowManager;
88 };
89}
2D (width,height) size structure - Float
Definition size.h:184
Definition signal.h:141
Base class for controllers managing windows.
Definition window_controller.h:41
bool resizable()
Gets the ability for the user to resize the window.
void dismiss()
Closes the window.
void set_icon(const std::vector< std::string > &icon_images)
Sets the icon used for the window.
void immediate_update()
Immediately redraws the window.
void set_frame_size(const Sizef &size, bool resizable=true)
Sets the size of the window.
SlotContainer slots
Slot container helping with automatic disconnection of connected slots when the controller is destroy...
Definition window_controller.h:80
void set_resizable(bool resizable)
Sets the ability for the user to resize the window.
void set_content_size(const Sizef &size, bool resizable=true)
Sets the size of the window.
const std::shared_ptr< View > & root_view() const
Returns the root view.
const std::string & title() const
Returns the window title.
void set_title(const std::string &title)
Sets the window title.
void set_root_view(std::shared_ptr< View > root_view)
Changes the root view.
Manages one or more windows.
Definition window_manager.h:43
Definition clanapp.h:36