arnaucube
arnaucube/openEventsPlatformAppPublic Self-hosted repository
openEventsPlatformApp/plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.js
plugins/cordova-plugin-camera/www/ios/CameraPopoverHandle.jsRaw
 1/*
 2 *
 3 * Licensed to the Apache Software Foundation (ASF) under one
 4 * or more contributor license agreements.  See the NOTICE file
 5 * distributed with this work for additional information
 6 * regarding copyright ownership.  The ASF licenses this file
 7 * to you under the Apache License, Version 2.0 (the
 8 * "License"); you may not use this file except in compliance
 9 * with the License.  You may obtain a copy of the License at
10 *
11 *   http://www.apache.org/licenses/LICENSE-2.0
12 *
13 * Unless required by applicable law or agreed to in writing,
14 * software distributed under the License is distributed on an
15 * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16 * KIND, either express or implied.  See the License for the
17 * specific language governing permissions and limitations
18 * under the License.
19 *
20*/
21
22var exec = require('cordova/exec');
23
24/**
25 * @namespace navigator
26 */
27
28/**
29 * A handle to an image picker popover.
30 *
31 * __Supported Platforms__
32 *
33 * - iOS
34 *
35 * @example
36 * navigator.camera.getPicture(onSuccess, onFail,
37 * {
38 *     destinationType: Camera.DestinationType.FILE_URI,
39 *     sourceType: Camera.PictureSourceType.PHOTOLIBRARY,
40 *     popoverOptions: new CameraPopoverOptions(300, 300, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY)
41 * });
42 *
43 * // Reposition the popover if the orientation changes.
44 * window.onorientationchange = function() {
45 *     var cameraPopoverHandle = new CameraPopoverHandle();
46 *     var cameraPopoverOptions = new CameraPopoverOptions(0, 0, 100, 100, Camera.PopoverArrowDirection.ARROW_ANY);
47 *     cameraPopoverHandle.setPosition(cameraPopoverOptions);
48 * }
49 * @module CameraPopoverHandle
50 */
51var CameraPopoverHandle = function() {
52    /**
53     * Can be used to reposition the image selection dialog,
54     * for example, when the device orientation changes.
55     * @memberof CameraPopoverHandle
56     * @instance
57     * @method setPosition
58     * @param {module:CameraPopoverOptions} popoverOptions
59     */
60    this.setPosition = function(popoverOptions) {
61        var args = [ popoverOptions ];
62        exec(null, null, "Camera", "repositionPopover", args);
63    };
64};
65
66module.exports = CameraPopoverHandle;