Interfaces to define the abstract HelpSystem

helpintfs.pas contains interfaces to define the abstract HelpSystem.

You can create your own HelpSystem based on these interfaces, or use the LCL help system in lazhelpintf.pas. THTMLHelpDatabase and THTMLBrowserHelpViewer in lazhelphtml.pas use the LCL help system. To create your own help system, implement a descendant of THelpManager.

This file is part of the Lazarus Component Library (LCL).

Author: Mattias Gaertner

Exception raised for Help system errors

All help-specific errors should use this Exception type.

Represents result codes returned by THelpManager

TShowHelpResult is an enumerated type with values that represent result codes for help requests using THelpManager. It is also the type returned from convenience methods like ShowTableOfContents, ShowHelpForKeyword, ShowHelpForPascalContexts, et. al.

No help result available (help error) Help request successfully completed Help request was canceled Help database was not found Help database found, but the context was not found No Help viewer registered for this format No Help found for the keyword or directive Help viewer could not display a help node No help node(s) found for the help selector Set type used to store values from the TShowHelpResult enumeration Identifier used to represent a Help database

THelpDatabaseID is an alias for the String type.

THelpDatabaseID is the type used to implement the THelpQuery.HelpDatabaseID property.

Constructor for the class instance Constructor for the class instance Constructor for the class instance Constructor for the class instance Constructor for the class instance

THelpQueryMessage is a THelpQuery descendant which contains a query for messages, like the compiler warnings and errors.

WholeMessage is a string with the complete message.

MessageParts contains Name/Value pairs prepared by the IDE. Common names and values in the property include:

Stage
Indicates what part of the build process the message belongs to. Common values are 'FPC', 'Linker' or 'make'.
Type
For FPC: 'Hint', 'Note', 'Warning', 'Error', 'Fatal', 'Panic', 'Compiling', 'Assembling', For make: ?. For Linker: ?.
Line
An integer with the line number as given by FPC (in brackets).
Column
An integer with the column number as given by FPC (in brackets).
Message
The message text without other parsed items.
  Example:

    Message written by FPC:
      unit1.pas(21,3) Warning: unit buttons not used

    Results in:
      Stage=FPC
      Type=Warning
      Line=21
      Column=3
      Message=unit buttons not used
            
Constructor for the class instance Destructor for the class instance Constructor for the class instance Defines a help manager used to display a help query or a table of contents

THelpManager is a TObject descendant which defines a help manager. It provides methods used to display help for specific help query types, or a help table of contents. It also provides methods used to display/handle error messages.

On its own, THelpManager is not particulary useful. All of the methods return the shrHelpNotFound help result. They are, however, declared as abstract/virtual and should be implemented/overridden in a descendent class which provides support for a specific help format like HTML, CHM, INF, or other content type.

THelpDatabases

HelpManager is a THelpManager variable with the unit global singleton for the class instance. Its value is assigned by the Lazarus IDE when the LCL Help System is initialized. LCL applications can call CreateLCLHelpSystem in LazHelpIntf.

Display the Help table of contents Displays a Help file wih the given file name and MIME type Display a Help file wih the give URL and MIME type Displaying Help (How It Works)
  • Start the help system, if not already started.
  • Search all appropriate help Databases for the given context. If multiple contexts fit, a help selector is shown and the user chooses one.
  • Calls the help Database to show the context. The help Database will search for an appropriate help viewer and start the application.