|
htmlPlugIn
Embedded plug-in class | [Previous] [Main] [Next] |
| htmlPlugIn encapsultes the <EMBED> tag. It is used to display output from a plug-in application. The output is displayed as part of the HTML document in a rectangular area of the page. This attribute first appeared in Netscape Navigator 2.0, and is not supported by all browsers.
| |
|
| |
| A plug-in is a small application that acts as an extension to the browser. When loaded, an embedded plug-in is displayed as part of the HTML document in a rectangular region of the page, similar to the way of GIF image is embedded, except that the plug-in is a real application and can repond to user events. Numerous plug-in's are available from various software vendors, and can be used to add sophisticated features, such as audio and video streaming, to web sites.
| |
|
| |
| The htmlPlugIn class contains a htmlNoEmbed object as an internal member variable. The NoEmbed() method is used to access the object, and can be used provide content for display by browsers that cannot display plug-in's. If the browser can display plug-in's, any content specified using the NoEmbed() method will be ignored. If preferred, you can also manually add htmlNoEmbed objects to any page instead of using htmlPlugIn::NoEmbed().
| |
|
| |
| The Source() method specifies the file to run. The MimeType() method specifies the MIME type of the plug-in needed to run the file. The browser will use either the suffix of the source filename or type to determine which plug-in to use. You must use either the Source() or the MimeType() method.
| |
|
| |
| If the appropriate plug-in is installed on the browser, the it's embedded contents are automatically displayed. If the plug-in is not installed on the browser, the browser may prompt the user to install it. The HelpURL() method defines the location of a page containing instructions for installing the plug-in, should the browser decide installation instructions must be displayed.
| |
|
| |
| #include <dcmicro/htmlpp/plugin.h>
| |
|
| |
|
| |
| htmlNoEmbed, htmlApplet, htmlScript
| |
|
| |
| typedef enum {
| |
| unit_default = 0, // usually pixels on most browsers
| |
| unit_pixel, // pixels
| |
| unit_en // half the point size
| |
| } UnitType ;
| |
|
| |
| typedef enum {
| |
| default_palette = 0 // browser default palette
| |
| background_palette,
| |
| foreground_palette
| |
| } PaletteType ;
| |
|
| |
| htmlPlugIn()
| |
| Constructs an empty object.
| |
|
| |
| htmlPlugIn( | const String& source_url,
| |
| const String& mime_type,
| ||
| int width = 0,
| ||
| int height = 0 )
| ||
| Constructs an object, using the specified source_url or mime_type, optionally including height and width dimensions (default unit is pixels). Either source_url or mime_type may be specified; the unused parameter should be an empty string (e.g., "").
| |
|
| |
| htmlPlugIn( const htmlPlugIn& rhs )
| |
| Copy constructor.
| |
|
| |
| virtual ~htmlPlugIn()
| |
| Destroys the object.
| |
|
| |
| = | htmlPlugIn& operator= ( const htmlPlugIn& rhs )
| |
| Replaces the object contents with rhs, then returns a reference to the object.
| |
|
| |
| Source | htmlPlugIn& Source( const String& source_url )
| |
| Defines the location of the plug-in data file as source_url, then returns a reference to the object. The browser will typically determine the MIME type based upon the filename suffix. If Source() is not specified, the MimeType() method must be used instead.
| |
|
| |
| Source | String Source() const
| |
| Returns the source URL of the location of the plug-in data file, or an empty string if not set.
| |
|
| |
| MimeType | htmlPlugIn& MimeType( const String& mime_type )
| |
| Sets the MIME type of the plug-in to mime_type (which the browsers uses to determine which plug-in to load) then returns a reference to the object. If MimeType() is not specified, the Source() method must be used instead.
| |
|
| |
| This method is typically used for plug-in's that require no data, such as a plug-in that displays a clock or obtains it's data on it's own. If the plug-in is to visible, both the Height() and Width() methods must be used to specify the display dimensions.
| |
|
| |
| MimeType | String MimeType() const
| |
| Returns the MIME type of the plug-in, or an empty string if not set.
| |
|
| |
| Width | htmlPlugIn& Width( int width )
| |
| Sets the width of the display area used by the plug-in to width, then returns a reference to the object. The units are determined by the Units() method (default is pixels). If width is a negative value, the attribute is cleared.
| |
|
| |
| Width | int Width() const
| |
| Returns the width of the display area used by the plug-in, or zero if not set.
| |
|
| |
| Height | htmlPlugIn& Height( int height )
| |
| Sets the height of the display area used by the plug-in to height, then returns a reference to the object. The units are determined by the Units() method (default is pixels). If height is a negative value, the attribute is cleared.
| |
|
| |
| Height | int Height() const
| |
| Returns the height of the display area used by the plug-in, or zero if not set.
| |
|
| |
| NoEmbed | htmlNoEmbed& NoEmbed()
| |
| Returns a reference to the internal htmlNoEmbed object for the plug-in. You can use this method to add alternative content for display by browsers that cannot display plug-in's. If the browser can display plug-in's, any content specified will be ignored.
| |
|
| |
| HelpURL | htmlPlugIn& HelpURL( const String& url )
| |
| Sets the location URL of a page containing instructions for installing the plug-in if it is not already installed on the browser, then returns a reference to the object.
| |
|
| |
| HelpURL | String HelpURL() const
| |
| Returns the URL containing instructions for installing the plug-in, or an empty string if not set.
| |
|
| |
| Align | htmlPlugIn& Align( Alignment align )
| |
| Sets the alignment for the plug-in to align, then returns a reference to the object.
| |
|
|
| |
| Align | int Align() const
| |
| Returns the alignment for the plug-in as an integer, or align_default if not set.
| |
|
| |
| Border | htmlPlugIn& Border( int border_pixels )
| |
| Sets the border around the plug-in to border_pixels pixels, then returns a reference to the object. If border_pixels is a negative value, the attribute is cleared.
| |
|
| |
| Border | int Border() const
| |
| Returns the number of pixels specified for the border around the plug-in, or zero if not set.
| |
|
| |
| Units | htmlPlugIn& Units( UnitType unit_type )
| |
| Defines the measurement units used by the Height() and Width() methods to unit_type, then returns a reference to the object.
| |
|
|
| |
| Units | UnitType Units() const
| |
| Returns the measurement units used by the Height() and Width() methods.
| |
|
| |
| Hide | htmlPlugIn& Hide( Boolean hide )
| |
| Controls whether the plug-in is visible on the page and returns a reference to the object. If hide is TRUE, the plug-in will be hidden. Otherwise, the plug-in will be visible.
| |
|
| |
| IsHidden | Boolean IsHidden() const
| |
| Returns TRUE if the plug-in is hidden on the page, or FALSE if it is visible.
| |
|
| |
| HSpace | htmlPlugIn& HSpace( int pixels )
| |
| Sets the horizontal margin between the left and right edges of the plug-in and it's surroudings to pixels, then returns a reference to the object. If pixels is a negative value, the attribute is cleared.
| |
|
| |
| HSpace | int HSpace() const
| |
| Returns the horizontal space setting in pixels, or zero if not set.
| |
|
| |
| VSpace | htmlPlugIn& VSpace( int pixels )
| |
| Sets the vertical margin between the top and bottom edges of the plug-in and it's surroudings to pixels, then returns a reference to the object. If pixels is a negative value, the attribute is cleared.
| |
|
| |
| VSpace | int VSpace() const
| |
| Returns the vertical space setting in pixels, or zero if not set.
| |
|
| |
| Palette | htmlPlugIn& Palette( PaletteType palette_type )
| |
| Determines which palette the plug-in will use, then returns a reference to the object. Relevent only for browsers running on Windows platforms.
| |
|
|
| |
| Name | htmlPlugIn& Name( const String& name )
| |
| Sets the name that JavaScript can use to reference the plug-in to name, then returns a reference to the object.
| |
|
| |
| Name | String Name() const
| |
| Returns the name of the plug-in, or an empty string if not set.
| |
|
| |
| void Print( ostream& os ) const
| ||
| Outputs the object to os.
| |
|
| |
| Clone | htmlObject FAR * Clone() const
| |
| Returns a base-class pointer to a deep copy of the object.
| |
|
| |
|
| |
| #include <stdio.h>
| |
| #include <stdlib.h>
| |
| #include <dcmicro/htmlpp/htmlpp.h>
| |
|
| |
| int main( void )
| |
| {
| |
| htmlCgi server ;
| |
| htmlPage page( "html++ example application" ) ;
| |
|
| |
| server << page ;
| |
| return 0 ;
| |
| }
| |
|
| |
|
| |
| Content-Type: text/html
| |
| <HTML>
| |
| <HEAD>
| |
| <TITLE>html++ example application</TITLE>
| |
| </HEAD>
| |
| <BODY>
| |
| </BODY>
| |
| </HTML>
| |
|
| |
|
| |
