1 2 3 4 5 6 7 8 9 10 11 12 13 14 15 16 17 18 19 20 21 22 23 24 25 26 27 28 29 30 31 32 33 34 35 36 37 38 39 40 41 42 43 44 45 46 47 48 49 50 51 52 53 54 55 56 57 58 59 60 61
// SPDX-FileCopyrightText: 2023 Klarälvdalens Datakonsult AB, a KDAB Group company <info@kdab.com>
// SPDX-FileContributor: Andrew Hayzen <andrew.hayzen@kdab.com>
//
// SPDX-License-Identifier: MIT OR Apache-2.0
#[cxx::bridge(namespace = "Qt")]
mod ffi {
/// This enum type defines what happens to the aspect ratio when scaling an rectangle.
#[repr(i32)]
enum AspectRatioMode {
/// The size is scaled freely. The aspect ratio is not preserved.
IgnoreAspectRatio,
/// The size is scaled to a rectangle as large as possible inside a given rectangle, preserving the aspect ratio.
KeepAspectRatio,
/// The size is scaled to a rectangle as small as possible outside a given rectangle, preserving the aspect ratio.
KeepAspectRatioByExpanding,
}
#[repr(i32)]
enum CaseSensitivity {
CaseInsensitive,
CaseSensitive,
}
#[repr(i32)]
enum DateFormat {
TextDate = 0,
ISODateWithMs = 9,
ISODate = 1,
RFC2822Date = 8,
}
#[repr(i32)]
enum SplitBehaviorFlags {
KeepEmptyParts,
SkipEmptyParts,
}
#[repr(i32)]
enum TimeSpec {
/// Local time, controlled by a system time-zone setting.
LocalTime,
/// Coordinated Universal Time.
UTC,
/// An offset in seconds from Coordinated Universal Time.
OffsetFromUTC,
/// A named time zone.
TimeZone,
}
unsafe extern "C++" {
include!("cxx-qt-lib/qt.h");
type AspectRatioMode;
type CaseSensitivity;
type DateFormat;
type SplitBehaviorFlags;
type TimeSpec;
}
}
pub use ffi::{AspectRatioMode, CaseSensitivity, DateFormat, SplitBehaviorFlags, TimeSpec};