objc2-osa-kit 0.3.2

Bindings to the OSAKit framework
Documentation
//! This file has been automatically generated by `objc2`'s `header-translator`.
//! DO NOT EDIT
use core::ffi::*;
use core::ptr::NonNull;
use objc2::__framework_prelude::*;
use objc2_app_kit::*;
use objc2_foundation::*;

use crate::*;

extern_class!(
    /// [Apple's documentation](https://developer.apple.com/documentation/osakit/osascriptview?language=objc)
    #[unsafe(super(NSTextView, NSText, NSView, NSResponder, NSObject))]
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct OSAScriptView;
);

extern_conformance!(
    unsafe impl NSAccessibility for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSAccessibilityElementProtocol for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSAccessibilityNavigableStaticText for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSAccessibilityStaticText for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSAnimatablePropertyContainer for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSAppearanceCustomization for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSChangeSpelling for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSCoding for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSColorChanging for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSDraggingDestination for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSDraggingSource for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSIgnoreMisspelledWords for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSMenuItemValidation for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSObjectProtocol for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSStandardKeyBindingResponding for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSTextContent for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSTextInput for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSTextInputClient for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSTextLayoutOrientationProvider for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSUserInterfaceItemIdentification for OSAScriptView {}
);

extern_conformance!(
    unsafe impl NSUserInterfaceValidations for OSAScriptView {}
);

impl OSAScriptView {
    extern_methods!(
        #[unsafe(method(source))]
        #[unsafe(method_family = none)]
        pub unsafe fn source(&self) -> Option<Retained<NSString>>;

        /// Setter for [`source`][Self::source].
        ///
        /// This is [copied][objc2_foundation::NSCopying::copy] when set.
        #[unsafe(method(setSource:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setSource(&self, source: Option<&NSString>);

        #[unsafe(method(usesScriptAssistant))]
        #[unsafe(method_family = none)]
        pub unsafe fn usesScriptAssistant(&self) -> bool;

        /// Setter for [`usesScriptAssistant`][Self::usesScriptAssistant].
        #[unsafe(method(setUsesScriptAssistant:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUsesScriptAssistant(&self, uses_script_assistant: bool);

        #[unsafe(method(usesTabs))]
        #[unsafe(method_family = none)]
        pub unsafe fn usesTabs(&self) -> bool;

        /// Setter for [`usesTabs`][Self::usesTabs].
        #[unsafe(method(setUsesTabs:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setUsesTabs(&self, uses_tabs: bool);

        #[unsafe(method(tabWidth))]
        #[unsafe(method_family = none)]
        pub unsafe fn tabWidth(&self) -> NSUInteger;

        /// Setter for [`tabWidth`][Self::tabWidth].
        #[unsafe(method(setTabWidth:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setTabWidth(&self, tab_width: NSUInteger);

        #[unsafe(method(wrapsLines))]
        #[unsafe(method_family = none)]
        pub unsafe fn wrapsLines(&self) -> bool;

        /// Setter for [`wrapsLines`][Self::wrapsLines].
        #[unsafe(method(setWrapsLines:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setWrapsLines(&self, wraps_lines: bool);

        #[unsafe(method(indentsWrappedLines))]
        #[unsafe(method_family = none)]
        pub unsafe fn indentsWrappedLines(&self) -> bool;

        /// Setter for [`indentsWrappedLines`][Self::indentsWrappedLines].
        #[unsafe(method(setIndentsWrappedLines:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIndentsWrappedLines(&self, indents_wrapped_lines: bool);

        #[unsafe(method(indentWidth))]
        #[unsafe(method_family = none)]
        pub unsafe fn indentWidth(&self) -> NSUInteger;

        /// Setter for [`indentWidth`][Self::indentWidth].
        #[unsafe(method(setIndentWidth:))]
        #[unsafe(method_family = none)]
        pub unsafe fn setIndentWidth(&self, indent_width: NSUInteger);
    );
}

/// Methods declared on superclass `NSTextView`.
impl OSAScriptView {
    extern_methods!(
        /// ************************** Initializing ***************************
        #[unsafe(method(initWithFrame:textContainer:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame_textContainer(
            this: Allocated<Self>,
            frame_rect: NSRect,
            container: Option<&NSTextContainer>,
        ) -> Retained<Self>;

        /// # Safety
        ///
        /// `coder` possibly has further requirements.
        #[unsafe(method(initWithCoder:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithCoder(
            this: Allocated<Self>,
            coder: &NSCoder,
        ) -> Option<Retained<Self>>;

        #[unsafe(method(initWithFrame:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initWithFrame(this: Allocated<Self>, frame_rect: NSRect) -> Retained<Self>;

        #[unsafe(method(initUsingTextLayoutManager:))]
        #[unsafe(method_family = init)]
        pub unsafe fn initUsingTextLayoutManager(
            this: Allocated<Self>,
            using_text_layout_manager: bool,
        ) -> Retained<Self>;

        #[unsafe(method(textViewUsingTextLayoutManager:))]
        #[unsafe(method_family = none)]
        pub unsafe fn textViewUsingTextLayoutManager(
            using_text_layout_manager: bool,
            mtm: MainThreadMarker,
        ) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSResponder`.
impl OSAScriptView {
    extern_methods!(
        #[unsafe(method(init))]
        #[unsafe(method_family = init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
    );
}

/// Methods declared on superclass `NSObject`.
impl OSAScriptView {
    extern_methods!(
        #[unsafe(method(new))]
        #[unsafe(method_family = new)]
        pub unsafe fn new(mtm: MainThreadMarker) -> Retained<Self>;
    );
}