OLD | NEW |
1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. | 1 // Copyright (c) 2012 The Chromium Authors. All rights reserved. |
2 // Use of this source code is governed by a BSD-style license that can be | 2 // Use of this source code is governed by a BSD-style license that can be |
3 // found in the LICENSE file. | 3 // found in the LICENSE file. |
4 | 4 |
5 #ifndef CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ |
6 #define CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ | 6 #define CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 24 matching lines...) Expand all Loading... |
35 typedef base::Callback<void(const std::string&, const dbus::ObjectPath&, | 35 typedef base::Callback<void(const std::string&, const dbus::ObjectPath&, |
36 const std::string&, bool)> IntrospectCallback; | 36 const std::string&, bool)> IntrospectCallback; |
37 | 37 |
38 // Retrieves introspection data from the remote object on service name | 38 // Retrieves introspection data from the remote object on service name |
39 // |service_name| with object path |object_path|, calling |callback| with | 39 // |service_name| with object path |object_path|, calling |callback| with |
40 // the XML-formatted data received. | 40 // the XML-formatted data received. |
41 virtual void Introspect(const std::string& service_name, | 41 virtual void Introspect(const std::string& service_name, |
42 const dbus::ObjectPath& object_path, | 42 const dbus::ObjectPath& object_path, |
43 const IntrospectCallback& callback) = 0; | 43 const IntrospectCallback& callback) = 0; |
44 | 44 |
| 45 // Parses XML-formatted introspection data returned by |
| 46 // org.freedesktop.DBus.Introspectable.Introspect and returns the list of |
| 47 // interface names declared within. |
| 48 static std::vector<std::string> GetInterfacesFromIntrospectResult( |
| 49 const std::string& xml_data); |
| 50 |
45 // Creates the instance | 51 // Creates the instance |
46 static IntrospectableClient* Create(DBusClientImplementationType type, | 52 static IntrospectableClient* Create(DBusClientImplementationType type, |
47 dbus::Bus* bus); | 53 dbus::Bus* bus); |
48 | 54 |
49 protected: | 55 protected: |
50 IntrospectableClient(); | 56 IntrospectableClient(); |
51 | 57 |
52 private: | 58 private: |
53 DISALLOW_COPY_AND_ASSIGN(IntrospectableClient); | 59 DISALLOW_COPY_AND_ASSIGN(IntrospectableClient); |
54 }; | 60 }; |
55 | 61 |
56 } // namespace chromeos | 62 } // namespace chromeos |
57 | 63 |
58 #endif // CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ | 64 #endif // CHROMEOS_DBUS_INTROSPECTABLE_CLIENT_H_ |
OLD | NEW |