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_CROS_DISKS_CLIENT_H_ | 5 #ifndef CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
6 #define CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 6 #define CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
7 #pragma once | 7 #pragma once |
8 | 8 |
9 #include <string> | 9 #include <string> |
10 #include <vector> | 10 #include <vector> |
(...skipping 162 matching lines...) Expand 10 before | Expand all | Expand 10 after Loading... |
173 // The second argument is the device path. | 173 // The second argument is the device path. |
174 typedef base::Callback<void(MountEventType, const std::string&) | 174 typedef base::Callback<void(MountEventType, const std::string&) |
175 > MountEventHandler; | 175 > MountEventHandler; |
176 | 176 |
177 virtual ~CrosDisksClient(); | 177 virtual ~CrosDisksClient(); |
178 | 178 |
179 // Calls Mount method. |callback| is called after the method call succeeds, | 179 // Calls Mount method. |callback| is called after the method call succeeds, |
180 // otherwise, |error_callback| is called. | 180 // otherwise, |error_callback| is called. |
181 virtual void Mount(const std::string& source_path, | 181 virtual void Mount(const std::string& source_path, |
182 MountType type, | 182 MountType type, |
183 MountCallback callback, | 183 const MountCallback& callback, |
184 ErrorCallback error_callback) = 0; | 184 const ErrorCallback& error_callback) = 0; |
185 | 185 |
186 // Calls Unmount method. |callback| is called after the method call succeeds, | 186 // Calls Unmount method. |callback| is called after the method call succeeds, |
187 // otherwise, |error_callback| is called. | 187 // otherwise, |error_callback| is called. |
188 virtual void Unmount(const std::string& device_path, | 188 virtual void Unmount(const std::string& device_path, |
189 UnmountCallback callback, | 189 const UnmountCallback& callback, |
190 ErrorCallback error_callback) = 0; | 190 const ErrorCallback& error_callback) = 0; |
191 | 191 |
192 // Calls EnumerateAutoMountableDevices method. |callback| is called after the | 192 // Calls EnumerateAutoMountableDevices method. |callback| is called after the |
193 // method call succeeds, otherwise, |error_callback| is called. | 193 // method call succeeds, otherwise, |error_callback| is called. |
194 virtual void EnumerateAutoMountableDevices( | 194 virtual void EnumerateAutoMountableDevices( |
195 EnumerateAutoMountableDevicesCallback callback, | 195 const EnumerateAutoMountableDevicesCallback& callback, |
196 ErrorCallback error_callback) = 0; | 196 const ErrorCallback& error_callback) = 0; |
197 | 197 |
198 // Calls FormatDevice method. |callback| is called after the method call | 198 // Calls FormatDevice method. |callback| is called after the method call |
199 // succeeds, otherwise, |error_callback| is called. | 199 // succeeds, otherwise, |error_callback| is called. |
200 virtual void FormatDevice(const std::string& device_path, | 200 virtual void FormatDevice(const std::string& device_path, |
201 const std::string& filesystem, | 201 const std::string& filesystem, |
202 FormatDeviceCallback callback, | 202 const FormatDeviceCallback& callback, |
203 ErrorCallback error_callback) = 0; | 203 const ErrorCallback& error_callback) = 0; |
204 | 204 |
205 // Calls GetDeviceProperties method. |callback| is called after the method | 205 // Calls GetDeviceProperties method. |callback| is called after the method |
206 // call succeeds, otherwise, |error_callback| is called. | 206 // call succeeds, otherwise, |error_callback| is called. |
207 virtual void GetDeviceProperties(const std::string& device_path, | 207 virtual void GetDeviceProperties(const std::string& device_path, |
208 GetDevicePropertiesCallback callback, | 208 const GetDevicePropertiesCallback& callback, |
209 ErrorCallback error_callback) = 0; | 209 const ErrorCallback& error_callback) = 0; |
210 | 210 |
211 // Registers given callback for events. | 211 // Registers given callback for events. |
212 // |mount_event_handler| is called when mount event signal is received. | 212 // |mount_event_handler| is called when mount event signal is received. |
213 // |mount_completed_handler| is called when MountCompleted signal is received. | 213 // |mount_completed_handler| is called when MountCompleted signal is received. |
214 virtual void SetUpConnections( | 214 virtual void SetUpConnections( |
215 MountEventHandler mount_event_handler, | 215 const MountEventHandler& mount_event_handler, |
216 MountCompletedHandler mount_completed_handler) = 0; | 216 const MountCompletedHandler& mount_completed_handler) = 0; |
217 | 217 |
218 // Factory function, creates a new instance and returns ownership. | 218 // Factory function, creates a new instance and returns ownership. |
219 // For normal usage, access the singleton via DBusThreadManager::Get(). | 219 // For normal usage, access the singleton via DBusThreadManager::Get(). |
220 static CrosDisksClient* Create(DBusClientImplementationType type, | 220 static CrosDisksClient* Create(DBusClientImplementationType type, |
221 dbus::Bus* bus); | 221 dbus::Bus* bus); |
222 | 222 |
223 protected: | 223 protected: |
224 // Create() should be used instead. | 224 // Create() should be used instead. |
225 CrosDisksClient(); | 225 CrosDisksClient(); |
226 | 226 |
227 private: | 227 private: |
228 DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); | 228 DISALLOW_COPY_AND_ASSIGN(CrosDisksClient); |
229 }; | 229 }; |
230 | 230 |
231 } // namespace chromeos | 231 } // namespace chromeos |
232 | 232 |
233 #endif // CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ | 233 #endif // CHROMEOS_DBUS_CROS_DISKS_CLIENT_H_ |
OLD | NEW |