| OLD | NEW |
| (Empty) |
| 1 // Copyright 2016 The Chromium Authors. All rights reserved. | |
| 2 // Use of this source code is governed by a BSD-style license that can be | |
| 3 // found in the LICENSE file. | |
| 4 | |
| 5 #ifndef ASH_DISPLAY_DISPLAY_LAYOUT_BUILDER_H_ | |
| 6 #define ASH_DISPLAY_DISPLAY_LAYOUT_BUILDER_H_ | |
| 7 | |
| 8 #include "ash/display/display_layout.h" | |
| 9 #include "base/macros.h" | |
| 10 #include "base/memory/scoped_ptr.h" | |
| 11 | |
| 12 namespace ash { | |
| 13 | |
| 14 class DisplayLayout; | |
| 15 | |
| 16 // A utility class to create a DisplayLayout instance. | |
| 17 class ASH_EXPORT DisplayLayoutBuilder final { | |
| 18 public: | |
| 19 // Creates a builder that uses a copy of the |layout| as a source. | |
| 20 explicit DisplayLayoutBuilder(const DisplayLayout& layout); | |
| 21 | |
| 22 // Ccreates a builder with the primary display id. | |
| 23 explicit DisplayLayoutBuilder(int64_t primary_id); | |
| 24 | |
| 25 ~DisplayLayoutBuilder(); | |
| 26 | |
| 27 DisplayLayoutBuilder& SetDefaultUnified(bool default_unified); | |
| 28 | |
| 29 DisplayLayoutBuilder& SetMirrored(bool mirrored); | |
| 30 | |
| 31 DisplayLayoutBuilder& ClearPlacements(); | |
| 32 | |
| 33 // Adds a display placement. | |
| 34 DisplayLayoutBuilder& AddDisplayPlacement(int64_t display_id, | |
| 35 int64_t parent_id, | |
| 36 DisplayPlacement::Position position, | |
| 37 int offset); | |
| 38 | |
| 39 // Sets the display placement for the secondary display. | |
| 40 DisplayLayoutBuilder& SetSecondaryPlacement( | |
| 41 int64_t secondary_id, | |
| 42 DisplayPlacement::Position position, | |
| 43 int offset); | |
| 44 | |
| 45 // Returns the DisplayLayout. After this call, the builder becomes invalid. | |
| 46 scoped_ptr<DisplayLayout> Build(); | |
| 47 | |
| 48 private: | |
| 49 scoped_ptr<DisplayLayout> layout_; | |
| 50 | |
| 51 DISALLOW_COPY_AND_ASSIGN(DisplayLayoutBuilder); | |
| 52 }; | |
| 53 | |
| 54 } // namespace ash | |
| 55 | |
| 56 #endif // ASH_DISPLAY_DISPLAY_LAYOUT_BUILDER_H_ | |
| OLD | NEW |