Up
Authors
- ANOQ of the sun (
anoq@vip.cybercity.dk
)
-
- Richard Frith-Macdonald (
richard@brainstorm.co.uk
)
-
Version: 26606
Date: 2008-06-08 11:38:33 +0100 (Sun, 08 Jun 2008)
Copyright: (C) 1997,1999 Free Software Foundation, Inc.
- Declared in:
- Foundation/NSAttributedString.h
- Conforms to:
- NSCoding
- NSCopying
- NSMutableCopying
Availability: MacOS-X 10.0.0
A string in which name-value pairs represented by an
NSDictionary
may be associated to ranges of characters. Used for
text rendering by the GUI/AppKit framework, in which
fonts, sizes, etc. are stored under standard
attributes in the dictionaries.
Method summary
- (id)
attribute: (
NSString*)attributeName
atIndex: (unsigned int)index
effectiveRange: (
NSRange*)aRange;
Availability: MacOS-X 10.0.0
Returns value for given attribute at
index, and, if effectiveRange is non-nil,
this gets filled with a range over which this value
holds. This may not be the maximum range, depending
on the implementation.
- (id)
attribute: (
NSString*)attributeName
atIndex: (unsigned int)index
longestEffectiveRange: (
NSRange*)aRange
inRange: (
NSRange)rangeLimit;
Availability: MacOS-X 10.0.0
Returns value for given attribute at
index, and, if longestEffectiveRange is
non-nil, this gets filled with the range over
which the attribute applies, clipped to
rangeLimit.
- (
NSAttributedString*)
attributedSubstringFromRange: (
NSRange)aRange;
Availability: MacOS-X 10.0.0
Returns substring with attribute information.
- (
NSDictionary*)
attributesAtIndex: (unsigned int)index
effectiveRange: (
NSRange*)aRange;
Availability: MacOS-X 10.0.0
Returns attributes and values at index,
and, if effectiveRange is non-nil, this gets filled
with a range over which these attributes and values
still hold. This may not be the maximum range,
depending on the implementation.
- (
NSDictionary*)
attributesAtIndex: (unsigned int)index
longestEffectiveRange: (
NSRange*)aRange
inRange: (
NSRange)rangeLimit;
Availability: MacOS-X 10.0.0
Returns attributes and values at index,
and, if longestEffectiveRange is non-nil, this gets
filled with the range over which the attribute-value
set is the same as at index, clipped to
rangeLimit.
- (id)
initWithAttributedString: (
NSAttributedString*)attributedString;
Availability: MacOS-X 10.0.0
Initialize to copy of
attributedString.
- (id)
initWithString: (
NSString*)aString;
Availability: MacOS-X 10.0.0
Initialize to aString with no
attributes.
- (id)
initWithString: (
NSString*)aString
attributes: (
NSDictionary*)attributes;
Availability: MacOS-X 10.0.0
Initialize to aString with given
attributes applying over full range of
string.
- (BOOL)
isEqualToAttributedString: (
NSAttributedString*)otherString;
Availability: MacOS-X 10.0.0
Returns whether all characters and attributes are
equal between this string and otherString.
- (unsigned int)
length;
Availability: MacOS-X 10.0.0
Return length of the underlying string.
- (
NSString*)
string;
Availability: MacOS-X 10.0.0
Return the underlying string, stripped of
attributes.
- Declared in:
- Foundation/NSAttributedString.h
Availability: MacOS-X 10.0.0
Method summary
- (void)
addAttribute: (
NSString*)name
value: (id)value
range: (
NSRange)aRange;
Availability: MacOS-X 10.0.0
Adds attribute applying to given range.
- (void)
addAttributes: (
NSDictionary*)attributes
range: (
NSRange)aRange;
Availability: MacOS-X 10.0.0
Add attributes to apply over given range.
- (void)
appendAttributedString: (
NSAttributedString*)attributedString;
Availability: MacOS-X 10.0.0
Appends attributed string to end of this one,
preserving attributes.
- (void)
beginEditing;
Availability: MacOS-X 10.0.0
An empty method provided for subclasses to override.
Call before executing a collection of changes, for
optimization.
- (void)
deleteCharactersInRange: (
NSRange)aRange;
Availability: MacOS-X 10.0.0
Removes characters and attributes applying to them.
- (void)
endEditing;
Availability: MacOS-X 10.0.0
An empty method provided for subclasses to override.
Call after executing a collection of changes, for
optimization.
- (void)
insertAttributedString: (
NSAttributedString*)attributedString
atIndex: (unsigned int)index;
Availability: MacOS-X 10.0.0
Inserts attributed string within this one,
preserving attributes.
- (
NSMutableString*)
mutableString;
Availability: MacOS-X 10.0.0
Returns mutable version of the underlying string.
- (void)
removeAttribute: (
NSString*)name
range: (
NSRange)aRange;
Availability: MacOS-X 10.0.0
Removes given attribute from aRange.
- (void)
replaceCharactersInRange: (
NSRange)aRange
withAttributedString: (
NSAttributedString*)attributedString;
Availability: MacOS-X 10.0.0
Replaces substring and attributes.
- (void)
replaceCharactersInRange: (
NSRange)aRange
withString: (
NSString*)aString;
Availability: MacOS-X 10.0.0
Subclasses
should override this method.
Replaces substring; replacement is granted
attributes equal to those of the first character
of the portion replaced.
- (void)
setAttributedString: (
NSAttributedString*)attributedString;
Availability: MacOS-X 10.0.0
Replaces entire contents (so this object can be
reused).
- (void)
setAttributes: (
NSDictionary*)attributes
range: (
NSRange)aRange;
Availability: MacOS-X 10.0.0
Sets attributes to apply over range,
replacing any previous attributes.
- Declared in:
- Foundation/NSAttributedString.h
Availability: Not in OpenStep/MacOS-X
Description forthcoming.
Method summary
- (
NSAttributedString*)
attributedSubstringWithRange: (
NSRange)aRange;
Availability: Not in OpenStep/MacOS-X
Dep[recated synonym for
attributedSubstringFromRange:
for consistency with NSString
Up