1 /* |
1 /* |
2 * Copyright (c) 2009 Nokia Corporation and/or its subsidiary(-ies). |
2 * Copyright (c) 2009-2010 Nokia Corporation and/or its subsidiary(-ies). |
3 * All rights reserved. |
3 * All rights reserved. |
4 * This component and the accompanying materials are made available |
4 * This component and the accompanying materials are made available |
5 * under the terms of "Eclipse Public License v1.0" |
5 * under the terms of "Eclipse Public License v1.0" |
6 * which accompanies this distribution, and is available |
6 * which accompanies this distribution, and is available |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
7 * at the URL "http://www.eclipse.org/legal/epl-v10.html". |
32 */ |
32 */ |
33 class CxeAutoFocusControl : public QObject |
33 class CxeAutoFocusControl : public QObject |
34 { |
34 { |
35 Q_OBJECT |
35 Q_OBJECT |
36 public: |
36 public: |
37 |
37 |
38 /* |
38 /* |
39 * Autofocus control states. |
39 * Autofocus control states. |
40 */ |
40 */ |
41 enum State |
41 enum State |
42 { |
42 { |
43 //! focusing |
43 //! focusing |
44 InProgress = 0x01, |
44 InProgress = 0x01, |
45 |
45 |
46 //! Autofocus Failed |
46 //! Autofocus Failed |
47 Failed = 0x02, |
47 Failed = 0x02, |
48 |
48 |
49 //! Focused |
49 //! Focused |
50 Ready = 0x04, |
50 Ready = 0x04, |
51 |
51 |
52 //! State after successfully canceling AF or during startup |
52 //! State after successfully canceling AF or during startup |
53 Unknown = 0x08, |
53 Unknown = 0x08, |
54 |
54 |
55 //! Starting to cancel any pending AF requests |
55 //! Starting to cancel any pending AF requests |
56 Canceling = 0x10 // Starting to Cancel any pending AF requests |
56 Canceling = 0x10 // Starting to Cancel any pending AF requests |
57 }; |
57 }; |
58 |
58 |
59 // TODO: Check if we have to get all the supported modes from adaptation. |
59 // TODO: Check if we have to get all the supported modes from adaptation. |
60 enum Mode |
60 enum Mode |
61 { |
61 { |
62 //! AF mode: Auto |
62 //! AF mode: Auto |
63 Auto, |
63 Auto, |
64 |
64 |
65 //! AF mode: Hyperfocal |
65 //! AF mode: Hyperfocal |
66 Hyperfocal, |
66 Hyperfocal, |
67 |
67 |
68 //! AF mode: Macro |
68 //! AF mode: Macro |
69 Macro, |
69 Macro, |
70 |
70 |
71 //! AF mode: Infinity |
71 //! AF mode: Infinity |
72 Infinity, |
72 Infinity, |
73 |
73 |
74 //! AF mode: Portrait |
74 //! AF mode: Portrait |
75 Portrait |
75 Portrait |
76 }; |
76 }; |
77 |
77 |
78 /** |
78 /** |
79 * Starts Autofocus. |
79 * Starts Autofocus. |
80 * \param soundEnabled indicates if the auto focus sound should be played |
80 * \param soundEnabled indicates if the auto focus sound should be played |
81 */ |
81 */ |
82 virtual CxeError::Id start(bool soundEnabled = true) = 0; |
82 virtual CxeError::Id start(bool soundEnabled = true) = 0; |
83 |
83 |
84 /** |
84 /** |
85 * Cancels Autofocus. |
85 * Cancels Autofocus. |
86 */ |
86 */ |
87 virtual void cancel() = 0; // cancels active start operation |
87 virtual void cancel() = 0; // cancels active start operation |
88 |
88 |
89 |
89 |
90 /** |
90 /** |
91 * Setting Autofocus Mode. |
91 * Setting Autofocus Mode. |
92 */ |
92 */ |
93 virtual void setMode( Mode newMode ) = 0; // sets default value for current view/mode |
93 virtual void setMode( Mode newMode ) = 0; // sets default value for current view/mode |
94 |
94 |
95 /** |
95 /** |
96 * Get current Autofocus mode. |
96 * Get current Autofocus mode. |
97 */ |
97 */ |
98 virtual Mode mode() const = 0; |
98 virtual Mode mode() const = 0; |
99 |
99 |
|
100 /** |
|
101 * Is the mode a fixed focus mode. |
|
102 */ |
|
103 virtual bool isFixedFocusMode(Mode mode) const = 0; |
|
104 |
100 /** |
105 /** |
101 * Get current Autofocus state. |
106 * Get current Autofocus state. |
102 */ |
107 */ |
103 virtual State state() const = 0; // returns current AF state, one of AutoFocusState |
108 virtual State state() const = 0; // returns current AF state, one of AutoFocusState |
104 |
109 |
105 /** |
110 /** |
106 * Check if Autofocus is Supported or Not. |
111 * Check if Autofocus is Supported or Not. |
107 */ |
112 */ |
108 virtual bool supported() const = 0; // true when AF is supported |
113 virtual bool supported() const = 0; // true when AF is supported |
109 |
114 |
110 /** |
115 /** |
111 * Check if auto focus sound is enabled |
116 * Check if auto focus sound is enabled |
112 */ |
117 */ |
113 virtual bool isSoundEnabled() const = 0; |
118 virtual bool isSoundEnabled() const = 0; |
114 |
119 |