1 // Copyright 2015 The Weave Authors. All rights reserved. 2 // Use of this source code is governed by a BSD-style license that can be 3 // found in the LICENSE file. 4 5 #ifndef LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_ 6 #define LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_ 7 8 #include <memory> 9 #include <string> 10 11 #include <base/values.h> 12 13 namespace weave { 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; 20 // Called when a new command is sent via the notification channel. 21 virtual void OnCommandCreated(const base::DictionaryValue& command, 22 const std::string& channel_name) = 0; 23 // Called when DEVICE_DELETED notification is received. 24 virtual void OnDeviceDeleted(const std::string& cloud_id) = 0; 25 26 protected: ~NotificationDelegate()27 virtual ~NotificationDelegate() {} 28 }; 29 30 } // namespace weave 31 32 #endif // LIBWEAVE_SRC_NOTIFICATION_NOTIFICATION_DELEGATE_H_ 33