Avi Drissman | 3e1a26c | 2022-09-15 20:26:03 | [diff] [blame] | 1 | // Copyright 2022 The Chromium Authors |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Tom Anderson | 4ee8374 | 2022-07-14 20:58:41 | [diff] [blame] | 5 | #ifndef UI_LINUX_LINUX_UI_FACTORY_H_ |
| 6 | #define UI_LINUX_LINUX_UI_FACTORY_H_ |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 7 | |
Takuto Ikuta | 7aff87d2 | 2025-05-15 15:18:42 | [diff] [blame] | 8 | #include <vector> |
| 9 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 10 | #include "base/component_export.h" |
Ali Hijazi | e63cbaf6 | 2023-12-20 19:29:35 | [diff] [blame] | 11 | #include "base/memory/raw_ptr.h" |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 12 | |
Tom Anderson | 992d987 | 2022-07-14 21:24:50 | [diff] [blame] | 13 | namespace ui { |
| 14 | |
| 15 | class LinuxUi; |
Tom Anderson | cd61f3b2 | 2022-09-14 16:27:49 | [diff] [blame] | 16 | class LinuxUiTheme; |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 17 | enum class SystemTheme : int; |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 18 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 19 | // Returns a LinuxUi for the default toolkit. May create a LinuxUi instance if |
| 20 | // one does not exist. May return nullptr if no toolkits are available. |
| 21 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 22 | LinuxUi* GetDefaultLinuxUi(); |
| 23 | |
Tom Anderson | 975c84e1 | 2022-09-14 22:17:58 | [diff] [blame] | 24 | // Returns a LinuxUiTheme for the default toolkit. May create a LinuxUiTheme |
| 25 | // instance if one does not exist. May return nullptr if no toolkits are |
| 26 | // available. Should only be used by tests or LinuxUi internals. Otherwise, use |
| 27 | // the accessors in LinuxUiTheme instead. |
| 28 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 29 | LinuxUiTheme* GetDefaultLinuxUiTheme(); |
| 30 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 31 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
Tom Anderson | cd61f3b2 | 2022-09-14 16:27:49 | [diff] [blame] | 32 | LinuxUiTheme* GetLinuxUiTheme(SystemTheme system_theme); |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 33 | |
Tom Anderson | 4943182 | 2023-07-21 22:35:40 | [diff] [blame] | 34 | // Returns all `LinuxUiTheme`s that have been created. |
| 35 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
Ali Hijazi | e63cbaf6 | 2023-12-20 19:29:35 | [diff] [blame] | 36 | const std::vector<raw_ptr<LinuxUiTheme, VectorExperimental>>& |
| 37 | GetLinuxUiThemes(); |
Tom Anderson | 4943182 | 2023-07-21 22:35:40 | [diff] [blame] | 38 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 39 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 40 | SystemTheme GetDefaultSystemTheme(); |
Tom Anderson | 992d987 | 2022-07-14 21:24:50 | [diff] [blame] | 41 | |
| 42 | } // namespace ui |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 43 | |
Tom Anderson | 4ee8374 | 2022-07-14 20:58:41 | [diff] [blame] | 44 | #endif // UI_LINUX_LINUX_UI_FACTORY_H_ |