=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-
                                   LSMail 4.3  
                                created by MrJukes
                    updated by Vendicator, Jesus_mjjg, ilmcuts
                             Last Modified: 2003-06-13
=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-=-


-- ABOUT -----------------------------------------------------------------------

 LSMail is LiteStep's longest running third-party module.  It checks for new
 mail on multiple POP3 accounts either periodically or ob request and notifies
 the users whether they have new mail (or not).


-- INSTALLATION ----------------------------------------------------------------

 Put Lsmail.dll in a directory of your choice, e.g. C:\Litestep\Modules\.
 Open your step.rc and add a LoadModule line pointing to the dll, for example:

 LoadModule "C:\Litestep\Modules\LSMail.dll"

 You can use the step.rc and !bang commands described below to control LSMail.
 When you're done save the file and recycle.


-- USAGE -----------------------------------------------------------------------

 Left clicking will check for new mail on all servers (if no new mail is found, 
 the "new mail" flag will be cleared).

 Right clicking brings up a menu that is fairly self-explanatory:
 - "Check Mail" will check mail on all servers.
 - "Launch E-Mail Client will launch the e-mail client you specified with
   LSMailEMailClient.
 - "Clear New Mail" will clear the new mail flag and switch back to normal mode.
 - Display Last Error will display the last error that LSMail encountered
   (Include this error message if you e-mail a bug report).


-- STEP.RC COMMANDS ------------------------------------------------------------

 The values given after the commands are the default values.

 LSMailX 0                      ; (X/Y coordinate, width, height)
 LSMailY 0                      ; These commands specify position and size of
 LSMailW 400                    ; the LSMail window. If you have a recent LS
 LSMailH 25                     ; build the X and Y commands use GetRCCoordinate,
                                ; which means you can use positions relative
                                ; from the center of the screen (30c) or percent
                                ; values (30%).

 LSMailTimer 5                  ; How often LSMail should check for mail (in
                                ; minutes). If this is 0 no timer will be set
                                ; and all checking will have to be done
                                ; manually.

 LSMailBangMode FALSE           ; Disable all GUI routines. Speed improvement.

 LSMailStartHidden FALSE        ; Doesn't show the LSMail window until you tell
                                ; it to show via !bang.

 LSMailAlwaysOnTop FALSE        ; Makes the LSMail window appear ontop of all
                                ; other windows.

 LSMailNoText FALSE		; Disables text output in window, if you only want
				; special gfx for notifying you that there is new mail.

 LSMailNoMessageBoxes FALSE     ; Suppresses all messageboxes and sends them as
                                ; warnings to the log file.

 LSMailDisableCheck FALSE       ; Prevents LSMail from trying to check mail
                                ; until it is manually enabled.

 LSMailEMailClient !none        ; Specifies the command to execute if "Launch
                                ; E-Mail client" is chosen from the menu.

 LSMailFont Arial               ; The Font to be used in the LSMail window.
 LSMailFontSize 12              ; The size of the font.
 LSMailFontBold FALSE           ; Makes the text appear in bold.

 LSMailFontColor FFFFFF         ; Font color in "normal" state.
 LSMailNewMailFontColor 0000FF  ; Font color if there is new mail.
 LSMailCheckingFontColor 0000FF ; Font color while checking mail.
 LSMailErrorFontColor FF0000    ; Font color if an error has occured while
                                ; checking mail.

	; Mouse Click Actions:

 LSMailOnLeftDBL !None
 LSMailOnLeftDown !None
 LSMailOnLeftUp !LSMailCheckMail

 LSMailOnRightDBL !None
 LSMailOnRightDown !LSMailMenu
 LSMailOnRightUp !None

 LSMailOnMiddleDBL !None
 LSMailOnMiddleDown !None
 LSMailOnMiddleUp !None

	; *NOTE*
	; If you do not specify a background color or a background image
	; LSMail will use the desktop as its background.

 LSMailBackColor 000000         ; Normal background color
 LSMailBackNewMailColor 0000FF  ; Background color when there is new mail
 LSMailBackCheckingColor 000000 ; Background color when checking mail
 LSMailBackErrorColor FF0000    ; Background color if an error has occured

 LSMailBackBmp .none            ; Normal Background image
 LSMailNewMailBmp .none         ; Background image when there is new mail
 LSMailCheckingBmp .none        ; Background image when LsMail is checking
 LSMailErrorBmp .none           ; Background image to display if an error has occured

 LSMailNewMailCmd !none         ; Bang to be executed when there is new mail
 LSMailNoMailCmd !none          ; Bang to be executed when you don't have any mail
 LSMailCheckMailCmd !none       ; Bang to be executed when lsmail checks for new mail
 LSMailDoneCheckCmd !none       ; Bang to be executed when lsmail is done checking
 LSMailErrorCmd !none           ; Bang to be executed if an error has occured

    ; Server Configuration
    ; You can have as many of these are you would like
    ; The format is as follows:
    ;   *LSMailServer X Y "Display Name" host.name.com<:port> login (password-optional)
    ;  Where:
    ;    X = x offset for displaying the text inside the main window
    ;    Y = y offset for displaying the text inside the main window
    ;    Display Name = What to display for the server name
    ;    host.name.com = Host to connect to
    ;    <:port> = This is optional, leave it off and it defaults to 110
    ;    login = Your login
    ;    password = mail accounts password, not required here, lsmail will ask
    ;    for password if not given.

    ; Examples:
    ;   *LSMailServer 0 0 Purdue postoffice.purdue.edu:110 mrjukes
    ;   *LSMailServer 0 16 Interaccess mail.interaccess.com mrjukes


