Alexa Auto SDK  2.3.1
TemplateRuntime.h
1 /*
2  * Copyright 2017-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_ALEXA_TEMPLATE_RUNTIME_H
17 #define AACE_ALEXA_TEMPLATE_RUNTIME_H
18 
19 #include <chrono>
20 #include <string>
21 
22 #include <AACE/Core/PlatformInterface.h>
23 #include "AlexaEngineInterfaces.h"
24 #include "FocusState.h"
25 #include "PlayerActivity.h"
26 
29 namespace aace {
30 namespace alexa {
31 
42 protected:
43  TemplateRuntime() = default;
44 
45 public:
51 
52  virtual ~TemplateRuntime();
53 
66  virtual void renderTemplate(const std::string& payload);
67 
78  virtual void renderTemplate(const std::string& payload, FocusState focusState);
79 
83  virtual void clearTemplate() = 0;
84 
99  virtual void renderPlayerInfo(const std::string& payload);
100 
117  virtual void renderPlayerInfo(
118  const std::string& payload,
119  PlayerActivity audioPlayerState,
120  std::chrono::milliseconds offset,
121  FocusState focusState);
122 
126  virtual void clearPlayerInfo() = 0;
127 
132  void displayCardCleared();
133 
140  void setEngineInterface(
141  std::shared_ptr<aace::alexa::TemplateRuntimeEngineInterface> templateRuntimeEngineInterface);
142 
143 private:
144  std::weak_ptr<aace::alexa::TemplateRuntimeEngineInterface> m_templateRuntimeEngineInterface;
145 };
146 
147 } // namespace alexa
148 } // namespace aace
149 
150 #endif // AACE_ALEXA_TEMPLATE_RUNTIME_H
Definition: TemplateRuntime.h:41
PlayerActivity
Definition: PlayerActivity.h:36
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26
FocusState
Definition: FocusState.h:36
void displayCardCleared()
Definition: TemplateRuntime.cpp:45
virtual void clearPlayerInfo()=0
virtual void clearTemplate()=0
virtual void renderTemplate(const std::string &payload)
Definition: TemplateRuntime.cpp:23
virtual void renderPlayerInfo(const std::string &payload)
Definition: TemplateRuntime.cpp:32

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