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_IMAGE_BURNER_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_IMAGE_BURNER_CLIENT_H_ |
6 #define CHROMEOS_DBUS_IMAGE_BURNER_CLIENT_H_ | 6 #define CHROMEOS_DBUS_IMAGE_BURNER_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 | 10 |
(...skipping 24 matching lines...) Expand all Loading... |
35 const std::string& error)> BurnFinishedHandler; | 35 const std::string& error)> BurnFinishedHandler; |
36 | 36 |
37 // A callback to handle burn_progress_update signal. | 37 // A callback to handle burn_progress_update signal. |
38 typedef base::Callback<void(const std::string& target_path, | 38 typedef base::Callback<void(const std::string& target_path, |
39 int64 num_bytes_burnt, | 39 int64 num_bytes_burnt, |
40 int64 total_size)> BurnProgressUpdateHandler; | 40 int64 total_size)> BurnProgressUpdateHandler; |
41 | 41 |
42 // Burns the image |from_path| to the disk |to_path|. | 42 // Burns the image |from_path| to the disk |to_path|. |
43 virtual void BurnImage(const std::string& from_path, | 43 virtual void BurnImage(const std::string& from_path, |
44 const std::string& to_path, | 44 const std::string& to_path, |
45 ErrorCallback error_callback) = 0; | 45 const ErrorCallback& error_callback) = 0; |
46 | 46 |
47 // Sets callbacks as event handlers. | 47 // Sets callbacks as event handlers. |
48 // |burn_finished_handler| is called when burn_finished signal is received. | 48 // |burn_finished_handler| is called when burn_finished signal is received. |
49 // |burn_progress_update_handler| is called when burn_progress_update signal | 49 // |burn_progress_update_handler| is called when burn_progress_update signal |
50 // is received. | 50 // is received. |
51 virtual void SetEventHandlers( | 51 virtual void SetEventHandlers( |
52 BurnFinishedHandler burn_finished_handler, | 52 const BurnFinishedHandler& burn_finished_handler, |
53 BurnProgressUpdateHandler burn_progress_update_handler) = 0; | 53 const BurnProgressUpdateHandler& burn_progress_update_handler) = 0; |
54 | 54 |
55 // Resets event handlers. After calling this method, nothing is done when | 55 // Resets event handlers. After calling this method, nothing is done when |
56 // signals are received. | 56 // signals are received. |
57 virtual void ResetEventHandlers() = 0; | 57 virtual void ResetEventHandlers() = 0; |
58 | 58 |
59 // Factory function, creates a new instance and returns ownership. | 59 // Factory function, creates a new instance and returns ownership. |
60 // For normal usage, access the singleton via DBusThreadManager::Get(). | 60 // For normal usage, access the singleton via DBusThreadManager::Get(). |
61 static ImageBurnerClient* Create(DBusClientImplementationType type, | 61 static ImageBurnerClient* Create(DBusClientImplementationType type, |
62 dbus::Bus* bus); | 62 dbus::Bus* bus); |
63 | 63 |
64 protected: | 64 protected: |
65 // Create() should be used instead. | 65 // Create() should be used instead. |
66 ImageBurnerClient(); | 66 ImageBurnerClient(); |
67 | 67 |
68 private: | 68 private: |
69 DISALLOW_COPY_AND_ASSIGN(ImageBurnerClient); | 69 DISALLOW_COPY_AND_ASSIGN(ImageBurnerClient); |
70 }; | 70 }; |
71 | 71 |
72 } // namespace chromeos | 72 } // namespace chromeos |
73 | 73 |
74 #endif // CHROMEOS_DBUS_IMAGE_BURNER_CLIENT_H_ | 74 #endif // CHROMEOS_DBUS_IMAGE_BURNER_CLIENT_H_ |
OLD | NEW |