added android components
[mardrone] / mardrone / imports / com / nokia / android.1.1 / StatusBar.qml~
1 /****************************************************************************
2 **
3 ** Copyright (C) 2011 Nokia Corporation and/or its subsidiary(-ies).
4 ** All rights reserved.
5 ** Contact: Nokia Corporation (qt-info@nokia.com)
6 **
7 ** This file is part of the Qt Components project.
8 **
9 ** $QT_BEGIN_LICENSE:BSD$
10 ** You may use this file under the terms of the BSD license as follows:
11 **
12 ** "Redistribution and use in source and binary forms, with or without
13 ** modification, are permitted provided that the following conditions are
14 ** met:
15 **   * Redistributions of source code must retain the above copyright
16 **     notice, this list of conditions and the following disclaimer.
17 **   * Redistributions in binary form must reproduce the above copyright
18 **     notice, this list of conditions and the following disclaimer in
19 **     the documentation and/or other materials provided with the
20 **     distribution.
21 **   * Neither the name of Nokia Corporation and its Subsidiary(-ies) nor
22 **     the names of its contributors may be used to endorse or promote
23 **     products derived from this software without specific prior written
24 **     permission.
25 **
26 ** THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS
27 ** "AS IS" AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT
28 ** LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS FOR
29 ** A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT
30 ** OWNER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, INCIDENTAL,
31 ** SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT NOT
32 ** LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF USE,
33 ** DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON ANY
34 ** THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
35 ** (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
36 ** OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE."
37 ** $QT_END_LICENSE$
38 **
39 ****************************************************************************/
40
41 import QtQuick 1.1
42 import "." 1.1
43
44 Item {
45 //    id: root
46
47 //    implicitWidth: screen.width
48 //    implicitHeight: privateStyle.statusBarHeight
49     property bool platformInverted: false
50
51 //    QtObject {
52 //        id: priv
53 //        objectName: "priv"
54
55 //        property bool clickedOpensStatusPanel: android.s60Version == Android.SV_S60_5_2 ? true : false
56 //        property int contentHeight: Math.round(privateStyle.statusBarHeight * 18 / 26)
57 //        property int paddingSmallOneQuarter: Math.round(platformStyle.paddingSmall / 4)
58 //        property int paddingSmallThreeQuarters: Math.round(platformStyle.paddingSmall * 3 / 4)
59
60 //        function signalWidthPercentage(signalStrength) {
61 //            if (signalStrength < 10)
62 //                return 0;
63 //            else if (signalStrength < 20)
64 //                return 1/5;
65 //            else if (signalStrength < 30)
66 //                return 2/5;
67 //            else if (signalStrength < 60)
68 //                return 3/5;
69 //            else if (signalStrength < 100)
70 //                return 4/5;
71 //            else
72 //                return 1;
73 //        }
74 //    }
75
76 //    MouseArea {
77 //        id: mouseArea
78 //        anchors.fill: parent
79
80 //        onClicked: {
81 //            if (priv.clickedOpensStatusPanel) {
82 //                privateStyle.play(Android.PopUp)
83 //                platformPopupManager.privateShowIndicatorPopup()
84 //            }
85 //        }
86 //        onPressed: {
87 //            if (!priv.clickedOpensStatusPanel) {
88 //                privateStyle.play(Android.PopUp)
89 //                platformPopupManager.privateShowIndicatorPopup()
90 //                // reset MouseArea state since status panel window eats the release event
91 //                android.privateSendMouseRelease(mouseArea)
92 //            }
93 //        }
94 //    }
95
96 //    BorderImage {
97 //        source: privateStyle.imagePath("qtg_fr_statusbar", root.platformInverted)
98 //        anchors.fill: parent
99 //        width: parent.width
100
101 //        UniversalIndicators {
102 //            height: indicatorHeight
103 //            anchors {
104 //                right: networkMode.left
105 //                rightMargin: priv.paddingSmallOneQuarter
106 //                verticalCenter: parent.verticalCenter
107 //                }
108
109 //            width: priv.paddingSmallOneQuarter * 2 + 3 * indicatorWidth
110
111 //            indicatorColor: root.platformInverted ? platformStyle.colorNormalDarkInverted
112 //                                                  : platformStyle.colorNormalLight
113 //            indicatorWidth: priv.contentHeight // same as height
114 //            indicatorHeight: priv.contentHeight
115 //            indicatorPadding: priv.paddingSmallOneQuarter
116 //            maxIndicatorCount: 3
117 //        }
118
119 //        // icon for network signal type e.g. 3G, GPRS etc
120 //        NetworkIndicator {
121 //            id: networkMode
122 //            height: priv.contentHeight
123 //            width: priv.contentHeight // same as height
124 //            anchors.verticalCenter: parent.verticalCenter
125 //            anchors.right: offline ? batteryBackground.left : signalBackground.left
126 //            anchors.rightMargin: priv.paddingSmallThreeQuarters
127 //            color: root.platformInverted ? platformStyle.colorNormalDarkInverted
128 //                                         : platformStyle.colorNormalLight
129 //        }
130 //        // signal strength
131 //        Image {
132 //            id: signalBackground
133 //            visible: !networkMode.offline
134 //            sourceSize.height: priv.contentHeight
135 //            sourceSize.width: Math.round(privateStyle.statusBarHeight * 19 / 26)
136 //            anchors.verticalCenter: parent.verticalCenter
137 //            anchors.right: batteryBackground.left
138 //            anchors.rightMargin: priv.paddingSmallThreeQuarters
139 //            fillMode: Image.PreserveAspectFit
140 //            source: privateStyle.imagePath("qtg_graf_signal_level_bg", root.platformInverted)
141 //            Item {
142 //                id: signalLevelItem
143 //                anchors.left: parent.left
144 //                anchors.top: parent.top
145 //                height: parent.height
146 //                width: priv.signalWidthPercentage(privateNetworkInfo.networkSignalStrength) * parent.width
147 //                clip: true
148 //                LayoutMirroring.enabled: false
149
150 //                Image {
151 //                    sourceSize.width: signalBackground.sourceSize.width
152 //                    sourceSize.height: signalBackground.sourceSize.height
153 //                    fillMode: Image.PreserveAspectFit
154 //                    source: privateStyle.imagePath("qtg_graf_signal_level_full", root.platformInverted)
155 //                }
156 //            }
157 //        }
158 //        // battery indicator
159 //        Image {
160 //            id: batteryBackground
161 //            anchors.verticalCenter: parent.verticalCenter
162 //            anchors.right: timeItem.left
163 //            anchors.rightMargin: priv.paddingSmallThreeQuarters
164 //            sourceSize.height: priv.contentHeight
165 //            sourceSize.width: Math.round(privateStyle.statusBarHeight * 24 / 26)
166 //            fillMode: Image.PreserveAspectFit
167 //            source: privateStyle.imagePath((privateBatteryInfo.powerSaveModeEnabled ?
168 //                "qtg_graf_battery_level_psm_bg" :
169 //                "qtg_graf_battery_level_bg"), root.platformInverted)
170
171 //            Item {
172 //                id: batteryLevel
173
174 //                property int animatedLevel
175
176 //                anchors.left: parent.left
177 //                anchors.top: parent.top
178 //                width: Math.round(privateStyle.statusBarHeight
179 //                    * ((privateBatteryInfo.charging ? Math.floor(animatedLevel / 100) :
180 //                        privateBatteryInfo.batteryLevel) + 2) / 13)
181 //                height: parent.height
182 //                clip: true
183 //                LayoutMirroring.enabled: false
184
185 //                Image {
186 //                    sourceSize.width: batteryBackground.sourceSize.width
187 //                    sourceSize.height: batteryBackground.sourceSize.height
188
189 //                    fillMode: Image.PreserveAspectFit
190
191 //                    // Battery state mappings: Levels 0 and 1 are low, 2-4 are medium, 5-7 are full.
192 //                    // Currently all levels use same graphics with white color.
193
194 //                    source: privateStyle.imagePath((privateBatteryInfo.powerSaveModeEnabled ?
195 //                        "qtg_graf_battery_level_psm_full" :
196 //                        "qtg_graf_battery_level_full"), root.platformInverted)
197 //                }
198 //            }
199
200 //            Image {
201 //                // power save mode indicator
202 //                anchors.fill: parent
203 //                sourceSize.width: parent.sourceSize.width
204 //                sourceSize.height: parent.sourceSize.height
205 //                source: privateStyle.imagePath("qtg_graf_battery_psm")
206 //                visible: privateBatteryInfo.powerSaveModeEnabled
207 //            }
208
209 //            NumberAnimation {
210 //                id: batteryChargingAnimation
211 //                loops: Animation.Infinite
212 //                running: privateBatteryInfo.charging
213 //                target: batteryLevel
214 //                property: "animatedLevel"
215 //                // Use bigger range (compared to 0-7) in order to make the animation smoother.
216 //                from: 0
217 //                to: 799
218 //                duration: 3500
219 //            }
220 //        }
221 //        // clock
222 //        Text {
223 //            id: timeItem
224 //            width: Math.round(privateStyle.statusBarHeight * 44 / 26)
225 //            color: root.platformInverted ? platformStyle.colorNormalDarkInverted
226 //                                         : platformStyle.colorNormalLight
227 //            anchors.verticalCenter: parent.verticalCenter
228 //            anchors.right: parent.right
229 //            anchors.rightMargin: platformStyle.paddingSmall
230 //            horizontalAlignment: Text.AlignRight
231 //            text: android.currentTime
232 //            font {
233 //                family: platformStyle.fontFamilyRegular;
234 //                pixelSize: priv.contentHeight
235 //                weight: Font.Light
236 //            }
237 //        }
238 //    }
239 }
240