2 * Copyright (C) 2013 The Android Open Source Project
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
8 * http://www.apache.org/licenses/LICENSE-2.0
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.
17 package com.android.camera;
19 import android.graphics.Rect;
20 import android.view.View;
22 import com.android.camera.ShutterButton.OnShutterButtonListener;
25 public interface PhotoController extends OnShutterButtonListener {
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;
35 // returns the actual set zoom value
36 public int onZoomChanged(int requestedZoom);
38 public boolean isImageCaptureIntent();
40 public boolean isCameraIdle();
42 public void onCaptureDone();
44 public void onCaptureCancelled();
46 public void onCaptureRetake();
48 public void cancelAutoFocus();
50 public void stopPreview();
52 public int getCameraState();
54 public void onSingleTapUp(View view, int x, int y);
56 public void updatePreviewAspectRatio(float aspectRatio);
58 public void updateCameraOrientation();
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.
65 public void onPreviewUIReady();
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.
73 public void onPreviewUIDestroyed();
75 /********************** Capture animation **********************/
78 * Starts the pre-capture animation.
80 public void startPreCaptureAnimation();