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_IMAGE_CAPTURE_CONFIG_PRIVATE_H_ 7#define PPAPI_CPP_PRIVATE_IMAGE_CAPTURE_CONFIG_PRIVATE_H_ 8 9#include "ppapi/c/private/ppb_image_capture_config_private.h" 10#include "ppapi/cpp/resource.h" 11#include "ppapi/cpp/size.h" 12 13/// @file 14/// This file defines the ImageCaptureConfig_Private interface for 15/// establishing an image capture configuration resource within the browser. 16namespace pp { 17 18/// The <code>ImageCaptureConfig_Private</code> interface contains methods for 19/// establishing image capture configuration within the browser. The new 20/// configuration will take effect after <code> 21/// ImageCaptureConfig_Private.SetConfig</code> is called. 22class ImageCaptureConfig_Private { 23 public: 24 /// Default constructor for creating an is_null() 25 /// <code>ImageCaptureConfig_Private</code> object. 26 ImageCaptureConfig_Private(); 27 28 /// The copy constructor for <code>ImageCaptureConfig_Private</code>. 29 /// 30 /// @param[in] other A reference to a <code>ImageCaptureConfig_Private 31 /// </code>. 32 ImageCaptureConfig_Private(const ImageCaptureConfig_Private& other); 33 34 /// Constructs a <code>ImageCaptureConfig_Private</code> from a <code> 35 /// Resource</code>. 36 /// 37 /// @param[in] resource A <code>PPB_ImageCaptureConfig_Private</code> 38 /// resource. 39 explicit ImageCaptureConfig_Private(const Resource& resource); 40 41 /// Constructs a <code>ImageCaptureConfig_Private</code> object. 42 /// 43 /// @param[in] instance The instance with which this resource will be 44 /// associated. 45 explicit ImageCaptureConfig_Private(const InstanceHandle& instance); 46 47 /// A constructor used when you have received a <code>PP_Resource</code> as a 48 /// return value that has had 1 ref added for you. 49 /// 50 /// @param[in] resource A <code>PPB_ImageCaptureConfig_Private</code> 51 /// resource. 52 ImageCaptureConfig_Private(PassRef, PP_Resource resource); 53 54 // Destructor. 55 ~ImageCaptureConfig_Private(); 56 57 /// GetPreviewSize() returns the preview image size in pixels for the given 58 /// <code>ImageCaptureConfig_Private</code>. 59 /// 60 /// @param[out] preview_size A <code>Size</code> that indicates the 61 /// requested preview image size. 62 void GetPreviewSize(Size* preview_size); 63 64 /// SetPreviewSize() sets the preview image size for the given <code> 65 /// ImageCaptureConfig_Private</code>. 66 /// 67 /// @param[in] preview_size A <code>Size</code> that indicates the 68 /// requested preview image size. 69 void SetPreviewSize(const Size& preview_size); 70 71 /// GetJpegSize() returns the JPEG image size in pixels for the given 72 /// <code>ImageCaptureConfig_Private</code>. 73 /// 74 /// @param[out] jpeg_size A <code>Size</code> that indicates the current 75 /// JPEG image size. 76 void GetJpegSize(Size* jpeg_size); 77 78 /// SetJpegSize() sets the JPEG image size for the given <code> 79 /// ImageCaptureConfig_Private</code>. 80 /// 81 /// @param[in] jpeg_size A <code>Size</code> that indicates the requested 82 /// JPEG image size. 83 void SetJpegSize(const Size& jpeg_size); 84 85 /// IsImageCaptureConfig() determines if the given resource is a 86 /// <code>ImageCaptureConfig_Private</code>. 87 /// 88 /// @param[in] resource A <code>Resource</code> corresponding to an image 89 /// capture config resource. 90 /// 91 /// @return true if the given resource is an <code> 92 /// ImageCaptureConfig_Private</code> resource, otherwise false. 93 static bool IsImageCaptureConfig(const Resource& resource); 94}; 95 96} // namespace pp 97 98#endif /* PPAPI_CPP_PRIVATE_IMAGE_CAPTURE_CONFIG_PRIVATE_H_ */ 99 100