htmlBreak
Line break class
[Previous] [Main] [Next]


Description
htmlBreak encapsulates the <BR> tag. It inserts a line break in text. No extra space is added before the new line. If text is wrapping around an element (such as an image) the ClearMargin() method can be used to force the text to continue at the next clear line (i.e., it stops wrapping around the element).  
 
Declaration
#include <dcmicro/htmlpp/break.h>  
 
Hierarchy
htmlbreak.gif  
 
See Also
htmlParagraph, htmlNoBreak  
Text Formatting Classes in the User's Guide  
 
Related Constants/Definitions
typedef enum {  
clear_default = 0,  
clear_left,   // continue on next line with clear LEFT margin  
clear_right,    // continue on next line withclear RIGHT margin  
clear_all    // continue on next line with BOTH margins clear  
} MarginType ;  
 
Constructors
htmlBreak()  
Constructs an empty object.  
 
htmlBreak( MarginType clear_margin )  
Constructs an object, using the specified margin type.  
 
Destructor
virtual ~htmlBreak()  
Destroys the object.  
 
Member Methods
ClearMarginhtmlBreak& ClearMargin( MarginType clear_margin )  
Set margin for clearing to the specified type, preventing text from wrapping around one or both sides of an element such as an image.  
 
  • clear_left Causes text to appear at the next clear left margin (e.g., text is not allowed to wrap to the left of any element).
  • clear_right Causes text to appear at the next line that has a clear right margin (e.g., text is not allowed to wrap to the right of any element).
  • clear_all Prevents text from wrapping to the left or the right of any element. The result is that the text appears at the next completely clear line.
 
ClearMarginMarginType ClearMargin() const  
Return the current margin type.  
 
Print   void Print( ostream& os ) const  
Output the object to os.  
 
ClonehtmlObject FAR * Clone() const  
Returns a base-class pointer to a deep copy of the object.  
 
Example Use
 
#include <stdio.h>  
#include <stdlib.h>  
#include <dcmicro/htmlpp/htmlpp.h>  
 
int main( void )  
{  
   htmlCgi   server ;  
   htmlPage  page( "html++ example application" ) ;  
 
   htmlParagraph p ;  
   p << "Paragraph text has vertical space below it." ;  
 
   page << p   
        << "Breaks begin new lines, but without"  
        << htmlBreak()  
        << "additional vertical space."  
        << htmlBreak() ;  
 
   server << page ;  
   return 0 ;  
}  
 
Program Output
 
Content-Type: text/html  
<HTML>  
<HEAD>  
<TITLE>html++ example application</TITLE>  
</HEAD>  
<BODY>  
<P>Paragraph text has vertical space below it.</P>  
Breaks begin new lines, but without<BR>  
additional vertical space.<BR>  
</BODY>  
</HTML>  
 
break.gif  




©1998 DC Micro Development. All rights reserved.
No portion of this document may be c opied or reproduced without expressed written consent.
html++ is a trademark of DC Micro Development.