blob: fde942a03d20c29e13cc4dd6cfd40947f9303463 [file] [log] [blame]
// Copyright 2017 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.
library fuchsia.modular;
// Debug service provider interface that provides the ability to listen to
// the internal state of the suggestion service.
[Discoverable]
protocol SuggestionDebug {
WatchAskProposals(AskProposalListener listener);
WatchInterruptionProposals(InterruptionProposalListener listener);
WatchNextProposals(NextProposalListener listener);
// Waits until Suggestion Engine has reached a steady state such that no
// further activity will occur unless acted upon from the outside.
WaitUntilIdle() -> ();
// Calls |async::Loop::RunUntilIdle()|, which processes all immediately
// available messages. Unlike |WaitUntilIdle|, this does not wait for
// long-running delayed tasks.
RunUntilIdle() -> ();
};
protocol AskProposalListener {
// Receives the current ask query and ranked proposals
OnAskStart(string query, vector<ProposalSummary> proposals);
// Receives notification of query completion or dismissal.
// |selected_proposal| is null if query was dismissed
OnProposalSelected(ProposalSummary? selected_proposal);
};
protocol InterruptionProposalListener {
// Receives updates to the current proposal list and rankings
OnInterrupt(ProposalSummary interruption_proposal);
};
protocol NextProposalListener {
// Receives updates to the current proposal list and rankings
OnNextUpdate(vector<ProposalSummary> proposals);
};
// This is necessary because a Proposal is not Clone-able, as CustomAction
// can contain an InterfaceHandle.
struct ProposalSummary {
string id;
string publisher_url;
SuggestionDisplay display;
};