blob: f32d2d9679b58cea6927dcfc75efba8e3d8e18c2 [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
Michael Kolbd6954f32013-03-08 20:43:01 -080019import android.view.View;
Michael Kolb8872c232013-01-29 10:33:22 -080020
Michael Kolbd6954f32013-03-08 20:43:01 -080021import com.android.camera.ShutterButton.OnShutterButtonListener;
Michael Kolb8872c232013-01-29 10:33:22 -080022
Michael Kolb8872c232013-01-29 10:33:22 -080023
Michael Kolbd6954f32013-03-08 20:43:01 -080024public interface PhotoController extends OnShutterButtonListener {
Michael Kolb8872c232013-01-29 10:33:22 -080025
Michael Kolbd6954f32013-03-08 20:43:01 -080026 public static final int PREVIEW_STOPPED = 0;
27 public static final int IDLE = 1; // preview is active
28 // Focus is in progress. The exact focus state is in Focus.java.
29 public static final int FOCUSING = 2;
30 public static final int SNAPSHOT_IN_PROGRESS = 3;
31 // Switching between cameras.
32 public static final int SWITCHING_CAMERA = 4;
Michael Kolb8872c232013-01-29 10:33:22 -080033
Michael Kolbd6954f32013-03-08 20:43:01 -080034 // returns the actual set zoom value
35 public int onZoomChanged(int 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
Michael Kolbd6954f32013-03-08 20:43:01 -080055 public void onCountDownFinished();
Michael Kolb8872c232013-01-29 10:33:22 -080056
Michael Kolbd6954f32013-03-08 20:43:01 -080057 public void onScreenSizeChanged(int width, int height, int previewWidth, int previewHeight);
58
Doris Liu44ab1472013-06-07 18:04:57 -070059 public void updateCameraOrientation();
Doris Liu6a83d522013-07-02 12:03:32 -070060
61 public void enableRecordingLocation(boolean enable);
Angus Kongdcccc512013-08-08 17:06:03 -070062
63 /**
64 * This is the callback when the UI or buffer holder for camera preview,
65 * such as {@link android.graphics.SurfaceTexture}, is ready to be used.
66 * The controller can start the camera preview after or in this callback.
67 */
68 public void onPreviewUIReady();
69
70
71 /**
72 * This is the callback when the UI or buffer holder for camera preview,
73 * such as {@link android.graphics.SurfaceTexture}, is being destroyed.
74 * The controller should try to stop the preview in this callback.
75 */
76 public void onPreviewUIDestroyed();
Michael Kolb8872c232013-01-29 10:33:22 -080077}