Adding Peter Thatcher to the owners file.
[chromium-blink-merge.git] / chromeos / dbus / nfc_manager_client.h
blob7e6207007c42d81b36c8f9b0f06cfd54b28a0b52
1 // Copyright 2013 The Chromium 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.
5 #ifndef CHROMEOS_DBUS_NFC_MANAGER_CLIENT_H_
6 #define CHROMEOS_DBUS_NFC_MANAGER_CLIENT_H_
8 #include <vector>
10 #include "chromeos/chromeos_export.h"
11 #include "chromeos/dbus/dbus_client.h"
12 #include "chromeos/dbus/nfc_property_set.h"
13 #include "dbus/object_path.h"
14 #include "dbus/object_proxy.h"
15 #include "dbus/property.h"
17 namespace chromeos {
19 // NfcManagerClient is used to communicate with the neard Manager service.
20 class CHROMEOS_EXPORT NfcManagerClient : public DBusClient {
21 public:
22 // Structure of properties associated with the NFC manager.
23 struct Properties : public NfcPropertySet {
24 // List of Adapter object paths.
25 dbus::Property<std::vector<dbus::ObjectPath> > adapters;
27 Properties(dbus::ObjectProxy* object_proxy,
28 const PropertyChangedCallback& callback);
29 ~Properties() override;
32 // Interface for observing changes to the NFC manager. Use this interface
33 // to be notified when NFC adapters get added or removed.
34 // NOTE: Users of the NFC D-Bus client code shouldn't need to observe changes
35 // from NfcManagerClient::Observer; to get notified of changes to the list of
36 // NFC adapters, use NfcAdapterClient::Observer instead.
37 class Observer {
38 public:
39 virtual ~Observer() {}
41 // Called when a new adapter with object path |object_path| is added to the
42 // system.
43 virtual void AdapterAdded(const dbus::ObjectPath& object_path) {}
45 // Called when an adapter with object path |object_path| is removed from the
46 // system.
47 virtual void AdapterRemoved(const dbus::ObjectPath& object_path) {}
49 // Called when the manager property with name |property_name| has acquired
50 // a new value.
51 virtual void ManagerPropertyChanged(const std::string& property_name) {}
54 ~NfcManagerClient() override;
56 // Adds and removes observers for events on the NFC manager.
57 virtual void AddObserver(Observer* observer) = 0;
58 virtual void RemoveObserver(Observer* observer) = 0;
60 // Obtains the properties of the NFC manager service.
61 virtual Properties* GetProperties() = 0;
63 // Creates the instance.
64 static NfcManagerClient* Create();
66 protected:
67 friend class NfcClientTest;
69 NfcManagerClient();
71 private:
72 DISALLOW_COPY_AND_ASSIGN(NfcManagerClient);
75 } // namespace chromeos
77 #endif // CHROMEOS_DBUS_NFC_MANAGER_CLIENT_H_