blob: bdd9ac2d5ec2aee63515abdb7c464b738db3fc5a [file] [log] [blame]
// Copyright 2020 The Fuchsia Authors. All rights reserved.
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.
#ifndef SRC_UI_A11Y_LIB_SCREEN_READER_CHANGE_RANGE_VALUE_ACTION_H_
#define SRC_UI_A11Y_LIB_SCREEN_READER_CHANGE_RANGE_VALUE_ACTION_H_
#include <fuchsia/accessibility/semantics/cpp/fidl.h>
#include <lib/fpromise/scope.h>
#include "src/ui/a11y/lib/screen_reader/screen_reader_action.h"
namespace a11y {
// ChangeRangeValueAction class implements increment and decrement action for range control.
class ChangeRangeValueAction : public ScreenReaderAction {
public:
// Actions supported by this class.
enum ChangeRangeValueActionType { kIncrementAction, kDecrementAction };
explicit ChangeRangeValueAction(ActionContext* action_context,
ScreenReaderContext* screen_reader_context,
ChangeRangeValueActionType action);
virtual ~ChangeRangeValueAction();
// This method implements the sequence of events that should happen when range control is
// incremented or decremented.
void Run(a11y::gesture_util_v2::GestureContext gesture_context) override;
private:
// Stores if the range value will be incremented or decremented.
ChangeRangeValueActionType range_value_action_;
fpromise::scope scope_;
};
} // namespace a11y
#endif // SRC_UI_A11Y_LIB_SCREEN_READER_CHANGE_RANGE_VALUE_ACTION_H_