#ifndef ASH_TEST_TEST_WINDOW_BUILDER_H_
#define ASH_TEST_TEST_WINDOW_BUILDER_H_
#include <memory>
#include "ash/ash_export.h"
#include "base/memory/raw_ptr.h"
#include "ui/aura/client/aura_constants.h"
#include "ui/aura/window.h"
#include "ui/base/class_property.h"
#include "ui/compositor/layer_type.h"
#include "ui/gfx/geometry/rect.h"
namespace ash {
class ASH_EXPORT TestWindowBuilder {
public:
TestWindowBuilder();
TestWindowBuilder(TestWindowBuilder& other);
TestWindowBuilder& operator=(TestWindowBuilder& params) = delete;
~TestWindowBuilder();
TestWindowBuilder& SetParent(aura::Window* parent);
TestWindowBuilder& SetWindowType(aura::client::WindowType type);
TestWindowBuilder& SetWindowId(int id);
TestWindowBuilder& SetBounds(const gfx::Rect& bounds);
TestWindowBuilder& SetWindowTitle(const std::u16string& title);
TestWindowBuilder& SetDelegate(aura::WindowDelegate* delegate);
TestWindowBuilder& SetColorWindowDelegate(SkColor color);
TestWindowBuilder& SetTestWindowDelegate();
TestWindowBuilder& AllowAllWindowStates();
TestWindowBuilder& SetShow(bool show);
template <typename T>
TestWindowBuilder& SetWindowProperty(const ui::ClassProperty<T>* property,
T value) {
init_properties_.SetProperty(property, value);
return *this;
}
[[nodiscard]] std::unique_ptr<aura::Window> Build();
private:
raw_ptr<aura::Window, ExperimentalAsh> parent_ = nullptr;
raw_ptr<aura::Window, ExperimentalAsh> context_ = nullptr;
raw_ptr<aura::WindowDelegate, ExperimentalAsh> delegate_ = nullptr;
aura::client::WindowType window_type_ = aura::client::WINDOW_TYPE_NORMAL;
ui::LayerType layer_type_ = ui::LAYER_TEXTURED;
gfx::Rect bounds_;
ui::PropertyHandler init_properties_;
int window_id_ = aura::Window::kInitialId;
std::u16string window_title_ = std::u16string();
bool show_ = true;
bool built_ = false;
};
TestWindowBuilder ChildTestWindowBuilder(aura::Window* parent,
const gfx::Rect& bounds = gfx::Rect(),
int window_id = -1);
}
#endif