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>
|
2010-08-02 00:28:19 +04:00
|
|
|
#include <String.h>
|
|
|
|
#include <TimeUnitFormat.h>
|
|
|
|
|
|
|
|
|
2010-08-30 00:55:00 +04:00
|
|
|
class BTimeZone;
|
|
|
|
|
2011-08-19 02:13:06 +04:00
|
|
|
namespace icu {
|
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:
|
2010-08-30 00:55:00 +04:00
|
|
|
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);
|
|
|
|
|
2010-08-02 00:28:19 +04:00
|
|
|
status_t Format(bigtime_t startValue,
|
|
|
|
bigtime_t stopValue, BString* buffer,
|
2010-08-30 00:55:00 +04:00
|
|
|
time_unit_style style = B_TIME_UNIT_FULL
|
2010-08-02 00:28:19 +04:00
|
|
|
) const;
|
2010-08-30 00:55:00 +04:00
|
|
|
|
|
|
|
private:
|
|
|
|
BString fSeparator;
|
|
|
|
BTimeUnitFormat fTimeUnitFormat;
|
2011-08-19 02:13:06 +04:00
|
|
|
icu::GregorianCalendar* fCalendar;
|
2010-08-02 00:28:19 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
|
|
|
|
#endif
|