window_controller.h Source File - ClanLib SDK
Description: window_controller.h Source File

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
40 class WindowController
41 {
42 public:
43 WindowController();
44 virtual ~WindowController();
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
65 void set_resizable(bool resizable);
66
68 bool resizable();
69
71 void set_icon(const std::vector<std::string> &icon_images);
72
74 void dismiss();
75
77 void immediate_update();
78
80 SlotContainer slots;
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}
clan::Sizef
2D (width,height) size structure - Float
Definition size.h:189
clan::SlotContainer
Definition signal.h:141
clan::View
View for an area of the user interface.
Definition view.h:66
clan::WindowController::~WindowController
virtual ~WindowController()
clan::WindowController::resizable
bool resizable()
Gets the ability for the user to resize the window.
clan::WindowController::dismiss
void dismiss()
Closes the window.
clan::WindowController::set_icon
void set_icon(const std::vector< std::string > &icon_images)
Sets the icon used for the window.
clan::WindowController::immediate_update
void immediate_update()
Immediately redraws the window.
clan::WindowController::WindowController
WindowController()
clan::WindowController::set_frame_size
void set_frame_size(const Sizef &size, bool resizable=true)
Sets the size of the window.
clan::WindowController::slots
SlotContainer slots
Slot container helping with automatic disconnection of connected slots when the controller is destroy...
Definition window_controller.h:80
clan::WindowController::WindowManager
friend class WindowManager
Definition window_controller.h:87
clan::WindowController::set_resizable
void set_resizable(bool resizable)
Sets the ability for the user to resize the window.
clan::WindowController::set_content_size
void set_content_size(const Sizef &size, bool resizable=true)
Sets the size of the window.
clan::WindowController::root_view
const std::shared_ptr< View > & root_view() const
Returns the root view.
clan::WindowController::title
const std::string & title() const
Returns the window title.
clan::WindowController::set_title
void set_title(const std::string &title)
Sets the window title.
clan::WindowController::set_root_view
void set_root_view(std::shared_ptr< View > root_view)
Changes the root view.
clan
Definition clanapp.h:36