blob: d95a0fcb7ad7c86510f06f67663614bcbdb1df0f [file] [log] [blame]
Michael Kolb8872c232013-01-29 10:33:22 -08001/*
Michael Kolbd6954f32013-03-08 20:43:01 -08002 * Copyright (C) 2013 The Android Open Source Project
Michael Kolb8872c232013-01-29 10:33:22 -08003 *
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
Doris Liu36ebcb12013-10-28 14:44:24 -070019import android.graphics.Rect;
Michael Kolbd6954f32013-03-08 20:43:01 -080020import android.view.View;
Michael Kolb8872c232013-01-29 10:33:22 -080021
Michael Kolbd6954f32013-03-08 20:43:01 -080022import com.android.camera.ShutterButton.OnShutterButtonListener;
Michael Kolb8872c232013-01-29 10:33:22 -080023
Michael Kolb8872c232013-01-29 10:33:22 -080024
Michael Kolbd6954f32013-03-08 20:43:01 -080025public interface PhotoController extends OnShutterButtonListener {
Michael Kolb8872c232013-01-29 10:33:22 -080026
Michael Kolbd6954f32013-03-08 20:43:01 -080027 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;
Michael Kolb8872c232013-01-29 10:33:22 -080034
Sol Boucher2192fba2014-08-19 17:24:07 -070035 public void onZoomChanged(float requestedZoom);
Michael Kolb8872c232013-01-29 10:33:22 -080036
Michael Kolbd6954f32013-03-08 20:43:01 -080037 public boolean isImageCaptureIntent();
Michael Kolb8872c232013-01-29 10:33:22 -080038
Michael Kolbd6954f32013-03-08 20:43:01 -080039 public boolean isCameraIdle();
Michael Kolb8872c232013-01-29 10:33:22 -080040
Michael Kolbd6954f32013-03-08 20:43:01 -080041 public void onCaptureDone();
Michael Kolb8872c232013-01-29 10:33:22 -080042
Michael Kolbd6954f32013-03-08 20:43:01 -080043 public void onCaptureCancelled();
Michael Kolb8872c232013-01-29 10:33:22 -080044
Michael Kolbd6954f32013-03-08 20:43:01 -080045 public void onCaptureRetake();
Michael Kolb8872c232013-01-29 10:33:22 -080046
Michael Kolbd6954f32013-03-08 20:43:01 -080047 public void cancelAutoFocus();
Michael Kolb8872c232013-01-29 10:33:22 -080048
Michael Kolbd6954f32013-03-08 20:43:01 -080049 public void stopPreview();
Michael Kolb8872c232013-01-29 10:33:22 -080050
Michael Kolbd6954f32013-03-08 20:43:01 -080051 public int getCameraState();
Michael Kolb8872c232013-01-29 10:33:22 -080052
Michael Kolbd6954f32013-03-08 20:43:01 -080053 public void onSingleTapUp(View view, int x, int y);
Michael Kolb8872c232013-01-29 10:33:22 -080054
Doris Liu70da9182013-12-17 18:41:15 -080055 public void updatePreviewAspectRatio(float aspectRatio);
56
Doris Liu44ab1472013-06-07 18:04:57 -070057 public void updateCameraOrientation();
Doris Liu6a83d522013-07-02 12:03:32 -070058
Angus Kongdcccc512013-08-08 17:06:03 -070059 /**
60 * This is the callback when the UI or buffer holder for camera preview,
61 * such as {@link android.graphics.SurfaceTexture}, is ready to be used.
62 * The controller can start the camera preview after or in this callback.
63 */
64 public void onPreviewUIReady();
65
66
67 /**
68 * This is the callback when the UI or buffer holder for camera preview,
69 * such as {@link android.graphics.SurfaceTexture}, is being destroyed.
70 * The controller should try to stop the preview in this callback.
71 */
72 public void onPreviewUIDestroyed();
Doris Liu1dfe7822013-12-12 00:02:08 -080073
74 /********************** Capture animation **********************/
75
76 /**
77 * Starts the pre-capture animation.
78 */
79 public void startPreCaptureAnimation();
Doris Liu70da9182013-12-17 18:41:15 -080080
Michael Kolb8872c232013-01-29 10:33:22 -080081}