2 // Tizen Web Device API
3 // Copyright (c) 2012 Samsung Electronics Co., Ltd.
5 // Licensed under the Apache License, Version 2.0 (the License);
6 // you may not use this file except in compliance with the License.
7 // You may obtain a copy of the License at
9 // http://www.apache.org/licenses/LICENSE-2.0
11 // Unless required by applicable law or agreed to in writing, software
12 // distributed under the License is distributed on an "AS IS" BASIS,
13 // WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
14 // See the License for the specific language governing permissions and
15 // limitations under the License.
27 #include <unicode/calendar.h>
29 #include "TZDateProperties.h"
30 #include "DurationProperties.h"
48 TZDATE_DAY_OF_WEEK_IN_MONTH,
66 TZDate(const bool isNotNull = TRUE);
67 TZDate(const std::string &timezone);
68 TZDate(const TZDateProperties &properties);
71 virtual bool isNull();
72 virtual long get(const TZDateFields field);
73 virtual std::string getTimezone();
74 virtual TZDateProperties toTimezone(const std::string timezone);
75 virtual void set(const TZDateFields field, const long value);
77 virtual long getUTC(const TZDateFields field);
78 virtual void setUTC(const TZDateFields field, const long value);
80 virtual long long difference(const TZDateProperties &prop);
81 virtual TZDateProperties addDuration(const DurationProperties &duration);
82 virtual std::string getUTCTimezoneName();
83 virtual std::string getLocalTimezoneName();
84 virtual TZDateProperties makeProperties();
86 virtual double getTime();
87 virtual bool setTime(const double time);
88 virtual std::string toDateString(bool bLocale = false) ;
89 virtual std::string toTimeString(bool bLocale = false);
90 virtual std::string toString(bool bLocale = false);
92 virtual std::string getTimezoneAbbreviation();
93 virtual long secondsFromUTC();
95 virtual TZDateProperties getDSTTransition(DSTTransition trans);
98 long _get(const TZDateFields field, icu::Calendar *cal);
99 std::string _getTimezoneName(icu::Calendar *cal);
100 const UCalendarDateFields _convertDateField(const TZDateFields field);
102 icu::Calendar * _makeCalendar(const TZDateProperties &properties);
103 TZDateProperties _makeProperties(icu::Calendar *cal);
105 icu::Calendar *myCalendar;
109 typedef DPL::SharedPtr<TZDate> TZDatePtr;
114 #endif /* _DATETIME_H_ */