chromium/ui/gfx/break_list.h

// Copyright 2012 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_BREAK_LIST_H_
#define UI_GFX_BREAK_LIST_H_

#include <stddef.h>

#include <utility>
#include <vector>

#include "base/check_op.h"
#include "ui/gfx/range/range.h"

namespace gfx {

// BreakLists manage ordered, non-overlapping, and non-repeating ranged values.
// These may be used to apply ranged colors and styles to text, for an example.
//
// Each break stores the start position and value of its associated range.
// A solitary break at position 0 applies to the entire space [0, max_).
// |max_| is initially 0 and should be set to match the available ranged space.
// The first break always has position 0, to ensure all positions have a value.
// The value of the terminal break applies to the range [break.first, max_).
// The value of other breaks apply to the range [break.first, (break+1).first).
template <typename T>
class BreakList {};

template <class T>
BreakList<T>::BreakList() :{}

template <class T>
BreakList<T>::BreakList(T value) :{}

template <class T>
bool BreakList<T>::ClearAndSetInitialValue(T value) {}

template <class T>
bool BreakList<T>::ApplyValue(T value, const Range& range) {}

template<class T>
void BreakList<T>::SetMax(size_t max) {}

template <class T>
typename BreakList<T>::const_iterator BreakList<T>::GetBreak(
    size_t position) const {}

template<class T>
Range BreakList<T>::GetRange(
    const typename BreakList<T>::const_iterator& i) const {}

template<class T>
bool BreakList<T>::EqualsValueForTesting(T value) const {}

template<class T>
bool BreakList<T>::EqualsForTesting(const std::vector<Break>& breaks) const {}

#ifndef NDEBUG
template <class T>
void BreakList<T>::CheckBreaks() {}
#endif

}  // namespace gfx

#endif  // UI_GFX_BREAK_LIST_H_