1 /*
2  * Copyright (C) 2015 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.captureintent.resource;
18 
19 import android.content.Context;
20 import android.content.Intent;
21 import android.os.Handler;
22 
23 import com.android.camera.FatalErrorHandler;
24 import com.android.camera.SoundPlayer;
25 import com.android.camera.app.AppController;
26 import com.android.camera.app.LocationManager;
27 import com.android.camera.app.OrientationManager;
28 import com.android.camera.async.MainThread;
29 import com.android.camera.async.SafeCloseable;
30 import com.android.camera.burst.BurstFacade;
31 import com.android.camera.captureintent.CaptureIntentModuleUI;
32 import com.android.camera.one.OneCameraManager;
33 import com.android.camera.one.OneCameraOpener;
34 import com.android.camera.settings.CameraFacingSetting;
35 import com.android.camera.settings.ResolutionSetting;
36 import com.android.camera.settings.SettingsManager;
37 
38 /**
39  * Defines an interface that any implementation of this should retain basic
40  * resources to construct a state machine of
41  * {@link com.android.camera.captureintent.CaptureIntentModule}.
42  */
43 public interface ResourceConstructed extends SafeCloseable {
44     /**
45      * Obtains the intent that starts this activity.
46      *
47      * @return An {@link android.content.Intent} object.
48      */
getIntent()49     public Intent getIntent();
50 
51     /**
52      * Obtains the UI object associated with the intent module.
53      *
54      * @return A {@link com.android.camera.captureintent.CaptureIntentModuleUI}
55      *         object.
56      */
getModuleUI()57     public CaptureIntentModuleUI getModuleUI();
58 
59     /**
60      * Obtains the scope namespace used in
61      * {@link com.android.camera.settings.SettingsManager}.
62      *
63      * @return The scope namespace of the intent module.
64      */
getSettingScopeNamespace()65     public String getSettingScopeNamespace();
66 
67     /**
68      * Obtains the main thread.
69      *
70      * @return A {@link com.android.camera.async.MainThread} object.
71      */
getMainThread()72     public MainThread getMainThread();
73 
74     /**
75      * Obtains the Android application context.
76      *
77      * @return A {@link android.content.Context} object.
78      */
getContext()79     public Context getContext();
80 
81     /**
82      * Obtains the hardware manager that provides the ability to query for
83      * hardware specific characteristics.
84      *
85      * @return  An {@link com.android.camera.one.OneCameraManager} object.
86      */
getOneCameraManager()87     public OneCameraManager getOneCameraManager();
88 
89     /**
90      * Obtains the camera manager that controls camera devices.
91      *
92      * @return An {@link com.android.camera.one.OneCameraOpener} object.
93      */
getOneCameraOpener()94     public OneCameraOpener getOneCameraOpener();
95 
96     /**
97      * Obtains the location manager that is able to report device current
98      * location.
99      *
100      * @return A {@link com.android.camera.app.LocationManager} object.
101      */
getLocationManager()102     public LocationManager getLocationManager();
103 
104     /**
105      * Obtains the orientation manager that is able to report device current
106      * orientation.
107      *
108      * @return An {@link com.android.camera.app.OrientationManager} object.
109      */
getOrientationManager()110     public OrientationManager getOrientationManager();
111 
112     /**
113      * Obtains the settings manager of the activity.
114      *
115      * @return A {@link com.android.camera.settings.SettingsManager} object.
116      */
getSettingsManager()117     public SettingsManager getSettingsManager();
118 
119     /**
120      * Obtains the burst facade.
121      *
122      * @return A {@link com.android.camera.burst.BurstFacade} object.
123      */
getBurstFacade()124     public BurstFacade getBurstFacade();
125 
126     /**
127      * Obtains the current camera facing setting.
128      *
129      * @return A {@link com.android.camera.settings.CameraFacingSetting} object.
130      */
getCameraFacingSetting()131     public CameraFacingSetting getCameraFacingSetting();
132 
133     /**
134      * Obtains the current resolution setting.
135      *
136      * @return A {@link com.android.camera.settings.ResolutionSetting} object.
137      */
getResolutionSetting()138     public ResolutionSetting getResolutionSetting();
139 
140     /**
141      * Obtains a handler to perform camera related operations.
142      *
143      * @return A {@link android.os.Handler} object.
144      */
getCameraHandler()145     public Handler getCameraHandler();
146 
147     /**
148      * Obtains a sound player that is able to play various capture sounds.
149      *
150      * @return A {@link com.android.camera.SoundPlayer} object.
151      */
getSoundPlayer()152     public SoundPlayer getSoundPlayer();
153 
154     /**
155      * Obtains the app controller
156      *
157      * @deprecated Please avoid to use app controller.
158      * @return An {@link com.android.camera.app.AppController} object.
159      */
160     @Deprecated
getAppController()161     public AppController getAppController();
162 
163     /**
164      * Obtains the fatal error handler.
165      *
166      * @return An {@link FatalErrorHandler} object.
167      */
getFatalErrorHandler()168     public FatalErrorHandler getFatalErrorHandler();
169 }
170