AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
UserInputManager.h
Go to the documentation of this file.
1 /*
2  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
3  *
4  * Licensed under the Apache License, Version 2.0 (the "License").
5  * You may not use this file except in compliance with the License.
6  * A copy of the License is located at
7  *
8  * http://aws.amazon.com/apache2.0/
9  *
10  * or in the "license" file accompanying this file. This file is distributed
11  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
12  * express or implied. See the License for the specific language governing
13  * permissions and limitations under the License.
14  */
15 
16 #ifndef SAMPLEAPP_USERINPUTMANAGER_H_
17 #define SAMPLEAPP_USERINPUTMANAGER_H_
18 
19 #include <atomic>
20 #include <memory>
21 
25 
26 #include "ConsoleReader.h"
27 #include "GuiRenderer.h"
29 
30 namespace alexaClientSDK {
31 namespace sampleApp {
32 
38 public:
49  static std::unique_ptr<UserInputManager> create(
50  std::shared_ptr<sampleApplications::common::InteractionManager> interactionManager,
51  std::shared_ptr<GuiRenderer> guiRenderer,
52  std::shared_ptr<ConsoleReader> consoleReader,
53  std::shared_ptr<avsCommon::sdkInterfaces::LocaleAssetsManagerInterface> localeAssetsManager,
55 
62 
65  void onLogout() override;
67 
68 private:
79  std::shared_ptr<sampleApplications::common::InteractionManager> interactionManager,
80  std::shared_ptr<GuiRenderer> guiRenderer,
81  std::shared_ptr<ConsoleReader> consoleReader,
82  std::shared_ptr<avsCommon::sdkInterfaces::LocaleAssetsManagerInterface> localeAssetsManager,
84 
92  bool readConsoleInput(char* input);
93 
94 #ifdef ENABLE_COMMS
95 
100  bool sendDtmf(const std::string& dtmfTones);
101 #endif
102 
106  void controlSpeaker();
107 
108 #ifdef ENABLE_PCC
109 
112  void controlPhone();
113 #endif
114 
115 #ifdef ENABLE_MCC
116 
119  void controlMeeting();
120 #endif
121 
127  bool confirmReset();
128 
132  void settingsMenu();
133 
137  void dynamicEndpointModificationMenu();
138 
142  void endpointControllerMenu();
143 
149  bool confirmReauthorizeDevice();
150 
153  void onAuthStateChange(AuthObserverInterface::State newState, AuthObserverInterface::Error newError) override;
155 
157  void onCapabilitiesStateChange(
160  const std::vector<avsCommon::sdkInterfaces::endpoints::EndpointIdentifier>& addedOrUpdatedEndpoints,
161  const std::vector<avsCommon::sdkInterfaces::endpoints::EndpointIdentifier>& deletedEndpoints) override;
163 
167  void diagnosticsMenu();
168 
172  void devicePropertiesMenu();
173 
177  void deviceProtocolTracerMenu();
178 
182  void audioInjectionMenu();
183 
187  bool deviceSetupCompleted();
188 
190  std::shared_ptr<sampleApplications::common::InteractionManager> m_interactionManager;
191 
193  std::shared_ptr<GuiRenderer> m_guiRenderer;
194 
196  std::shared_ptr<ConsoleReader> m_consoleReader;
197 
199  std::shared_ptr<avsCommon::sdkInterfaces::LocaleAssetsManagerInterface> m_localeAssetsManager;
200 
203 
206  std::atomic_bool m_limitedInteraction;
207 
209  std::atomic_bool m_restart;
210 };
211 
212 } // namespace sampleApp
213 } // namespace alexaClientSDK
214 
215 #endif // SAMPLEAPP_USERINPUTMANAGER_H_
::std::string string
Definition: gtest-port.h:1097
Error
The enum Error encodes possible errors which may occur when changing state.
Definition: CapabilitiesDelegateObserverInterface.h:44
Definition: CapabilitiesDelegateObserverInterface.h:29
SampleAppReturnCode
Definition: SampleApplicationReturnCodes.h:24
State
The enum State describes the state of the CapabilitiesDelegate.
Definition: CapabilitiesDelegateObserverInterface.h:32
Observes user input from the console and notifies the interaction manager of the user&#39;s intentions...
Definition: UserInputManager.h:34
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
static std::unique_ptr< UserInputManager > create(std::shared_ptr< sampleApplications::common::InteractionManager > interactionManager, std::shared_ptr< GuiRenderer > guiRenderer, std::shared_ptr< ConsoleReader > consoleReader, std::shared_ptr< avsCommon::sdkInterfaces::LocaleAssetsManagerInterface > localeAssetsManager, const avsCommon::sdkInterfaces::endpoints::EndpointIdentifier &defaultEndpointId)
std::string EndpointIdentifier
Definition: EndpointIdentifier.h:38
Definition: RegistrationObserverInterface.h:24

AlexaClientSDK 3.0.0 - Copyright 2016-2022 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0