Show
Ignore:
Timestamp:
10/09/08 09:30:57 (3 months ago)
Author:
FM
Message:

revised richtext headers

Files:
1 modified

Legend:

Unmodified
Added
Removed
  • wxWidgets/trunk/interface/wx/richtext/richtexthtml.h

    r55912 r56199  
    1717 
    1818    Image handling requires a little extra work from the application, to choose an 
    19     appropriate image format for the target HTML viewer and to clean up the 
    20     temporary images 
    21     later. If you are planning to load the HTML into a standard web browser, you can 
     19    appropriate image format for the target HTML viewer and to clean up the temporary 
     20    images later. 
     21    If you are planning to load the HTML into a standard web browser, you can 
    2222    specify the handler flag wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64 (the default) 
    2323    and no extra work is required: the images will be written with the HTML. 
    2424 
    2525    However, if you want wxHTML compatibility, you will need to use 
    26     wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY 
    27     or wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES. In this case, you must either call 
    28     wxRichTextHTMLHandler::DeleteTemporaryImages before 
    29     the next load operation, or you must store the image 
    30     locations and delete them yourself when appropriate. You can call 
    31     wxRichTextHTMLHandler::GetTemporaryImageLocations to 
     26    @c wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY or 
     27    @c wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES. 
     28 
     29    In this case, you must either call wxRichTextHTMLHandler::DeleteTemporaryImages 
     30    before the next load operation, or you must store the image locations and 
     31    delete them yourself when appropriate. 
     32 
     33    You can call wxRichTextHTMLHandler::GetTemporaryImageLocations to 
    3234    get the array of temporary image names. 
     35 
     36 
     37    @section richtexthtmlhandler_flags Handler flags 
     38 
     39    The following flags can be used with this handler, via the handler's SetFlags() 
     40    function or the buffer or control's SetHandlerFlags() function: 
     41 
     42    - wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_MEMORY 
     43      Images are saved to the memory filesystem: suitable for showing wxHTML windows. 
     44    - wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_FILES 
     45      Images are saved to temporary files: suitable for showing in wxHTML windows. 
     46    - wxRICHTEXT_HANDLER_SAVE_IMAGES_TO_BASE64 
     47      Images are written with the HTML files in Base 64 format: suitable for showing 
     48      in web browsers. 
     49    - wxRICHTEXT_HANDLER_NO_HEADER_FOOTER 
     50      Don't include header and footer tags (HTML, HEAD, BODY), so that the HTML 
     51      can be used as part of a larger document. 
     52 
    3353 
    3454    @library{wxrichtext} 
     
    3959public: 
    4060    /** 
    41         ,  wxString&@e ext = wxT("html"), @b int@e type = wxRICHTEXT_TYPE_HTML) 
    4261        Constructor. 
    4362    */ 
    44     wxRichTextHTMLHandler() const; 
     63    wxRichTextHTMLHandler(const wxString& name = wxT("HTML"), 
     64                          const wxString& ext = wxT("html"), 
     65                          int type = wxRICHTEXT_TYPE_HTML); 
    4566 
    4667    /** 
     
    4970    void ClearTemporaryImageLocations(); 
    5071 
    51     //@{ 
    5272    /** 
    53         Delete the in-memory or temporary files generated by the last operation. This 
    54         is a static 
    55         function that can be used to delete the saved locations from an earlier 
    56         operation, 
    57         for example after the user has viewed the HTML file. 
     73        Deletes the in-memory or temporary files generated by the last operation. 
    5874    */ 
    5975    bool DeleteTemporaryImages(); 
     76 
     77    /** 
     78        Delete the in-memory or temporary files generated by the last operation. 
     79        This is a static function that can be used to delete the saved locations 
     80        from an earlier operation, for example after the user has viewed the HTML file. 
     81    */ 
    6082    bool DeleteTemporaryImages(int flags, 
    6183                               const wxArrayString& imageLocations); 
    62     //@} 
    6384 
    6485    /** 
     
    84105    /** 
    85106        Reset the file counter, in case, for example, the same names are required each 
    86         time 
     107        time. 
    87108    */ 
    88109    static void SetFileCounter(int counter); 
     
    90111    /** 
    91112        Sets the mapping for converting point sizes to HTML font sizes. 
     113 
    92114        There should be 7 elements, one for each HTML font size, each element 
    93         specifying the maximum point size for that 
    94         HTML font size. 
     115        specifying the maximum point size for that HTML font size. 
    95116        For example: 
     117        @code 
     118        wxArrayInt fontSizeMapping; 
     119        fontSizeMapping.Add(7); 
     120        fontSizeMapping.Add(9); 
     121        fontSizeMapping.Add(11); 
     122        fontSizeMapping.Add(12); 
     123        fontSizeMapping.Add(14); 
     124        fontSizeMapping.Add(22); 
     125        fontSizeMapping.Add(100); 
     126 
     127        htmlHandler.SetFontSizeMapping(fontSizeMapping); 
     128        @endcode 
    96129    */ 
    97130    void SetFontSizeMapping(const wxArrayInt& fontSizeMapping); 
    98131 
    99132    /** 
    100         Sets the directory for storing temporary files. If empty, the system 
    101         temporary directory will be used. 
     133        Sets the directory for storing temporary files. 
     134        If empty, the system temporary directory will be used. 
    102135    */ 
    103136    void SetTempDir(const wxString& tempDir);