Merge Chromium + Blink git repositories
[chromium-blink-merge.git] / ui / views / controls / separator.h
blobb0dfbce00dc1fab8f8a071e357e67ade1b1060b3
1 // Copyright (c) 2011 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.
5 #ifndef UI_VIEWS_CONTROLS_SEPARATOR_H_
6 #define UI_VIEWS_CONTROLS_SEPARATOR_H_
8 #include <string>
10 #include "ui/views/view.h"
12 namespace views {
14 // The Separator class is a view that shows a line used to visually separate
15 // other views.
17 class VIEWS_EXPORT Separator : public View {
18 public:
19 enum Orientation {
20 HORIZONTAL,
21 VERTICAL
24 // The separator's class name.
25 static const char kViewClassName[];
27 explicit Separator(Orientation orientation);
28 ~Separator() override;
30 SkColor color() const { return color_; }
31 void SetColor(SkColor color);
33 int size() const { return size_; }
34 // Preferred size of one axis: height for horizontal separator
35 // and width for vertical separator
36 void SetPreferredSize(int size);
38 // Overridden from View:
39 gfx::Size GetPreferredSize() const override;
40 void GetAccessibleState(ui::AXViewState* state) override;
41 void OnPaint(gfx::Canvas* canvas) override;
42 const char* GetClassName() const override;
44 private:
45 const Orientation orientation_;
46 SkColor color_;
47 int size_;
49 DISALLOW_COPY_AND_ASSIGN(Separator);
52 } // namespace views
54 #endif // UI_VIEWS_CONTROLS_SEPARATOR_H_