-- !BANG COMMANDS --------------------------------------------------------------

 !LSMailShow            ; Shows the window
 !LSMailHide            ; Hides the window
 !LSMailToggle          ; Toggles visibility
 !LSMailCheckMail       ; Checks the mail
 !LSMailHook            ; Hooks lsmail to lsbox
 !LSMailToggleCheck     ; Toggles whether LsMail is allowed to check mail
 !LSMailEnableCheck     ; Enables LsMail to check for mail
 !LSMailDisableCheck    ; Disables LsMail from checking for mail
 !LSMailMove x y        ; Move LsMail to position x,y on screen
 !LSMailMenu            ; Shows the LSMail menu at the current mouse position
 !LSMailClearNew		; Clears the new mail flag, returning bg to normal
 !LSMailZeroMail		; Resets email count to 0, bg returns to normal

-- EXPORTED VARIABLES ----------------------------------------------------------

 LsMail sets the following evars after each mail check (if your LS build
 supports this feature)::

 $LsMailNumMessages$    ; Total number of messages found on all servers
 $LsMailServer[nr]$     ; Number of messages on each individual server
			; ie. for 2 servers: 
			; $LsMailServer1$ and $LsMailServer2$


-- VERSION HISTORY -------------------------------------------------------------

4.3, 2003-06-13 (Vendicator)
	- Using STL instead of homebrewn linked list
	- Added !LSMailClearNew and !LSMailZeroMail
	- Added "LSMailNoText" for disabling text output for those who only want to see different gfx
	  when there is new mail.
	- Started work on a SafeString class using the functions from strsafe.h and converted to TCHAR
	- Included the *line reader for getting server configs.
	- Also using Clickable class, allows for specifying the actions when user clicks window
	- LsMail now uses GuiWindow class for window handling functions (lsbox, toggling etc).
	  Note that the on top handling is slightly different.
	- Started moving some of my classes to a separate folder for code reuse.

4.2, 2003-05-31 (ilmcuts)
    - Added !LsMailMenu to show the rightclick menu.
    - Fixed potential access violations (aka crashes).
    - Fixed fonts from charsets other than ANSI_CHARSET not working correctly.
    - Fixed display only being updated when all servers are done retrieving the
      mail count (Vendicator).
    - Fixed LSMailEMailClient requiring quotes and not working reliably with
      parameters.
    - Fixed compatibility with old builds and PureLS (possibly even works with
      0.24.5 now :p).
    - Fixed all compiler warnings on warning level 3 and most on level 4.
    - Restructured readme.
    
4.16, 2003-03-23 (ilmcuts)
    - Improved parser, it uses the existing cache instead of reparsing step.rc.
    - Fixed access violation.

