Alexa Auto SDK  2.3.1
Alerts.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_ALERTS_H
17 #define AACE_ALEXA_ALERTS_H
18 
19 #include <AACE/Core/PlatformInterface.h>
20 #include "AlexaEngineInterfaces.h"
21 
24 namespace aace {
25 namespace alexa {
26 
36 protected:
37  Alerts() = default;
38 
39 public:
40  virtual ~Alerts();
41 
45  enum class AlertState {
46 
50  READY,
51 
55  STARTED,
56 
60  STOPPED,
61 
65  SNOOZED,
66 
70  COMPLETED,
71 
75  PAST_DUE,
76 
81 
86 
90  ERROR,
91 
95  DELETED,
96 
101  };
102 
110  virtual void alertStateChanged(const std::string& alertToken, AlertState state, const std::string& reason) = 0;
111 
126  virtual void alertCreated(const std::string& alertToken, const std::string& detailedInfo) = 0;
127 
133  virtual void alertDeleted(const std::string& alertToken) = 0;
134 
138  void localStop();
139 
146  void removeAllAlerts();
147 
154  void setEngineInterface(std::shared_ptr<aace::alexa::AlertsEngineInterface> alertsEngineInterface);
155 
156 private:
157  std::weak_ptr<aace::alexa::AlertsEngineInterface> m_alertsEngineInterface;
158 };
159 
160 inline std::ostream& operator<<(std::ostream& stream, const Alerts::AlertState& state) {
161  switch (state) {
163  stream << "READY";
164  break;
166  stream << "STARTED";
167  break;
169  stream << "STOPPED";
170  break;
172  stream << "SNOOZED";
173  break;
175  stream << "COMPLETED";
176  break;
178  stream << "PAST_DUE";
179  break;
181  stream << "FOCUS_ENTERED_FOREGROUND";
182  break;
184  stream << "FOCUS_ENTERED_BACKGROUND";
185  break;
187  stream << "ERROR";
188  break;
190  stream << "DELETED";
191  break;
193  stream << "SCHEDULED_FOR_LATER";
194  break;
195  }
196  return stream;
197 }
198 
199 } // namespace alexa
200 } // namespace aace
201 
202 #endif // AACE_ALEXA_ALERTS_H
virtual void alertDeleted(const std::string &alertToken)=0
Definition: PlatformInterface.h:29
AlertState
Definition: Alerts.h:45
void removeAllAlerts()
Definition: Alerts.cpp:29
Definition: AddressBook.h:26
virtual void alertCreated(const std::string &alertToken, const std::string &detailedInfo)=0
Definition: Alerts.h:35
virtual void alertStateChanged(const std::string &alertToken, AlertState state, const std::string &reason)=0
void localStop()
Definition: Alerts.cpp:23

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