blob: ecd685a2732a7268d09041bf95d2d424bad45af3 [file] [log] [blame]
// Copyright 2016 The Chromium Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#include <memory>
#include "base/macros.h"
#include "ui/display/display_export.h"
#include "ui/display/display_layout.h"
namespace display {
class DisplayLayout;
// A utility class to create a DisplayLayout instance.
class DISPLAY_EXPORT DisplayLayoutBuilder final {
// Creates a builder that uses a copy of the |layout| as a source.
explicit DisplayLayoutBuilder(const DisplayLayout& layout);
// Creates a builder with the primary display id.
explicit DisplayLayoutBuilder(int64_t primary_id);
DisplayLayoutBuilder& SetDefaultUnified(bool default_unified);
DisplayLayoutBuilder& SetMirrored(bool mirrored);
DisplayLayoutBuilder& ClearPlacements();
// Adds a display placement.
DisplayLayoutBuilder& AddDisplayPlacement(int64_t display_id,
int64_t parent_id,
DisplayPlacement::Position position,
int offset);
// Adds a display placement.
DisplayLayoutBuilder& AddDisplayPlacement(const DisplayPlacement& placement);
// Sets the display placement for the secondary display.
DisplayLayoutBuilder& SetSecondaryPlacement(
int64_t secondary_id,
DisplayPlacement::Position position,
int offset);
// Returns the DisplayLayout. After this call, the builder becomes invalid.
std::unique_ptr<DisplayLayout> Build();
std::unique_ptr<DisplayLayout> layout_;
} // namespace display