objc2-web-kit 0.2.2

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

use crate::*;

extern_class!(
    #[derive(Debug, PartialEq, Eq, Hash)]
    pub struct WKWebsiteDataStore;

    unsafe impl ClassType for WKWebsiteDataStore {
        type Super = NSObject;
        type Mutability = InteriorMutable;
    }
);

unsafe impl NSCoding for WKWebsiteDataStore {}

unsafe impl NSObjectProtocol for WKWebsiteDataStore {}

unsafe impl NSSecureCoding for WKWebsiteDataStore {}

extern_methods!(
    unsafe impl WKWebsiteDataStore {
        #[method_id(@__retain_semantics Other defaultDataStore)]
        pub unsafe fn defaultDataStore() -> Retained<WKWebsiteDataStore>;

        #[method_id(@__retain_semantics Other nonPersistentDataStore)]
        pub unsafe fn nonPersistentDataStore() -> Retained<WKWebsiteDataStore>;

        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new(&self) -> Retained<Self>;

        #[method_id(@__retain_semantics Init init)]
        pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;

        #[method(isPersistent)]
        pub unsafe fn isPersistent(&self) -> bool;

        #[method_id(@__retain_semantics Other allWebsiteDataTypes)]
        pub unsafe fn allWebsiteDataTypes() -> Retained<NSSet<NSString>>;

        #[cfg(all(feature = "WKWebsiteDataRecord", feature = "block2"))]
        #[method(fetchDataRecordsOfTypes:completionHandler:)]
        pub unsafe fn fetchDataRecordsOfTypes_completionHandler(
            &self,
            data_types: &NSSet<NSString>,
            completion_handler: &block2::Block<dyn Fn(NonNull<NSArray<WKWebsiteDataRecord>>)>,
        );

        #[cfg(all(feature = "WKWebsiteDataRecord", feature = "block2"))]
        #[method(removeDataOfTypes:forDataRecords:completionHandler:)]
        pub unsafe fn removeDataOfTypes_forDataRecords_completionHandler(
            &self,
            data_types: &NSSet<NSString>,
            data_records: &NSArray<WKWebsiteDataRecord>,
            completion_handler: &block2::Block<dyn Fn()>,
        );

        #[cfg(feature = "block2")]
        #[method(removeDataOfTypes:modifiedSince:completionHandler:)]
        pub unsafe fn removeDataOfTypes_modifiedSince_completionHandler(
            &self,
            data_types: &NSSet<NSString>,
            date: &NSDate,
            completion_handler: &block2::Block<dyn Fn()>,
        );

        #[cfg(feature = "WKHTTPCookieStore")]
        #[method_id(@__retain_semantics Other httpCookieStore)]
        pub unsafe fn httpCookieStore(&self) -> Retained<WKHTTPCookieStore>;

        #[method_id(@__retain_semantics Other identifier)]
        pub unsafe fn identifier(&self) -> Option<Retained<NSUUID>>;

        #[method_id(@__retain_semantics Other dataStoreForIdentifier:)]
        pub unsafe fn dataStoreForIdentifier(identifier: &NSUUID) -> Retained<WKWebsiteDataStore>;

        #[cfg(feature = "block2")]
        #[method(removeDataStoreForIdentifier:completionHandler:)]
        pub unsafe fn removeDataStoreForIdentifier_completionHandler(
            identifier: &NSUUID,
            completion_handler: &block2::Block<dyn Fn(*mut NSError)>,
        );

        #[cfg(feature = "block2")]
        #[method(fetchAllDataStoreIdentifiers:)]
        pub unsafe fn fetchAllDataStoreIdentifiers(
            completion_handler: &block2::Block<dyn Fn(NonNull<NSArray<NSUUID>>)>,
        );
    }
);

extern_methods!(
    /// Methods declared on superclass `NSObject`
    unsafe impl WKWebsiteDataStore {
        #[method_id(@__retain_semantics New new)]
        pub unsafe fn new_class() -> Retained<Self>;
    }
);