Vitaly Buka | 4615e0d | 2015-10-14 15:35:12 -0700 | [diff] [blame] | 1 | // Copyright 2015 The Weave Authors. All rights reserved. |
Alex Vakulenko | eedf3be | 2015-05-13 17:52:02 -0700 | [diff] [blame] | 2 | // Use of this source code is governed by a BSD-style license that can be |
| 3 | // found in the LICENSE file. |
| 4 | |
Vitaly Buka | 912b698 | 2015-07-06 11:13:03 -0700 | [diff] [blame] | 5 | #ifndef LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_ |
| 6 | #define LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_ |
Alex Vakulenko | eedf3be | 2015-05-13 17:52:02 -0700 | [diff] [blame] | 7 | |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 8 | #include <memory> |
Alex Vakulenko | eedf3be | 2015-05-13 17:52:02 -0700 | [diff] [blame] | 9 | #include <string> |
| 10 | |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 11 | #include <base/values.h> |
| 12 | |
Vitaly Buka | b6f015a | 2015-07-09 14:59:23 -0700 | [diff] [blame] | 13 | namespace weave { |
Alex Vakulenko | eedf3be | 2015-05-13 17:52:02 -0700 | [diff] [blame] | 14 | |
| 15 | class NotificationDelegate { |
| 16 | public: |
| 17 | virtual void OnConnected(const std::string& channel_name) = 0; |
| 18 | virtual void OnDisconnected() = 0; |
| 19 | virtual void OnPermanentFailure() = 0; |
Alex Vakulenko | 6e3c30e | 2015-05-21 17:39:25 -0700 | [diff] [blame] | 20 | // Called when a new command is sent via the notification channel. |
Alex Vakulenko | e07c29d | 2015-10-22 10:31:12 -0700 | [diff] [blame] | 21 | virtual void OnCommandCreated(const base::DictionaryValue& command, |
| 22 | const std::string& channel_name) = 0; |
Alex Vakulenko | 6b40d8f | 2015-06-24 11:44:22 -0700 | [diff] [blame] | 23 | // Called when DEVICE_DELETED notification is received. |
Johan Euphrosine | 312c2f5 | 2015-09-29 00:04:29 -0700 | [diff] [blame] | 24 | virtual void OnDeviceDeleted(const std::string& cloud_id) = 0; |
Alex Vakulenko | eedf3be | 2015-05-13 17:52:02 -0700 | [diff] [blame] | 25 | |
| 26 | protected: |
| 27 | virtual ~NotificationDelegate() = default; |
| 28 | }; |
| 29 | |
Vitaly Buka | b6f015a | 2015-07-09 14:59:23 -0700 | [diff] [blame] | 30 | } // namespace weave |
Alex Vakulenko | eedf3be | 2015-05-13 17:52:02 -0700 | [diff] [blame] | 31 | |
Vitaly Buka | 912b698 | 2015-07-06 11:13:03 -0700 | [diff] [blame] | 32 | #endif // LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_ |