use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
#[cfg(feature = "objc2-core-foundation")]
use objc2_core_foundation::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct NSRulerOrientation(pub NSUInteger);
impl NSRulerOrientation {
#[doc(alias = "NSHorizontalRuler")]
pub const HorizontalRuler: Self = Self(0);
#[doc(alias = "NSVerticalRuler")]
pub const VerticalRuler: Self = Self(1);
}
unsafe impl Encode for NSRulerOrientation {
const ENCODING: Encoding = NSUInteger::ENCODING;
}
unsafe impl RefEncode for NSRulerOrientation {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type NSRulerViewUnitName = NSString;
extern "C" {
pub static NSRulerViewUnitInches: &'static NSRulerViewUnitName;
}
extern "C" {
pub static NSRulerViewUnitCentimeters: &'static NSRulerViewUnitName;
}
extern "C" {
pub static NSRulerViewUnitPoints: &'static NSRulerViewUnitName;
}
extern "C" {
pub static NSRulerViewUnitPicas: &'static NSRulerViewUnitName;
}
extern_class!(
#[unsafe(super(NSView, NSResponder, NSObject))]
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
pub struct NSRulerView;
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibility for NSRulerView {}
);
#[cfg(all(
feature = "NSAccessibilityProtocols",
feature = "NSResponder",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSAccessibilityElementProtocol for NSRulerView {}
);
#[cfg(all(feature = "NSAnimation", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSAnimatablePropertyContainer for NSRulerView {}
);
#[cfg(all(feature = "NSAppearance", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSAppearanceCustomization for NSRulerView {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSCoding for NSRulerView {}
);
#[cfg(all(feature = "NSDragging", feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSDraggingDestination for NSRulerView {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
extern_conformance!(
unsafe impl NSObjectProtocol for NSRulerView {}
);
#[cfg(all(
feature = "NSResponder",
feature = "NSUserInterfaceItemIdentification",
feature = "NSView"
))]
extern_conformance!(
unsafe impl NSUserInterfaceItemIdentification for NSRulerView {}
);
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSRulerView {
extern_methods!(
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(registerUnitWithName:abbreviation:unitToPointsConversionFactor:stepUpCycle:stepDownCycle:))]
#[unsafe(method_family = none)]
pub fn registerUnitWithName_abbreviation_unitToPointsConversionFactor_stepUpCycle_stepDownCycle(
unit_name: &NSRulerViewUnitName,
abbreviation: &NSString,
conversion_factor: CGFloat,
step_up_cycle: &NSArray<NSNumber>,
step_down_cycle: &NSArray<NSNumber>,
mtm: MainThreadMarker,
);
#[unsafe(method(initWithCoder:))]
#[unsafe(method_family = init)]
pub unsafe fn initWithCoder(this: Allocated<Self>, coder: &NSCoder) -> Retained<Self>;
#[cfg(feature = "NSScrollView")]
#[unsafe(method(initWithScrollView:orientation:))]
#[unsafe(method_family = init)]
pub fn initWithScrollView_orientation(
this: Allocated<Self>,
scroll_view: Option<&NSScrollView>,
orientation: NSRulerOrientation,
) -> Retained<Self>;
#[cfg(feature = "NSScrollView")]
#[unsafe(method(scrollView))]
#[unsafe(method_family = none)]
pub fn scrollView(&self) -> Option<Retained<NSScrollView>>;
#[cfg(feature = "NSScrollView")]
#[unsafe(method(setScrollView:))]
#[unsafe(method_family = none)]
pub fn setScrollView(&self, scroll_view: Option<&NSScrollView>);
#[unsafe(method(orientation))]
#[unsafe(method_family = none)]
pub fn orientation(&self) -> NSRulerOrientation;
#[unsafe(method(setOrientation:))]
#[unsafe(method_family = none)]
pub fn setOrientation(&self, orientation: NSRulerOrientation);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(baselineLocation))]
#[unsafe(method_family = none)]
pub fn baselineLocation(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(requiredThickness))]
#[unsafe(method_family = none)]
pub fn requiredThickness(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(ruleThickness))]
#[unsafe(method_family = none)]
pub fn ruleThickness(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setRuleThickness:))]
#[unsafe(method_family = none)]
pub fn setRuleThickness(&self, rule_thickness: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(reservedThicknessForMarkers))]
#[unsafe(method_family = none)]
pub fn reservedThicknessForMarkers(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setReservedThicknessForMarkers:))]
#[unsafe(method_family = none)]
pub fn setReservedThicknessForMarkers(&self, reserved_thickness_for_markers: CGFloat);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(reservedThicknessForAccessoryView))]
#[unsafe(method_family = none)]
pub fn reservedThicknessForAccessoryView(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setReservedThicknessForAccessoryView:))]
#[unsafe(method_family = none)]
pub fn setReservedThicknessForAccessoryView(
&self,
reserved_thickness_for_accessory_view: CGFloat,
);
#[unsafe(method(measurementUnits))]
#[unsafe(method_family = none)]
pub fn measurementUnits(&self) -> Retained<NSRulerViewUnitName>;
#[unsafe(method(setMeasurementUnits:))]
#[unsafe(method_family = none)]
pub fn setMeasurementUnits(&self, measurement_units: &NSRulerViewUnitName);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(originOffset))]
#[unsafe(method_family = none)]
pub fn originOffset(&self) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(setOriginOffset:))]
#[unsafe(method_family = none)]
pub fn setOriginOffset(&self, origin_offset: CGFloat);
#[unsafe(method(clientView))]
#[unsafe(method_family = none)]
pub fn clientView(&self) -> Option<Retained<NSView>>;
#[unsafe(method(setClientView:))]
#[unsafe(method_family = none)]
pub fn setClientView(&self, client_view: Option<&NSView>);
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(addMarker:))]
#[unsafe(method_family = none)]
pub fn addMarker(&self, marker: &NSRulerMarker);
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(removeMarker:))]
#[unsafe(method_family = none)]
pub fn removeMarker(&self, marker: &NSRulerMarker);
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(markers))]
#[unsafe(method_family = none)]
pub fn markers(&self) -> Option<Retained<NSArray<NSRulerMarker>>>;
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(setMarkers:))]
#[unsafe(method_family = none)]
pub fn setMarkers(&self, markers: Option<&NSArray<NSRulerMarker>>);
#[cfg(all(feature = "NSEvent", feature = "NSRulerMarker"))]
#[unsafe(method(trackMarker:withMouseEvent:))]
#[unsafe(method_family = none)]
pub fn trackMarker_withMouseEvent(&self, marker: &NSRulerMarker, event: &NSEvent) -> bool;
#[unsafe(method(accessoryView))]
#[unsafe(method_family = none)]
pub fn accessoryView(&self) -> Option<Retained<NSView>>;
#[unsafe(method(setAccessoryView:))]
#[unsafe(method_family = none)]
pub fn setAccessoryView(&self, accessory_view: Option<&NSView>);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(moveRulerlineFromLocation:toLocation:))]
#[unsafe(method_family = none)]
pub fn moveRulerlineFromLocation_toLocation(
&self,
old_location: CGFloat,
new_location: CGFloat,
);
#[unsafe(method(invalidateHashMarks))]
#[unsafe(method_family = none)]
pub fn invalidateHashMarks(&self);
#[unsafe(method(drawHashMarksAndLabelsInRect:))]
#[unsafe(method_family = none)]
pub fn drawHashMarksAndLabelsInRect(&self, rect: NSRect);
#[unsafe(method(drawMarkersInRect:))]
#[unsafe(method_family = none)]
pub fn drawMarkersInRect(&self, rect: NSRect);
#[unsafe(method(isFlipped))]
#[unsafe(method_family = none)]
pub fn isFlipped(&self) -> bool;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSRulerView {
extern_methods!(
#[unsafe(method(initWithFrame:))]
#[unsafe(method_family = init)]
pub fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSRulerView {
extern_methods!(
#[unsafe(method(init))]
#[unsafe(method_family = init)]
pub fn init(this: Allocated<Self>) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSRulerView {
extern_methods!(
#[unsafe(method(new))]
#[unsafe(method_family = new)]
pub fn new(mtm: MainThreadMarker) -> Retained<Self>;
);
}
#[cfg(all(feature = "NSResponder", feature = "NSView"))]
impl NSView {
extern_methods!(
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(rulerView:shouldMoveMarker:))]
#[unsafe(method_family = none)]
pub fn rulerView_shouldMoveMarker(
&self,
ruler: &NSRulerView,
marker: &NSRulerMarker,
) -> bool;
#[cfg(all(feature = "NSRulerMarker", feature = "objc2-core-foundation"))]
#[unsafe(method(rulerView:willMoveMarker:toLocation:))]
#[unsafe(method_family = none)]
pub fn rulerView_willMoveMarker_toLocation(
&self,
ruler: &NSRulerView,
marker: &NSRulerMarker,
location: CGFloat,
) -> CGFloat;
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(rulerView:didMoveMarker:))]
#[unsafe(method_family = none)]
pub fn rulerView_didMoveMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker);
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(rulerView:shouldRemoveMarker:))]
#[unsafe(method_family = none)]
pub fn rulerView_shouldRemoveMarker(
&self,
ruler: &NSRulerView,
marker: &NSRulerMarker,
) -> bool;
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(rulerView:didRemoveMarker:))]
#[unsafe(method_family = none)]
pub fn rulerView_didRemoveMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker);
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(rulerView:shouldAddMarker:))]
#[unsafe(method_family = none)]
pub fn rulerView_shouldAddMarker(
&self,
ruler: &NSRulerView,
marker: &NSRulerMarker,
) -> bool;
#[cfg(all(feature = "NSRulerMarker", feature = "objc2-core-foundation"))]
#[unsafe(method(rulerView:willAddMarker:atLocation:))]
#[unsafe(method_family = none)]
pub fn rulerView_willAddMarker_atLocation(
&self,
ruler: &NSRulerView,
marker: &NSRulerMarker,
location: CGFloat,
) -> CGFloat;
#[cfg(feature = "NSRulerMarker")]
#[unsafe(method(rulerView:didAddMarker:))]
#[unsafe(method_family = none)]
pub fn rulerView_didAddMarker(&self, ruler: &NSRulerView, marker: &NSRulerMarker);
#[cfg(feature = "NSEvent")]
#[unsafe(method(rulerView:handleMouseDown:))]
#[unsafe(method_family = none)]
pub fn rulerView_handleMouseDown(&self, ruler: &NSRulerView, event: &NSEvent);
#[unsafe(method(rulerView:willSetClientView:))]
#[unsafe(method_family = none)]
pub fn rulerView_willSetClientView(&self, ruler: &NSRulerView, new_client: &NSView);
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(rulerView:locationForPoint:))]
#[unsafe(method_family = none)]
pub fn rulerView_locationForPoint(&self, ruler: &NSRulerView, point: NSPoint) -> CGFloat;
#[cfg(feature = "objc2-core-foundation")]
#[unsafe(method(rulerView:pointForLocation:))]
#[unsafe(method_family = none)]
pub fn rulerView_pointForLocation(&self, ruler: &NSRulerView, point: CGFloat) -> NSPoint;
);
}