use objc2::__framework_prelude::*;
use objc2_foundation::*;
use crate::*;
#[repr(transparent)]
#[derive(Clone, Copy, Debug, PartialEq, Eq, Hash, PartialOrd, Ord)]
pub struct CLSContextType(pub NSInteger);
impl CLSContextType {
#[doc(alias = "CLSContextTypeNone")]
pub const None: Self = Self(0);
#[doc(alias = "CLSContextTypeApp")]
pub const App: Self = Self(1);
#[doc(alias = "CLSContextTypeChapter")]
pub const Chapter: Self = Self(2);
#[doc(alias = "CLSContextTypeSection")]
pub const Section: Self = Self(3);
#[doc(alias = "CLSContextTypeLevel")]
pub const Level: Self = Self(4);
#[doc(alias = "CLSContextTypePage")]
pub const Page: Self = Self(5);
#[doc(alias = "CLSContextTypeTask")]
pub const Task: Self = Self(6);
#[doc(alias = "CLSContextTypeChallenge")]
pub const Challenge: Self = Self(7);
#[doc(alias = "CLSContextTypeQuiz")]
pub const Quiz: Self = Self(8);
#[doc(alias = "CLSContextTypeExercise")]
pub const Exercise: Self = Self(9);
#[doc(alias = "CLSContextTypeLesson")]
pub const Lesson: Self = Self(10);
#[doc(alias = "CLSContextTypeBook")]
pub const Book: Self = Self(11);
#[doc(alias = "CLSContextTypeGame")]
pub const Game: Self = Self(12);
#[doc(alias = "CLSContextTypeDocument")]
pub const Document: Self = Self(13);
#[doc(alias = "CLSContextTypeAudio")]
pub const Audio: Self = Self(14);
#[doc(alias = "CLSContextTypeVideo")]
pub const Video: Self = Self(15);
#[doc(alias = "CLSContextTypeCourse")]
pub const Course: Self = Self(16);
#[doc(alias = "CLSContextTypeCustom")]
pub const Custom: Self = Self(17);
}
unsafe impl Encode for CLSContextType {
const ENCODING: Encoding = NSInteger::ENCODING;
}
unsafe impl RefEncode for CLSContextType {
const ENCODING_REF: Encoding = Encoding::Pointer(&Self::ENCODING);
}
pub type CLSContextTopic = NSString;
extern "C" {
pub static CLSContextTopicMath: &'static CLSContextTopic;
}
extern "C" {
pub static CLSContextTopicScience: &'static CLSContextTopic;
}
extern "C" {
pub static CLSContextTopicLiteracyAndWriting: &'static CLSContextTopic;
}
extern "C" {
pub static CLSContextTopicWorldLanguage: &'static CLSContextTopic;
}
extern "C" {
pub static CLSContextTopicSocialScience: &'static CLSContextTopic;
}
extern "C" {
pub static CLSContextTopicComputerScienceAndEngineering: &'static CLSContextTopic;
}
extern "C" {
pub static CLSContextTopicArtsAndMusic: &'static CLSContextTopic;
}
extern "C" {
pub static CLSContextTopicHealthAndFitness: &'static CLSContextTopic;
}
extern_class!(
#[derive(Debug, PartialEq, Eq, Hash)]
#[cfg(feature = "CLSObject")]
pub struct CLSContext;
#[cfg(feature = "CLSObject")]
unsafe impl ClassType for CLSContext {
#[inherits(NSObject)]
type Super = CLSObject;
type Mutability = InteriorMutable;
}
);
#[cfg(feature = "CLSObject")]
unsafe impl NSCoding for CLSContext {}
#[cfg(feature = "CLSObject")]
unsafe impl NSObjectProtocol for CLSContext {}
#[cfg(feature = "CLSObject")]
unsafe impl NSSecureCoding for CLSContext {}
extern_methods!(
#[cfg(feature = "CLSObject")]
unsafe impl CLSContext {
#[method_id(@__retain_semantics New new)]
pub unsafe fn new() -> Retained<Self>;
#[method_id(@__retain_semantics Init init)]
pub unsafe fn init(this: Allocated<Self>) -> Retained<Self>;
#[method_id(@__retain_semantics Other identifierPath)]
pub unsafe fn identifierPath(&self) -> Retained<NSArray<NSString>>;
#[method_id(@__retain_semantics Other identifier)]
pub unsafe fn identifier(&self) -> Retained<NSString>;
#[method_id(@__retain_semantics Other universalLinkURL)]
pub unsafe fn universalLinkURL(&self) -> Option<Retained<NSURL>>;
#[method(setUniversalLinkURL:)]
pub unsafe fn setUniversalLinkURL(&self, universal_link_url: Option<&NSURL>);
#[method(type)]
pub unsafe fn r#type(&self) -> CLSContextType;
#[method_id(@__retain_semantics Other customTypeName)]
pub unsafe fn customTypeName(&self) -> Option<Retained<NSString>>;
#[method(setCustomTypeName:)]
pub unsafe fn setCustomTypeName(&self, custom_type_name: Option<&NSString>);
#[method_id(@__retain_semantics Other title)]
pub unsafe fn title(&self) -> Retained<NSString>;
#[method(setTitle:)]
pub unsafe fn setTitle(&self, title: &NSString);
#[method(displayOrder)]
pub unsafe fn displayOrder(&self) -> NSInteger;
#[method(setDisplayOrder:)]
pub unsafe fn setDisplayOrder(&self, display_order: NSInteger);
#[method_id(@__retain_semantics Other topic)]
pub unsafe fn topic(&self) -> Option<Retained<CLSContextTopic>>;
#[method(setTopic:)]
pub unsafe fn setTopic(&self, topic: Option<&CLSContextTopic>);
#[method(isAssignable)]
pub unsafe fn isAssignable(&self) -> bool;
#[method(setAssignable:)]
pub unsafe fn setAssignable(&self, assignable: bool);
#[method(suggestedAge)]
pub unsafe fn suggestedAge(&self) -> NSRange;
#[method(setSuggestedAge:)]
pub unsafe fn setSuggestedAge(&self, suggested_age: NSRange);
#[method(suggestedCompletionTime)]
pub unsafe fn suggestedCompletionTime(&self) -> NSRange;
#[method(setSuggestedCompletionTime:)]
pub unsafe fn setSuggestedCompletionTime(&self, suggested_completion_time: NSRange);
#[cfg(feature = "CLSProgressReportingCapability")]
#[method_id(@__retain_semantics Other progressReportingCapabilities)]
pub unsafe fn progressReportingCapabilities(
&self,
) -> Retained<NSSet<CLSProgressReportingCapability>>;
#[method_id(@__retain_semantics Other summary)]
pub unsafe fn summary(&self) -> Option<Retained<NSString>>;
#[method(setSummary:)]
pub unsafe fn setSummary(&self, summary: Option<&NSString>);
#[method_id(@__retain_semantics Init initWithType:identifier:title:)]
pub unsafe fn initWithType_identifier_title(
this: Allocated<Self>,
r#type: CLSContextType,
identifier: &NSString,
title: &NSString,
) -> Retained<Self>;
#[method(isActive)]
pub unsafe fn isActive(&self) -> bool;
#[method(becomeActive)]
pub unsafe fn becomeActive(&self);
#[method(resignActive)]
pub unsafe fn resignActive(&self);
#[method(setType:)]
pub unsafe fn setType(&self, r#type: CLSContextType);
#[cfg(feature = "CLSProgressReportingCapability")]
#[method(addProgressReportingCapabilities:)]
pub unsafe fn addProgressReportingCapabilities(
&self,
capabilities: &NSSet<CLSProgressReportingCapability>,
);
#[method(resetProgressReportingCapabilities)]
pub unsafe fn resetProgressReportingCapabilities(&self);
}
);
extern_methods!(
#[cfg(feature = "CLSObject")]
unsafe impl CLSContext {
#[method_id(@__retain_semantics Other parent)]
pub unsafe fn parent(&self) -> Option<Retained<CLSContext>>;
#[method(removeFromParent)]
pub unsafe fn removeFromParent(&self);
#[method(addChildContext:)]
pub unsafe fn addChildContext(&self, child: &CLSContext);
#[cfg(feature = "block2")]
#[method(descendantMatchingIdentifierPath:completion:)]
pub unsafe fn descendantMatchingIdentifierPath_completion(
&self,
identifier_path: &NSArray<NSString>,
completion: &block2::Block<dyn Fn(*mut CLSContext, *mut NSError)>,
);
#[method_id(@__retain_semantics Other navigationChildContexts)]
pub unsafe fn navigationChildContexts(&self) -> Retained<NSArray<CLSContext>>;
#[method(addNavigationChildContext:)]
pub unsafe fn addNavigationChildContext(&self, child: &CLSContext);
#[method(removeNavigationChildContext:)]
pub unsafe fn removeNavigationChildContext(&self, child: &CLSContext);
}
);