AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
SmartScreenCaptionPresenter.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_SMARTSCREENCAPTIONPRESENTER_H_
17 #define ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_SMARTSCREENCAPTIONPRESENTER_H_
18 
21 
22 namespace alexaClientSDK {
23 namespace sampleApplications {
24 namespace ipcServerSampleApp {
25 
27 public:
28  explicit SmartScreenCaptionPresenter(std::shared_ptr<RenderCaptionsInterface> renderCaptionsInterface);
29 
32  void onCaptionActivity(const captions::CaptionFrame& captionFrame, avsCommon::avs::FocusState focusState) override;
33  std::pair<bool, int> getWrapIndex(const captions::CaptionLine& captionLine) override;
35 
36 private:
38  std::shared_ptr<RenderCaptionsInterface> m_renderCaptionsInterface;
39 
40  rapidjson::Document convertCaptionFrameToJson(const captions::CaptionFrame& captionFrame);
41  rapidjson::Value convertCaptionLineToJson(
42  const captions::CaptionLine& captionLine,
43  rapidjson::Document::AllocatorType& allocator);
44  rapidjson::Value convertTextStyleToJson(
45  captions::TextStyle textStyle,
46  rapidjson::Document::AllocatorType& allocator);
47  rapidjson::Value convertStyleToJson(captions::Style style, rapidjson::Document::AllocatorType& allocator);
48 
49  rapidjson::Value convertCaptionLinesToJson(
50  const std::vector<captions::CaptionLine>& captionLines,
51  rapidjson::Document::AllocatorType& allocator);
52 };
53 
54 } // namespace ipcServerSampleApp
55 } // namespace sampleApplications
56 } // namespace alexaClientSDK
57 
58 #endif // ALEXA_CLIENT_SDK_LIBIPCSERVERSAMPLEAPP_INCLUDE_IPCSERVERSAMPLEAPP_SMARTSCREENCAPTIONPRESENTER_H_
Definition: TextStyle.h:76
Definition: TextStyle.h:28
SmartScreenCaptionPresenter(std::shared_ptr< RenderCaptionsInterface > renderCaptionsInterface)
Definition: CaptionFrame.h:33
FocusState
Definition: FocusState.h:29
void onCaptionActivity(const captions::CaptionFrame &captionFrame, avsCommon::avs::FocusState focusState) override
bool Value(const T &value, M matcher)
Definition: gmock-matchers.h:4347
Definition: CaptionLine.h:30
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
Definition: CaptionPresenterInterface.h:33
std::pair< bool, int > getWrapIndex(const captions::CaptionLine &captionLine) override

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