PhotoController.java revision a1ec04a9f9526418f5cb17a5afbfc48aca1e02d0
1/* 2 * Copyright (C) 2013 The Android Open Source Project 3 * 4 * Licensed under the Apache License, Version 2.0 (the "License"); 5 * you may not use this file except in compliance with the License. 6 * You may obtain a copy of the License at 7 * 8 * http://www.apache.org/licenses/LICENSE-2.0 9 * 10 * Unless required by applicable law or agreed to in writing, software 11 * distributed under the License is distributed on an "AS IS" BASIS, 12 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. 13 * See the License for the specific language governing permissions and 14 * limitations under the License. 15 */ 16 17package com.android.camera; 18 19import android.graphics.Rect; 20import android.view.View; 21 22import com.android.camera.ShutterButton.OnShutterButtonListener; 23 24 25public interface PhotoController extends OnShutterButtonListener { 26 27 public static final int PREVIEW_STOPPED = 0; 28 public static final int IDLE = 1; // preview is active 29 // Focus is in progress. The exact focus state is in Focus.java. 30 public static final int FOCUSING = 2; 31 public static final int SNAPSHOT_IN_PROGRESS = 3; 32 // Switching between cameras. 33 public static final int SWITCHING_CAMERA = 4; 34 35 // returns the actual set zoom value 36 public int onZoomChanged(int requestedZoom); 37 38 public boolean isImageCaptureIntent(); 39 40 public boolean isCameraIdle(); 41 42 public void onCaptureDone(); 43 44 public void onCaptureCancelled(); 45 46 public void onCaptureRetake(); 47 48 public void cancelAutoFocus(); 49 50 public void stopPreview(); 51 52 public int getCameraState(); 53 54 public void onSingleTapUp(View view, int x, int y); 55 56 public void updatePreviewAspectRatio(float aspectRatio); 57 58 public void updateCameraOrientation(); 59 60 /** 61 * This is the callback when the UI or buffer holder for camera preview, 62 * such as {@link android.graphics.SurfaceTexture}, is ready to be used. 63 * The controller can start the camera preview after or in this callback. 64 */ 65 public void onPreviewUIReady(); 66 67 68 /** 69 * This is the callback when the UI or buffer holder for camera preview, 70 * such as {@link android.graphics.SurfaceTexture}, is being destroyed. 71 * The controller should try to stop the preview in this callback. 72 */ 73 public void onPreviewUIDestroyed(); 74 75 /********************** Capture animation **********************/ 76 77 /** 78 * Starts the pre-capture animation. 79 */ 80 public void startPreCaptureAnimation(); 81 82} 83