AlexaClientSDK  3.0.0
A cross-platform, modular SDK for interacting with the Alexa Voice Service
PlaybackCommand.h
Go to the documentation of this file.
1 /*
2  *
3  * Copyright Amazon.com, Inc. or its affiliates. All Rights Reserved.
4  *
5  * Licensed under the Apache License, Version 2.0 (the "License").
6  * You may not use this file except in compliance with the License.
7  * A copy of the License is located at
8  *
9  * http://aws.amazon.com/apache2.0/
10  *
11  * or in the "license" file accompanying this file. This file is distributed
12  * on an "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either
13  * express or implied. See the License for the specific language governing
14  * permissions and limitations under the License.
15  */
16 
17 #ifndef ALEXA_CLIENT_SDK_CAPABILITYAGENTS_PLAYBACKCONTROLLER_INCLUDE_PLAYBACKCONTROLLER_PLAYBACKCOMMAND_H_
18 #define ALEXA_CLIENT_SDK_CAPABILITYAGENTS_PLAYBACKCONTROLLER_INCLUDE_PLAYBACKCONTROLLER_PLAYBACKCOMMAND_H_
19 
20 #include <string>
21 #include <ostream>
23 
24 namespace alexaClientSDK {
25 namespace capabilityAgents {
26 namespace playbackController {
27 
32 public:
38  PlaybackCommand(const std::string& name);
39 
43  virtual ~PlaybackCommand() = default;
44 
50  virtual std::string getEventName() const = 0;
51 
57  virtual std::string getEventPayload() const = 0;
58 
66  friend std::ostream& operator<<(std::ostream&, const PlaybackCommand& command);
67 
75 
83 
84 protected:
87 
88 private:
94  virtual std::string toString() const;
95 };
96 
101 public:
107  ButtonCommand_v1_0(const std::string& name);
108 
111  std::string getEventName() const override;
112 
113  std::string getEventPayload() const override;
115 };
116 
121 public:
127  ButtonCommand_v1_1(const std::string& name);
128 
131  std::string getEventName() const override;
132 
133  std::string getEventPayload() const override;
135 };
136 
141 public:
149  ToggleCommand(const std::string& name, bool action);
150 
153  std::string getEventName() const override;
154 
155  std::string getEventPayload() const override;
157 
158 private:
164  std::string getActionString() const;
165 
171  std::string toString() const override;
172 
177  bool m_action;
178 };
179 
180 } // namespace playbackController
181 } // namespace capabilityAgents
182 } // namespace alexaClientSDK
183 
184 #endif // ALEXA_CLIENT_SDK_CAPABILITYAGENTS_PLAYBACKCONTROLLER_INCLUDE_PLAYBACKCONTROLLER_PLAYBACKCOMMAND_H_
::std::string string
Definition: gtest-port.h:1097
PlaybackButton
Enumeration class for supported playback buttons.
Definition: PlaybackButtons.h:26
static const PlaybackCommand & toggleToCommand(avsCommon::avs::PlaybackToggle toggle, bool action)
friend std::ostream & operator<<(std::ostream &, const PlaybackCommand &command)
static const PlaybackCommand & buttonToCommand(avsCommon::avs::PlaybackButton button)
Whether or not curl logs should be emitted.
Definition: AVSConnectionManager.h:36
const std::string m_name
The distinct AVS name of a command.
Definition: PlaybackCommand.h:86
PlaybackToggle
Definition: PlaybackButtons.h:46
action
Definition: upload.py:393

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