blob: 719d76d7f9d98ae4da008bbcd5503dff50fc4c00 [file] [log] [blame]
Vitaly Buka4615e0d2015-10-14 15:35:12 -07001// Copyright 2015 The Weave Authors. All rights reserved.
Alex Vakulenkoeedf3be2015-05-13 17:52:02 -07002// Use of this source code is governed by a BSD-style license that can be
3// found in the LICENSE file.
4
Vitaly Buka912b6982015-07-06 11:13:03 -07005#ifndef LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_
6#define LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_
Alex Vakulenkoeedf3be2015-05-13 17:52:02 -07007
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -07008#include <memory>
Alex Vakulenkoeedf3be2015-05-13 17:52:02 -07009#include <string>
10
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -070011#include <base/values.h>
12
Vitaly Bukab6f015a2015-07-09 14:59:23 -070013namespace weave {
Alex Vakulenkoeedf3be2015-05-13 17:52:02 -070014
15class NotificationDelegate {
16 public:
17 virtual void OnConnected(const std::string& channel_name) = 0;
18 virtual void OnDisconnected() = 0;
19 virtual void OnPermanentFailure() = 0;
Alex Vakulenko6e3c30e2015-05-21 17:39:25 -070020 // Called when a new command is sent via the notification channel.
Alex Vakulenkoe07c29d2015-10-22 10:31:12 -070021 virtual void OnCommandCreated(const base::DictionaryValue& command,
22 const std::string& channel_name) = 0;
Alex Vakulenko6b40d8f2015-06-24 11:44:22 -070023 // Called when DEVICE_DELETED notification is received.
Johan Euphrosine312c2f52015-09-29 00:04:29 -070024 virtual void OnDeviceDeleted(const std::string& cloud_id) = 0;
Alex Vakulenkoeedf3be2015-05-13 17:52:02 -070025
26 protected:
27 virtual ~NotificationDelegate() = default;
28};
29
Vitaly Bukab6f015a2015-07-09 14:59:23 -070030} // namespace weave
Alex Vakulenkoeedf3be2015-05-13 17:52:02 -070031
Vitaly Buka912b6982015-07-06 11:13:03 -070032#endif // LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_