Class CNContactFormatter

  • All Implemented Interfaces:
    NSCoding, NSCopying, NSSecureCoding, NSObject

    public class CNContactFormatter
    extends NSFormatter
    implements NSSecureCoding
    Formats a contact name. This formatter handles international ordering and delimiting of the contact name components. This includes applying the user defaults when appropriate.
    • Constructor Detail

      • CNContactFormatter

        protected CNContactFormatter​(org.moe.natj.general.Pointer peer)
    • Method Detail

      • accessInstanceVariablesDirectly

        public static boolean accessInstanceVariablesDirectly()
      • allocWithZone

        public static java.lang.Object allocWithZone​(org.moe.natj.general.ptr.VoidPtr zone)
      • attributedStringFromContactStyleDefaultAttributes

        public static NSAttributedString attributedStringFromContactStyleDefaultAttributes​(CNContact contact,
                                                                                           long style,
                                                                                           NSDictionary<?,​?> attributes)
        Formats the contact name returning an attributed string. This behaves like +stringFromContact:style: except it returns an attributed string. Includes the attribute key CNContactPropertyAttribute.
        Parameters:
        contact - The contact whose name is to be formatted.
        style - The formatting style to be used for the contact name.
        attributes - The default attributes to use. See NSFormatter for details.
        Returns:
        The formatted contact name as an attributed string.
      • automaticallyNotifiesObserversForKey

        public static boolean automaticallyNotifiesObserversForKey​(java.lang.String key)
      • cancelPreviousPerformRequestsWithTarget

        public static void cancelPreviousPerformRequestsWithTarget​(java.lang.Object aTarget)
      • cancelPreviousPerformRequestsWithTargetSelectorObject

        public static void cancelPreviousPerformRequestsWithTargetSelectorObject​(java.lang.Object aTarget,
                                                                                 org.moe.natj.objc.SEL aSelector,
                                                                                 java.lang.Object anArgument)
      • classFallbacksForKeyedArchiver

        public static NSArray<java.lang.String> classFallbacksForKeyedArchiver()
      • classForKeyedUnarchiver

        public static org.moe.natj.objc.Class classForKeyedUnarchiver()
      • debugDescription_static

        public static java.lang.String debugDescription_static()
      • delimiterForContact

        public static java.lang.String delimiterForContact​(CNContact contact)
        The recommended delimiter to use between name components for a given contact.
      • description_static

        public static java.lang.String description_static()
      • descriptorForRequiredKeysForStyle

        public static CNKeyDescriptor descriptorForRequiredKeysForStyle​(long style)
        The contact key descriptor required for the formatter. Use to fetch all contact keys required for the formatter style. Can combine key descriptors for different formatter styles in the fetch.
        Parameters:
        style - The formatting style to be used for the contact name.
        Returns:
        The contact key descriptor for the formatting style.
      • hash_static

        public static long hash_static()
      • instanceMethodSignatureForSelector

        public static NSMethodSignature instanceMethodSignatureForSelector​(org.moe.natj.objc.SEL aSelector)
      • instancesRespondToSelector

        public static boolean instancesRespondToSelector​(org.moe.natj.objc.SEL aSelector)
      • isSubclassOfClass

        public static boolean isSubclassOfClass​(org.moe.natj.objc.Class aClass)
      • keyPathsForValuesAffectingValueForKey

        public static NSSet<java.lang.String> keyPathsForValuesAffectingValueForKey​(java.lang.String key)
      • nameOrderForContact

        public static long nameOrderForContact​(CNContact contact)
        The recommended name order for a given contact.
      • new_objc

        public static java.lang.Object new_objc()
      • resolveClassMethod

        public static boolean resolveClassMethod​(org.moe.natj.objc.SEL sel)
      • resolveInstanceMethod

        public static boolean resolveInstanceMethod​(org.moe.natj.objc.SEL sel)
      • setVersion_static

        public static void setVersion_static​(long aVersion)
      • stringFromContactStyle

        public static java.lang.String stringFromContactStyle​(CNContact contact,
                                                              long style)
        Formats the contact name.
        Parameters:
        contact - The contact whose name is to be formatted.
        style - The formatting style to be used for the contact name.
        Returns:
        The formatted contact name.
      • superclass_static

        public static org.moe.natj.objc.Class superclass_static()
      • version_static

        public static long version_static()
      • attributedStringFromContactDefaultAttributes

        public NSAttributedString attributedStringFromContactDefaultAttributes​(CNContact contact,
                                                                               NSDictionary<?,​?> attributes)
        Formats the contact name returning an attributed string. This behaves like -stringFromContact:style: except it returns an attributed string. CNContactPropertyAttribute key has the value of a CNContact name property key.
        Parameters:
        contact - The contact whose name is to be formatted.
        attributes - The default attributes to use. See NSFormatter for details.
        Returns:
        The formatted contact name as an attributed string.
      • setStyle

        public void setStyle​(long value)
        The style for a contact formatter instance. The default value is CNContactFormatterStyleFullName.
      • stringFromContact

        public java.lang.String stringFromContact​(CNContact contact)
        Formats the contact name.
        Parameters:
        contact - The contact whose name is to be formatted.
        Returns:
        The formatted contact name.
      • style

        public long style()
        The style for a contact formatter instance. The default value is CNContactFormatterStyleFullName.
      • supportsSecureCoding

        public static boolean supportsSecureCoding()
      • _supportsSecureCoding

        public boolean _supportsSecureCoding()
        Description copied from interface: NSSecureCoding
        This property must return YES on all classes that allow secure coding. Subclasses of classes that adopt NSSecureCoding and override initWithCoder: must also override this method and return YES. The Secure Coding Guide should be consulted when writing methods that decode data.
        Specified by:
        _supportsSecureCoding in interface NSSecureCoding
      • descriptorForRequiredKeysForDelimiter

        public static CNKeyDescriptor descriptorForRequiredKeysForDelimiter()
        The contact key descriptor required for the name delimiter. Use to fetch all contact keys required for +delimiterForContact:. Can combine key descriptors for different formatter styles in the fetch.
        Returns:
        The contact key descriptor for the name delimiter.
      • descriptorForRequiredKeysForNameOrder

        public static CNKeyDescriptor descriptorForRequiredKeysForNameOrder()
        The contact key descriptor required for the name order. Use to fetch all contact keys required for +nameOrderForContact:. Can combine key descriptors for different formatter styles in the fetch.
        Returns:
        The contact key descriptor for the name order.