16 #ifndef ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_ALEXAPRESENTATION_APLDOCUMENTSESSION_H_ 17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_ALEXAPRESENTATION_APLDOCUMENTSESSION_H_ 21 #include <unordered_set> 32 namespace sampleApplications {
33 namespace ipcServerSampleApp {
38 ,
public std::enable_shared_from_this<APLDocumentSession> {
57 std::shared_ptr<alexaClientSDK::aplCapabilityCommonInterfaces::APLDocumentObserverInterface> observer,
59 bool hasPresentationAssociation);
80 void updateTimeout(std::chrono::milliseconds timeout)
override;
89 std::shared_ptr<presentationOrchestratorInterfaces::PresentationInterface> presentation)
override;
100 APLClient::AplCommandExecutionEvent event,
106 const std::chrono::steady_clock::time_point& timestamp)
override;
113 const unsigned int requestToken,
140 const std::shared_ptr<aplCapabilityCommonInterfaces::APLDocumentSessionInterface>& aplDocumentSessionInterface);
153 APLDocumentSessionWrapper(std::shared_ptr<APLDocumentSession> documentSession);
166 void updateTimeout(std::chrono::milliseconds timeout)
override;
175 operator std::shared_ptr<APLDocumentSession>
const();
179 std::shared_ptr<APLDocumentSession> m_documentSession;
187 bool executeRenderDocument(
bool firstRender =
false);
193 void executeClearDocument(
bool forceClear =
false);
199 bool executeIsPresentationActive()
const;
205 bool executeIsPresentationForegrounded()
const;
215 std::weak_ptr<APLViewhostInterface> m_viewhost;
218 bool m_hasPresentationAssociation;
221 std::shared_ptr<presentationOrchestratorInterfaces::PresentationInterface> m_presentation;
239 std::shared_ptr<aplCapabilityCommonInterfaces::APLDocumentObserverInterface> m_observer;
242 std::unordered_set<std::string> m_tokens;
248 bool m_renderComplete;
257 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_ALEXAPRESENTATION_APLDOCUMENTSESSION_H_
void interruptCommandSequence() override
void onCommandExecutionComplete(const std::string &token, APLClient::AplCommandExecutionEvent event, const std::string &message) override
std::string getToken() const override
void onDataSourceFetch(const std::string &token, const std::string &dataSourceType, const std::string &payload) override
void renderDocument(const std::string &document, const std::string &data, const alexaClientSDK::aplCapabilityCommonInterfaces::PresentationSession &presentationSession, const alexaClientSDK::aplCapabilityCommonInterfaces::PresentationOptions &presentationOptions)
Definition: PresentationSession.h:40
void onPresentationStateChanged(presentationOrchestratorInterfaces::PresentationRequestToken id, presentationOrchestratorInterfaces::PresentationState newState) override
void requestForeground() override
void executeCommands(const std::string &commands) override
static std::shared_ptr< APLDocumentSession > getDocumentSessionFromInterface(const std::shared_ptr< aplCapabilityCommonInterfaces::APLDocumentSessionInterface > &aplDocumentSessionInterface)
void updateTimeout(std::chrono::milliseconds timeout) override
APLTimeoutType
Definition: APLTimeoutType.h:30
::std::string string
Definition: gtest-port.h:1097
void updateLifespan(presentationOrchestratorInterfaces::PresentationLifespan lifespan) override
Single-thread executor implementation.
Definition: Executor.h:45
void onDocumentCleared(const std::string &token) override
Definition: PresentationOptions.h:30
void clearDocument() override
Definition: PresentationObserverInterface.h:30
void onRuntimeError(const std::string &token, const std::string &payload) override
void stopTimeout() override
void onSendEvent(const std::string &token, const std::string &arguments, const std::string &components, const std::string &source) override
void onDataSourceUpdateComplete(const std::string &token, bool result, const std::string &error) override
void onVisualContextAvailable(const unsigned int requestToken, const std::string &token, const std::string &version, const std::string &visualContext, const std::string &datasourceContext) override
Definition: APLDocumentSession.h:34
PresentationState
Definition: PresentationTypes.h:48
void onSetDocumentIdleTimeout(const std::string &token, const std::chrono::milliseconds &timeout) override
Definition: APLDocumentSessionInterface.h:37
bool isForegroundFocused() override
void updateTimeoutType(const aplCapabilityCommonInterfaces::APLTimeoutType &timeoutType)
void onDocumentFinished(const std::string &token) override
void onRenderDocumentComplete(const std::string &token, bool result, const std::string &error, const std::chrono::steady_clock::time_point ×tamp) override
void resetTimeout() override
std::shared_ptr< APLViewhostInterface > APLViewhostInterfacePtr
Definition: APLViewhostInterface.h:152
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
void dataSourceUpdate(const std::string &sourceType, const std::string &payload) override
uint64_t PresentationRequestToken
Definition: PresentationTypes.h:25
APLDocumentSession(const std::string &document, const std::string &data, const std::string &supportedViewPorts, const aplCapabilityCommonInterfaces::PresentationSession &presentationSession, const aplCapabilityCommonInterfaces::PresentationOptions &presentationOptions, std::shared_ptr< alexaClientSDK::aplCapabilityCommonInterfaces::APLDocumentObserverInterface > observer, APLViewhostInterfacePtr viewhost, bool hasPresentationAssociation)
PresentationLifespan
Definition: PresentationTypes.h:27
bool onNavigateBack(presentationOrchestratorInterfaces::PresentationRequestToken id) override
void provideDocumentContext(const unsigned int stateRequestToken) override
tuple message
Definition: gtest_output_test.py:331
Definition: APLViewhostObserverInterface.h:30
void onPresentationAvailable(presentationOrchestratorInterfaces::PresentationRequestToken id, std::shared_ptr< presentationOrchestratorInterfaces::PresentationInterface > presentation) override
void onOpenURL(const std::string &token, const std::string &url) override