-rw-r--r-- | libopie/odevice.cpp | 8 | ||||
-rw-r--r-- | libopie/odevice.h | 5 |
2 files changed, 6 insertions, 7 deletions
diff --git a/libopie/odevice.cpp b/libopie/odevice.cpp index 4c33a0e..d6e6892 100644 --- a/libopie/odevice.cpp +++ b/libopie/odevice.cpp | |||
@@ -730,110 +730,110 @@ QValueList <OLedState> ODevice::ledStateList ( OLed /*which*/ ) const | |||
730 | } | 730 | } |
731 | 731 | ||
732 | /** | 732 | /** |
733 | * @return the state for a given OLed | 733 | * @return the state for a given OLed |
734 | */ | 734 | */ |
735 | OLedState ODevice::ledState ( OLed /*which*/ ) const | 735 | OLedState ODevice::ledState ( OLed /*which*/ ) const |
736 | { | 736 | { |
737 | return Led_Off; | 737 | return Led_Off; |
738 | } | 738 | } |
739 | 739 | ||
740 | /** | 740 | /** |
741 | * Set the state for a LED | 741 | * Set the state for a LED |
742 | * @param which Which OLed to use | 742 | * @param which Which OLed to use |
743 | * @param st The state to set | 743 | * @param st The state to set |
744 | * @return success or failure | 744 | * @return success or failure |
745 | */ | 745 | */ |
746 | bool ODevice::setLedState ( OLed which, OLedState st ) | 746 | bool ODevice::setLedState ( OLed which, OLedState st ) |
747 | { | 747 | { |
748 | Q_UNUSED( which ) | 748 | Q_UNUSED( which ) |
749 | Q_UNUSED( st ) | 749 | Q_UNUSED( st ) |
750 | return false; | 750 | return false; |
751 | } | 751 | } |
752 | 752 | ||
753 | /** | 753 | /** |
754 | * @return if the device has a light sensor | 754 | * @return if the device has a light sensor |
755 | */ | 755 | */ |
756 | bool ODevice::hasLightSensor ( ) const | 756 | bool ODevice::hasLightSensor ( ) const |
757 | { | 757 | { |
758 | return false; | 758 | return false; |
759 | } | 759 | } |
760 | 760 | ||
761 | /** | 761 | /** |
762 | * @return a value from the light senso | 762 | * @return a value from the light senso |
763 | */ | 763 | */ |
764 | int ODevice::readLightSensor ( ) | 764 | int ODevice::readLightSensor ( ) |
765 | { | 765 | { |
766 | return -1; | 766 | return -1; |
767 | } | 767 | } |
768 | 768 | ||
769 | /** | 769 | /** |
770 | * @return the light sensor resolution whatever that is ;) | 770 | * @return the light sensor resolution whatever that is ;) |
771 | */ | 771 | */ |
772 | int ODevice::lightSensorResolution ( ) const | 772 | int ODevice::lightSensorResolution ( ) const |
773 | { | 773 | { |
774 | return 0; | 774 | return 0; |
775 | } | 775 | } |
776 | 776 | ||
777 | /** | 777 | /** |
778 | * @return a list with valid CPU frequency | 778 | * @return a list with CPU frequencies supported by the hardware |
779 | */ | 779 | */ |
780 | QStrList &ODevice::cpuFrequencies ( ) const | 780 | const QStrList &ODevice::allowedCpuFrequencies ( ) const |
781 | { | 781 | { |
782 | return *d->m_cpu_frequencies; | 782 | return *d->m_cpu_frequencies; |
783 | } | 783 | } |
784 | 784 | ||
785 | 785 | ||
786 | /** | 786 | /** |
787 | * Set desired cpu frequency | 787 | * Set desired CPU frequency |
788 | * | 788 | * |
789 | * @param index index into d->m_cpu_frequencies of the frequency to be set | 789 | * @param index index into d->m_cpu_frequencies of the frequency to be set |
790 | */ | 790 | */ |
791 | bool ODevice::setCpuFrequency(uint index) | 791 | bool ODevice::setCurrentCpuFrequency(uint index) |
792 | { | 792 | { |
793 | if (index >= d->m_cpu_frequencies->count()) | 793 | if (index >= d->m_cpu_frequencies->count()) |
794 | return false; | 794 | return false; |
795 | 795 | ||
796 | char *freq = d->m_cpu_frequencies->at(index); | 796 | char *freq = d->m_cpu_frequencies->at(index); |
797 | qWarning("set freq to %s", freq); | 797 | qWarning("set freq to %s", freq); |
798 | 798 | ||
799 | int fd; | 799 | int fd; |
800 | 800 | ||
801 | if ((fd = ::open("/proc/sys/cpu/0/speed", O_WRONLY)) >= 0) { | 801 | if ((fd = ::open("/proc/sys/cpu/0/speed", O_WRONLY)) >= 0) { |
802 | char writeCommand[50]; | 802 | char writeCommand[50]; |
803 | const int count = sprintf(writeCommand, "%s\n", freq); | 803 | const int count = sprintf(writeCommand, "%s\n", freq); |
804 | int res = (::write(fd, writeCommand, count) != -1); | 804 | int res = (::write(fd, writeCommand, count) != -1); |
805 | ::close(fd); | 805 | ::close(fd); |
806 | return res; | 806 | return res; |
807 | } | 807 | } |
808 | 808 | ||
809 | return false; | 809 | return false; |
810 | } | 810 | } |
811 | 811 | ||
812 | 812 | ||
813 | /** | 813 | /** |
814 | * @return a list of hardware buttons | 814 | * @return a list of hardware buttons |
815 | */ | 815 | */ |
816 | const QValueList <ODeviceButton> &ODevice::buttons ( ) | 816 | const QValueList <ODeviceButton> &ODevice::buttons ( ) |
817 | { | 817 | { |
818 | initButtons ( ); | 818 | initButtons ( ); |
819 | 819 | ||
820 | return *d-> m_buttons; | 820 | return *d-> m_buttons; |
821 | } | 821 | } |
822 | 822 | ||
823 | /** | 823 | /** |
824 | * @return The amount of time that would count as a hold | 824 | * @return The amount of time that would count as a hold |
825 | */ | 825 | */ |
826 | uint ODevice::buttonHoldTime ( ) const | 826 | uint ODevice::buttonHoldTime ( ) const |
827 | { | 827 | { |
828 | return d-> m_holdtime; | 828 | return d-> m_holdtime; |
829 | } | 829 | } |
830 | 830 | ||
831 | /** | 831 | /** |
832 | * This method return a ODeviceButton for a key code | 832 | * This method return a ODeviceButton for a key code |
833 | * or 0 if no special hardware button is available for the device | 833 | * or 0 if no special hardware button is available for the device |
834 | * | 834 | * |
835 | * @return The devicebutton or 0l | 835 | * @return The devicebutton or 0l |
836 | * @see ODeviceButton | 836 | * @see ODeviceButton |
837 | */ | 837 | */ |
838 | const ODeviceButton *ODevice::buttonForKeycode ( ushort code ) | 838 | const ODeviceButton *ODevice::buttonForKeycode ( ushort code ) |
839 | { | 839 | { |
diff --git a/libopie/odevice.h b/libopie/odevice.h index 18ff5f1..f2f6467 100644 --- a/libopie/odevice.h +++ b/libopie/odevice.h | |||
@@ -153,97 +153,96 @@ public: | |||
153 | // sandman do we want to allow destructions? -zecke? | 153 | // sandman do we want to allow destructions? -zecke? |
154 | virtual ~ODevice ( ); | 154 | virtual ~ODevice ( ); |
155 | 155 | ||
156 | static ODevice *inst ( ); | 156 | static ODevice *inst ( ); |
157 | 157 | ||
158 | // information | 158 | // information |
159 | 159 | ||
160 | QString modelString ( ) const; | 160 | QString modelString ( ) const; |
161 | OModel model ( ) const; | 161 | OModel model ( ) const; |
162 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } | 162 | inline OModel series ( ) const { return (OModel) ( model ( ) & Model_Series_Mask ); } |
163 | 163 | ||
164 | QString vendorString ( ) const; | 164 | QString vendorString ( ) const; |
165 | OVendor vendor ( ) const; | 165 | OVendor vendor ( ) const; |
166 | 166 | ||
167 | QString systemString ( ) const; | 167 | QString systemString ( ) const; |
168 | OSystem system ( ) const; | 168 | OSystem system ( ) const; |
169 | 169 | ||
170 | QString systemVersionString ( ) const; | 170 | QString systemVersionString ( ) const; |
171 | 171 | ||
172 | Transformation rotation ( ) const; | 172 | Transformation rotation ( ) const; |
173 | ODirection direction ( ) const; | 173 | ODirection direction ( ) const; |
174 | 174 | ||
175 | // system | 175 | // system |
176 | 176 | ||
177 | virtual bool setSoftSuspend ( bool on ); | 177 | virtual bool setSoftSuspend ( bool on ); |
178 | virtual bool suspend ( ); | 178 | virtual bool suspend ( ); |
179 | 179 | ||
180 | virtual bool setDisplayStatus ( bool on ); | 180 | virtual bool setDisplayStatus ( bool on ); |
181 | virtual bool setDisplayBrightness ( int brightness ); | 181 | virtual bool setDisplayBrightness ( int brightness ); |
182 | virtual int displayBrightnessResolution ( ) const; | 182 | virtual int displayBrightnessResolution ( ) const; |
183 | virtual bool setDisplayContrast ( int contrast ); | 183 | virtual bool setDisplayContrast ( int contrast ); |
184 | virtual int displayContrastResolution ( ) const; | 184 | virtual int displayContrastResolution ( ) const; |
185 | 185 | ||
186 | // input / output | 186 | // input / output |
187 | //FIXME playAlarmSound and al might be better -zecke | 187 | //FIXME playAlarmSound and al might be better -zecke |
188 | virtual void alarmSound ( ); | 188 | virtual void alarmSound ( ); |
189 | virtual void keySound ( ); | 189 | virtual void keySound ( ); |
190 | virtual void touchSound ( ); | 190 | virtual void touchSound ( ); |
191 | 191 | ||
192 | virtual QValueList <OLed> ledList ( ) const; | 192 | virtual QValueList <OLed> ledList ( ) const; |
193 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; | 193 | virtual QValueList <OLedState> ledStateList ( OLed led ) const; |
194 | virtual OLedState ledState ( OLed led ) const; | 194 | virtual OLedState ledState ( OLed led ) const; |
195 | virtual bool setLedState ( OLed led, OLedState st ); | 195 | virtual bool setLedState ( OLed led, OLedState st ); |
196 | 196 | ||
197 | virtual bool hasLightSensor ( ) const; | 197 | virtual bool hasLightSensor ( ) const; |
198 | virtual int readLightSensor ( ); | 198 | virtual int readLightSensor ( ); |
199 | virtual int lightSensorResolution ( ) const; | 199 | virtual int lightSensorResolution ( ) const; |
200 | 200 | ||
201 | QStrList &cpuFrequencies() const; | 201 | const QStrList &allowedCpuFrequencies() const; |
202 | bool setCpuFrequency(uint index); | 202 | bool setCurrentCpuFrequency(uint index); |
203 | int cpuFrequency() const; | ||
204 | 203 | ||
205 | /** | 204 | /** |
206 | * Returns the available buttons on this device. The number and location | 205 | * Returns the available buttons on this device. The number and location |
207 | * of buttons will vary depending on the device. Button numbers will be assigned | 206 | * of buttons will vary depending on the device. Button numbers will be assigned |
208 | * by the device manufacturer and will be from most preferred button to least preffered | 207 | * by the device manufacturer and will be from most preferred button to least preffered |
209 | * button. Note that this list only contains "user mappable" buttons. | 208 | * button. Note that this list only contains "user mappable" buttons. |
210 | */ | 209 | */ |
211 | const QValueList<ODeviceButton> &buttons ( ); | 210 | const QValueList<ODeviceButton> &buttons ( ); |
212 | 211 | ||
213 | /** | 212 | /** |
214 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it | 213 | * Returns the DeviceButton for the \a keyCode. If \a keyCode is not found, it |
215 | * returns 0L | 214 | * returns 0L |
216 | */ | 215 | */ |
217 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); | 216 | const ODeviceButton *buttonForKeycode ( ushort keyCode ); |
218 | 217 | ||
219 | /** | 218 | /** |
220 | * Reassigns the pressed action for \a button. To return to the factory | 219 | * Reassigns the pressed action for \a button. To return to the factory |
221 | * default pass an empty string as \a qcopMessage. | 220 | * default pass an empty string as \a qcopMessage. |
222 | */ | 221 | */ |
223 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); | 222 | void remapPressedAction ( int button, const OQCopMessage &qcopMessage ); |
224 | 223 | ||
225 | /** | 224 | /** |
226 | * Reassigns the held action for \a button. To return to the factory | 225 | * Reassigns the held action for \a button. To return to the factory |
227 | * default pass an empty string as \a qcopMessage. | 226 | * default pass an empty string as \a qcopMessage. |
228 | */ | 227 | */ |
229 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); | 228 | void remapHeldAction ( int button, const OQCopMessage &qcopMessage ); |
230 | 229 | ||
231 | /** | 230 | /** |
232 | * How long (in ms) you have to press a button for a "hold" action | 231 | * How long (in ms) you have to press a button for a "hold" action |
233 | */ | 232 | */ |
234 | uint buttonHoldTime ( ) const; | 233 | uint buttonHoldTime ( ) const; |
235 | 234 | ||
236 | signals: | 235 | signals: |
237 | void buttonMappingChanged ( ); | 236 | void buttonMappingChanged ( ); |
238 | 237 | ||
239 | private slots: | 238 | private slots: |
240 | void systemMessage ( const QCString &, const QByteArray & ); | 239 | void systemMessage ( const QCString &, const QByteArray & ); |
241 | 240 | ||
242 | protected: | 241 | protected: |
243 | void reloadButtonMapping ( ); | 242 | void reloadButtonMapping ( ); |
244 | }; | 243 | }; |
245 | 244 | ||
246 | } | 245 | } |
247 | 246 | ||
248 | #endif | 247 | #endif |
249 | 248 | ||