AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
APLViewhostInterface.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 ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_ALEXAPRESENTATION_APLVIEWHOSTINTERFACE_H_
17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_ALEXAPRESENTATION_APLVIEWHOSTINTERFACE_H_
18 
19 #include <chrono>
20 #include <memory>
21 #include <rapidjson/document.h>
22 #include <string>
23 
29 
30 namespace alexaClientSDK {
31 namespace sampleApplications {
32 namespace ipcServerSampleApp {
33 
38 public:
42  virtual ~APLViewhostInterface() = default;
43 
48  virtual void addObserver(const APLViewhostObserverInterfacePtr& observer) = 0;
49 
54  virtual void removeObserver(const APLViewhostObserverInterfacePtr& observer) = 0;
55 
65  virtual void renderDocument(
66  const aplCapabilityCommonInterfaces::PresentationSession& presentationSession,
67  const std::string& token,
68  const std::string& document,
69  const std::string& datasources,
70  const std::string& supportedViewports,
71  const std::string& windowId) = 0;
72 
77  virtual void clearDocument() {
78  clearDocument("");
79  }
80 
85  virtual void clearDocument(const std::string& token) {
86  // no-op by default for backwards compatibility
87  }
88 
94  virtual void executeCommands(const std::string& commands, const std::string& token) = 0;
95 
102  virtual void dataSourceUpdate(const std::string& sourceType, const std::string& data, const std::string& token) = 0;
103 
108  virtual void interruptCommandSequence() {
110  }
111 
116  virtual void interruptCommandSequence(const std::string& token) {
117  // no-op by default for backwards compatibility
118  }
119 
126  const std::string& token,
127  const std::chrono::steady_clock::time_point& receiveTime){
128  // no-op by default for compatibility
129  };
130 
135  virtual std::string getMaxAPLVersion() const = 0;
136 
141  virtual void setMetricRecorder(
142  std::shared_ptr<avsCommon::utils::metrics::MetricRecorderInterface> metricRecorder) = 0;
143 
149  virtual bool handleBack(const std::string& windowId) = 0;
150 };
151 
152 using APLViewhostInterfacePtr = std::shared_ptr<APLViewhostInterface>;
153 } // namespace ipcServerSampleApp
154 } // namespace sampleApplications
155 } // namespace alexaClientSDK
156 
157 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_ALEXAPRESENTATION_APLVIEWHOSTINTERFACE_H_
virtual void addObserver(const APLViewhostObserverInterfacePtr &observer)=0
std::shared_ptr< APLViewhostObserverInterface > APLViewhostObserverInterfacePtr
Definition: APLViewhostObserverInterface.h:155
virtual void clearDocument()
Definition: APLViewhostInterface.h:77
::std::string string
Definition: gtest-port.h:1097
virtual void setMetricRecorder(std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder)=0
virtual void onRenderDirectiveReceived(const std::string &token, const std::chrono::steady_clock::time_point &receiveTime)
Definition: APLViewhostInterface.h:125
static std::shared_ptr< avsCommon::utils::metrics::MetricRecorderInterface > metricRecorder
Metric recorder shared ptr.
Definition: BaseAPLCapabilityAgentTest.cpp:261
virtual void removeObserver(const APLViewhostObserverInterfacePtr &observer)=0
virtual void clearDocument(const std::string &token)
Definition: APLViewhostInterface.h:85
std::shared_ptr< APLViewhostInterface > APLViewhostInterfacePtr
Definition: APLViewhostInterface.h:152
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
virtual void interruptCommandSequence()
Definition: APLViewhostInterface.h:108
virtual void renderDocument(const aplCapabilityCommonInterfaces::PresentationSession &presentationSession, const std::string &token, const std::string &document, const std::string &datasources, const std::string &supportedViewports, const std::string &windowId)=0
virtual void dataSourceUpdate(const std::string &sourceType, const std::string &data, const std::string &token)=0
virtual void interruptCommandSequence(const std::string &token)
Definition: APLViewhostInterface.h:116
virtual void executeCommands(const std::string &commands, const std::string &token)=0

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