WT_Dash_Pattern Class Reference
[Rendition attributes]

#include <dashpat.h>

Inheritance diagram for WT_Dash_Pattern:

Inheritance graph
[legend]
Collaboration diagram for WT_Dash_Pattern:

Collaboration graph
[legend]
List of all members.

Detailed Description

Rendition attribute describing a user definable line pattern.

Given a unique ID and a sequence of dash and space lengths, this object defines a custom line pattern.

Note:
Dash patterns override line patterns. When finished with the dash pattern, clients must "turn off" dash patterns by setting the current dash pattern to WT_Dash_Pattern::kNull.
Warning:
The unique ID must not conflict with the predefined line pattern definitions or the static dash pattern kNull (therefore should be >= WT_Line_Pattern::Count.) To reserve room for predefined line pattern growth in the future (which will all have positive ID's, it is suggested that dash pattern ID's begin at WT_Line_Pattern::Count+100 and increase in value from there. The toolkit does not prevent conflicts from happening.
See also:
WT_Rendition
Examples:

WhipExamples/DashPattern.cpp.

Definition at line 44 of file dashpat.h.

Public Member Functions

 WT_Dash_Pattern ()
 Construct a WT_Dash_Pattern object.
 WT_Dash_Pattern (WT_Integer32 id_number, WT_Integer16 length, WT_Integer16 const *pArray) throw (WT_Result)
 Construct a WT_Dash_Pattern object with the given data.
 WT_Dash_Pattern (WT_Dash_Pattern const &r) throw (WT_Result)
 Construct a WT_Dash_Pattern object. Copy constructor.
virtual ~WT_Dash_Pattern ()
 Destroys a WT_Dash_Pattern object.
WT_Integer16 length () const
 Returns the length of the dash pattern definition value array.
WT_Integer32 number () const
 Returns the read-only id of the dash pattern.
WT_Integer32number ()
 Returns a writable reference to the id of the dash pattern.
WT_Integer16 const * pattern () const
 Returns a read-only pointer to the array of values (contiguous pairs) representing pixels-on pixels-off defining the dash pattern.
WT_Result set (WT_Dash_Pattern const &pattern)
 Copies the given dash pattern to this one.
WT_Result set (WT_Integer32 id_number, WT_Integer16 length=0, WT_Integer16 const *pArray=0)
 Sets the dash pattern with the given data.
void set_pattern (WT_Integer16 length, WT_Integer16 const *pArray)
 Sets the pattern data with the given data (retains the existing index number.).
virtual WT_Dash_Patternoperator= (WT_Dash_Pattern const &r) throw (WT_Result)
 Assignment operator. Copies the given dash pattern to this one.
virtual WT_Dash_Patternoperator= (WT_Integer32 id_number) throw (WT_Result)
 Assignment operator. Sets the dash pattern id.
WT_Integer16operator[] (WT_Integer16 index)
 Index operator. Returns a writable reference to a dash pattern definition value array entry.
WT_ID object_id () const
 Returns the WT_ID for this object.
WT_Result materialize (WT_Opcode const &opcode, WT_File &file)
 Materializes the contents of the object from the file and the given opcode.
WT_Result process (WT_File &file)
 Calls the configured action handler for this object (passes in the file reference.).
WT_Result skip_operand (WT_Opcode const &opcode, WT_File &file)
 Causes the file reading to proceed to the end of this object.
WT_Result serialize (WT_File &file) const
 Forces the serialization of the object to the file.
WT_Result sync (WT_File &file) const
 Serializes the attribute out to the file, if necessary.
WT_Boolean operator== (WT_Attribute const &attrib) const
 Returns WD_True if the attributes are equal.

Static Public Member Functions

static WT_Result default_process (WT_Dash_Pattern &item, WT_File &file)
 Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

Static Public Attributes

static const WT_Dash_Pattern kNull
 Default null dash pattern.

Friends

class WT_Rendition
class WT_PDFRendition
class WT_Class_Factory
class WT_W2D_Class_Factory
class WT_Opcode
class WT_Dash_Pattern_List


Constructor & Destructor Documentation

WT_Dash_Pattern::WT_Dash_Pattern WT_Integer32  id_number,
WT_Integer16  length,
WT_Integer16 const *  pArray
throw (WT_Result) [inline]
 

Construct a WT_Dash_Pattern object with the given data.

Exceptions:
WT_Result::Toolkit_Usage_Error The length parameter was not an even number.
WT_Result::Out_Of_Memory_Error Internal data could not be allocated.
Parameters:
id_number  Unique identifier for the dash pattern.
Warning:
The unique ID must not conflict with the predefined line pattern definitions or the static dash pattern kNull (therefore should be >= WT_Line_Pattern::Count).
length  Length of the pArray argument. Must be even.
pArray  Array of values (contiguous pairs) representing pixels-on pixels-off defining the dash pattern.

Definition at line 96 of file dashpat.h.


Member Function Documentation

static WT_Result WT_Dash_Pattern::default_process WT_Dash_Pattern item,
WT_File file
[static]
 

Provides a default action handler for this attribute (e.g. sets the current rendition's corresponding attribute.).

Warning:
This is used by the framework and should not be called by client code.
Parameters:
item  The attribute to process.
file  The file being read.

WT_Result WT_Dash_Pattern::materialize WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Materializes the contents of the object from the file and the given opcode.

Reads in the object data and causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
WT_Result::Opcode_Not_Valid_For_This_Object The object does not support the opcode type.
WT_Result::Internal_Error Something went very wrong.

Implements WT_Object.

virtual WT_Dash_Pattern& WT_Dash_Pattern::operator= WT_Integer32  id_number  )  throw (WT_Result) [inline, virtual]
 

Assignment operator. Sets the dash pattern id.

Parameters:
id_number  Unique identifier for the dash pattern.
Warning:
The unique ID must not conflict with the predefined line pattern definitions or the static dash pattern kNull (therefore should be >= WT_Line_Pattern::Count.)

Definition at line 172 of file dashpat.h.

WT_Integer16& WT_Dash_Pattern::operator[] WT_Integer16  index  ) 
 

