1 // Copyright (c) 2012 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_BASE_IME_COMPOSITION_UNDERLINE_H_
6 #define UI_BASE_IME_COMPOSITION_UNDERLINE_H_
10 #include "base/basictypes.h"
11 #include "third_party/skia/include/core/SkColor.h"
15 // Intentionally keep sync with blink::WebCompositionUnderline defined in:
16 // third_party/WebKit/public/web/WebCompositionUnderline.h
17 struct CompositionUnderline
{
18 CompositionUnderline()
21 color(SK_ColorTRANSPARENT
),
23 background_color(SK_ColorTRANSPARENT
) {}
25 // TODO(huangs): remove this constructor.
26 CompositionUnderline(uint32 s
, uint32 e
, SkColor c
, bool t
)
31 background_color(SK_ColorTRANSPARENT
) {}
33 CompositionUnderline(uint32 s
, uint32 e
, SkColor c
, bool t
, SkColor bc
)
38 background_color(bc
) {}
40 bool operator==(const CompositionUnderline
& rhs
) const {
41 return (this->start_offset
== rhs
.start_offset
) &&
42 (this->end_offset
== rhs
.end_offset
) && (this->color
== rhs
.color
) &&
43 (this->thick
== rhs
.thick
) &&
44 (this->background_color
== rhs
.background_color
);
47 bool operator!=(const CompositionUnderline
& rhs
) const {
48 return !(*this == rhs
);
55 SkColor background_color
;
58 typedef std::vector
<CompositionUnderline
> CompositionUnderlines
;
62 #endif // UI_BASE_IME_COMPOSITION_UNDERLINE_H_