c17fcad7df82c31fcf35f12541df63c34ca32ce4
[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 deleteIconId: "icon-m-toolbar-delete-white"
48     property string shareIconId: "icon-m-toolbar-share-white"
49     property string favoriteMarkIconId: "icon-m-toolbar-favorite-mark-white"
50     property string favoriteUnmarkIconId: "icon-m-toolbar-favorite-unmark-white"
51     property string galleryIconId: "icon-m-camera-roll"
52
53     property string flashAutoIconId: "icon-m-camera-flash-auto"
54     property string flashOnIconId: "icon-m-camera-flash-always"
55     property string flashOffIconId: "icon-m-camera-flash-off"
56     property string flashRedEyeIconId: "icon-m-camera-flash-red-eye"
57
58     property string whiteBalanceAutoIconId: "icon-m-camera-whitebalance-auto"
59     property string whiteBalanceSunsetIconId: "icon-m-camera-whitebalance-sunny"
60     property string whiteBalanceCloudyIconId: "icon-m-camera-whitebalance-cloudy"
61     property string whiteBalanceFlourescentIconId: "icon-m-camera-whitebalance-fluorescent"
62     property string whiteBalanceTungstenIconId: "icon-m-camera-whitebalance-tungsten"
63
64     property string colorFilterNormalIconId: "icon-m-camera-no-filter"
65     property string colorFilterGrayScaleIconId: "icon-m-camera-filter-black-white"
66     property string colorFilterSepiaIconId: "icon-m-camera-filter-sepia"
67     property string colorFilterVividIconId: "icon-m-camera-filter-vivid"
68     property string colorFilterNegativeIconId: "icon-m-camera-filter-negative"
69     property string colorFilterSolarizeIconId: "icon-m-camera-filter-solarize"
70
71     property string imageSceneModeAutoIconId: "icon-m-camera-scene-auto"
72     property string imageSceneModeCloseupIconId: "icon-m-camera-scene-macro"
73     property string imageSceneModeLandscapeIconId: "icon-m-camera-scene-landscape"
74     property string imageSceneModePortraitIconId: "icon-m-camera-scene-portrait"
75     property string imageSceneModeNightIconId: "icon-m-camera-night"
76     property string imageSceneModeSportIconId: "icon-m-camera-scene-sports"
77
78     property string videoSceneModeAutoIconId: "icon-m-camera-scene-auto"
79     property string videoSceneModeNightIconId: "icon-m-camera-video-night"
80
81     property string isoAudoIconId: "icon-m-camera-iso-auto"
82     property string iso100IconId: "icon-m-camera-iso-100"
83     property string iso200IconId: "icon-m-camera-iso-200"
84     property string iso400IconId: "icon-m-camera-iso-400"
85     property string iso800IconId: "icon-m-camera-iso-800"
86
87     function videoIcon(ratio, res, device) {
88         if (res == "high") {
89             return "icon-m-camera-video-high-resolution"
90         } else if (res == "medium") {
91             return "icon-m-camera-video-fine-resolution"
92         } else if (res == "low") {
93             return "icon-m-camera-video-low-resolution"
94         } else {
95             return ""
96         }
97     }
98
99     property variant __imageData: [
100         ["3:2", "low", "icon-m-camera-resolution-3m"],
101         ["3:2", "medium", "icon-m-camera-resolution-6m"],
102         ["3:2", "high", "icon-m-camera-resolution-7m"],
103         ["4:3", "low", "icon-m-camera-resolution-3m"],
104         ["4:3", "medium", "icon-m-camera-resolution-6m"],
105         ["4:3", "high", "icon-m-camera-resolution-8m"],
106         ["16:9", "low", "icon-m-camera-resolution-3m"],
107         ["16:9", "medium", "icon-m-camera-resolution-6m"],
108         ["16:9", "high", "icon-m-camera-resolution-7m"]
109     ]
110
111     function imageIcon(ratio, res, device) {
112         var x = 0
113         var len = __imageData.length
114         for (x = 0; x < len; x++) {
115             if (__imageData[x][0] == ratio && __imageData[x][1] == res) {
116                 return __imageData[x][2]
117             }
118         }
119
120         return ""
121     }
122
123     function whiteBalanceIcon(val) {
124         switch (val) {
125             case WhiteBalance.Auto:
126                 return whiteBalanceAutoIconId
127             case WhiteBalance.Sunset:
128                 return whiteBalanceSunsetIconId
129             case WhiteBalance.Cloudy:
130                 return whiteBalanceCloudyIconId
131             case WhiteBalance.Flourescent:
132                 return whiteBalanceFlourescentIconId
133             case WhiteBalance.Tungsten:
134                 return whiteBalanceTungstenIconId
135             default:
136                 return ""
137         }
138     }
139
140     function colorFilterIcon(val) {
141         switch (val) {
142             case ColorTone.Normal:
143                 return colorFilterNormalIconId
144             case ColorTone.GrayScale:
145                 return colorFilterGrayScaleIconId
146             case ColorTone.Sepia:
147                 return colorFilterSepiaIconId
148             case ColorTone.Vivid:
149                 return colorFilterVividIconId
150             case ColorTone.Negative:
151                 return colorFilterNegativeIconId
152             case ColorTone.Solarize:
153                 return colorFilterSolarizeIconId
154             default:
155                 return ""
156         }
157     }
158
159     function imageSceneModeIcon(val) {
160         switch (val) {
161             case Scene.Auto:
162                 return imageSceneModeAutoIconId
163             case Scene.Closeup:
164                 return imageSceneModeCloseupIconId
165             case Scene.Landscape:
166                 return imageSceneModeLandscapeIconId
167             case Scene.Portrait:
168                 return imageSceneModePortraitIconId
169             case Scene.Night:
170                 return imageSceneModeNightIconId
171             case Scene.Sport:
172                 return imageSceneModeSportIconId
173             default:
174                 return ""
175         }
176     }
177
178     function videoSceneModeIcon(val) {
179         switch (val) {
180             case Scene.Auto:
181                 return videoSceneModeAutoIconId
182             case Scene.Night:
183                 return videoSceneModeNightIconId
184             default:
185                 return ""
186         }
187     }
188
189     function flashIcon(val) {
190         switch (val) {
191             case Flash.Auto:
192                 return flashAutoIconId
193             case Flash.On:
194                 return flashOnIconId
195             case Flash.Off:
196                 return flashOffIconId
197             case Flash.RedEye:
198                 return flashRedEyeIconId
199             default:
200                 return ""
201         }
202     }
203
204     function isoIcon(val) {
205         switch (val) {
206             case 0:
207                 return isoAudoIconId
208             case 100:
209                 return iso100IconId
210             case 200:
211                 return iso200IconId
212             case 400:
213                 return iso400IconId
214             case 800:
215                 return iso800IconId
216             default:
217                 return ""
218         }
219     }
220
221     function flashIndicatorIcon(val) {
222         return flashIcon(val) + "-screen"
223     }
224
225     function whiteBalanceIndicatorIcon(val) {
226         if (val == WhiteBalance.Auto) {
227             return ""
228         } else {
229             return whiteBalanceIcon(val) + "-screen"
230         }
231     }
232
233     function colorFilterIndicatorIcon(val) {
234         if (val == ColorTone.Normal) {
235             return ""
236         } else {
237             return colorFilterIcon(val) + "-screen"
238         }
239     }
240
241     function imageSceneModeIndicatorIcon(val) {
242         if (val == Scene.Auto) {
243             return ""
244         } else {
245             return imageSceneModeIcon(val) + "-screen"
246         }
247     }
248
249     function videoSceneModeIndicatorIcon(val) {
250         if (val == Scene.Auto) {
251             return ""
252         } else {
253             return videoSceneModeIcon(val) + "-screen"
254         }
255     }
256 }