Paul Stewart | b9b3f9d | 2014-09-10 15:12:39 -0700 | [diff] [blame] | 1 | // Copyright 2014 The Chromium OS 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 CHROMEOS_DBUS_BINDINGS_ADAPTOR_GENERATOR_H_ |
| 6 | #define CHROMEOS_DBUS_BINDINGS_ADAPTOR_GENERATOR_H_ |
| 7 | |
| 8 | #include <string> |
| 9 | #include <vector> |
| 10 | |
| 11 | #include <base/macros.h> |
| 12 | |
Paul Stewart | 1dce1ae | 2014-10-01 05:30:18 -0700 | [diff] [blame] | 13 | #include "chromeos-dbus-bindings/header_generator.h" |
Paul Stewart | b9b3f9d | 2014-09-10 15:12:39 -0700 | [diff] [blame] | 14 | #include "chromeos-dbus-bindings/indented_text.h" |
| 15 | |
| 16 | namespace base { |
| 17 | |
| 18 | class FilePath; |
| 19 | |
| 20 | } // namespace base |
| 21 | |
| 22 | namespace chromeos_dbus_bindings { |
| 23 | |
| 24 | class IndentedText; |
| 25 | struct Interface; |
| 26 | |
Paul Stewart | 1dce1ae | 2014-10-01 05:30:18 -0700 | [diff] [blame] | 27 | class AdaptorGenerator : public HeaderGenerator { |
Paul Stewart | b9b3f9d | 2014-09-10 15:12:39 -0700 | [diff] [blame] | 28 | public: |
Paul Stewart | 1dce1ae | 2014-10-01 05:30:18 -0700 | [diff] [blame] | 29 | static bool GenerateAdaptor(const Interface& interface, |
| 30 | const base::FilePath& output_file); |
Paul Stewart | b9b3f9d | 2014-09-10 15:12:39 -0700 | [diff] [blame] | 31 | |
| 32 | private: |
| 33 | friend class AdaptorGeneratorTest; |
| 34 | |
Paul Stewart | b9b3f9d | 2014-09-10 15:12:39 -0700 | [diff] [blame] | 35 | // Generates the constructor for the adaptor. |
| 36 | static void AddConstructor(const Interface& interface, |
| 37 | const std::string& class_name, |
Paul Stewart | b9b3f9d | 2014-09-10 15:12:39 -0700 | [diff] [blame] | 38 | IndentedText *text); |
| 39 | |
| 40 | // Generates the method interface class. |
| 41 | static void AddMethodInterface(const Interface& interface, |
Paul Stewart | b9b3f9d | 2014-09-10 15:12:39 -0700 | [diff] [blame] | 42 | IndentedText *text); |
| 43 | |
Paul Stewart | b9b3f9d | 2014-09-10 15:12:39 -0700 | [diff] [blame] | 44 | DISALLOW_COPY_AND_ASSIGN(AdaptorGenerator); |
| 45 | }; |
| 46 | |
| 47 | } // namespace chromeos_dbus_bindings |
| 48 | |
| 49 | #endif // CHROMEOS_DBUS_BINDINGS_ADAPTOR_GENERATOR_H_ |