blob: 031b2f564a3f66bb30bfd50cd2aa4432527dc537 [file] [log] [blame]
// Depends on the implementation of the Layout and the Presenter.
// Owned by the Presenter because multiple layouts can use the same
// Presenter.
import 'layout.dart';
/// Renders the layout. Can be used by multiple strategies that use the same
/// PresentationModel.
abstract class Presenter<T> {
/// Called when a surface is removed.
RemoveSurfaceCallback removeSurfaceCallback;
/// Called when the focus changes.
FocusChangeCallback changeFocusCallback;
/// Constructor for a presenter.
Presenter({
this.removeSurfaceCallback,
this.changeFocusCallback,
});
/// Notify the presenter of a layout change.
void onLayoutChange(T layoutModer);
/// Instructs to remove a surface.
void removeSurface(Iterable<String> surfaces) =>
removeSurfaceCallback(surfaces);
/// Instructs to change the focus of a surface.
void changeFocus(String surface, {bool focus = false}) =>
changeFocusCallback(surface, focus);
}