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 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 8 | #include "base/component_export.h" |
Tom Anderson | d6ecb87 | 2022-09-02 19:13:03 | [diff] [blame] | 9 | #include "base/features.h" |
Ali Hijazi | e63cbaf6 | 2023-12-20 19:29:35 | [diff] [blame^] | 10 | #include "base/memory/raw_ptr.h" |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 11 | |
Tom Anderson | 992d987 | 2022-07-14 21:24:50 | [diff] [blame] | 12 | namespace ui { |
| 13 | |
| 14 | class LinuxUi; |
Tom Anderson | cd61f3b2 | 2022-09-14 16:27:49 | [diff] [blame] | 15 | class LinuxUiTheme; |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 16 | enum class SystemTheme : int; |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 17 | |
Tom Anderson | 10fc024 | 2023-05-19 23:10:16 | [diff] [blame] | 18 | // TODO(https://crbug.com/1317782): Remove in M110. |
| 19 | COMPONENT_EXPORT(LINUX_UI_FACTORY) BASE_DECLARE_FEATURE(kAllowQt); |
| 20 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 21 | // Returns a LinuxUi for the default toolkit. May create a LinuxUi instance if |
| 22 | // one does not exist. May return nullptr if no toolkits are available. |
| 23 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 24 | LinuxUi* GetDefaultLinuxUi(); |
| 25 | |
Tom Anderson | 975c84e1 | 2022-09-14 22:17:58 | [diff] [blame] | 26 | // Returns a LinuxUiTheme for the default toolkit. May create a LinuxUiTheme |
| 27 | // instance if one does not exist. May return nullptr if no toolkits are |
| 28 | // available. Should only be used by tests or LinuxUi internals. Otherwise, use |
| 29 | // the accessors in LinuxUiTheme instead. |
| 30 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 31 | LinuxUiTheme* GetDefaultLinuxUiTheme(); |
| 32 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 33 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
Tom Anderson | cd61f3b2 | 2022-09-14 16:27:49 | [diff] [blame] | 34 | LinuxUiTheme* GetLinuxUiTheme(SystemTheme system_theme); |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 35 | |
Tom Anderson | 4943182 | 2023-07-21 22:35:40 | [diff] [blame] | 36 | // Returns all `LinuxUiTheme`s that have been created. |
| 37 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
Ali Hijazi | e63cbaf6 | 2023-12-20 19:29:35 | [diff] [blame^] | 38 | const std::vector<raw_ptr<LinuxUiTheme, VectorExperimental>>& |
| 39 | GetLinuxUiThemes(); |
Tom Anderson | 4943182 | 2023-07-21 22:35:40 | [diff] [blame] | 40 | |
Tom Anderson | 074a5d41 | 2022-08-30 18:54:53 | [diff] [blame] | 41 | COMPONENT_EXPORT(LINUX_UI_FACTORY) |
| 42 | SystemTheme GetDefaultSystemTheme(); |
Tom Anderson | 992d987 | 2022-07-14 21:24:50 | [diff] [blame] | 43 | |
| 44 | } // namespace ui |
Tom Anderson | 80d3ad4 | 2022-05-03 12:09:27 | [diff] [blame] | 45 | |
Tom Anderson | 4ee8374 | 2022-07-14 20:58:41 | [diff] [blame] | 46 | #endif // UI_LINUX_LINUX_UI_FACTORY_H_ |