Alexa Auto SDK  2.3.0
ContactUploaderEngineInterface.h
1 /*
2  * Copyright 2018-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_CONTACTUPLOADER_CONTACTUPLOADER_ENGINE_INTERFACE_H
17 #define AACE_CONTACTUPLOADER_CONTACTUPLOADER_ENGINE_INTERFACE_H
18 
19 #include <iostream>
20 
21 #include "AACE/Core/PlatformInterface.h"
22 #include "ContactUploaderEngineInterface.h"
23 
26 namespace aace {
27 namespace contactUploader {
28 
29 class ContactUploaderEngineInterface {
30 public:
34  enum class ContactUploaderStatus {
38  UPLOAD_CONTACTS_STARTED,
39 
43  UPLOAD_CONTACTS_UPLOADING,
44 
64  UPLOAD_CONTACTS_COMPLETED,
65 
69  UPLOAD_CONTACTS_CANCELED,
70 
74  UPLOAD_CONTACTS_ERROR,
75 
79  REMOVE_CONTACTS_STARTED,
80 
84  REMOVE_CONTACTS_COMPLETED,
85 
89  REMOVE_CONTACTS_ERROR,
90 
94  UNKNOWN_ERROR
95 
96  };
97 
98  virtual bool onAddContactsBegin() = 0;
99  virtual bool onAddContactsEnd() = 0;
100  virtual bool onAddContactsCancel() = 0;
101  virtual bool onAddContact(const std::string& contact) = 0;
102  virtual bool onRemoveUploadedContacts() = 0;
103 };
104 
105 inline std::ostream& operator<<(
106  std::ostream& stream,
107  const ContactUploaderEngineInterface::ContactUploaderStatus& status) {
108  switch (status) {
109  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_STARTED:
110  stream << "UPLOAD_CONTACTS_STARTED";
111  break;
112  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_UPLOADING:
113  stream << "UPLOAD_CONTACTS_UPLOADING";
114  break;
115  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_COMPLETED:
116  stream << "UPLOAD_CONTACTS_COMPLETED";
117  break;
118  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_CANCELED:
119  stream << "UPLOAD_CONTACTS_CANCELED";
120  break;
121  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_ERROR:
122  stream << "UPLOAD_CONTACTS_ERROR";
123  break;
124  case ContactUploaderEngineInterface::ContactUploaderStatus::REMOVE_CONTACTS_STARTED:
125  stream << "REMOVE_CONTACTS_STARTED";
126  break;
127  case ContactUploaderEngineInterface::ContactUploaderStatus::REMOVE_CONTACTS_COMPLETED:
128  stream << "REMOVE_CONTACTS_COMPLETED";
129  break;
130  case ContactUploaderEngineInterface::ContactUploaderStatus::REMOVE_CONTACTS_ERROR:
131  stream << "REMOVE_CONTACTS_ERROR";
132  break;
133  case ContactUploaderEngineInterface::ContactUploaderStatus::UNKNOWN_ERROR:
134  stream << "UNKNOWN_ERROR";
135  break;
136  }
137  return stream;
138 }
139 
140 } // namespace contactUploader
141 } // namespace aace
142 
143 #endif // AACE_CONTACTUPLOADER_CONTACTUPLOADER_ENGINE_INTERFACE_H
Definition: AddressBook.h:26

Alexa Auto SDK 2.3.0 - Copyright 2017-2020 Amazon.com, Inc. or its affiliates. All Rights Reserved. Licensed under the Apache License, Version 2.0