Class

TMSWordThread

Module

uSpell

Last Modified

7/15/2014 3:26:44 PM

Scope

Global

Inherits from

TThread

Declaration


  TMSWordThread = class(TThread)
  private
    FBeforeLines: TStringList;
    FAfterLines: TStringList;
    FWordSettings: TList;
    FEditControl: TCustomMemo;
    FShowingMessage: boolean;
//    FEmptyVar: OleVariant;
    FFalseVar: OleVariant;
//    FTrueVar: OleVariant;
    FNullStr: OleVariant;
    FWord: WordApplication;
    FDoc: WordDocument;
    FWordVersion: single;
    FDialog: OleVariant;
    FDocDlg: OleVariant;
    FText: string;
    FSpellCheck: boolean;
    FSucceeded: boolean;
    FCanceled: boolean;
    FTitle: string;
    FDocWindowHandle: HWnd;
    FOldFormChange: TNotifyEvent;
    FOldOnActivate: TNotifyEvent;
    FError: Exception;
    FErrorText1: string;
    FErrorText2: string;
    FAllowErrorRetry: boolean;
    FRetryResult: TShow508MessageResult;
    FResultMessage: string;
    FSpellChecking: boolean;
    FLock: TRTLCriticalSection;
    procedure OnFormChange(Sender: TObject);
    procedure OnAppActivate(Sender: TObject);
    procedure OnThreadTerminate(Sender: TObject);
    procedure FindDocumentWindow;
    procedure TransferText;
    function RunWithErrorTrap(AMethod: TThreadMethod;
      SpellCheckErrorMessage, GrammarCheckErrorMessage, AdditionalErrorMessage: string;
      AllowRetry: boolean): boolean;
    procedure WordError;
    procedure StartWord;
    procedure CreateDocument;
    procedure DoCheck;
    procedure ConfigWord;
    procedure ConfigDoc;
    procedure GetDialogs;
    procedure SaveUserSettings;
    procedure LoadUserSettings;
    procedure ExitWord;
    procedure ReportResults;
    procedure SaveWordSettings;
    procedure RestoreWordSettings;
    function UserSetting(Index: integer): boolean;
    procedure ThreadLock;
    procedure ThreadUnlock;
  protected
    constructor CreateThread(SpellCheck: boolean; AEditControl: TCustomMemo);
    procedure Execute; override;
  public
    procedure RefocusSpellCheckDialog;
    property Text: string read FText;
    property Succeeded: boolean read FSucceeded;
    property Canceled: boolean read FCanceled;
  end;

Class Hierarchy


Class Fields

Name Type Scope Comments
FAfterLines TStringList Private -
FAllowErrorRetry Boolean Private -
FBeforeLines TStringList Private -
FCanceled Boolean Private -
FDialog OleVariant Private -
FDoc Simple (unknown) Private -
FDocDlg OleVariant Private -
FDocWindowHandle HWND Private -
FEditControl TCustomMemo Private -
FError Exception Private -
FErrorText1 UnicodeString Private -
FErrorText2 UnicodeString Private -
FFalseVar OleVariant Private FEmptyVar: OleVariant;
FLock Simple (unknown) Private -
FNullStr OleVariant Private FTrueVar: OleVariant;
FOldFormChange TNotifyEvent Private -
FOldOnActivate TNotifyEvent Private -
FResultMessage UnicodeString Private -
FRetryResult Simple (unknown) Private -
FShowingMessage Boolean Private -
FSpellCheck Boolean Private -
FSpellChecking Boolean Private -
FSucceeded Boolean Private -
FText UnicodeString Private -
FTitle UnicodeString Private -
FWord Simple (unknown) Private -
FWordSettings TList Private -
FWordVersion Single Private -

Properties

Name Type Scope Comments
Canceled Boolean Public -
Succeeded Boolean Public -
Text UnicodeString Public -

Constructors

Name Declaration Scope Comments
CreateThread constructor CreateThread(SpellCheck: boolean; AEditControl: TCustomMemo); Protected -

Methods

Name Declaration Scope Comments
ConfigDoc procedure ConfigDoc; Private -
ConfigWord procedure ConfigWord; Private -
CreateDocument procedure CreateDocument; Private -
DoCheck procedure DoCheck; Private -
Execute procedure Execute; override; Protected -
ExitWord procedure ExitWord; Private -
FindDocumentWindow procedure FindDocumentWindow; Private -
GetDialogs procedure GetDialogs; Private
Var
  DispParams: TDispParams;
  OleArgs: array of OleVariant;
  ExcepInfo: TExcepInfo;
  Status: integer;
LoadUserSettings procedure LoadUserSettings; Private -
OnAppActivate procedure OnAppActivate(Sender: TObject); Private -
OnFormChange procedure OnFormChange(Sender: TObject); Private -
OnThreadTerminate procedure OnThreadTerminate(Sender: TObject); Private -
RefocusSpellCheckDialog procedure RefocusSpellCheckDialog; Public -
ReportResults procedure ReportResults; Private -
RestoreWordSettings procedure RestoreWordSettings; Private -
RunWithErrorTrap function RunWithErrorTrap(AMethod: TThreadMethod; SpellCheckErrorMessage, GrammarCheckErrorMessage, AdditionalErrorMessage: string; AllowRetry: boolean): boolean; Private -
SaveUserSettings procedure SaveUserSettings; Private -
SaveWordSettings procedure SaveWordSettings; Private -
StartWord procedure StartWord; Private -
ThreadLock procedure ThreadLock; Private -
ThreadUnlock procedure ThreadUnlock; Private -
TransferText procedure TransferText; Private -
UserSetting function UserSetting(Index: integer): boolean; Private -
WordError procedure WordError; Private -

Referenced By (2)

Module (line) Referrer Type
uSpell (128) MSWordThread Read
uSpell (255) - Read