chromium/ui/gfx/selection_bound.h

// Copyright 2014 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef UI_GFX_SELECTION_BOUND_H_
#define UI_GFX_SELECTION_BOUND_H_

#include "ui/gfx/geometry/point.h"
#include "ui/gfx/geometry/point_f.h"
#include "ui/gfx/gfx_export.h"

namespace gfx {

class Rect;
class RectF;

// Bound of a selection end-point.
class GFX_EXPORT SelectionBound {};

GFX_EXPORT bool operator==(const SelectionBound& lhs,
                           const SelectionBound& rhs);
GFX_EXPORT bool operator!=(const SelectionBound& lhs,
                           const SelectionBound& rhs);

GFX_EXPORT gfx::Rect RectBetweenSelectionBounds(const SelectionBound& b1,
                                                const SelectionBound& b2);

GFX_EXPORT gfx::RectF RectFBetweenSelectionBounds(const SelectionBound& b1,
                                                  const SelectionBound& b2);

GFX_EXPORT gfx::RectF RectFBetweenVisibleSelectionBounds(
    const SelectionBound& b1,
    const SelectionBound& b2);

// This is declared here for use in gtest-based unit tests but is defined in
// the //ui/gfx:test_support target. Depend on that to use this in your unit
// test. This should not be used in production code - call ToString() instead.
void PrintTo(const SelectionBound& bound, ::std::ostream* os);

}  // namespace gfx

#endif  // UI_GFX_SELECTION_BOUND_H_