Add back scene mode indicators
[harmattan/cameraplus] / qml / harmattan / CameraTheme.qml
1 // -*- qml -*-
2
3 /*!
4  * This file is part of CameraPlus.
5  *
6  * Copyright (C) 2012-2013 Mohammed Sameer <msameer@foolab.org>
7  *
8  * This library is free software; you can redistribute it and/or
9  * modify it under the terms of the GNU Lesser General Public
10  * License as published by the Free Software Foundation; either
11  * version 2.1 of the License, or (at your option) any later version.
12  *
13  * This library is distributed in the hope that it will be useful,
14  * but WITHOUT ANY WARRANTY; without even the implied warranty of
15  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
16  * Lesser General Public License for more details.
17  *
18  * You should have received a copy of the GNU Lesser General Public
19  * License along with this library; if not, write to the Free Software
20  * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA  02110-1301  USA
21  */
22
23 import QtQuick 1.1
24 import QtCamera 1.0
25
26 QtObject {
27     property string standbyIcon: "image://theme/icon-l-camera-standby"
28
29     property string gpsIndicatorIcon: "image://theme/icon-m-camera-location"
30     property string faceDetectionIndicatorIcon: "image://theme/icon-m-camera-face-detection-screen"
31
32     property string recordingDurationIcon: "image://theme/icon-m-camera-ongoing-recording"
33     property string cameraTorchOnIconId: "icon-m-camera-torch-on"
34     property string cameraTorchOffIconId: "icon-m-camera-torch-off"
35     property string soundMuteOnIconId: "icon-m-toolbar-volume-off-white-selected"
36     property string soundMuteOffIconId: "icon-m-toolbar-volume-white-selected"
37     property string videoStopIconId: "icon-m-toolbar-mediacontrol-stop-white"
38     property string videoPauseIconId: "icon-m-toolbar-mediacontrol-pause-white"
39     property string videoPlayIconId: "icon-m-toolbar-mediacontrol-play-white"
40     property string cameraManualExposureIconId: "icon-m-camera-manual-exposure"
41     property string cameraVideoIconId: "icon-m-camera-video"
42     property string cameraImageIconId: "icon-m-viewfinder-camera"
43     property string captureButtonImageIconId: "icon-m-camera-shutter"
44     property string captureButtonVideoIconId: "icon-m-camera-video-record"
45     property string captureButtonRecordingIconId: "icon-m-camera-video-record"
46     property string cameraToolBarMenuIcon: "icon-m-toolbar-back-white"
47     property string deleteEnabledIconId: "icon-m-toolbar-delete-white"
48     property string deleteDisabledIconId: "icon-m-toolbar-delete-dimmed-white"
49     property string shareEnabledIconId: "icon-m-toolbar-share-white"
50     property string shareDisabledIconId: "icon-m-toolbar-share-dimmed-white"
51     property string favoriteDisabledIconId: "icon-m-toolbar-favorite-mark-dimmed-white"
52     property string favoriteMarkIconId: "icon-m-toolbar-favorite-mark-white"
53     property string favoriteUnmarkIconId: "icon-m-toolbar-favorite-unmark-white"
54     property string menuIconId: "icon-m-toolbar-view-menu-white"
55
56     property string flashAutoIconId: "icon-m-camera-flash-auto"
57     property string flashOnIconId: "icon-m-camera-flash-always"
58     property string flashOffIconId: "icon-m-camera-flash-off"
59     property string flashRedEyeIconId: "icon-m-camera-flash-red-eye"
60
61     property string whiteBalanceAutoIconId: "icon-m-camera-whitebalance-auto"
62     property string whiteBalanceSunsetIconId: "icon-m-camera-whitebalance-sunny"
63     property string whiteBalanceCloudyIconId: "icon-m-camera-whitebalance-cloudy"
64     property string whiteBalanceFlourescentIconId: "icon-m-camera-whitebalance-fluorescent"
65     property string whiteBalanceTungstenIconId: "icon-m-camera-whitebalance-tungsten"
66
67     property string colorFilterNormalIconId: "icon-m-camera-no-filter"
68     property string colorFilterGrayScaleIconId: "icon-m-camera-filter-black-white"
69     property string colorFilterSepiaIconId: "icon-m-camera-filter-sepia"
70     property string colorFilterVividIconId: "icon-m-camera-filter-vivid"
71     property string colorFilterNegativeIconId: "icon-m-camera-filter-negative"
72     property string colorFilterSolarizeIconId: "icon-m-camera-filter-solarize"
73
74     property string imageSceneModeAutoIconId: "icon-m-camera-scene-auto"
75     property string imageSceneModeCloseupIconId: "icon-m-camera-scene-macro"
76     property string imageSceneModeLandscapeIconId: "icon-m-camera-scene-landscape"
77     property string imageSceneModePortraitIconId: "icon-m-camera-scene-portrait"
78     property string imageSceneModeNightIconId: "icon-m-camera-night"
79     property string imageSceneModeSportIconId: "icon-m-camera-scene-sports"
80
81     property string videoSceneModeAutoIconId: "icon-m-camera-scene-auto"
82     property string videoSceneModeNightIconId: "icon-m-camera-video-night"
83
84     property string isoAudoIconId: "icon-m-camera-iso-auto"
85     property string iso100IconId: "icon-m-camera-iso-100"
86     property string iso200IconId: "icon-m-camera-iso-200"
87     property string iso400IconId: "icon-m-camera-iso-400"
88     property string iso800IconId: "icon-m-camera-iso-800"
89
90     function videoIcon(ratio, res, device) {
91         if (res == "high") {
92             return "icon-m-camera-video-high-resolution"
93         } else if (res == "medium") {
94             return "icon-m-camera-video-fine-resolution"
95         } else if (res == "low") {
96             return "icon-m-camera-video-low-resolution"
97         } else {
98             return ""
99         }
100     }
101
102     property variant __imageData: [
103         ["3:2", "low", "icon-m-camera-resolution-3m"],
104         ["3:2", "medium", "icon-m-camera-resolution-6m"],
105         ["3:2", "high", "icon-m-camera-resolution-7m"],
106         ["4:3", "low", "icon-m-camera-resolution-3m"],
107         ["4:3", "medium", "icon-m-camera-resolution-6m"],
108         ["4:3", "high", "icon-m-camera-resolution-8m"],
109         ["16:9", "low", "icon-m-camera-resolution-3m"],
110         ["16:9", "medium", "icon-m-camera-resolution-6m"],
111         ["16:9", "high", "icon-m-camera-resolution-7m"]
112     ]
113
114     function imageIcon(ratio, res, device) {
115         var x = 0
116         var len = __imageData.length
117         for (x = 0; x < len; x++) {
118             if (__imageData[x][0] == ratio && __imageData[x][1] == res) {
119                 return __imageData[x][2]
120             }
121         }
122
123         return ""
124     }
125
126     function whiteBalanceIcon(val) {
127         switch (val) {
128             case WhiteBalance.Auto:
129                 return whiteBalanceAutoIconId
130             case WhiteBalance.Sunset:
131                 return whiteBalanceSunsetIconId
132             case WhiteBalance.Cloudy:
133                 return whiteBalanceCloudyIconId
134             case WhiteBalance.Flourescent:
135                 return whiteBalanceFlourescentIconId
136             case WhiteBalance.Tungsten:
137                 return whiteBalanceTungstenIconId
138             default:
139                 return ""
140         }
141     }
142
143     function colorFilterIcon(val) {
144         switch (val) {
145             case ColorTone.Normal:
146                 return colorFilterNormalIconId
147             case ColorTone.GrayScale:
148                 return colorFilterGrayScaleIconId
149             case ColorTone.Sepia:
150                 return colorFilterSepiaIconId
151             case ColorTone.Vivid:
152                 return colorFilterVividIconId
153             case ColorTone.Negative:
154                 return colorFilterNegativeIconId
155             case ColorTone.Solarize:
156                 return colorFilterSolarizeIconId
157             default:
158                 return ""
159         }
160     }
161
162     function imageSceneModeIcon(val) {
163         switch (val) {
164             case Scene.Auto:
165                 return imageSceneModeAutoIconId
166             case Scene.Closeup:
167                 return imageSceneModeCloseupIconId
168             case Scene.Landscape:
169                 return imageSceneModeLandscapeIconId
170             case Scene.Portrait:
171                 return imageSceneModePortraitIconId
172             case Scene.Night:
173                 return imageSceneModeNightIconId
174             case Scene.Sport:
175                 return imageSceneModeSportIconId
176             default:
177                 return ""
178         }
179     }
180
181     function videoSceneModeIcon(val) {
182         switch (val) {
183             case Scene.Auto:
184                 return videoSceneModeAutoIconId
185             case Scene.Night:
186                 return videoSceneModeNightIconId
187             default:
188                 return ""
189         }
190     }
191
192     function flashIcon(val) {
193         switch (val) {
194             case Flash.Auto:
195                 return flashAutoIconId
196             case Flash.On:
197                 return flashOnIconId
198             case Flash.Off:
199                 return flashOffIconId
200             case Flash.RedEye:
201                 return flashRedEyeIconId
202             default:
203                 return ""
204         }
205     }
206
207     function isoIcon(val) {
208         switch (val) {
209             case 0:
210                 return isoAudoIconId
211             case 100:
212                 return iso100IconId
213             case 200:
214                 return iso200IconId
215             case 400:
216                 return iso400IconId
217             case 800:
218                 return iso800IconId
219             default:
220                 return ""
221         }
222     }
223
224     function flashIndicatorIcon(val) {
225         return flashIcon(val) + "-screen"
226     }
227
228     function whiteBalanceIndicatorIcon(val) {
229         if (val == WhiteBalance.Auto) {
230             return ""
231         } else {
232             return whiteBalanceIcon(val) + "-screen"
233         }
234     }
235
236     function colorFilterIndicatorIcon(val) {
237         if (val == ColorTone.Normal) {
238             return ""
239         } else {
240             return colorFilterIcon(val) + "-screen"
241         }
242     }
243
244     function imageSceneModeIndicatorIcon(val) {
245         if (val == Scene.Auto) {
246             return ""
247         } else {
248             return imageSceneModeIcon(val) + "-screen"
249         }
250     }
251
252     function videoSceneModeIndicatorIcon(val) {
253         if (val == Scene.Auto) {
254             return ""
255         } else {
256             return videoSceneModeIcon(val) + "-screen"
257         }
258     }
259 }