a9faf94392
values * added locking to BLocale (needed since the data of the global object may change any time) * BLocale no longer passes out pointers to internal objects, it fill objects passed in by the client instead (just like be_locale_roster does) * dropped default language as member from RosterData, it is no part of the default locale * fleshed out implementation of TimeUnitFormat and DurationFormat, both of which can now be given a BLocale in order to set the strings being used during formatting git-svn-id: file:///srv/svn/repos/haiku/haiku/trunk@38428 a95241bf-73f2-0310-859d-f6bbb57e9c96
50 lines
1.0 KiB
C++
50 lines
1.0 KiB
C++
/*
|
|
* Copyright 2010, Haiku, Inc.
|
|
* Distributed under the terms of the MIT License.
|
|
*/
|
|
#ifndef _B_DURATION_FORMAT_H_
|
|
#define _B_DURATION_FORMAT_H_
|
|
|
|
|
|
#include <Format.h>
|
|
#include <String.h>
|
|
#include <TimeUnitFormat.h>
|
|
|
|
|
|
class BTimeZone;
|
|
|
|
namespace icu_44 {
|
|
class GregorianCalendar;
|
|
}
|
|
|
|
|
|
class BDurationFormat : public BFormat {
|
|
typedef BFormat Inherited;
|
|
|
|
public:
|
|
BDurationFormat(
|
|
const BString& separator = ", ");
|
|
BDurationFormat(const BDurationFormat& other);
|
|
virtual ~BDurationFormat();
|
|
|
|
BDurationFormat& operator=(const BDurationFormat& other);
|
|
|
|
void SetSeparator(const BString& separator);
|
|
|
|
virtual status_t SetLocale(const BLocale* locale);
|
|
status_t SetTimeZone(const BTimeZone* timeZone);
|
|
|
|
status_t Format(bigtime_t startValue,
|
|
bigtime_t stopValue, BString* buffer,
|
|
time_unit_style style = B_TIME_UNIT_FULL
|
|
) const;
|
|
|
|
private:
|
|
BString fSeparator;
|
|
BTimeUnitFormat fTimeUnitFormat;
|
|
icu_44::GregorianCalendar* fCalendar;
|
|
};
|
|
|
|
|
|
#endif
|