InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnpPerformTextAttrRuby Class Reference

Public Member Functions

 SnpPerformTextAttrRuby ()
 
virtual ~SnpPerformTextAttrRuby ()
 
ErrorCode ApplyRuby (const InDesign::TextRange &textRange, const SnpRubyDataSettings &rubyData)
 
ErrorCode RemoveRuby (const InDesign::TextRange &textRange)
 
ErrorCode InspectRuby (const InDesign::TextRange &textRange, SnpRubyDataSettings &rubyData)
 
void SetRubyData (const InDesign::TextRange &textRange, SnpRubyDataSettings &rubyData)
 
void ReportRubyData (const SnpRubyDataSettings &rubyData, IDataBase *db)
 
ErrorCode CreateRubyStrandIfNeeded (ITextModel *textModel)
 
ErrorCode GetRubyStrandInfo (const InDesign::TextRange &textRangeToExamine, InDesign::TextRange &firstRubyStrandRange, WideString &firstRubyString, bool16 &firstRubyAttr)
 

Detailed Description

Constructor & Destructor Documentation

SnpPerformTextAttrRuby::SnpPerformTextAttrRuby ()
inline

Constructor.

virtual SnpPerformTextAttrRuby::~SnpPerformTextAttrRuby ()
inlinevirtual

Destructor..

Member Function Documentation

ErrorCode SnpPerformTextAttrRuby::ApplyRuby (const InDesign::TextRangetextRange,
const SnpRubyDataSettingsrubyData 
)

Applies ruby attributes onto the specified text model range.

Parameters
textRange(in) The text range to which you want to apply ruby.
rubyData(in) The ruby settings. Use SetRubyData() to fill in the members.
Returns
kSuccess on success, kFailure otherwise.
ErrorCode SnpPerformTextAttrRuby::CreateRubyStrandIfNeeded (ITextModeltextModel)

The ruby attribute strand isn't there by default when a new text model is created, so we need to check if someone has created it... (Change of behavior in InDesign 2.0)

Parameters
textModel(in) The text model on which the ruby attribute strand is to be created.
Returns
ErrorCode kSuccess if successful.
ErrorCode SnpPerformTextAttrRuby::GetRubyStrandInfo (const InDesign::TextRangetextRangeToExamine,
InDesign::TextRangefirstRubyStrandRange,
WideStringfirstRubyString,
bool16 & firstRubyAttr 
)

Gets info about the first ruby strand found in the selected text range. Use this method to accurately check on the existence of any ruby in the specified text range.

Parameters
textRangeToExamine(in) Specifies the text range to look at for ruby.
firstRubyStrandRange(out) If ruby exists in the textRangeToExamine, this returns the actual text range for the first ruby strand. If ruby does not exist in the textRangeToExamine, this will return a nil TextModel.
firstRubyString(out) If ruby exists in the textRangeToExamine, this returns the first ruby string in the range identified by firstRubyStrandRange. Otherwise, returns an empty string.
firstRubyAttr(out) If ruby exists in the textRangeToExamine, this returns the state of the kTARubyAttrBoss attribute.
ErrorCode SnpPerformTextAttrRuby::InspectRuby (const InDesign::TextRangetextRange,
SnpRubyDataSettingsrubyData 
)

Inspects ruby attributes over the specified text model range. The details are printed onto the SNIPLOG.

Parameters
textRange(in) The text range from which you want to inspect ruby.
rubyData(out) The ruby settings.
Returns
kSuccess on success, kFailure otherwise.
ErrorCode SnpPerformTextAttrRuby::RemoveRuby (const InDesign::TextRangetextRange)

Removes (or simply turns off) ruby attributes from the specified text model range.

Parameters
textRange(in) The text range from which you want to remove ruby.
Returns
kSuccess on success, kFailure otherwise.
void SnpPerformTextAttrRuby::ReportRubyData (const SnpRubyDataSettingsrubyData,
IDataBasedb 
)

Reports ruby data to SNIPLOG.

Parameters
rubyData(in) The ruby settings.
db(in) Database for getting the swatch names.
void SnpPerformTextAttrRuby::SetRubyData (const InDesign::TextRangetextRange,
SnpRubyDataSettingsrubyData 
)

Sets the SnpRubyDataSettings structure.

Parameters
textRange(in) The text range to use as a basis for some ruby settings, particularly those that depend on the base text.
rubyData(out) The ruby settings that can be passed on to ApplyRuby().