PromptFlow.h (2392B)
1 // Copyright (c) Microsoft Corporation. 2 // Licensed under the MIT License. 3 #pragma once 4 #include "ExecutionContext.h" 5 6 namespace AppInstaller::CLI::Workflow 7 { 8 // Handles all opened source(s) agreements if needed. 9 // Required Args: The source to be checked for agreements 10 // Inputs: None 11 // Outputs: None 12 struct HandleSourceAgreements : public WorkflowTask 13 { 14 HandleSourceAgreements(Repository::Source source) : WorkflowTask("HandleSourceAgreements"), m_source(std::move(source)) {} 15 16 void operator()(Execution::Context& context) const override; 17 18 private: 19 Repository::Source m_source; 20 }; 21 22 // Shows all the prompts required for a single package, e.g. for package agreements 23 // Required Args: None 24 // Inputs: Manifest, Installer 25 // Outputs: None 26 struct ShowPromptsForSinglePackage : public WorkflowTask 27 { 28 ShowPromptsForSinglePackage(bool ensureAgreementsAcceptance) : 29 WorkflowTask("ShowPromptsForSinglePackage"), m_ensureAgreementsAcceptance(ensureAgreementsAcceptance) {} 30 31 void operator()(Execution::Context& context) const override; 32 33 private: 34 bool m_ensureAgreementsAcceptance; 35 }; 36 37 // Shows all the prompts required for multiple package, e.g. for package agreements 38 // Required Args: None 39 // Inputs: PackageSubContexts 40 // Outputs: None 41 struct ShowPromptsForMultiplePackages : public WorkflowTask 42 { 43 ShowPromptsForMultiplePackages(bool ensureAgreementsAcceptance, bool installerDownloadOnly) : 44 WorkflowTask("ShowPromptsForMultiplePackages"), m_ensureAgreementsAcceptance(ensureAgreementsAcceptance), 45 m_installerDownloadOnly(installerDownloadOnly) {} 46 47 void operator()(Execution::Context& context) const override; 48 49 private: 50 bool m_ensureAgreementsAcceptance; 51 bool m_installerDownloadOnly; 52 }; 53 54 // If the context is not interactive, terminate it with the given HRESULT. 55 // Required Args: None 56 // Inputs: None 57 // Outputs: None 58 struct RequireInteractivity : public WorkflowTask 59 { 60 RequireInteractivity(HRESULT nonInteractiveError) : 61 WorkflowTask("RequireInteractivity"), m_nonInteractiveError(nonInteractiveError) {} 62 63 void operator()(Execution::Context& context) const override; 64 65 private: 66 HRESULT m_nonInteractiveError; 67 }; 68 }