SignDoc SDK (C++)  5.0.0
SignDocTextFieldAttributes Class Reference

Attributes of a text field, list box field or combo box field used for the construction of the appearance (PDF documents only). More...

#include <SignDocSDK-cpp.h>

Public Member Functions

 SignDocTextFieldAttributes ()
 Constructor. More...
 
 SignDocTextFieldAttributes (const SignDocTextFieldAttributes &aSource)
 Copy constructor. More...
 
 ~SignDocTextFieldAttributes ()
 Destructor. More...
 
SignDocTextFieldAttributesoperator= (const SignDocTextFieldAttributes &aSource)
 Assignment operator. More...
 
void swap (SignDocTextFieldAttributes &aOther)
 Efficiently swap this object with another one. More...
 
bool isSet () const
 Check if text field attributes are set or not. More...
 
bool isValid () const
 Check if the text field attributes are valid. More...
 
void clear ()
 Unset all attributes. More...
 
std::string getFontName (Encoding aEncoding) const
 Get the name of the font. More...
 
void setFontName (Encoding aEncoding, const std::string &aFontName)
 Set the name of the font. More...
 
std::string getFontResourceName (Encoding aEncoding) const
 Get the resource name of the font. More...
 
double getFontSize () const
 Get the font size. More...
 
void setFontSize (double aFontSize)
 Set the font size. More...
 
SignDocColorgetTextColor () const
 Get the text color. More...
 
void setTextColor (const SignDocColor &aTextColor)
 Set the text color. More...
 
std::string getRest (Encoding aEncoding) const
 Get unparsed parts of default appearance string. More...
 
void setRest (Encoding aEncoding, const std::string &aInput)
 Set unparsed parts of default appearance string. More...
 
 SignDocTextFieldAttributes (SIGNDOC_TextFieldAttributes *aP)
 Internal function. More...
 
SIGNDOC_TextFieldAttributes * getImpl ()
 Internal function. More...
 
const SIGNDOC_TextFieldAttributes * getImpl () const
 Internal function. More...
 
void setImpl (SIGNDOC_TextFieldAttributes *aP)
 Internal function. More...
 

Detailed Description

Attributes of a text field, list box field or combo box field used for the construction of the appearance (PDF documents only).

This class represents a PDF default appearance string.

Modifying an object of this type does not modify the underlying field or document. Use SignDocDocument::setTextFieldAttributes() or SignDocField::setTextFieldAttributes() to update the text attributes of a field or of the document.

See also
SignDocDocument::getTextFieldAttributes(), SignDocDocument::setTextFieldAttributes(), SignDocField::getTextFieldAttributes(), SignDocField::setTextFieldAttributes()

Constructor & Destructor Documentation

Constructor.

Copy constructor.

Parameters
[in]aSourceThe object to be copied.

Destructor.

SignDocTextFieldAttributes ( SIGNDOC_TextFieldAttributes *  aP)
inline

Internal function.

Member Function Documentation

void clear ( )
inline

Unset all attributes.

isSet() will return false.

std::string getFontName ( Encoding  aEncoding) const
inline

Get the name of the font.

This function returns an empty string if isSet() would return false.

Parameters
[in]aEncodingThe encoding to be used for the return value.
Returns
The name of the font, "?" if the font is invalid.
See also
getFontResourceName(), getFontSize(), setFontName()
std::string getFontResourceName ( Encoding  aEncoding) const
inline

Get the resource name of the font.

This function returns an empty string if isSet() would return false.

Note that setting the resource name is not possible.

Parameters
[in]aEncodingThe encoding to be used for the return value.
Returns
The resource name of the font.
See also
getFontName()
double getFontSize ( ) const
inline

Get the font size.

This function returns 0 if isSet() would return false.

Returns
The font size (in user space units). If the font size is 0, the default font size (which depends on the field size) will be used.
See also
getFontName(), setFontSize()
SIGNDOC_TextFieldAttributes* getImpl ( )
inline

Internal function.

const SIGNDOC_TextFieldAttributes* getImpl ( ) const
inline

Internal function.

std::string getRest ( Encoding  aEncoding) const
inline

Get unparsed parts of default appearance string.

If this function returns a non-empty string, there are unsupported operators in the default appearance string.

Parameters
[in]aEncodingThe encoding to be used for the return value.
Returns
Concatenated unparsed parts of the default appearance string, ie, the default appearance string sans font name, font size, and text color. If this function returns a non-empty string, it will start with a space character.
See also
setRest()
SignDocColor * getTextColor ( ) const
inline

Get the text color.

This function returns nullptr if isSet() would return false.

Returns
A pointer to an object describing the text color or nullptr if the text color is not available. The caller is responsible for destroying the object.
See also
setTextColor()
bool isSet ( ) const
inline

Check if text field attributes are set or not.

If this function returns false for a SignDocTextFieldAttributes object retrieved from a text field, the document's natural text field attributes will be used (if present).

This function returns false for all SignDocTextFieldAttributes objects retrieved from TIFF documents (but you can set the attributes anyway, making isSet() return true).

Returns
true if any attribute is set, false if no attributes are set.
See also
isValid()
bool isValid ( ) const
inline

Check if the text field attributes are valid.

This function does not check if the font name refers to a valid font. This function does not check the string set by setRest().

Returns
true if isSet() would return false or if all attributes are set and are valid, false otherwise.
See also
isSet(), setRest()
SignDocTextFieldAttributes & operator= ( const SignDocTextFieldAttributes aSource)
inline

Assignment operator.

Parameters
[in]aSourceThe source object.
Returns
This object.
void setFontName ( Encoding  aEncoding,
const std::string &  aFontName 
)
inline

Set the name of the font.

The font name can be the name of a standard font, the name of an already embedded font, or the name of a font defined by a font configuration file.

SignDocDocument::addSignature() ignores the font name set by this function if string parameter "FontName" of SignDocSignatureParameters is set to a non-empty value or if the "SignatureTemplate" element of the XML document given to blob parameter "Template" has a non-empty "font-name" attribute.

Parameters
[in]aEncodingThe encoding of aFontName.
[in]aFontNameThe new font name.
See also
getFontName(), setFontSize(), setTextColor(), SignDocDocumentLoader::loadFontConfigBlob(), SignDocDocumentLoader::loadFontConfigEnvironment(), SignDocDocumentLoader::loadFontConfigFile(), SignDocDocumentLoader::loadFontConfigStream()
void setFontSize ( double  aFontSize)
inline

Set the font size.

SignDocDocument::addSignature() ignores the font size set by this function and uses length parameter "FontSize" of SignDocSignatureParameters instead.

Parameters
[in]aFontSizeThe font size (in user space units). If the font size is 0, the default font size (which depends on the field size) will be used.
See also
getFontSize(), setFontName(), SignDocDocument::sff_fit_height_only
void setImpl ( SIGNDOC_TextFieldAttributes *  aP)
inline

Internal function.

void setRest ( Encoding  aEncoding,
const std::string &  aInput 
)
inline

Set unparsed parts of default appearance string.

Parameters
[in]aEncodingThe encoding of aInput.
[in]aInputThe new string of unparsed operators. If this string is non-empty and does not start with a space character, a space character will be prepended automatically.
void setTextColor ( const SignDocColor aTextColor)
inline

Set the text color.

Parameters
[in]aTextColorThe text color.
void swap ( SignDocTextFieldAttributes aOther)
inline

Efficiently swap this object with another one.

Parameters
[in]aOtherThe other object.

The documentation for this class was generated from the following file: