// Copyright 2023 The Chromium Authors
// Use of this source code is governed by a BSD-style license that can be
// found in the LICENSE file.

#ifndef IOS_CHROME_BROWSER_SHARED_PUBLIC_COMMANDS_AUTOFILL_COMMANDS_H_
#define IOS_CHROME_BROWSER_SHARED_PUBLIC_COMMANDS_AUTOFILL_COMMANDS_H_

#include "components/autofill/core/browser/payments/legal_message_line.h"

namespace autofill {
struct AutofillAiErrorDialogContext;
struct AutofillErrorDialogContext;
struct FormActivityParams;
struct SaveEntityParams;
class VirtualCardEnrollUiModel;
}  // namespace autofill
namespace web {
class WebState;
}

// Commands related to the Autofill flows (passwords, addresses, payments etc).
@protocol AutofillCommands

// Shows the card unmask authentication flow.
- (void)showCardUnmaskAuthentication;

// Dismisses the card unmask authentication flow.
- (void)dismissCardUnmaskAuthentication;

// Continue the card unmask authentication flow with OTP auth.
- (void)continueCardUnmaskWithOtpAuth;

// Continue the card unmask flow with the CVC authentication input dialog.
- (void)continueCardUnmaskWithCvcAuth;

// Shows the credential suggestion bottom sheet view controller.
- (void)showCredentialBottomSheet:(const autofill::FormActivityParams&)params;

// Shows the payments suggestion bottom sheet view controller.
- (void)showPaymentsBottomSheet:(const autofill::FormActivityParams&)params;

// Shows the scan card save and fill suggestion bottom sheet view controller.
- (void)showScanCardSaveAndFillBottomSheet:
    (const autofill::FormActivityParams&)params;

// Dismisses the sheets shown through `showPaymentsBottomSheet` and
// `showScanCardSaveAndFillBottomSheet`.
- (void)dismissPaymentAndScanCardSheets;

// Commands to manage save card bottomsheet.
- (void)showSaveCardBottomSheetOnOriginWebState:(web::WebState*)originWebState;
- (void)dismissSaveCardBottomSheet;

// Sends a command to show the Wallet Reminder Notice Bottom Sheet.
- (void)showWalletReminderNoticeOnOriginWebState:(web::WebState*)originWebState
                               legalMessageLines:(autofill::LegalMessageLines)
                                                     legalMessageLines;

// Sends a command to show the VCN enrollment Bottom Sheet.
- (void)showVirtualCardEnrollmentBottomSheet:
            (std::unique_ptr<autofill::VirtualCardEnrollUiModel>)model
                              originWebState:(web::WebState*)originWebState;

// Dismisses the VCN enrollment.
- (void)dismissVirtualCardEnrollmentBottomSheet;

// Sends a command to show the bottom sheet to edit an address.
- (void)showEditAddressBottomSheet;

// Sends a command to stop showing the bottom sheet to edit an address provided
// it's shown.
- (void)dismissEditAddressBottomSheet;

// Command to reset the autofill suggestions loading states.
// Deprecated: use BrowserCoordinatorCommands instead.
- (void)legacyResetAutofillSuggestionsLoadingStates;

// Commands to manage the Autofill error dialog.
- (void)showAutofillErrorDialog:
    (autofill::AutofillErrorDialogContext)errorContext;
- (void)dismissAutofillErrorDialog;

// Commands to manage the Autofill AI error dialog.
- (void)showAutofillAiErrorDialog:
    (autofill::AutofillAiErrorDialogContext)errorContext;
- (void)dismissAutofillAiErrorDialog;

// Commands to manage the Autofill progress dialog.
- (void)showAutofillProgressDialog;
- (void)dismissAutofillProgressDialog;

// Commands to manage the Autofill save entity dialog.
- (void)showSaveEntityDialog:(autofill::SaveEntityParams)params;
- (void)dismissSaveEntityDialog;

// Commands to manage the Autofill notice bottom sheet.
- (void)showAmbientAutofillNotice:(const autofill::FormActivityParams&)params;
- (void)dismissAmbientAutofillNotice;

// Commands to manage the Autofill AI Private Inference notice bottom sheet.
- (void)showAutofillAIPrivateInferenceNotice;
- (void)dismissAutofillAIPrivateInferenceNotice;

@end

#endif  // IOS_CHROME_BROWSER_SHARED_PUBLIC_COMMANDS_AUTOFILL_COMMANDS_H_
