OLD | NEW |
---|---|
(Empty) | |
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 | |
3 // found in the LICENSE file. | |
4 | |
5 #ifndef CHROME_BROWSER_SYSTEM_MONITOR_IMAGE_CAPTURE_CAMERA_H_ | |
6 #define CHROME_BROWSER_SYSTEM_MONITOR_IMAGE_CAPTURE_CAMERA_H_ | |
7 | |
8 #import <Foundation/Foundation.h> | |
9 #import <ImageCaptureCore/ImageCaptureCore.h> | |
10 | |
11 #include "base/file_path.h" | |
12 #include "base/platform_file.h" | |
13 #include "base/string_util.h" | |
14 #include "base/sys_string_conversions.h" | |
15 | |
16 // Client's use this listener interface to get notifications about | |
17 // events happening as a particular ImageCapture device is interacted with. | |
18 // Clients drive the interaction through the ImageCaptureDeviceBrowserMac | |
19 // and the ImageCaptureCameraInterface classes, and get notifications of | |
20 // events through this interface. | |
21 class ImageCaptureDeviceListener { | |
sail
2012/12/13 02:14:00
this should probably be moved to a separate header
Greg Billock
2012/12/14 00:39:59
Is that just to isolate the ObjC? I thought about
| |
22 public: | |
23 virtual ~ImageCaptureDeviceListener() {} | |
24 | |
25 // Get a notification that a particular item has been found on the device. | |
26 // These calls will come automatically after a new device is initialized. | |
27 virtual void ItemAdded(const std::string& name, | |
28 const base::PlatformFileInfo& info) = 0; | |
29 | |
30 // Called when there are no more items to retrieve. | |
31 virtual void NoMoreItems() = 0; | |
32 | |
33 // Called upon completion of a file download request. The |path| is the | |
34 // requested download file. Note: in NOT_FOUND error case, can be called | |
35 // inline with the download request. | |
36 virtual void DownloadedFile(const std::string& name, | |
37 base::PlatformFileError error) = 0; | |
38 | |
39 // Called to let the client know the device is removed. | |
40 virtual void DeviceRemoved() = 0; | |
41 }; | |
42 | |
43 // Interface to a camera device found by ImageCaptureCore. This class manages a | |
44 // session to the camera and provides the backing interactions to present the | |
45 // media files on it to the filesystem delegate. FilePaths will be artificial, | |
46 // like "/$device_id/" + name. | |
47 @interface ImageCaptureCameraInterface | |
48 : NSObject<ICCameraDeviceDelegate, ICCameraDeviceDownloadDelegate> { | |
49 @private | |
50 ICCameraDevice* camera_; | |
sail
2012/12/13 02:14:00
scoped_nsobject
Greg Billock
2012/12/14 00:39:59
Done.
| |
51 ImageCaptureDeviceListener* listener_; | |
sail
2012/12/13 02:14:00
// weak
Greg Billock
2012/12/14 00:39:59
Done.
| |
52 } | |
53 | |
54 - (id)init:(ICCameraDevice*)camera_device; | |
sail
2012/12/13 02:14:00
maybe initWithCameraDevice:
Greg Billock
2012/12/14 00:39:59
Done.
| |
55 - (void)open; | |
56 - (void)close; | |
57 - (void)setListener:(ImageCaptureDeviceListener*)listener; | |
58 - (void)DidRenameDownloadFile:(const std::string&)name | |
sail
2012/12/13 02:14:00
lowercase D
Greg Billock
2012/12/14 00:39:59
This isn't public; should it even be here?
| |
59 withError:(bool)rename_error; | |
sail
2012/12/13 02:14:00
renameError
Greg Billock
2012/12/14 00:39:59
Done.
| |
60 | |
61 // Download the given |file| to the provided |local_path|. Completion notice | |
62 // will be sent to the listener's DownloadedFile method. | |
63 - (void)DownloadFile:(const std::string&)name | |
sail
2012/12/13 02:14:00
lowercase D
Greg Billock
2012/12/14 00:39:59
Done.
| |
64 localPath:(const FilePath&)local_path; | |
sail
2012/12/13 02:14:00
localPath
Greg Billock
2012/12/14 00:39:59
Done.
| |
65 | |
66 @end | |
67 | |
68 #endif // CHROME_BROWSER_SYSTEM_MONITOR_IMAGE_CAPTURE_CAMERA_H_ | |
OLD | NEW |