Home | History | Annotate | Download | only in camera
      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 
     17 package com.android.camera;
     18 
     19 import android.graphics.Rect;
     20 import android.view.View;
     21 
     22 import com.android.camera.ShutterButton.OnShutterButtonListener;
     23 
     24 
     25 public 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 onCountDownFinished();
     57 
     58     public void onPreviewRectChanged(Rect previewRect);
     59 
     60     public void updateCameraOrientation();
     61 
     62     public void enableRecordingLocation(boolean enable);
     63 
     64     /**
     65      * This is the callback when the UI or buffer holder for camera preview,
     66      * such as {@link android.graphics.SurfaceTexture}, is ready to be used.
     67      * The controller can start the camera preview after or in this callback.
     68      */
     69     public void onPreviewUIReady();
     70 
     71 
     72     /**
     73      * This is the callback when the UI or buffer holder for camera preview,
     74      * such as {@link android.graphics.SurfaceTexture}, is being destroyed.
     75      * The controller should try to stop the preview in this callback.
     76      */
     77     public void onPreviewUIDestroyed();
     78 }
     79