1 // Copyright 2014 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 UI_DISPLAY_TYPES_DISPLAY_MODE_H_
6 #define UI_DISPLAY_TYPES_DISPLAY_MODE_H_
7 
8 #include <memory>
9 #include <ostream>
10 #include <string>
11 
12 #include "base/macros.h"
13 #include "ui/display/types/display_types_export.h"
14 #include "ui/gfx/geometry/size.h"
15 
16 namespace display {
17 
18 // This class represents the basic information for a native mode. Platforms may
19 // extend this class to add platform specific information about the mode.
20 class DISPLAY_TYPES_EXPORT DisplayMode {
21  public:
22   DisplayMode(const gfx::Size& size, bool interlaced, float refresh_rate);
23   ~DisplayMode();
24   std::unique_ptr<DisplayMode> Clone() const;
25 
size()26   const gfx::Size& size() const { return size_; }
is_interlaced()27   bool is_interlaced() const { return is_interlaced_; }
refresh_rate()28   float refresh_rate() const { return refresh_rate_; }
29 
30   std::string ToString() const;
31 
32  private:
33   const gfx::Size size_;
34   const float refresh_rate_;
35   const bool is_interlaced_;
36 
37   DISALLOW_COPY_AND_ASSIGN(DisplayMode);
38 };
39 
40 // Used to by gtest to print readable errors.
41 DISPLAY_TYPES_EXPORT void PrintTo(const DisplayMode& mode, std::ostream* os);
42 
43 }  // namespace display
44 
45 #endif  // UI_DISPLAY_TYPES_DISPLAY_MODE_H_
46