Alexa Auto SDK  2.0.0
ContactUploaderEngineInterface.h
1 /*
2  * Copyright 2018-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_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 : public aace::core::PlatformInterface {
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<<(std::ostream& stream, const ContactUploaderEngineInterface::ContactUploaderStatus& status) {
106  switch (status) {
107  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_STARTED:
108  stream << "UPLOAD_CONTACTS_STARTED";
109  break;
110  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_UPLOADING:
111  stream << "UPLOAD_CONTACTS_UPLOADING";
112  break;
113  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_COMPLETED:
114  stream << "UPLOAD_CONTACTS_COMPLETED";
115  break;
116  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_CANCELED:
117  stream << "UPLOAD_CONTACTS_CANCELED";
118  break;
119  case ContactUploaderEngineInterface::ContactUploaderStatus::UPLOAD_CONTACTS_ERROR:
120  stream << "UPLOAD_CONTACTS_ERROR";
121  break;
122  case ContactUploaderEngineInterface::ContactUploaderStatus::REMOVE_CONTACTS_STARTED:
123  stream << "REMOVE_CONTACTS_STARTED";
124  break;
125  case ContactUploaderEngineInterface::ContactUploaderStatus::REMOVE_CONTACTS_COMPLETED:
126  stream << "REMOVE_CONTACTS_COMPLETED";
127  break;
128  case ContactUploaderEngineInterface::ContactUploaderStatus::REMOVE_CONTACTS_ERROR:
129  stream << "REMOVE_CONTACTS_ERROR";
130  break;
131  case ContactUploaderEngineInterface::ContactUploaderStatus::UNKNOWN_ERROR:
132  stream << "UNKNOWN_ERROR";
133  break;
134  }
135  return stream;
136 }
137 
138 } // aace::contactUploader
139 } // aace
140 
141 #endif // AACE_CONTACTUPLOADER_CONTACTUPLOADER_ENGINE_INTERFACE_H
Definition: PlatformInterface.h:29
Definition: AddressBook.h:26

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