| 1 |
// Copyright 2013-2015 The Servo Project Developers. See the COPYRIGHT |
| 2 |
// file at the top-level directory of this distribution. |
| 3 |
// |
| 4 |
// Licensed under the Apache License, Version 2.0 <LICENSE-APACHE or |
| 5 |
// http://www.apache.org/licenses/LICENSE-2.0> or the MIT license |
| 6 |
// <LICENSE-MIT or http://opensource.org/licenses/MIT>, at your |
| 7 |
// option. This file may not be copied, modified, or distributed |
| 8 |
// except according to those terms. |
| 9 |
|
| 10 |
use std::os::raw::c_void; |
| 11 |
|
| 12 |
use crate::array::CFArrayRef; |
| 13 |
use crate::base::{Boolean, CFAllocatorRef, CFIndex, CFTypeID}; |
| 14 |
use crate::data::CFDataRef; |
| 15 |
use crate::date::{CFAbsoluteTime, CFTimeInterval}; |
| 16 |
use crate::dictionary::CFDictionaryRef; |
| 17 |
use crate::locale::CFLocaleRef; |
| 18 |
use crate::notification_center::CFNotificationName; |
| 19 |
use crate::string::CFStringRef; |
| 20 |
|
| 21 |
#[repr(C)] |
| 22 |
pub struct __CFTimeZone(c_void); |
| 23 |
|
| 24 |
pub type CFTimeZoneRef = *const __CFTimeZone; |
| 25 |
pub type CFTimeZoneNameStyle = CFIndex; |
| 26 |
|
| 27 |
/* Constants to specify styles for time zone names */ |
| 28 |
pub const kCFTimeZoneNameStyleStandard: CFTimeZoneNameStyle = 0; |
| 29 |
pub const kCFTimeZoneNameStyleShortStandard: CFTimeZoneNameStyle = 1; |
| 30 |
pub const kCFTimeZoneNameStyleDaylightSaving: CFTimeZoneNameStyle = 2; |
| 31 |
pub const kCFTimeZoneNameStyleShortDaylightSaving: CFTimeZoneNameStyle = 3; |
| 32 |
pub const kCFTimeZoneNameStyleGeneric: CFTimeZoneNameStyle = 4; |
| 33 |
pub const kCFTimeZoneNameStyleShortGeneric: CFTimeZoneNameStyle = 5; |
| 34 |
|
| 35 |
extern "C" { |
| 36 |
/* |
| 37 |
* CFTimeZone.h |
| 38 |
*/ |
| 39 |
|
| 40 |
pub static kCFTimeZoneSystemTimeZoneDidChangeNotification: CFNotificationName; |
| 41 |
|
| 42 |
/* Creating a Time Zone */ |
| 43 |
pub fn CFTimeZoneCreate( |
| 44 |
allocator: CFAllocatorRef, |
| 45 |
name: CFStringRef, |
| 46 |
data: CFDataRef, |
| 47 |
) -> CFTimeZoneRef; |
| 48 |
pub fn CFTimeZoneCreateWithName( |
| 49 |
allocator: CFAllocatorRef, |
| 50 |
name: CFStringRef, |
| 51 |
tryAbbrev: Boolean, |
| 52 |
) -> CFTimeZoneRef; |
| 53 |
pub fn CFTimeZoneCreateWithTimeIntervalFromGMT( |
| 54 |
allocator: CFAllocatorRef, |
| 55 |
interval: CFTimeInterval, |
| 56 |
) -> CFTimeZoneRef; |
| 57 |
|
| 58 |
/* System and Default Time Zones and Information */ |
| 59 |
pub fn CFTimeZoneCopyAbbreviationDictionary() -> CFDictionaryRef; |
| 60 |
pub fn CFTimeZoneCopyAbbreviation(tz: CFTimeZoneRef, at: CFAbsoluteTime) -> CFStringRef; |
| 61 |
pub fn CFTimeZoneCopyDefault() -> CFTimeZoneRef; |
| 62 |
pub fn CFTimeZoneCopySystem() -> CFTimeZoneRef; |
| 63 |
pub fn CFTimeZoneSetDefault(tz: CFTimeZoneRef); |
| 64 |
pub fn CFTimeZoneCopyKnownNames() -> CFArrayRef; |
| 65 |
pub fn CFTimeZoneResetSystem(); |
| 66 |
pub fn CFTimeZoneSetAbbreviationDictionary(dict: CFDictionaryRef); |
| 67 |
|
| 68 |
/* Getting Information About Time Zones */ |
| 69 |
pub fn CFTimeZoneGetName(tz: CFTimeZoneRef) -> CFStringRef; |
| 70 |
pub fn CFTimeZoneCopyLocalizedName( |
| 71 |
tz: CFTimeZoneRef, |
| 72 |
style: CFTimeZoneNameStyle, |
| 73 |
locale: CFLocaleRef, |
| 74 |
) -> CFStringRef; |
| 75 |
pub fn CFTimeZoneGetSecondsFromGMT(tz: CFTimeZoneRef, time: CFAbsoluteTime) -> CFTimeInterval; |
| 76 |
pub fn CFTimeZoneGetData(tz: CFTimeZoneRef) -> CFDataRef; |
| 77 |
|
| 78 |
/* Getting Daylight Savings Time Information */ |
| 79 |
pub fn CFTimeZoneIsDaylightSavingTime(tz: CFTimeZoneRef, at: CFAbsoluteTime) -> Boolean; |
| 80 |
pub fn CFTimeZoneGetDaylightSavingTimeOffset( |
| 81 |
tz: CFTimeZoneRef, |
| 82 |
at: CFAbsoluteTime, |
| 83 |
) -> CFTimeInterval; |
| 84 |
pub fn CFTimeZoneGetNextDaylightSavingTimeTransition( |
| 85 |
tz: CFTimeZoneRef, |
| 86 |
at: CFAbsoluteTime, |
| 87 |
) -> CFAbsoluteTime; |
| 88 |
|
| 89 |
/* Getting the CFTimeZone Type ID */ |
| 90 |
pub fn CFTimeZoneGetTypeID() -> CFTypeID; |
| 91 |
} |