2010-08-02 00:28:19 +04:00
|
|
|
/*
|
2011-08-19 02:13:06 +04:00
|
|
|
* Copyright 2010-2011, Haiku, Inc.
|
2010-08-02 00:28:19 +04:00
|
|
|
* Distributed under the terms of the MIT License.
|
|
|
|
*/
|
|
|
|
#ifndef _B_DURATION_FORMAT_H_
|
|
|
|
#define _B_DURATION_FORMAT_H_
|
|
|
|
|
|
|
|
|
2010-08-30 00:55:00 +04:00
|
|
|
#include <Format.h>
|
2014-10-01 16:24:15 +04:00
|
|
|
#include <Locale.h>
|
2010-08-02 00:28:19 +04:00
|
|
|
#include <String.h>
|
|
|
|
#include <TimeUnitFormat.h>
|
|
|
|
|
|
|
|
|
2010-08-30 00:55:00 +04:00
|
|
|
class BTimeZone;
|
|
|
|
|
2015-05-10 22:13:59 +03:00
|
|
|
#ifndef U_ICU_NAMESPACE
|
|
|
|
#define U_ICU_NAMESPACE icu
|
|
|
|
#endif
|
|
|
|
namespace U_ICU_NAMESPACE {
|
2010-08-30 00:55:00 +04:00
|
|
|
class GregorianCalendar;
|
|
|
|
}
|
|
|
|
|
|
|
|
|
2010-08-02 00:28:19 +04:00
|
|
|
class BDurationFormat : public BFormat {
|
2010-08-30 00:55:00 +04:00
|
|
|
typedef BFormat Inherited;
|
|
|
|
|
2010-08-02 00:28:19 +04:00
|
|
|
public:
|
2014-10-27 11:05:48 +03:00
|
|
|
BDurationFormat(const BLanguage& language,
|
|
|
|
const BFormattingConventions& conventions,
|
2017-05-17 01:16:31 +03:00
|
|
|
const BString& separator = ", ",
|
|
|
|
const time_unit_style style = B_TIME_UNIT_FULL);
|
|
|
|
BDurationFormat(const BString& separator = ", ",
|
|
|
|
const time_unit_style style = B_TIME_UNIT_FULL);
|
2010-08-30 00:55:00 +04:00
|
|
|
BDurationFormat(const BDurationFormat& other);
|
|
|
|
virtual ~BDurationFormat();
|
|
|
|
|
|
|
|
void SetSeparator(const BString& separator);
|
|
|
|
status_t SetTimeZone(const BTimeZone* timeZone);
|
|
|
|
|
2014-10-01 20:13:35 +04:00
|
|
|
status_t Format(BString& buffer,
|
|
|
|
const bigtime_t startValue,
|
2017-11-11 01:59:01 +03:00
|
|
|
const bigtime_t stopValue) const;
|
2010-08-30 00:55:00 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
BString fSeparator;
|
|
|
|
BTimeUnitFormat fTimeUnitFormat;
|
2015-05-10 22:13:59 +03:00
|
|
|
U_ICU_NAMESPACE::GregorianCalendar* fCalendar;
|
2010-08-02 00:28:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|