blob: 9a9edb0941a24b5605cf0509cf69480ff7125e87 [file] [log] [blame]
Avi Drissman3e1a26c2022-09-15 20:26:031// Copyright 2022 The Chromium Authors
Tom Anderson80d3ad42022-05-03 12:09:272// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Tom Anderson4ee83742022-07-14 20:58:415#ifndef UI_LINUX_LINUX_UI_FACTORY_H_
6#define UI_LINUX_LINUX_UI_FACTORY_H_
Tom Anderson80d3ad42022-05-03 12:09:277
Tom Anderson074a5d412022-08-30 18:54:538#include "base/component_export.h"
Tom Andersond6ecb872022-09-02 19:13:039#include "base/features.h"
Ali Hijazie63cbaf62023-12-20 19:29:3510#include "base/memory/raw_ptr.h"
Tom Anderson80d3ad42022-05-03 12:09:2711
Tom Anderson992d9872022-07-14 21:24:5012namespace ui {
13
14class LinuxUi;
Tom Andersoncd61f3b22022-09-14 16:27:4915class LinuxUiTheme;
Tom Anderson074a5d412022-08-30 18:54:5316enum class SystemTheme : int;
Tom Anderson80d3ad42022-05-03 12:09:2717
Tom Anderson10fc0242023-05-19 23:10:1618// TODO(https://crbug.com/1317782): Remove in M110.
19COMPONENT_EXPORT(LINUX_UI_FACTORY) BASE_DECLARE_FEATURE(kAllowQt);
20
Tom Anderson074a5d412022-08-30 18:54:5321// 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.
23COMPONENT_EXPORT(LINUX_UI_FACTORY)
24LinuxUi* GetDefaultLinuxUi();
25
Tom Anderson975c84e12022-09-14 22:17:5826// 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.
30COMPONENT_EXPORT(LINUX_UI_FACTORY)
31LinuxUiTheme* GetDefaultLinuxUiTheme();
32
Tom Anderson074a5d412022-08-30 18:54:5333COMPONENT_EXPORT(LINUX_UI_FACTORY)
Tom Andersoncd61f3b22022-09-14 16:27:4934LinuxUiTheme* GetLinuxUiTheme(SystemTheme system_theme);
Tom Anderson074a5d412022-08-30 18:54:5335
Tom Anderson49431822023-07-21 22:35:4036// Returns all `LinuxUiTheme`s that have been created.
37COMPONENT_EXPORT(LINUX_UI_FACTORY)
Ali Hijazie63cbaf62023-12-20 19:29:3538const std::vector<raw_ptr<LinuxUiTheme, VectorExperimental>>&
39GetLinuxUiThemes();
Tom Anderson49431822023-07-21 22:35:4040
Tom Anderson074a5d412022-08-30 18:54:5341COMPONENT_EXPORT(LINUX_UI_FACTORY)
42SystemTheme GetDefaultSystemTheme();
Tom Anderson992d9872022-07-14 21:24:5043
44} // namespace ui
Tom Anderson80d3ad42022-05-03 12:09:2745
Tom Anderson4ee83742022-07-14 20:58:4146#endif // UI_LINUX_LINUX_UI_FACTORY_H_