1/* Copyright 2014 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
6#ifndef PPAPI_CPP_PRIVATE_CAMERA_CAPABILITIES_PRIVATE_H_
7#define PPAPI_CPP_PRIVATE_CAMERA_CAPABILITIES_PRIVATE_H_
8
9#include "ppapi/c/private/ppb_camera_capabilities_private.h"
10#include "ppapi/cpp/resource.h"
11#include "ppapi/cpp/size.h"
12
13/// @file
14/// This file defines the CameraCapabilities_Private interface for
15/// establishing an image capture configuration resource within the browser.
16namespace pp {
17
18/// The <code>CameraCapabilities_Private</code> interface contains methods for
19/// getting the image capture capabilities within the browser.
20class CameraCapabilities_Private : public Resource {
21 public:
22  /// Default constructor for creating an is_null()
23  /// <code>CameraCapabilities_Private</code> object.
24  CameraCapabilities_Private();
25
26  /// The copy constructor for <code>CameraCapabilities_Private</code>.
27  ///
28  /// @param[in] other A reference to a <code>CameraCapabilities_Private
29  /// </code>.
30  CameraCapabilities_Private(const CameraCapabilities_Private& other);
31
32  /// Constructs a <code>CameraCapabilities_Private</code> from a <code>
33  /// Resource</code>.
34  ///
35  /// @param[in] resource A <code>PPB_CameraCapabilities_Private</code>
36  /// resource.
37  explicit CameraCapabilities_Private(const Resource& resource);
38
39  /// Constructs a <code>CameraCapabilities_Private</code> object.
40  ///
41  /// @param[in] instance The instance with which this resource will be
42  /// associated.
43  explicit CameraCapabilities_Private(const InstanceHandle& instance);
44
45  /// A constructor used when you have received a <code>PP_Resource</code> as a
46  /// return value that has had 1 ref added for you.
47  ///
48  /// @param[in] resource A <code>PPB_CameraCapabilities_Private</code>
49  /// resource.
50  CameraCapabilities_Private(PassRef, PP_Resource resource);
51
52  // Destructor.
53  ~CameraCapabilities_Private();
54
55  /// GetSupportedPreviewSizes() returns the supported preview sizes for the
56  /// given <code>CameraCapabilities_Private</code>.
57  ///
58  /// @param[out] A vector of <code>Size</code> corresponding to the
59  /// supported preview sizes in pixels.
60  void GetSupportedPreviewSizes(std::vector<Size>* preview_sizes);
61
62  /// GetSupportedJpegSize() returns the supported JPEG sizes for the given
63  /// <code>CameraCapabilities_Private</code>.
64  ///
65  /// @param[out] A vector of <code>Size</code> corresponding to the
66  /// supported JPEG image sizes in pixels.
67  void GetSupportedJpegSizes(std::vector<Size>* jpeg_sizes);
68
69  /// IsCameraCapabilities() determines if the given resource is a
70  /// <code>CameraCapabilities_Private</code>.
71  ///
72  /// @param[in] resource A <code>Resource</code> corresponding to an image
73  /// capture capabilities resource.
74  ///
75  /// @return true if the given resource is an <code>
76  /// CameraCapabilities_Private</code> resource, otherwise false.
77  static bool IsCameraCapabilities(const Resource& resource);
78};
79
80}  // namespace pp
81
82#endif  /* PPAPI_CPP_PRIVATE_CAMERA_CAPABILITIES_PRIVATE_H_ */
83
84