4.15, 2003-01-27 (Vendicator)
    - The enable/disabled check bangs did the opposite of what they were
      supposed to do, thanks to Maciej Ligenza for pointing it out.
    - Fixed a rare start up error.

4.14, 2003-01-19 (Vendicator)
    - Added support for LSMailFontBold.
    - Moved code a bit.
    - Added a check to prevent illegal access to servers before they are set up
    - Made sure to initialize all vars to prevent errors-
    - Recreated change (didn't find source) from jesus_mjjg ':' isn't printed
      anymore when no name is entered.

4.13, 2002-10-30 (Vendicator) - unreleased?
    - Removed ugly hWnd2 variable hack
    - Moved code out from lsmail.cpp to separate .cpp files, had to resort to a
      static hack to send the lsmail object to them...
    - Added LsMailBangMode (disables the gui routines for faster functioning).

4.12, 2002-08-25 (Vendicator)
    - Fixed startup window paint before a mail check has been run.
    - Other shells without LSSetvar() in lsapi should be working again, PureLS
      and others.
    - Added check for log support in lsapi.dll to be on the safe side.

4.11, 2002-08-19 (Vendicator)
    - Fixed timer bug causing lsmail not to do interval mail checking.
    - Sets the following vars after a mail check:
      LsMailNumMessages [total nr messages], LsMailServer[nr] [nr messages]

4.1,  2002-08-18 (Vendicator)
    - Big push towards more OOP.
    - Even more code cleaning.
    - Filesize slashed with about 50k, had to use ugly hack by adding hWnd2 as
      a public HWND for external funtions.
    - Added setting to disable mail check "LSMailDisableCheck", use bangs to
      enable at runtime: !LSMailToggleCheck, !LSMailEnableCheck,
      !LSMailDisableCheck
    - Added !LsMailMove x y
    - Added LSMailErrorBmp, LSMailBackErrorColor, LSMailErrorFontColor,
      LSMailErrorCmd per request of... sorry I forgot...
    - !Refresh support
    - Cleaner Readme format

4.08a, 2002-07-24 (Vendicator)
    - Fixed LSMail not removing the status !bang commands correctly on recycle.
    - More stuff moved into the OOP layout.

4.08, 2002-07-24 (Vendicator)
    - Added !LsMailHook for lsbox support.
    - Added LSMailNoMessageBoxes, which sends errors as warnings to log file.
    - Started rewrite to a more OOP layout, will make it easier to add other
      server types.
    - Added LSMailDoneCheckCmd, per request of Maestr0.

4.07, 2002-05-29 (Vendicator)
    - Fixed so that it defaults to old password style if none is present in the
      .rc config.
    - LsMail no longer shows up in taskmanager.
    - Added killing of lsmail thread on quit, might fix the ls crash on recycle
      when lsmail was checking.
    - Added LSMailCheckMailCmd, per request of morph, originally added by ilmcuts.

4.06, 2002-05-11 (Jesus_mjjg)
    - It is now possible to specify the password in the step.rc:
      *LSMailServer X Y "Display Name" host.name.com<:port> login password
      But it seems to be better to use ears to configure lsmail:
      *LSMailServer 5 6 Mail $mailPop1$ $mailLogin1$ $mailPassword1$
      You have been warned! Don't tell me that because of me someone took your
      password. If you don't want to put your password, don't put it, it'll work
      like before.

4.05, 2002-04-17 (Vendicator)
    - Can show a separate bitmap when checking mail (LSMailCheckingBmp)
    - You can now specify a !bang to run when you have new mail/no mail
      (LSMailNewMailCmd/LSMailNoMailCmd).
    - Zero account is removed since it really didn't do anything useful now.

4.02, 2002-04-16 (Vendicator)
    - Clearing new mail flag made previous left click action abundant, changed
      to check mail.

4.01, 2002-04-15 (Vendicator)
    - Centered coordinates support.
    - Clearing of new mail flag when server reports no mail.

4.0,  XXXX-XX-XX (MrJukes)
	- Complete rewrite


-- CONTACT ---------------------------------------------------------------------

Vendicator:
vendicator_AT_mail_DOT_com

ilmcuts:
ilmcuts_at_gmx_dot_net
#litestep, #lsdev on irc.freenode.net


Have fun,
	MrJukes, Vendicator, ilmcuts