Alexa Auto SDK  2.0.0
Alerts.h
1 /*
2  * Copyright 2017-2019 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  };
92 
100  virtual void alertStateChanged( const std::string& alertToken, AlertState state, const std::string& reason ) = 0;
101 
116  virtual void alertCreated( const std::string& alertToken, const std::string& detailedInfo ) = 0;
117 
123  virtual void alertDeleted( const std::string& alertToken ) = 0;
124 
128  void localStop();
129 
135  void removeAllAlerts();
136 
143  void setEngineInterface( std::shared_ptr<aace::alexa::AlertsEngineInterface> alertsEngineInterface );
144 
145 private:
146  std::weak_ptr<aace::alexa::AlertsEngineInterface> m_alertsEngineInterface;
147 };
148 
149 inline std::ostream& operator<<(std::ostream& stream, const Alerts::AlertState& state) {
150  switch (state) {
152  stream << "READY";
153  break;
155  stream << "STARTED";
156  break;
158  stream << "STOPPED";
159  break;
161  stream << "SNOOZED";
162  break;
164  stream << "COMPLETED";
165  break;
167  stream << "PAST_DUE";
168  break;
170  stream << "FOCUS_ENTERED_FOREGROUND";
171  break;
173  stream << "FOCUS_ENTERED_BACKGROUND";
174  break;
176  stream << "ERROR";
177  break;
178  }
179  return stream;
180 }
181 
182 } // aace::alexa
183 } // aace
184 
185 #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.0.0 - Copyright 2017-2019 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0