public class CLSContext extends CLSObject
Contexts have two major components.
(1) Child contexts, used to model your app hierarchy. (2) Activity, holds user generated data that pertains to this context.
| Modifier and Type | Class and Description |
|---|---|
static interface |
CLSContext.Block_descendantMatchingIdentifierPathCompletion |
NSObject.Function_instanceMethodForSelector_ret, NSObject.Function_methodForSelector_ret| Modifier | Constructor and Description |
|---|---|
protected |
CLSContext(org.moe.natj.general.Pointer peer) |
| Modifier and Type | Method and Description |
|---|---|
boolean |
_supportsSecureCoding()
This property must return YES on all classes that allow secure coding.
|
static boolean |
accessInstanceVariablesDirectly() |
void |
addChildContext(CLSContext child)
Adds a child context.
|
void |
addNavigationChildContext(CLSContext child)
Adds a child context to specify the user can navigate to the child from this context.
|
void |
addProgressReportingCapabilities(NSSet<? extends CLSProgressReportingCapability> capabilities)
Add or replace additional progress reporting capabilities of the app for this context.
|
static CLSContext |
alloc() |
static CLSContext |
allocWithZone(org.moe.natj.general.ptr.VoidPtr zone) |
static boolean |
automaticallyNotifiesObserversForKey(java.lang.String key) |
void |
becomeActive()
Marks contexts as active.
|
static void |
cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget) |
static void |
cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument) |
static NSArray<java.lang.String> |
classFallbacksForKeyedArchiver() |
static org.moe.natj.objc.Class |
classForKeyedUnarchiver() |
CLSActivity |
createNewActivity()
Creates a new activity
|
CLSActivity |
currentActivity()
Returns the current activity.
|
java.lang.String |
customTypeName()
An optional user-visible name for the context if its type is CLSContextTypeCustom.
|
static java.lang.String |
debugDescription_static() |
void |
descendantMatchingIdentifierPathCompletion(NSArray<java.lang.String> identifierPath,
CLSContext.Block_descendantMatchingIdentifierPathCompletion completion)
Returns a descendant of this context matching the context path you provide.
|
static java.lang.String |
description_static() |
long |
displayOrder()
The displayOrder is by default sorted ascending.
|
static long |
hash_static() |
java.lang.String |
identifier()
App-assigned identifier.
|
NSArray<java.lang.String> |
identifierPath()
Context identifier path of this context.
|
CLSContext |
init() |
CLSContext |
initWithCoder(NSCoder coder)
NS_DESIGNATED_INITIALIZER
|
CLSContext |
initWithTypeIdentifierTitle(long type,
java.lang.String identifier,
java.lang.String title)
Initialize and configure the type of content this context represents.
|
static NSObject.Function_instanceMethodForSelector_ret |
instanceMethodForSelector(org.moe.natj.objc.SEL aSelector) |
static NSMethodSignature |
instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector) |
static boolean |
instancesRespondToSelector(org.moe.natj.objc.SEL aSelector) |
boolean |
isActive()
Returns true if self is the active context.
|
boolean |
isAssignable()
This property is true if the context can be assigned as an activity.
|
static boolean |
isSubclassOfClass(org.moe.natj.objc.Class aClass) |
static NSSet<java.lang.String> |
keyPathsForValuesAffectingValueForKey(java.lang.String key) |
NSArray<? extends CLSContext> |
navigationChildContexts()
Child contexts that can be navigated to from this context.
|
static CLSContext |
new_objc() |
CLSContext |
parent()
Returns the parent of this context.
|
NSSet<? extends CLSProgressReportingCapability> |
progressReportingCapabilities()
Specifies progress reporting capablities of the app for this context.
|
void |
removeFromParent()
Removes this child context from its parent.
|
void |
removeNavigationChildContext(CLSContext child)
Removes the navigation path to the child context from this context.
|
void |
resetProgressReportingCapabilities()
Clears CLSProgressReportingCapability objects added to the receiver.
|
void |
resignActive()
Resign being active.
|
static boolean |
resolveClassMethod(org.moe.natj.objc.SEL sel) |
static boolean |
resolveInstanceMethod(org.moe.natj.objc.SEL sel) |
void |
setAssignable(boolean value)
This property is true if the context can be assigned as an activity.
|
void |
setCustomTypeName(java.lang.String value)
An optional user-visible name for the context if its type is CLSContextTypeCustom.
|
void |
setDisplayOrder(long value)
The displayOrder is by default sorted ascending.
|
void |
setSuggestedAge(NSRange value)
Suggested age range of students, expressed in years, for whom this context is suitable.
|
void |
setSuggestedCompletionTime(NSRange value)
Suggested time range, expressed in minutes, to complete the activity.
|
void |
setSummary(java.lang.String value)
An optional user-visible summary describing the context limited to 4000 characters in length.
|
void |
setThumbnail(CGImageRef value)
An optional thumbnail image associated with the context.
|
void |
setTitle(java.lang.String value)
Title of this context.
|
void |
setTopic(java.lang.String value)
Topic associated with this context.
|
void |
setType(long type)
Sets the type.
|
void |
setUniversalLinkURL(NSURL value)
Alternative deep link URL using universal links.
|
static void |
setVersion_static(long aVersion) |
NSRange |
suggestedAge()
Suggested age range of students, expressed in years, for whom this context is suitable.
|
NSRange |
suggestedCompletionTime()
Suggested time range, expressed in minutes, to complete the activity.
|
java.lang.String |
summary()
An optional user-visible summary describing the context limited to 4000 characters in length.
|
static org.moe.natj.objc.Class |
superclass_static() |
static boolean |
supportsSecureCoding() |
CGImageRef |
thumbnail()
An optional thumbnail image associated with the context.
|
java.lang.String |
title()
Title of this context.
|
java.lang.String |
topic()
Topic associated with this context.
|
long |
type()
Type of this context
|
NSURL |
universalLinkURL()
Alternative deep link URL using universal links.
|
static long |
version_static() |
dateCreated, dateLastModified, encodeWithCoderaccessibilityActivate, accessibilityActivationPoint, accessibilityAssistiveTechnologyFocusedIdentifiers, accessibilityAttributedHint, accessibilityAttributedLabel, accessibilityAttributedUserInputLabels, accessibilityAttributedValue, accessibilityContainerType, accessibilityCustomActions, accessibilityCustomRotors, accessibilityDecrement, accessibilityDragSourceDescriptors, accessibilityDropPointDescriptors, accessibilityElementAtIndex, accessibilityElementCount, accessibilityElementDidBecomeFocused, accessibilityElementDidLoseFocus, accessibilityElementIsFocused, accessibilityElements, accessibilityElementsHidden, accessibilityFrame, accessibilityHint, accessibilityIncrement, accessibilityLabel, accessibilityLanguage, accessibilityNavigationStyle, accessibilityPath, accessibilityPerformEscape, accessibilityPerformMagicTap, accessibilityRespondsToUserInteraction, accessibilityScroll, accessibilityTextualContext, accessibilityTraits, accessibilityUserInputLabels, accessibilityValue, accessibilityViewIsModal, addObserverForKeyPathOptionsContext, attemptRecoveryFromErrorOptionIndex, attemptRecoveryFromErrorOptionIndexDelegateDidRecoverSelectorContextInfo, autoContentAccessingProxy, awakeAfterUsingCoder, awakeFromNib, class_objc, classForCoder, classForKeyedArchiver, copy, dealloc, debugDescription, description, dictionaryWithValuesForKeys, didChangeValueForKey, didChangeValueForKeyWithSetMutationUsingObjects, didChangeValuesAtIndexesForKey, doesNotRecognizeSelector, fileManagerShouldProceedAfterError, fileManagerWillProcessPath, finalize_objc, forwardingTargetForSelector, forwardInvocation, hash, indexOfAccessibilityElement, isAccessibilityElement, isEqual, isKindOfClass, isMemberOfClass, isProxy, methodForSelector, methodSignatureForSelector, mutableArrayValueForKey, mutableArrayValueForKeyPath, mutableCopy, mutableOrderedSetValueForKey, mutableOrderedSetValueForKeyPath, mutableSetValueForKey, mutableSetValueForKeyPath, observationInfo, observeValueForKeyPathOfObjectChangeContext, performSelector, performSelectorInBackgroundWithObject, performSelectorOnMainThreadWithObjectWaitUntilDone, performSelectorOnMainThreadWithObjectWaitUntilDoneModes, performSelectorOnThreadWithObjectWaitUntilDone, performSelectorOnThreadWithObjectWaitUntilDoneModes, performSelectorWithObject, performSelectorWithObjectAfterDelay, performSelectorWithObjectAfterDelayInModes, performSelectorWithObjectWithObject, prepareForInterfaceBuilder, provideImageDataBytesPerRowOrigin_Size_UserInfo, removeObserverForKeyPath, removeObserverForKeyPathContext, replacementObjectForCoder, replacementObjectForKeyedArchiver, respondsToSelector, self, setAccessibilityActivationPoint, setAccessibilityAttributedHint, setAccessibilityAttributedLabel, setAccessibilityAttributedUserInputLabels, setAccessibilityAttributedValue, setAccessibilityContainerType, setAccessibilityCustomActions, setAccessibilityCustomRotors, setAccessibilityDragSourceDescriptors, setAccessibilityDropPointDescriptors, setAccessibilityElements, setAccessibilityElementsHidden, setAccessibilityFrame, setAccessibilityHint, setAccessibilityLabel, setAccessibilityLanguage, setAccessibilityNavigationStyle, setAccessibilityPath, setAccessibilityRespondsToUserInteraction, setAccessibilityTextualContext, setAccessibilityTraits, setAccessibilityUserInputLabels, setAccessibilityValue, setAccessibilityViewIsModal, setIsAccessibilityElement, setNilValueForKey, setObservationInfo, setShouldGroupAccessibilityChildren, setValueForKey, setValueForKeyPath, setValueForUndefinedKey, setValuesForKeysWithDictionary, shouldGroupAccessibilityChildren, superclass, validateValueForKeyError, validateValueForKeyPathError, valueForKey, valueForKeyPath, valueForUndefinedKey, willChangeValueForKey, willChangeValueForKeyWithSetMutationUsingObjects, willChangeValuesAtIndexesForKeypublic static boolean accessInstanceVariablesDirectly()
public void addChildContext(CLSContext child)
A context can only have a single parent. [@note] objectID of child context may change after it's been added.
public static CLSContext alloc()
public static CLSContext allocWithZone(org.moe.natj.general.ptr.VoidPtr zone)
public static boolean automaticallyNotifiesObserversForKey(java.lang.String key)
public void becomeActive()
If a context is already active, it will remain active. If another context is active, the other will resign active before this one becomes active.
public static void cancelPreviousPerformRequestsWithTarget(java.lang.Object aTarget)
public static void cancelPreviousPerformRequestsWithTargetSelectorObject(java.lang.Object aTarget,
org.moe.natj.objc.SEL aSelector,
java.lang.Object anArgument)
public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
public static org.moe.natj.objc.Class classForKeyedUnarchiver()
public CLSActivity createNewActivity()
Creates a new activity and sets it as the current activity.
public CLSActivity currentActivity()
Activity associated with a context. If no activity was ever created this is nil. See: @c -[CLSContext createNewActivity]; for more details.
public static java.lang.String debugDescription_static()
public void descendantMatchingIdentifierPathCompletion(NSArray<java.lang.String> identifierPath, CLSContext.Block_descendantMatchingIdentifierPathCompletion completion)
If there are any missing contexts, they will be filled in by calling the following method on the context's data store's delegate: @code -[CLSDataStoreDelegate createContextForIdentifier:parentContext:parentIdentifierPath:] @endcode If the dataStore does not have a delegate and there are missing contexts then an incomplete list of contexts will be passed to the completion handler. Completion block is called on a background thread.
public static java.lang.String description_static()
public long displayOrder()
Set the displayOrder if you want your contexts to be displayed in a particular order. The sort key is used as a way to sort sibling contexts in a particular order.
public static long hash_static()
public java.lang.String identifier()
The identifier could be used to embed information later used for deep linking. For example: @em hydrogen-element, or @em chapter-1.
public CLSContext init()
public CLSContext initWithCoder(NSCoder coder)
NSCodinginitWithCoder in interface NSCodinginitWithCoder in class CLSObjectpublic CLSContext initWithTypeIdentifierTitle(long type, java.lang.String identifier, java.lang.String title)
identifier - App-assigned identifier for this context. 256 characters max length.type - The type of content this context represents.title - Title for what this context represents. 256 characters max length.public static NSObject.Function_instanceMethodForSelector_ret instanceMethodForSelector(org.moe.natj.objc.SEL aSelector)
public static NSMethodSignature instanceMethodSignatureForSelector(org.moe.natj.objc.SEL aSelector)
public static boolean instancesRespondToSelector(org.moe.natj.objc.SEL aSelector)
public boolean isActive()
public static boolean isSubclassOfClass(org.moe.natj.objc.Class aClass)
public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey(java.lang.String key)
public static CLSContext new_objc()
public CLSContext parent()
public void removeFromParent()
If you remove a context from its parent and do not add it as a child of another context, it will be deleted when you call -save on the dataStore.
public void resignActive()
This method does nothing if the reciever of the message is not active.
public static boolean resolveClassMethod(org.moe.natj.objc.SEL sel)
public static boolean resolveInstanceMethod(org.moe.natj.objc.SEL sel)
public void setDisplayOrder(long value)
Set the displayOrder if you want your contexts to be displayed in a particular order. The sort key is used as a way to sort sibling contexts in a particular order.
public void setTitle(java.lang.String value)
For example: @em Level 1 @em.
public void setTopic(java.lang.String value)
See above for valid, predefined topics.
public void setUniversalLinkURL(NSURL value)
If your app supports universal links, you can supply them here to link the content this context represents.
public static void setVersion_static(long aVersion)
public static org.moe.natj.objc.Class superclass_static()
public static boolean supportsSecureCoding()
public boolean _supportsSecureCoding()
NSSecureCoding_supportsSecureCoding in interface NSSecureCoding_supportsSecureCoding in class CLSObjectpublic java.lang.String title()
For example: @em Level 1 @em.
public java.lang.String topic()
See above for valid, predefined topics.
public long type()
The type that best describes this context.
public NSURL universalLinkURL()
If your app supports universal links, you can supply them here to link the content this context represents.
public static long version_static()
public java.lang.String customTypeName()
This property is relevant only if the type is CLSContextTypeCustom. This string should be localized. If this property is not set for a context of type CLSContextTypeCustom, Schoolwork app will use a default localized string ‘Custom’ as the name of the activity representing this context.
public NSArray<java.lang.String> identifierPath()
The identifier path starts with the main app context object and finishes with the identifier of this context. This is the identifier path that one would use in @code -[CLSDataStore contextsMatchingIdintifierPath:completion:] @endcode to find `this' context.
public void setCustomTypeName(java.lang.String value)
This property is relevant only if the type is CLSContextTypeCustom. This string should be localized. If this property is not set for a context of type CLSContextTypeCustom, Schoolwork app will use a default localized string ‘Custom’ as the name of the activity representing this context.
public void setSummary(java.lang.String value)
This may be used to provide information about the types of activities available under a given context or the context itself. This string should be localized.
public void setThumbnail(CGImageRef value)
The size of this image should be equal to or larger than 80x80 pixels and equal to or smaller than 330x330 pixels. Images larger than 330x330 pixels will be scaled down. Images with both dimensions smaller than 80x80 pixels will not be accepted.
public java.lang.String summary()
This may be used to provide information about the types of activities available under a given context or the context itself. This string should be localized.
public CGImageRef thumbnail()
The size of this image should be equal to or larger than 80x80 pixels and equal to or smaller than 330x330 pixels. Images larger than 330x330 pixels will be scaled down. Images with both dimensions smaller than 80x80 pixels will not be accepted.
public void addProgressReportingCapabilities(NSSet<? extends CLSProgressReportingCapability> capabilities)
If this parameter contains multiple items with the same value for kind, then one of them will be arbitrarily selected and used. If this parameter contains a capability of kind CLSProgressReportingCapabilityKindDuration, it will be ignored.
capabilities - Progress reporting capabilities to add or replace existing capabilties.public boolean isAssignable()
The default value of this property is true. This should be set to false for a context that is used as a container for other contexts, but by itself, is not an assignable activity.
public NSSet<? extends CLSProgressReportingCapability> progressReportingCapabilities()
This information is intended to help teachers as they choose activities for their students. By default a CLSContext will have one CLSProgressReportingCapability instance of kind CLSProgressReportingCapabilityKindDuration. More progress reporting capabilities can be specified via '-addProgressReportingCapabilities:' to customize this set.
public void resetProgressReportingCapabilities()
Removes all capabilities added via '-addProgressReportingCapabilities:'. The context will have the default progress reporting capability of kind CLSProgressReportingCapabilityKindDuration.
public void setAssignable(boolean value)
The default value of this property is true. This should be set to false for a context that is used as a container for other contexts, but by itself, is not an assignable activity.
public void setSuggestedAge(NSRange value)
The default value is [0, NSIntegerMax - 1]. This is @em NSRange(0...Int.max-1) in @em Swift or @em NSMakeRange(0,NSIntegerMax) in @em Objective-C. Set the lower bound to 0 to specify no minimum age limit and set the upper bound to NSIntegerMax - 1 to specify no maximum age limit. [@example] An age range of 4 to 6 years is expressed by @em NSRange(4...6) in @em Swift or by @em NSMakeRange(4,3) in @Objective-C. [@example] An age range of up 10 years is expressed by @em NSRange(0...10) in @em Swift or by @em NSMakeRange(0,11) in @Objective-C. [@example] An age range of 18 years or above is expressed by @em NSRange(18...Int.max-1) in @em Swift or by @em NSMakeRange(18,NSIntegerMax-18) in @Objective-C.
public void setSuggestedCompletionTime(NSRange value)
The default value is [0, NSIntegerMax - 1]. This is @em NSRange(0...Int.max-1) in @em Swift or @em NSMakeRange(0,NSIntegerMax) in @em Objective-C. Set the lower bound value to 0 to specify no minimum time limit and set the upper bound to NSIntegerMax - 1 to specify no maximum time limit. [@example] An time range of 10 to 15 minutes is expressed by @em NSRange(10...15) in @em Swift or by @em NSMakeRange(10,6) in @Objective-C. [@example] An time range of up to 10 minutes is expressed by @em NSRange(0...10) in @em Swift or by @em NSMakeRange(0,11) in @Objective-C. [@example] An time range of at least 20 minutes is expressed by @em NSRange(20...Int.max-1) in @em Swift or by @em NSMakeRange(20,NSIntegerMax-20) in @Objective-C.
public void setType(long type)
Use this to update a previously saved context.
public NSRange suggestedAge()
The default value is [0, NSIntegerMax - 1]. This is @em NSRange(0...Int.max-1) in @em Swift or @em NSMakeRange(0,NSIntegerMax) in @em Objective-C. Set the lower bound to 0 to specify no minimum age limit and set the upper bound to NSIntegerMax - 1 to specify no maximum age limit. [@example] An age range of 4 to 6 years is expressed by @em NSRange(4...6) in @em Swift or by @em NSMakeRange(4,3) in @Objective-C. [@example] An age range of up 10 years is expressed by @em NSRange(0...10) in @em Swift or by @em NSMakeRange(0,11) in @Objective-C. [@example] An age range of 18 years or above is expressed by @em NSRange(18...Int.max-1) in @em Swift or by @em NSMakeRange(18,NSIntegerMax-18) in @Objective-C.
public NSRange suggestedCompletionTime()
The default value is [0, NSIntegerMax - 1]. This is @em NSRange(0...Int.max-1) in @em Swift or @em NSMakeRange(0,NSIntegerMax) in @em Objective-C. Set the lower bound value to 0 to specify no minimum time limit and set the upper bound to NSIntegerMax - 1 to specify no maximum time limit. [@example] An time range of 10 to 15 minutes is expressed by @em NSRange(10...15) in @em Swift or by @em NSMakeRange(10,6) in @Objective-C. [@example] An time range of up to 10 minutes is expressed by @em NSRange(0...10) in @em Swift or by @em NSMakeRange(0,11) in @Objective-C. [@example] An time range of at least 20 minutes is expressed by @em NSRange(20...Int.max-1) in @em Swift or by @em NSMakeRange(20,NSIntegerMax-20) in @Objective-C.
public void addNavigationChildContext(CLSContext child)
Used only for presentation purpose. Unlike @code -[CLSContext addChildContext:] @endcode, this method does not affect the identifierPath.
public NSArray<? extends CLSContext> navigationChildContexts()
Returns all the child contexts added via @code -[CLSContext addNavigationChildContext:] @endcode
public void removeNavigationChildContext(CLSContext child)
Used only for presentation purpose. Unlike @code -[CLSContext removeFromParent:] @endcode, this method does not affect the identiferPath.