Index operator. Returns a writable reference to a dash pattern definition value array entry.

Parameters:
index  The index into the dash pattern definition array.

WT_Result WT_Dash_Pattern::process WT_File file  )  [virtual]
 

Calls the configured action handler for this object (passes in the file reference.).

Warning:
This is used by the framework and should not be called by client code.

Implements WT_Object.

WT_Result WT_Dash_Pattern::serialize WT_File file  )  const [virtual]
 

Forces the serialization of the object to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.

Implements WT_Attribute.

WT_Result WT_Dash_Pattern::set WT_Integer32  id_number,
WT_Integer16  length = 0,
WT_Integer16 const *  pArray = 0
 

Sets the dash pattern with the given data.

Parameters:
id_number  Unique identifier for the dash pattern.
Warning:
The unique ID must not conflict with the predefined line pattern definitions or the static dash pattern kNull (therefore should be >= WT_Line_Pattern::Count.)
length  Length of the pArray argument. Must be even.
pArray  Array of values (contiguous pairs) representing pixels-on pixels-off defining the dash pattern.

void WT_Dash_Pattern::set_pattern WT_Integer16  length,
WT_Integer16 const *  pArray
[inline]
 

Sets the pattern data with the given data (retains the existing index number.).

Parameters:
length  Length of the pArray argument. Must be even.
pArray  Array of values (contiguous pairs) representing pixels-on pixels-off defining the dash pattern.

Definition at line 158 of file dashpat.h.

WT_Result WT_Dash_Pattern::skip_operand WT_Opcode const &  opcode,
WT_File file
[virtual]
 

Causes the file reading to proceed to the end of this object.

Warning:
This is used by the framework and should not be called by client code.
Bug:
Not all objects perform skip_operand() correctly; this is a known problem. For best results, if client code must use WT_File::get_next_object_shell() manually, it should also call the corresponding WT_Object::materialize() method to avoid this problem.
See also:
WT_File::get_next_object_shell(), WT_File_Heuristics::set_deferred_delete().

Reimplemented from WT_Object.

WT_Result WT_Dash_Pattern::sync WT_File file  )  const [virtual]
 

Serializes the attribute out to the file, if necessary.

Only outputs relevant desired rendition changes to the file.

Warning:
This is used by the framework and should not be called by client code.
Return values:
WT_Result::Success The operation was successful.
See also:
WT_File::desired_rendition().

Implements WT_Attribute.


Member Data Documentation

const WT_Dash_Pattern WT_Dash_Pattern::kNull [static]
 

Default null dash pattern.

Note:
When finished with the dash pattern, clients must "turn off" dash patterns by setting the current dash pattern to WT_Dash_Pattern::kNull.

Definition at line 79 of file dashpat.h.


The documentation for this class was generated from the following file:
Generated on Tue Jan 6 22:41:16 2009 for Autodesk DWF Whip 2D Toolkit by  doxygen 1.4.5