Alexa Auto SDK  2.3.0
APL.h
1 /*
2  * Copyright 2019-2020 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 AACE_APL_APL_H
17 #define AACE_APL_APL_H
18 
19 #include <chrono>
20 
21 #include <AACE/Core/PlatformInterface.h>
22 
23 #include "APLEngineInterface.h"
24 
27 namespace aace {
28 namespace apl {
29 
37 protected:
38  APL() = default;
39 
40 public:
41  using ActivityEvent = aace::apl::APLEngineInterface::ActivityEvent;
42 
43  virtual ~APL();
44 
50  virtual std::string getVisualContext() = 0;
51 
63  virtual void renderDocument(
64  const std::string& jsonPayload,
65  const std::string& token,
66  const std::string& windowId) = 0;
67 
72  virtual void clearDocument() = 0;
73 
80  virtual void executeCommands(const std::string& jsonPayload, const std::string& token) = 0;
81 
85  virtual void interruptCommandSequence() = 0;
86 
90  void clearCard();
91 
96 
103  void sendUserEvent(const std::string& payload);
104 
110  void setAPLMaxVersion(const std::string& aplMaxVersion);
111 
118  void setDocumentIdleTimeout(std::chrono::milliseconds documentIdleTimeout);
119 
127  void renderDocumentResult(const std::string& token, const bool result, const std::string& error);
128 
136  void executeCommandsResult(const std::string& token, const bool result, const std::string& error);
137 
144  void processActivityEvent(const std::string& source, const ActivityEvent event);
145 
152  void setEngineInterface(std::shared_ptr<APLEngineInterface> aplEngineInterface);
153 
154 private:
155  std::shared_ptr<APLEngineInterface> m_aplEngineInterface;
156 };
157 
158 } // namespace apl
159 } // namespace aace
160 
161 #endif
Definition: APL.h:36
void processActivityEvent(const std::string &source, const ActivityEvent event)
Definition: APL.cpp:69
virtual void executeCommands(const std::string &jsonPayload, const std::string &token)=0
virtual void renderDocument(const std::string &jsonPayload, const std::string &token, const std::string &windowId)=0
void clearAllExecuteCommands()
Definition: APL.cpp:33
virtual void clearDocument()=0
Definition: PlatformInterface.h:29
virtual std::string getVisualContext()=0
void clearCard()
Definition: APL.cpp:27
void executeCommandsResult(const std::string &token, const bool result, const std::string &error)
Definition: APL.cpp:63
virtual void interruptCommandSequence()=0
Definition: AddressBook.h:26
void sendUserEvent(const std::string &payload)
Definition: APL.cpp:39
void setAPLMaxVersion(const std::string &aplMaxVersion)
Definition: APL.cpp:45
void setDocumentIdleTimeout(std::chrono::milliseconds documentIdleTimeout)
Definition: APL.cpp:51
void renderDocumentResult(const std::string &token, const bool result, const std::string &error)
Definition: APL.cpp:57

Alexa Auto SDK 2.3.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0