113 \sa QLocale |
113 \sa QLocale |
114 */ |
114 */ |
115 |
115 |
116 /*! |
116 /*! |
117 Returns the date separator, which can occur in four different positions: |
117 Returns the date separator, which can occur in four different positions: |
118 Beginning of the expression |
118 Beginning of the expression; |
119 Between the first and second part |
119 Between the first and second part; |
120 Between the second and third part |
120 Between the second and third part; |
121 At the end of the expression |
121 At the end of the expression; |
122 Some of the positions may contain an empty string if a separator is not used in that position in the locale in question |
122 Some of the positions may contain an empty string if a separator is not used in that position in the locale in question. |
123 |
123 |
124 \return one of the four characters used to separate the day, |
124 \attention Symbian specific API |
|
125 |
|
126 \return Symbian - One of the four characters used to separate the day, |
125 month and year components of the date according to the |
127 month and year components of the date according to the |
126 system locale. |
128 system locale |
|
129 \return other platforms - Empty QChar or '\' (depending on index) |
127 |
130 |
128 \param index Index of the separator (0-3) |
131 \param index Index of the separator (0-3) |
129 */ |
132 */ |
130 QChar HbExtendedLocale::dateSeparator( int index ) const |
133 QChar HbExtendedLocale::dateSeparator( int index ) const |
131 { |
134 { |
145 /*! |
148 /*! |
146 Sets one of the four characters used to separate the day, |
149 Sets one of the four characters used to separate the day, |
147 month and year components of the date according to the |
150 month and year components of the date according to the |
148 system locale. |
151 system locale. |
149 |
152 |
|
153 \attention Symbian specific API |
|
154 |
150 \param ch Character to set, |
155 \param ch Character to set, |
151 \param index Index of the separator (0-3) |
156 \param index Index of the separator (0-3) |
152 |
157 |
153 \return true for Symbian if succesfull and false for other OS |
158 \return true for Symbian if succesfull and false for other OS |
154 */ |
159 */ |
169 return false; |
174 return false; |
170 #endif |
175 #endif |
171 } |
176 } |
172 |
177 |
173 /*! |
178 /*! |
174 Retrieves the time separator (for example, colon or full stop) |
179 Retrieves the time separator (for example, colon or full stop). |
175 |
180 |
176 \return one of the four characters used to separate the hour, |
181 \attention Symbian specific API |
|
182 |
|
183 \return Symbian - One of the four characters used to separate the hour, |
177 minute and second components of the date according to the |
184 minute and second components of the date according to the |
178 system locale. |
185 system locale |
|
186 \return other platforms - Empty QChar or ':' (depending on index) |
179 |
187 |
180 \param index Index of the separator (0-3) |
188 \param index Index of the separator (0-3) |
181 */ |
189 */ |
182 QChar HbExtendedLocale::timeSeparator( int index ) const |
190 QChar HbExtendedLocale::timeSeparator( int index ) const |
183 { |
191 { |
195 } |
203 } |
196 |
204 |
197 /*! |
205 /*! |
198 Sets one of the four characters used to separate the hour, |
206 Sets one of the four characters used to separate the hour, |
199 minute and second components of the date. |
207 minute and second components of the date. |
|
208 |
|
209 \attention Symbian specific API |
200 |
210 |
201 \param ch Character to set, |
211 \param ch Character to set, |
202 \param index Index of the separator (0-3) |
212 \param index Index of the separator (0-3) |
203 |
213 |
204 \return true for Symbian if succesfull and false for other OS |
214 \return true for Symbian if succesfull and false for other OS |
227 returns the order of the date components: day-month-year (the most commonly used format) |
237 returns the order of the date components: day-month-year (the most commonly used format) |
228 month-day-year (mostly used in the U.S. and Canada) |
238 month-day-year (mostly used in the U.S. and Canada) |
229 or year-month-day (used, for example, in Japanese, Chinese and Swedish) |
239 or year-month-day (used, for example, in Japanese, Chinese and Swedish) |
230 This enum defines the order of date components. |
240 This enum defines the order of date components. |
231 |
241 |
232 \value American American order (mm/dd/yyyy) |
242 \value American American order (mm/dd/yyyy) |
233 \value European European order (dd/mm/yyyy) |
243 \value European European order (dd/mm/yyyy) |
234 \value Japanese Japanese order (yyyy/mm/dd) |
244 \value Japanese Japanese order (yyyy/mm/dd) |
235 |
245 |
236 \sa dateStyle(), setDateStyle() |
246 \sa dateStyle(), setDateStyle() |
237 */ |
247 */ |
238 |
248 |
239 /*! |
249 /*! |
240 \return date style from system locale. The date style is returned according to DateStyle. |
250 Returns date style from system locale. The date style is returned according to DateStyle. |
|
251 |
|
252 \attention Symbian specific API |
|
253 |
|
254 \return date style for Symbian and HbExtendedLocale::American for other platforms |
241 */ |
255 */ |
242 HbExtendedLocale::DateStyle HbExtendedLocale::dateStyle() const |
256 HbExtendedLocale::DateStyle HbExtendedLocale::dateStyle() const |
243 { |
257 { |
244 #if defined(Q_OS_SYMBIAN) |
258 #if defined(Q_OS_SYMBIAN) |
245 _symbianLocale.LoadSystemSettings(); |
259 _symbianLocale.LoadSystemSettings(); |
299 |
315 |
300 /*! |
316 /*! |
301 \enum HbExtendedLocale::TimeStyle |
317 \enum HbExtendedLocale::TimeStyle |
302 |
318 |
303 Finds out if the 12-hour or the 24-hour clock is used |
319 Finds out if the 12-hour or the 24-hour clock is used |
304 \value Time12 12 hour clock style |
320 \value Time12 12 hour clock style |
305 \value Time24 24 hour clock style |
321 \value Time24 24 hour clock style |
306 |
322 |
307 \sa timeStyle(), setTimeStyle() |
323 \sa timeStyle(), setTimeStyle() |
308 */ |
324 */ |
309 |
325 |
310 /*! |
326 /*! |
311 \return time style from system locale. The time style is returned according to TimeStyle. |
327 Returns time style from system locale. The time style is returned according to TimeStyle. |
|
328 |
|
329 \attention Symbian specific API |
|
330 |
|
331 \return time style for Symbian and HbExtendedLocale::Time12 for other platforms |
312 */ |
332 */ |
313 HbExtendedLocale::TimeStyle HbExtendedLocale::timeStyle() const |
333 HbExtendedLocale::TimeStyle HbExtendedLocale::timeStyle() const |
314 { |
334 { |
315 #if defined(Q_OS_SYMBIAN) |
335 #if defined(Q_OS_SYMBIAN) |
316 _symbianLocale.LoadSystemSettings(); |
336 _symbianLocale.LoadSystemSettings(); |
358 #endif |
380 #endif |
359 } |
381 } |
360 |
382 |
361 |
383 |
362 /*! |
384 /*! |
363 Finds out if the AM/PM symbol is separated by a space from the time expression |
385 Finds out if the AM/PM symbol is separated by a space from the time expression. |
364 |
386 |
365 \return true if space is inserted between the time and the preceding or trailing am/pm text; otherwise returns false. |
387 \attention Symbian specific API |
|
388 |
|
389 \return Symbian - True if space is inserted between the time and the preceding or trailing am/pm text; otherwise returns false. |
|
390 \return other platforms - true |
366 */ |
391 */ |
367 bool HbExtendedLocale::amPmSpace() const |
392 bool HbExtendedLocale::amPmSpace() const |
368 { |
393 { |
369 #if defined(Q_OS_SYMBIAN) |
394 #if defined(Q_OS_SYMBIAN) |
370 _symbianLocale.LoadSystemSettings(); |
395 _symbianLocale.LoadSystemSettings(); |
394 |
421 |
395 /*! |
422 /*! |
396 \enum HbExtendedLocale::SymbolPos |
423 \enum HbExtendedLocale::SymbolPos |
397 |
424 |
398 \value Before |
425 \value Before |
399 \value After |
426 \value After |
400 |
427 |
401 Retrieves the position of the AM/PM symbol (before or after the time expression) |
428 Retrieves the position of the AM/PM symbol (before or after the time expression) |
402 \sa amPmSymbolPosition(), setAmPmSymbolPosition() |
429 \sa amPmSymbolPosition(), setAmPmSymbolPosition() |
403 \sa currencySymbolPosition(), setCurrencySymbolPosition() |
430 \sa currencySymbolPosition(), setCurrencySymbolPosition() |
404 */ |
431 */ |
405 |
432 |
406 /*! |
433 /*! |
407 \return Before if am/pm text is positioned before time; otherwise returns After. |
434 Returns HbExtendedLocale::Before if am/pm text is positioned before time; otherwise returns HbExtendedLocale::After. |
|
435 |
|
436 \attention Symbian specific API |
|
437 |
|
438 \return After/Before for Symbian and HbExtendedLocale::After for other platforms |
408 */ |
439 */ |
409 HbExtendedLocale::SymbolPos HbExtendedLocale::amPmSymbolPosition() const |
440 HbExtendedLocale::SymbolPos HbExtendedLocale::amPmSymbolPosition() const |
410 { |
441 { |
411 #if defined(Q_OS_SYMBIAN) |
442 #if defined(Q_OS_SYMBIAN) |
412 _symbianLocale.LoadSystemSettings(); |
443 _symbianLocale.LoadSystemSettings(); |
417 return HbExtendedLocale::After; |
448 return HbExtendedLocale::After; |
418 } |
449 } |
419 #else |
450 #else |
420 return HbExtendedLocale::After; |
451 return HbExtendedLocale::After; |
421 #endif |
452 #endif |
422 return HbExtendedLocale::After; |
|
423 } |
453 } |
424 |
454 |
425 /*! |
455 /*! |
426 Sets the am/pm text position. |
456 Sets the am/pm text position. |
427 The position is chosen according to the \a position parameter. |
457 The position is chosen according to the \a position parameter. |
|
458 |
|
459 \attention Symbian specific API |
428 |
460 |
429 \return true for Symbian if succesfull and false for other OS |
461 \return true for Symbian if succesfull and false for other OS |
430 */ |
462 */ |
431 bool HbExtendedLocale::setAmPmSymbolPosition( const SymbolPos position ) |
463 bool HbExtendedLocale::setAmPmSymbolPosition( const SymbolPos position ) |
432 { |
464 { |
460 |
492 |
461 \sa unitsDistanceShort(), unitsDistanceLong() |
493 \sa unitsDistanceShort(), unitsDistanceLong() |
462 */ |
494 */ |
463 |
495 |
464 /*! |
496 /*! |
465 Retrives the measurement system (if metric or imperial units are in use) |
497 Retrives the measurement system (if metric or imperial units are in use). |
466 |
498 |
467 \return short unit distance format from system locale. Format is specified by UnitsFormat. |
499 \attention Symbian specific API |
468 */ |
500 |
|
501 \return Symbian - Short unit distance format from system locale. Format is specified by UnitsFormat. |
|
502 \return other platforms - QLocale::MetricSystem |
|
503 */ |
469 QLocale::MeasurementSystem HbExtendedLocale::unitsDistanceShort() const |
504 QLocale::MeasurementSystem HbExtendedLocale::unitsDistanceShort() const |
470 { |
505 { |
471 #if defined(Q_OS_SYMBIAN) |
506 #if defined(Q_OS_SYMBIAN) |
472 _symbianLocale.LoadSystemSettings(); |
507 _symbianLocale.LoadSystemSettings(); |
473 TUnitsFormat val = _symbianLocale.GetLocale()->UnitsDistanceShort(); |
508 TUnitsFormat val = _symbianLocale.GetLocale()->UnitsDistanceShort(); |
484 } |
519 } |
485 |
520 |
486 /*! |
521 /*! |
487 Sets short unit distance \a format to system locale. |
522 Sets short unit distance \a format to system locale. |
488 |
523 |
|
524 \attention Symbian specific API |
|
525 |
489 \return true for Symbian and false for other OS |
526 \return true for Symbian and false for other OS |
490 */ |
527 */ |
491 bool HbExtendedLocale::setUnitsDistanceShort( const QLocale::MeasurementSystem format ) |
528 bool HbExtendedLocale::setUnitsDistanceShort( const QLocale::MeasurementSystem format ) |
492 { |
529 { |
493 #if defined(Q_OS_SYMBIAN) |
530 #if defined(Q_OS_SYMBIAN) |
512 return false; |
549 return false; |
513 #endif |
550 #endif |
514 } |
551 } |
515 |
552 |
516 /*! |
553 /*! |
517 \return long unit distance format from system locale. Format is specified by UnitsFormat. |
554 Returns long unit distance format from system locale. Format is specified by UnitsFormat. |
|
555 |
|
556 \attention Symbian specific API |
|
557 |
|
558 \return long unit distance format for Symbian and QLocale::MetricSystem for other platforms |
518 */ |
559 */ |
519 QLocale::MeasurementSystem HbExtendedLocale::unitsDistanceLong() const |
560 QLocale::MeasurementSystem HbExtendedLocale::unitsDistanceLong() const |
520 { |
561 { |
521 #if defined(Q_OS_SYMBIAN) |
562 #if defined(Q_OS_SYMBIAN) |
522 _symbianLocale.LoadSystemSettings(); |
563 _symbianLocale.LoadSystemSettings(); |
605 |
650 |
606 \sa negativeCurrencyFormat(), setNegativeCurrencyFormat() |
651 \sa negativeCurrencyFormat(), setNegativeCurrencyFormat() |
607 */ |
652 */ |
608 |
653 |
609 /*! |
654 /*! |
610 \return the negative currency format from system locale. |
655 Returns the negative currency format from system locale. |
611 */ |
656 |
|
657 \attention Symbian specific API |
|
658 |
|
659 \return the negative currency format for Symbian and HbExtendedLocale::LeadingMinusSign for other platforms |
|
660 */ |
612 HbExtendedLocale::NegativeCurrencyFormat HbExtendedLocale::negativeCurrencyFormat() const |
661 HbExtendedLocale::NegativeCurrencyFormat HbExtendedLocale::negativeCurrencyFormat() const |
613 { |
662 { |
614 #if defined(Q_OS_SYMBIAN) |
663 #if defined(Q_OS_SYMBIAN) |
615 _symbianLocale.LoadSystemSettings(); |
664 _symbianLocale.LoadSystemSettings(); |
616 TLocale::TNegativeCurrencyFormat val = _symbianLocale.GetLocale()->NegativeCurrencyFormat(); |
665 TLocale::TNegativeCurrencyFormat val = _symbianLocale.GetLocale()->NegativeCurrencyFormat(); |
664 #endif |
715 #endif |
665 } |
716 } |
666 |
717 |
667 /*! |
718 /*! |
668 Finds out if the currency symbol is separated by a space from the amount. |
719 Finds out if the currency symbol is separated by a space from the amount. |
669 \return true if negative currency values have a space between the currency symbol and the value; otherwise returns false. |
720 |
|
721 \attention Symbian specific API |
|
722 |
|
723 \return Symbian - True if negative currency values have a space between the currency symbol and the value; otherwise returns false. |
|
724 \return other platforms - false |
670 */ |
725 */ |
671 bool HbExtendedLocale::negativeCurrencySpace() const |
726 bool HbExtendedLocale::negativeCurrencySpace() const |
672 { |
727 { |
673 #if defined(Q_OS_SYMBIAN) |
728 #if defined(Q_OS_SYMBIAN) |
674 _symbianLocale.LoadSystemSettings(); |
729 _symbianLocale.LoadSystemSettings(); |
679 } |
734 } |
680 |
735 |
681 /*! |
736 /*! |
682 Sets whether negative currency values have a space between the currency symbol and the value. |
737 Sets whether negative currency values have a space between the currency symbol and the value. |
683 |
738 |
|
739 \attention Symbian specific API |
|
740 |
684 \param space True to set a flag which indicates that negative currency values should have |
741 \param space True to set a flag which indicates that negative currency values should have |
685 the space between the value and the symbol. False to unset it. |
742 the space between the value and the symbol. False to unset it. |
686 |
743 |
687 \return true for Symbian and false for other OS |
744 \return true for Symbian and false for other OS |
688 */ |
745 */ |
701 |
758 |
702 /*! |
759 /*! |
703 Finds out if the currency symbol is placed on the opposite side with negative |
760 Finds out if the currency symbol is placed on the opposite side with negative |
704 currencies compared to where it is placed with non-negative currencies. |
761 currencies compared to where it is placed with non-negative currencies. |
705 |
762 |
706 \return true if in negative currency values, the position of the currency |
763 \attention Symbian specific API |
|
764 |
|
765 \return Symbian - True if in negative currency values, the position of the currency |
707 symbol is set to be the opposite of the position used for non-negative |
766 symbol is set to be the opposite of the position used for non-negative |
708 values; otherwise returns false. |
767 values; otherwise returns false. |
|
768 \return other platforms - false |
709 */ |
769 */ |
710 bool HbExtendedLocale::negativeCurrencySymbolOpposite() const |
770 bool HbExtendedLocale::negativeCurrencySymbolOpposite() const |
711 { |
771 { |
712 #if defined(Q_OS_SYMBIAN) |
772 #if defined(Q_OS_SYMBIAN) |
713 _symbianLocale.LoadSystemSettings(); |
773 _symbianLocale.LoadSystemSettings(); |
720 /*! |
780 /*! |
721 Sets whether the position of the currency symbol for negative currency |
781 Sets whether the position of the currency symbol for negative currency |
722 values should be the \a opposite of the position used for |
782 values should be the \a opposite of the position used for |
723 non-negative values. |
783 non-negative values. |
724 |
784 |
|
785 \attention Symbian specific API |
|
786 |
725 \return true for Symbian and false for other OS |
787 \return true for Symbian and false for other OS |
726 */ |
788 */ |
727 bool HbExtendedLocale::setNegativeCurrencySymbolOpposite( const bool opposite ) |
789 bool HbExtendedLocale::setNegativeCurrencySymbolOpposite( const bool opposite ) |
728 { |
790 { |
729 #if defined(Q_OS_SYMBIAN) |
791 #if defined(Q_OS_SYMBIAN) |
739 |
801 |
740 /*! |
802 /*! |
741 Finds out if currency triads are used (the grouping of digits in large numbers, for example, 123 456 789). |
803 Finds out if currency triads are used (the grouping of digits in large numbers, for example, 123 456 789). |
742 The Symbian OS only supports the grouping of currency amounts. |
804 The Symbian OS only supports the grouping of currency amounts. |
743 |
805 |
744 \return true if currency triads are allowed in currency values; otherwise returns false. |
806 \attention Symbian specific API |
745 |
807 |
|
808 \return Symbian - True if currency triads are allowed in currency values; otherwise returns false. |
|
809 \return other platforms - false |
746 */ |
810 */ |
747 bool HbExtendedLocale::currencyTriadsAllowed() const |
811 bool HbExtendedLocale::currencyTriadsAllowed() const |
748 { |
812 { |
749 #if defined(Q_OS_SYMBIAN) |
813 #if defined(Q_OS_SYMBIAN) |
750 _symbianLocale.LoadSystemSettings(); |
814 _symbianLocale.LoadSystemSettings(); |
755 } |
819 } |
756 |
820 |
757 /*! |
821 /*! |
758 Sets whether triads are \a allowed in currency values. |
822 Sets whether triads are \a allowed in currency values. |
759 |
823 |
760 \return true for Symbian and false for other CS |
824 \attention Symbian specific API |
|
825 |
|
826 \return true for Symbian and false for other OS |
761 */ |
827 */ |
762 bool HbExtendedLocale::setCurrencyTriadsAllowed( const bool allowed ) |
828 bool HbExtendedLocale::setCurrencyTriadsAllowed( const bool allowed ) |
763 { |
829 { |
764 #if defined(Q_OS_SYMBIAN) |
830 #if defined(Q_OS_SYMBIAN) |
765 _symbianLocale.LoadSystemSettings(); |
831 _symbianLocale.LoadSystemSettings(); |
772 #endif |
838 #endif |
773 } |
839 } |
774 |
840 |
775 |
841 |
776 /*! |
842 /*! |
777 \return true if a space is inserted between the currency symbol and |
843 Returns boolean which tells if currency format contains a space. |
778 a positive currency value; otherwise returns false. |
844 |
779 |
845 \attention Symbian specific API |
780 \note For negative currency values, the space can be inserted using |
846 |
|
847 \return Symbian - True if a space is inserted between the currency symbol and |
|
848 a positive currency value; otherwise returns false. |
|
849 \return other platforms - false |
|
850 |
|
851 \note For negative currency values, the space can be inserted using |
781 setNegativeCurrencySpace(). |
852 setNegativeCurrencySpace(). |
782 */ |
853 */ |
783 bool HbExtendedLocale::currencySpace() const |
854 bool HbExtendedLocale::currencySpace() const |
784 { |
855 { |
785 #if defined(Q_OS_SYMBIAN) |
856 #if defined(Q_OS_SYMBIAN) |
792 |
863 |
793 /*! |
864 /*! |
794 Sets whether a \a space is inserted between the currency symbol and the |
865 Sets whether a \a space is inserted between the currency symbol and the |
795 currency amount. |
866 currency amount. |
796 |
867 |
797 \return true for Symbian and false for other OS |
868 \attention Symbian specific API |
|
869 |
|
870 \return true for Symbian and false for other OS |
798 */ |
871 */ |
799 bool HbExtendedLocale::setCurrencySpace( const bool space ) |
872 bool HbExtendedLocale::setCurrencySpace( const bool space ) |
800 { |
873 { |
801 #if defined(Q_OS_SYMBIAN) |
874 #if defined(Q_OS_SYMBIAN) |
802 _symbianLocale.LoadSystemSettings(); |
875 _symbianLocale.LoadSystemSettings(); |
811 |
884 |
812 |
885 |
813 /*! |
886 /*! |
814 The currency symbol may contain a different number of characters in different countries/regions. |
887 The currency symbol may contain a different number of characters in different countries/regions. |
815 Example: ś, $, Ft, kn, Euro symbol |
888 Example: ś, $, Ft, kn, Euro symbol |
816 \return the currency symbol. |
889 |
|
890 \attention Symbian specific API |
|
891 |
|
892 \return the currency symbol for Symbian and empty QString for other platforms |
817 */ |
893 */ |
818 QString HbExtendedLocale::currencySymbol() const |
894 QString HbExtendedLocale::currencySymbol() const |
819 { |
895 { |
820 // copy from other similar method |
896 // copy from other similar method |
821 #if defined(Q_OS_SYMBIAN) |
897 #if defined(Q_OS_SYMBIAN) |
848 #endif |
926 #endif |
849 } |
927 } |
850 |
928 |
851 /*! |
929 /*! |
852 Retrieves position of the currency symbol (before or after the amount). |
930 Retrieves position of the currency symbol (before or after the amount). |
853 \return the currency symbol position. |
931 |
854 |
932 \attention Symbian specific API |
855 \note For negative currency values, this position may be reversed using |
933 |
|
934 \return Symbian - the currency symbol position |
|
935 \return other platforms - HbExtendedLocale::Before |
|
936 |
|
937 \note For negative currency values, this position may be reversed using |
856 SetNegativeCurrencySymbolOpposite(). |
938 SetNegativeCurrencySymbolOpposite(). |
857 */ |
939 */ |
858 HbExtendedLocale::SymbolPos HbExtendedLocale::currencySymbolPosition() const |
940 HbExtendedLocale::SymbolPos HbExtendedLocale::currencySymbolPosition() const |
859 { |
941 { |
860 #if defined(Q_OS_SYMBIAN) |
942 #if defined(Q_OS_SYMBIAN) |
871 return HbExtendedLocale::Before; |
953 return HbExtendedLocale::Before; |
872 #endif |
954 #endif |
873 } |
955 } |
874 |
956 |
875 /*! |
957 /*! |
876 Sets the currency symbol \a position. |
958 Sets the currency symbol \a position. |
877 |
959 |
878 \return true for Symbian and false for other OS |
960 \attention Symbian specific API |
|
961 |
|
962 \return true for Symbian and false for other OS |
879 */ |
963 */ |
880 bool HbExtendedLocale::setCurrencySymbolPosition( const SymbolPos position ) |
964 bool HbExtendedLocale::setCurrencySymbolPosition( const SymbolPos position ) |
881 { |
965 { |
882 #if defined(Q_OS_SYMBIAN) |
966 #if defined(Q_OS_SYMBIAN) |
883 TLocalePos pos; |
967 TLocalePos pos; |
899 return false; |
983 return false; |
900 #endif |
984 #endif |
901 } |
985 } |
902 |
986 |
903 /*! |
987 /*! |
904 \return the number of decimal places to which currency values are set. |
988 Returns the number of decimal places to which currency values are set. |
|
989 |
|
990 \attention Symbian specific API |
|
991 |
|
992 \return Symbian - the number of decimal place |
|
993 \return other platforms - '0' |
905 */ |
994 */ |
906 int HbExtendedLocale::currencyDecimalPlaces() const |
995 int HbExtendedLocale::currencyDecimalPlaces() const |
907 { |
996 { |
908 #if defined(Q_OS_SYMBIAN) |
997 #if defined(Q_OS_SYMBIAN) |
909 _symbianLocale.LoadSystemSettings(); |
998 _symbianLocale.LoadSystemSettings(); |
912 return 0; |
1001 return 0; |
913 #endif |
1002 #endif |
914 } |
1003 } |
915 |
1004 |
916 /*! |
1005 /*! |
917 Sets the number of decimal \a places to which currency values should be set. |
1006 Sets the number of decimal \a places to which currency values should be set. |
918 |
1007 |
919 \return true for Symbian and false for other OS |
1008 \attention Symbian specific API |
|
1009 |
|
1010 \return true for Symbian and false for other OS |
920 */ |
1011 */ |
921 bool HbExtendedLocale::setCurrencyDecimalPlaces( const int places ) |
1012 bool HbExtendedLocale::setCurrencyDecimalPlaces( const int places ) |
922 { |
1013 { |
923 #if defined(Q_OS_SYMBIAN) |
1014 #if defined(Q_OS_SYMBIAN) |
924 _symbianLocale.LoadSystemSettings(); |
1015 _symbianLocale.LoadSystemSettings(); |
952 /*! |
1043 /*! |
953 Returns a currency \a amount as a string, based on the locale's |
1044 Returns a currency \a amount as a string, based on the locale's |
954 currency and numeric format settings. |
1045 currency and numeric format settings. |
955 These settings include the currency symbol, the symbol's |
1046 These settings include the currency symbol, the symbol's |
956 position and how negative values are formatted. |
1047 position and how negative values are formatted. |
|
1048 |
|
1049 \attention Cross-Platform API |
|
1050 \attention Uses QString::number() function with other platforms than Symbian. |
957 |
1051 |
958 \sa setCurrencyDecimalPlaces(), setCurrencySpace(), setCurrencySymbol(), |
1052 \sa setCurrencyDecimalPlaces(), setCurrencySpace(), setCurrencySymbol(), |
959 setCurrencySymbolPosition(), setNegativeCurrencySpace(), setNegativeCurrencyFormat(), |
1053 setCurrencySymbolPosition(), setNegativeCurrencySpace(), setNegativeCurrencyFormat(), |
960 setCurrencyTriadsAllowed(), setNegativeCurrencySymbolOpposite(), |
1054 setCurrencyTriadsAllowed(), setNegativeCurrencySymbolOpposite(), |
961 setGroupSeparator(), setDecimalPoint() |
1055 setGroupSeparator(), setDecimalPoint() |
1172 { ELangIndonesian_Apac, "id_APAC" } |
1272 { ELangIndonesian_Apac, "id_APAC" } |
1173 }; |
1273 }; |
1174 #endif |
1274 #endif |
1175 |
1275 |
1176 /*! |
1276 /*! |
1177 \return ISO name corresponding to the Symbian language \a code. |
1277 Returns ISO name corresponding to the Symbian language \a code. |
1178 If the code does not does not correspond to any Symbian language, |
1278 If the code does not does not correspond to any Symbian language, |
1179 returns a empty string. |
1279 returns a empty string. |
|
1280 |
|
1281 \attention Symbian specific API |
|
1282 |
|
1283 \return Symbian - ISO style language code |
|
1284 \return other platforms - empty QString |
1180 |
1285 |
1181 \sa User::Language() |
1286 \sa User::Language() |
1182 */ |
1287 */ |
1183 QString HbExtendedLocale::symbianLangToISO( const int code ) |
1288 QString HbExtendedLocale::symbianLangToISO( const int code ) |
1184 { |
1289 { |
1221 return QString(); |
1326 return QString(); |
1222 #endif |
1327 #endif |
1223 } |
1328 } |
1224 |
1329 |
1225 /*! |
1330 /*! |
1226 \return RFC3066 name corresponding to the Symbian language \a code. |
1331 Returns RFC3066 name corresponding to the Symbian language \a code. |
1227 If the code does not does not correspond to any Symbian language, |
1332 If the code does not does not correspond to any Symbian language, |
1228 returns a empty string. |
1333 returns a empty string. |
|
1334 |
|
1335 \attention Symbian specific API |
|
1336 |
|
1337 \return Symbian - RFC3066 style language code |
|
1338 \return other platforms - empty QString |
1229 |
1339 |
1230 \sa User::Language() |
1340 \sa User::Language() |
1231 */ |
1341 */ |
1232 QString HbExtendedLocale::symbianLangToRfc3066( const int code ) |
1342 QString HbExtendedLocale::symbianLangToRfc3066( const int code ) |
1233 { |
1343 { |
1235 } |
1345 } |
1236 |
1346 |
1237 /*! |
1347 /*! |
1238 Converts ISO tag to Symbian language code. |
1348 Converts ISO tag to Symbian language code. |
1239 |
1349 |
|
1350 \attention Symbian specific API |
|
1351 |
1240 \param langAndCountry ISO tag, example "fi_FI" |
1352 \param langAndCountry ISO tag, example "fi_FI" |
1241 |
1353 |
1242 \return Symbian language code or -1 (failed case) |
1354 \return Symbian language code if successful. With other platforms or if case fails then '-1'. |
1243 */ |
1355 */ |
1244 int HbExtendedLocale::ISOToSymbianLang( const QString &langAndCountry ) |
1356 int HbExtendedLocale::ISOToSymbianLang( const QString &langAndCountry ) |
1245 { |
1357 { |
1246 #if defined(Q_OS_SYMBIAN) |
1358 #if defined(Q_OS_SYMBIAN) |
1247 |
1359 |
1285 #endif |
1397 #endif |
1286 |
1398 |
1287 /*! |
1399 /*! |
1288 Returns a Qt version of the given \a sys_fmt Symbian datetime format string. |
1400 Returns a Qt version of the given \a sys_fmt Symbian datetime format string. |
1289 Some convertable fields use data from current system locale, |
1401 Some convertable fields use data from current system locale, |
1290 unwanted locale may cause unexpected results. |
1402 unwanted locale may cause unexpected results. |
|
1403 |
|
1404 \attention Symbian specific API |
|
1405 |
|
1406 \return Symbian - datetime format string |
|
1407 \return other platforms - "not supported" |
1291 */ |
1408 */ |
1292 QString HbExtendedLocale::symbianDateTimeToQt( const QString &sys_fmt ) |
1409 QString HbExtendedLocale::symbianDateTimeToQt( const QString &sys_fmt ) |
1293 { |
1410 { |
1294 #if defined(Q_OS_SYMBIAN) |
1411 #if defined(Q_OS_SYMBIAN) |
1295 _symbianLocale.LoadSystemSettings(); |
1412 _symbianLocale.LoadSystemSettings(); |
1656 |
1773 |
1657 /*! |
1774 /*! |
1658 \enum HbExtendedLocale::WeekDay |
1775 \enum HbExtendedLocale::WeekDay |
1659 This enum defines weekdays. |
1776 This enum defines weekdays. |
1660 |
1777 |
1661 \sa startOfWeek() |
1778 \sa startOfWeek() |
1662 */ |
1779 */ |
1663 |
1780 |
1664 /*! |
1781 /*! |
1665 Gets first day of the week. |
1782 Gets first day of the week. |
1666 It is usually Saturday, Sunday or Monday, but the Symbian OS allows setting any weekday as the first. |
1783 It is usually Saturday, Sunday or Monday, but the Symbian OS allows setting any weekday as the first. |
1667 Returns enum WeekDay. |
1784 |
1668 |
1785 \attention Symbian specific API |
1669 \return Monday for other OS |
1786 |
|
1787 \return Symbian - enum of WeekDay |
|
1788 \return other platforms - HbExtendedLocale::Monday |
1670 */ |
1789 */ |
1671 HbExtendedLocale::WeekDay HbExtendedLocale::startOfWeek() const |
1790 HbExtendedLocale::WeekDay HbExtendedLocale::startOfWeek() const |
1672 { |
1791 { |
1673 #if defined(Q_OS_SYMBIAN) |
1792 #if defined(Q_OS_SYMBIAN) |
1674 _symbianLocale.LoadSystemSettings(); |
1793 _symbianLocale.LoadSystemSettings(); |
1742 #endif |
1866 #endif |
1743 } |
1867 } |
1744 |
1868 |
1745 |
1869 |
1746 /*! |
1870 /*! |
1747 Gets days which are working days of week. |
1871 Gets days which are working days of week. |
1748 Returns QString which describes workdays as binary array. |
1872 1 meaning workday and 0 as non working day. |
1749 1 meaning workday and 0 as non working day. |
1873 |
1750 |
1874 \attention Symbian specific API |
1751 \return 0011111 for other OS |
1875 |
1752 |
1876 \return Symbian - QString which describes workdays as binary array |
1753 \sa setWorkDays() |
1877 \return other platforms - "0011111" |
|
1878 |
|
1879 \sa setWorkDays() |
1754 */ |
1880 */ |
1755 QString HbExtendedLocale::workDays() const |
1881 QString HbExtendedLocale::workDays() const |
1756 { |
1882 { |
1757 #if defined(Q_OS_SYMBIAN) |
1883 #if defined(Q_OS_SYMBIAN) |
1758 _symbianLocale.LoadSystemSettings(); |
1884 _symbianLocale.LoadSystemSettings(); |
1766 return QString("0011111"); |
1892 return QString("0011111"); |
1767 #endif |
1893 #endif |
1768 } |
1894 } |
1769 |
1895 |
1770 /*! |
1896 /*! |
1771 Sets working days of week. |
1897 Sets working days of week. |
|
1898 |
|
1899 \attention Symbian specific API |
|
1900 |
1772 \param days which describes workdays as QString binary array. |
1901 \param days which describes workdays as QString binary array. |
1773 1 meaning workday and 0 non workday. |
1902 1 meaning workday and 0 non workday. |
1774 |
1903 |
1775 \return true for Symbian if succesfull and false for other OS |
1904 \return true for Symbian if succesfull and false for other OS |
1776 |
1905 |
1796 return false; |
1925 return false; |
1797 #endif |
1926 #endif |
1798 } |
1927 } |
1799 |
1928 |
1800 /*! |
1929 /*! |
1801 Checks whether or not daylight saving is set for the home city |
1930 Checks whether or not daylight saving is set for the home city. |
1802 \return True if home daylight saving is set, false if home daylight saving is not set |
1931 |
|
1932 \attention Symbian specific API |
|
1933 |
|
1934 \return Symbian - True if home daylight saving is set. False if home daylight saving is not set. |
|
1935 \return other platforms - false |
1803 */ |
1936 */ |
1804 |
1937 |
1805 bool HbExtendedLocale::homeHasDaylightSavingOn() const |
1938 bool HbExtendedLocale::homeHasDaylightSavingOn() const |
1806 { |
1939 { |
1807 #if defined(Q_OS_SYMBIAN) |
1940 #if defined(Q_OS_SYMBIAN) |
1813 } |
1946 } |
1814 |
1947 |
1815 /*! |
1948 /*! |
1816 Returns the daylight saving zone in which the home city is located. |
1949 Returns the daylight saving zone in which the home city is located. |
1817 |
1950 |
|
1951 \attention Symbian specific API |
|
1952 |
1818 \value Home Home daylight saving zone |
1953 \value Home Home daylight saving zone |
1819 \value European European daylight saving zone |
1954 \value European European daylight saving zone |
1820 \value Northern Northern hemisphere (non-European) daylight saving zone |
1955 \value Northern Northern hemisphere (non-European) daylight saving zone |
1821 \value Southern Southern hemisphere daylight saving zone |
1956 \value Southern Southern hemisphere daylight saving zone |
1822 \value None No daylight saving zone |
1957 \value None No daylight saving zone |
|
1958 |
|
1959 \return Symbian - the daylight saving zone |
|
1960 \return other platforms - HbExtendedLocale::None |
1823 |
1961 |
1824 \sa setHomeDaylightSavingZone() |
1962 \sa setHomeDaylightSavingZone() |
1825 */ |
1963 */ |
1826 HbExtendedLocale::DaylightSavingZone HbExtendedLocale::homeDaylightSavingZone() const |
1964 HbExtendedLocale::DaylightSavingZone HbExtendedLocale::homeDaylightSavingZone() const |
1827 { |
1965 { |
1845 return HbExtendedLocale::None; |
1983 return HbExtendedLocale::None; |
1846 #endif |
1984 #endif |
1847 } |
1985 } |
1848 |
1986 |
1849 /*! |
1987 /*! |
1850 Gets the locale’s universal time offset |
1988 Gets the locale’s universal time offset. |
|
1989 |
|
1990 \attention Symbian specific API |
|
1991 |
1851 \return Offset in seconds from universal time. For other platforms it returns 0. |
1992 \return Offset in seconds from universal time. For other platforms it returns 0. |
1852 */ |
1993 */ |
1853 int HbExtendedLocale::universalTimeOffset() const |
1994 int HbExtendedLocale::universalTimeOffset() const |
1854 { |
1995 { |
1855 #if defined(Q_OS_SYMBIAN) |
1996 #if defined(Q_OS_SYMBIAN) |
1859 #else |
2000 #else |
1860 return 0; |
2001 return 0; |
1861 #endif |
2002 #endif |
1862 } |
2003 } |
1863 |
2004 |
|
2005 /*! |
|
2006 Constructor of HbExtendedLocale. |
|
2007 |
|
2008 \attention Cross-Platform API |
|
2009 */ |
1864 HbExtendedLocale::HbExtendedLocale() |
2010 HbExtendedLocale::HbExtendedLocale() |
1865 { |
2011 { |
1866 #if defined(Q_OS_SYMBIAN) |
2012 #if defined(Q_OS_SYMBIAN) |
1867 QLocale::system(); |
2013 QLocale::system(); |
1868 _symbianLocale.LoadSystemSettings(); |
2014 _symbianLocale.LoadSystemSettings(); |
1869 #endif |
2015 #endif |
1870 } |
2016 } |
1871 |
2017 |
1872 //! Returns new/dummy copy of HbExtendedLocale. |
2018 /*! |
|
2019 Returns new/dummy copy of HbExtendedLocale. |
|
2020 |
|
2021 \attention Cross-Platform API |
|
2022 */ |
1873 HbExtendedLocale HbExtendedLocale::system() |
2023 HbExtendedLocale HbExtendedLocale::system() |
1874 { |
2024 { |
1875 // make sure QLocale's lp is updated if in future QApplication does not do it |
2025 // make sure QLocale's lp is updated if in future QApplication does not do it |
1876 // currently this does not do anything |
2026 // currently this does not do anything |
1877 // just return default set locale |
2027 // just return default set locale |
1881 /*! |
2031 /*! |
1882 Formats the given date to a string according to the given date format. |
2032 Formats the given date to a string according to the given date format. |
1883 For example, what date components are included, and if leading zeroes are used. |
2033 For example, what date components are included, and if leading zeroes are used. |
1884 This is a function uses the date formats defined in the hbi18ndef.h header file. |
2034 This is a function uses the date formats defined in the hbi18ndef.h header file. |
1885 |
2035 |
|
2036 \attention Cross-Platform API |
|
2037 |
1886 \param date The date to be formatted. |
2038 \param date The date to be formatted. |
1887 \param dateFormat The wanted format to be used. |
2039 \param dateFormat The wanted format to be used. |
1888 |
2040 |
1889 \return The date as a string. |
2041 \return the date as a string |
1890 */ |
2042 */ |
1891 QString HbExtendedLocale::format( const QDate &date, const QString &dateFormat ) |
2043 QString HbExtendedLocale::format( const QDate &date, const QString &dateFormat ) |
1892 { |
2044 { |
1893 #if defined(Q_OS_SYMBIAN) |
2045 #if defined(Q_OS_SYMBIAN) |
1894 QScopedPointer<CTrapCleanup> sp; |
2046 QScopedPointer<CTrapCleanup> sp; |
1938 } |
2090 } |
1939 return TDesC2QString(s60DateStr->Des()); |
2091 return TDesC2QString(s60DateStr->Des()); |
1940 |
2092 |
1941 #else |
2093 #else |
1942 Q_UNUSED(dateFormat); |
2094 Q_UNUSED(dateFormat); |
1943 return toString(date, ShortFormat ); |
2095 return toString(date, ShortFormat ); |
1944 #endif |
2096 #endif |
1945 } |
2097 } |
1946 |
2098 |
1947 /*! |
2099 /*! |
1948 Formats the given time to a string according to the given time format. |
2100 Formats the given time to a string according to the given time format. |
1949 For example, what components are included (hours/minutes/seconds), and if leading zeroes and AM/PM or am/pm symbols are used. |
2101 For example, what components are included (hours/minutes/seconds), and if leading zeroes and AM/PM or am/pm symbols are used. |
1950 This is a function uses the time formats defined in the hbi18ndef.h header file. |
2102 This is a function uses the time formats defined in the hbi18ndef.h header file. |
1951 |
2103 |
1952 \param time The time to be formatted. |
2104 \attention Cross-Platform API |
1953 \param timeFormat The wanted format to be used. |
2105 |
|
2106 \param time The time to be formatted. |
|
2107 \param timeFormat The wanted format to be used. |
1954 |
2108 |
1955 \return The time as a string. |
2109 \return the time as a string |
1956 */ |
2110 */ |
1957 QString HbExtendedLocale::format( const QTime &time, const QString &timeFormat ) |
2111 QString HbExtendedLocale::format( const QTime &time, const QString &timeFormat ) |
1958 { |
2112 { |
1959 #if defined(Q_OS_SYMBIAN) |
2113 #if defined(Q_OS_SYMBIAN) |
1960 QScopedPointer<CTrapCleanup> sp; |
2114 QScopedPointer<CTrapCleanup> sp; |