// 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_BASE_MODELS_LIST_SELECTION_MODEL_H_ #define UI_BASE_MODELS_LIST_SELECTION_MODEL_H_ #include <stddef.h> #include <optional> #include "base/component_export.h" #include "base/containers/flat_set.h" namespace ui { // Selection model represented as a list of indexes. In addition to the set of // selected indices ListSelectionModel maintains the following: // // active: The index of the currently visible item in the list. This will be // nullopt if nothing is selected. // // anchor: The index of the last item the user clicked on. Extending the // selection extends it from this index. This will be nullopt if nothing // is selected. // // Typically there is only one selected item, in which case the anchor and // active index correspond to the same thing. class COMPONENT_EXPORT(UI_BASE) ListSelectionModel { … }; } // namespace ui #endif // UI_BASE_MODELS_LIST_SELECTION_MODEL_H_