#ifndef UTILS_H
#define UTILS_H

///////////////////////////////////////////////////////////////////
//                                                               //
//  U T I L I T Y   F U N C T I O N S                            // 
//                                                               //
///////////////////////////////////////////////////////////////////

//*****************************************************************
//* $Workfile: UTILS.H $  
//* $Archive: /testing/testsys/lib/snb/UTILS.H $  
//* $Revision: 39 $
//* $Author: Ian $    
//* $Date: 11/07/96 10:28a $  
//* 
//* Description: Utility functions for testing Scientific Workplace,   
//* Scientific Word, and Scientific Notebook
//*
//* TCI Software Research
//* 1190 Foster Rd.
//* Las Cruces, NM 88001
//* (505) 522-4600
//* (505) 522-0116 (Fax)
//* 
//*****************************************************************


///////////////////////////////////////////////////////////////////
//  I N C L U D E S
///////////////////////////////////////////////////////////////////

#include "stdafx.h" // Defines TCIString and HWND.
#include "logf.h"   // Defines NOACTION.
//#include    // You need this to test the registry.


//////////////Enumerated and other types for brackets and binomials//////////////////////////////////
//enum previewStatus {INITEX, SWP, PREVIEW, WARNING };

enum leftBracketType {
                        TOP_LEFT_PARENTHESIS,
                        TOP_LEFT_BRACKET,
                        TOP_LEFT_BRACE,
                        TOP_LEFT_ANGLE,
                        TOP_LEFT_FLOOR,
                        TOP_LEFT_CEILING,
                        TOP_VERTICAL_BAR,
                        TOP_DOUBLE_VERTICAL_BAR,
                        TOP_FORWARD_SLASH,
                        TOP_BACK_SLASH,
                        TOP_UP_DOWN_ARROW,
                        TOP_DASHED_VERTICAL_BAR,
                        TOP_UP_DOWN_DOUBLE_ARROW,
                        TOP_UP_ARROW,
                        TOP_UP_DOUBLE_ARROW,
                        TOP_DOWN_ARROW,
                        TOP_DOWN_DOUBLE_ARROW,
                        TOP_RIGHT_CEILING,
                        TOP_RIGHT_FLOOR,
                        TOP_RIGHT_ANGLE,
                        TOP_RIGHT_BRACE,
                        TOP_RIGHT_BRACKET,
                        TOP_RIGHT_PARENTHESIS
                      }; 

enum rightBracketType {
                        BOTTOM_RIGHT_PARENTHESIS,
                        BOTTOM_RIGHT_BRACKET,
                        BOTTOM_RIGHT_BRACE,
                        BOTTOM_RIGHT_ANGLE,
                        BOTTOM_RIGHT_FLOOR,
                        BOTTOM_RIGHT_CEILING,
                        BOTTOM_VERTICAL_BAR,
                        BOTTOM_DOUBLE_VERTICAL_BAR,
                        BOTTOM_FORWARD_SLASH,
                        BOTTOM_BACK_SLASH,
                        BOTTOM_UP_DOWN_ARROW,
                        BOTTOM_DASHED_VERTICAL_BAR,
                        BOTTOM_UP_DOWN_DOUBLE_ARROW,
                        BOTTOM_UP_ARROW,
                        BOTTOM_UP_DOUBLE_ARROW,
                        BOTTOM_DOWN_ARROW,
                        BOTTOM_DOWN_DOUBLE_ARROW,
                        BOTTOM_LEFT_CEILING,
                        BOTTOM_LEFT_FLOOR,
                        BOTTOM_LEFT_ANGLE,
                        BOTTOM_LEFT_BRACE,
                        BOTTOM_LEFT_BRACKET,
                        BOTTOM_LEFT_PARENTHESIS
                      };

enum lineWidth{ LINE_NONE, LINE_NORMAL, LINE_THICK };
enum binomSize{ BINOMIAL_AUTO, BINOMIAL_BIG, BINOMIAL_SMALL };
enum CurrentApp { ac, swp, snb, unknown };
/////////////////////////////Enumerated types for decoration/////////////////////////////////////////

enum decorationName    {
                        OVERLINE,
                        OVERLEFTARROW,
                        OVERRIGHTARROW,
                        OVERLEFTRIGHTARROW,
                        OVERBRACE,
                        WIDEHAT,
                        WIDETILDE,
                        UNDERLINE,
                        UNDERLEFTARROW,
                        UNDERRIGHTARROW,
                        UNDERLEFTRIGHTARROW,
                        UNDERBRACE,
                        FBOX,
                        FRAME
                       };


//////////////Enumerated types for displays////////////////////////////////////////////////
enum NumberingScheme {NONE, AUTO, CUSTOM, SUPRESS};
enum Units {UINCHES, UCENTIMETERS, UPICAS, UPOINTS};
enum AlignmentScheme {STANDARD, MULTIPLE, CENTERED, CENTER};
enum Lettering {CONTINUOUS, LETTERKEY};

//////////////Enumerated types for operators/////////////////////////////////////////////////////////
enum operatorLimitPosition{LIMIT_AUTO, LIMIT_ABOVEBELOW, LIMIT_ATRIGHT};
enum operatorLimitSize{SIZE_AUTO, SIZE_BIG, SIZE_SMALL};
enum operatorSymbol    {
                        INTEGRAL,
                        DOUBLE_INTEGRAL,
                        TRIPLE_INTEGRAL,
                        QUAD_INTEGRAL,
                        DOTSINTEGRAL,
                        OINTEGRAL,
                        SUM,
                        PRODUCT,
                        BIGCAP,
                        BIGWEDGE,
                        BIGOPLUS,
                        BIGODOT,
                        BIGSQCUP,
                        COPRODUCT,
                        BIGCUP,
                        BIGVEE,
                        BIGOTIMES,
                        BIGUPLUS
                       };

//////////////Enumerated types for tables/////////////////////////////////////////////////////////
enum ColumnAlignment {COLUMN_LEFT, COLUMN_CENTER, COLUMN_RIGHT};
enum BaseAlignment {BASE_BOTTOM, BASE_MIDDLE, BASE_TOP};
enum LineType {NO_LINE, SINGLE, DOUBLE};
enum LinePosition {LINE_TOP, LINE_LEFT, LINE_RIGHT, LINE_BOTTOM, LINE_ALL, LINE_OUTLINE};
enum ColumnWidth {AUTO_WIDTH, FIXED_WIDTH, UNITS}; 
enum VerticalAlignment{ VERTICAL_TOP, VERTICAL_MIDDLE, VERTICAL_BOTTOM };
//////////////Enumerated types for Standard buttons////////////////////////////////////////////////////
//enum stdButton {OK, YES, NO, CANCEL, CLOSE};


///////////////////////////////////////////////////////////////////
//  F U N C T I O N   P R O T O T Y P E S
///////////////////////////////////////////////////////////////////

void _EXPORT IanPreview(int timeInSeconds);
//
//Yet another attempt to make the preview work.
//

//
// This routine cuts highlighted text to the clipboard.
//
void _EXPORT EditCut(void);


//
// The EditPaste procedure copies text from the clipboard into the
//   current window or control.
//
void _EXPORT EditPaste(void);


//
// The EditCopy procedure copies highlighted text to the clipboard.  
//
void _EXPORT EditCopy(void); 

//
// The ChooseManualBibliography procedure sets the bibliography
// choice to Manual in the Document Options dialog.  
//
void _EXPORT ChooseManualBibliography(void); 

//
// The ChooseBibTeXBibliography procedure sets the bibliography
// choice to BibTeX in the Document Options dialog.  
//
void _EXPORT ChooseBibTeXBibliography(void); 

//
// The CreateManualCitation procedure enters a manual citation
// using given string for Key and remark.
//
void _EXPORT CreateManualCitation(const TCIString &key, const TCIString &remark); 

//
// The CreateBibTeXCitation procedure enters a BibTeX citation
// using given string for Key and remark and database. If bibEntryOnly 
// is non-zero then that box in the dialog will be checked.
//
void _EXPORT CreateBibTeXCitation(const TCIString &key, const TCIString &database, 
																		 const TCIString &remark, int bibEntryOnly); 

//
// Takes passed expected results and compares it to the 
// clipboard contents.
void _EXPORT CheckClipboardResults(const TCIString &expectedResults);

//
// Takes passed expected note text and compares it to the 
// current note text.
void _EXPORT CompareExpectedTextToMessageText(const TCIString &expectedText);

//
// Kills current application and restarts test application
//
void _EXPORT RestartApplication(void);

//
// Resets the database to installation defaults and defaults set in the ini file.
//
void _EXPORT ResetPreferences(void);

void _EXPORT HighlightCurrentLine(void);

//
// Uses Highlight current line and highlights only the current line,
// then copies this line to the clipboard.
void _EXPORT ObtainTextOfCurrentLine(void);


//   Overview of ValueSetPos function:
//
//   This feature is a simpleminded way of addressing the problem of value sets. It works by setting the focus
//   to a control which contains the valueset, pressing the HOME key and pressing the right arrow key and/or down
//   arrow keys until you set the focus to the desired value set. 
//
//   Structure:
//   
//   valueSetControl: The control's focus is set by the valueSetControl variable. The name for this 
//                    control is the one designated in the swp.ini file.
//
//       valueSetRow: The right arrow key is controled by the valueSetRow variable.
// 
//    valueSetColumn: The down arrow key is controled by the valueSetColumn variable.
//   
//           Example: ValueSetPos("UpperBrackets",4,0, FAIL|ABORT);
// 
//    In this example, focus is set to the control, "upperbrackets", the HOME key is 
//   pressed automatically, the right arrow key is pressed 4 times, and the down 
//   arrow key is pressed 0 times.
//
//   Note: In this example, a literal number 4 was used to set column position. In practice,
//         it is almost always better to use enumerated types  This function is almost never 
//         used alone. It is usually called by other functions.
//  
void _EXPORT ValueSetPos(const TCIString &valueSetControl, unsigned int valueSetColumn, unsigned int valueSetRow);


//   Overview of CreateBrackets function:
//
//   This function creates any combination of left and right brackets. It uses enumerated
//   types found at the top of this file and in the brackets.cpp system test.  
//
//   Structure:
//   
//   leftBracketType  LB: This enumerated type variable determines the left bracket.
//
//   rightBracketType RB: This enumerated type variable determines the right bracket. 
// 
//               Example: CreateBrackets(TOP_LEFT_PARENTHESIS, BOTTOM_RIGHT_PARENTHESIS, FAIL|ABORT);

//   In this example, the system creates a left parenthesis on the left side an a right parenthesis
//   on the right side.
//
//   Note: The TOP_ and BOTTOM_ designations refers to the control set in the brackets dialog box. 
//         TOP_ refers to the top row of brackets while BOTTOM_ refers to the bottom row of brackets.   
void _EXPORT CreateBrackets(leftBracketType LB, rightBracketType RB);


//   Overview of CreateBinomial function:
//
//  This function creates binomials with any combination of left and right brackets. It uses enumerated
//  types found at the top of this file and in the binomial.cpp system test. 
//
//  Arguments:
//  
//    TCIString numerator: Inserts a character into the numerator portion of the binomial.
//
//  TCIString denominator: Inserts a character into the denominator portion of the binomial
//
//     leftBracketType LB: This enumerated type variable determines the left bracket.
//	 
//    rightBracketType RB: This enumerated type variable determines the right bracket.
//	  
//        BOOL delimiters: If TRUE, this variable turns delimiters on by clicking the
//                          checkbox in the binomial dialog, otherwise delimiters are off. 
//
//        lineWidth width: This enumerated type variable determines the linewidth.
//                          Valid entries are: LINE_NONE, LINE_NORMAL, and LINE_THICK.
//
//         binomSize size: This enumerated type variable determines the binomial size. 
//                         Valid entries are: BINOMIAL_AUTO, BINOMIAL_BIG, BINOMIAL_SMALL.
// 
// 
//                Example: CreateBinomial("1","2",
//                     	   TOP_LEFT_PARENTHESIS,
//                     	   BOTTOM_RIGHT_PARENTHESIS,
//                    	   TRUE,
//                         LINE_THICK,
//                         BINOMIAL_BIG);
// 
//  In this example, the system creates a binomial with a 1 in the numerator, a 2 in the denominator,
//  a left parenthesis on the left side an a right parenthesis on the right side. Brackets are turned on.
//  The line thicknes is set to thick and the binomial is of the largest size.
//
//  Note: The TOP_ and BOTTOM_ designations refers to the control set in the brackets dialog box. 
//         TOP_ refers to the top row of brackets while BOTTOM_ refers to the bottom row of brackets.  
void _EXPORT CreateBinomial (const TCIString &numerator,
                                const TCIString &denominator,
                                leftBracketType LB,
                                rightBracketType RB,
                                BOOL delimiters,
                                lineWidth width,
                                binomSize size);


//   Overview of CreateDecoration function:
//
//  This function creates decorations. You may optionally place content in the 
//  cell created by the decoration. It uses enumerated types found above and in 
//  the decoration.cpp system test
//  . 
//
//  Arguments:
//  
//    decorationName decoration: Creates the specified decoration..
//
//           TCIString &content: Inserts content into the decoration cell.
// 
//                      Example: CreateDecoration (OVERLINE, "Test");
// 
//  In this example, the system creates the word "Test" with an overline decoration,
void _EXPORT CreateDecoration (decorationName decoration, const TCIString &content);

 
 
///////////////////////////DISPLAYS/////////DISPLAYS//////////DISPLAYS//////////////////
//
//  There are several functions associated with displays. A display can be created,after 
//  which it can have its numbering  alignment, or lettering changed. The functions
//  which control these are:
//
//  CreateDisplay(int lines, long logStatus /* = NOACTION */);
//  DisplayNumbering(NumberingScheme numbering,TCIString customLabel, TCIString displayKey, Units units, TCIString spaceAfter, long logStatus);
//  DisplayAlignment(AlignmentScheme alignment, long logStatus /* = NOACTION */);
//  DisplayLettering(Lettering letters, TCIString displayKey, long logStatus /* = NOACTION */);
//
/////////////////////////////////////////////////////////////////////////////////////////
//  Overview of CreateDisplay function:
//
//  This function creates displays. 
//
//  Arguments:
//  
//  int lines: Specifies the number of lines in a display..
//
//    Example: CreateDisplay (2);
// 
//  This example creates a 2 line display.
void  _EXPORT CreateDisplay(int lines);


///////////////////////HYPERTEXT LINKS///////////////////HYPERTEXT LINKS//////////////////
//
//  There are two functions associated with hypertext links. A hypertext link can be created
//  with screen text or with an icon. The functions which control these are:
//
//  CreateHypertextLink(const TCIString& screenText, const TCIString& printedTextLeft,
//                      const TCIString& printedTextRight, const TCIString& target);
//  CreateHypertextLinkWithIcon(const TCIString& printedTextLeft,
//                              const TCIString& printedTextRight, const TCIString& target);
//
/////////////////////////////////////////////////////////////////////////////////////////
//  Overview of CreateHypertextLink function:
//
//  This function creates Hypertext Links. 
//
//  Arguments:
//  
//  TCIString screenText:       Enter the text to be shown on screen.
//	TCIString printedTextLeft:  Enter any text you want printed out to the left of the link.
//  TCIString printedTextRight: Same as left, only it comes to the right.
//  TCIString target:           Enter the target to jump to.
//
//    Example: CreateHypertextLink("scrn","left", "right", "link1", FAIL|ABORT);
// 
//  This example creates a hypertext link with scrn showing on the screen, left being printed 
//  to the left of the link, right being printed to the right and choosing the jump will take 
//  you to the marker - link1.

void _EXPORT CreateHypertextLink(const TCIString& screenText, const TCIString& printedTextLeft,
                                    const TCIString& printedTextRight, const TCIString& target);

/////////////////////////////////////////////////////////////////////////////////////////
//  Overview of CreateHypertextLinkWithIcon function:
//
//  This function creates Hypertext Links, but instead of showing screen text it will add 
//  THE DEFAULT chosen icon. 
//
//  Arguments:
//  
//	TCIString printedTextLeft:  Enter any text you want printed out to the left of the link.
//  TCIString printedTextRight: Same as left, only it comes to the right.
//  TCIString target:           Enter the target to jump to.
//
//    Example: CreateHypertextLinkWithIcon("left", "right", "link1", FAIL|ABORT);
// 
//  This example creates a hypertext link with the default icon showing on the screen, left being 
//  printed to the left of the link, right being printed to the right and choosing the jump will  
//  take you to the marker - link1.
void _EXPORT CreateHypertextLinkWithIcon(const TCIString& printedTextLeft,
                                            const TCIString& printedTextRight, 
																						const TCIString& target);


/////////////////////////////////////////////////////////////////////////////////////////
//  Overview of Display Numbering function:
//
//  This function controls the numbering, labeling, spacing and reference keys for a display. 
//
//  Arguments:
//  
//  NumberingScheme numbering:  Specifies the kind of numbering for the display.
//                              Valid numberning options are NONE, AUTO, CUSTOM, and SUPRESS.
//   
//      TCIString customLabel:  This puts content in the custom label field.
//
//       TCIString displayKey:  This puts content in the "Key for this line" field.
//
//                Units units:  This controls the units for spacing in the "space after this line field."
//                              Valid units are UINCHES, UCENTIMETERS, UPICAS, and UPOINTS.
//
//       TCIString spaceAfter:  This controls how much space occurs after a given line of the display.
//                              A user would type in a number here. This variable is a TCIString so
//                              that we can put anything in here for testing purposes.
//
//                    Example:  DisplayNumbering(CUSTOM,"This is a custom label","This is a display key",UPICAS,"1");
//  
//  This example modifies an existing display by clicking the custom label button, inserting the label, "This is a custom label"
//  in the custom label field, inserting the label, "This is a display key" in the label field, selecting picas as the unit of
//  measurement, and 1 as the number of picas to insert after the line. If no label or key is desired, simply leave these fields 
//  blank.
//
//
//
void _EXPORT DisplayNumbering(NumberingScheme numbering,
                                  const TCIString &customLabel,
                                  const TCIString &displayKey,
                                  Units units,
                                  const TCIString &spaceAfter);


//  Overview of Display Alignment function:
//
//  This function controls alignment of content within a display. 
//
//  Arguments:
//  
//  AlignmentScheme alignment: Specifies the kind of numbering for the display.
//                             Valid alignment options are STANDARD, MULTIPLE, CENTERED, and CENTER.
//
//                             Note: CENTER and CENTERED do the same thing. I included both because I can 
//                             never remember which one to type.
//   
//                    Example: DisplayAlignment(CENTERED,FAIL|ABORT);
// 
//  This example modifies an existing display by clicking the Advanced button and 
//  clicking the "Each line centered option" button in the dialog box.  
//
void  _EXPORT DisplayAlignment(AlignmentScheme alignment);


//  Overview of Display lettering function:
//
//  This function controls lettering within a display. 
//
//  Arguments:
//  
//     Lettering &letters: Specifies the kind of numbering for the display.
//                         Valid options are CONTINUOUS and LETTERKEY.
//
//                         CONTINUOUS checks the lettering continuation checkbox.
//
//                         LETTERKEY checks the lettering continuation checkbox
//                         and places the contents of &displayKey into the "Key for whole display field."
//
//  TCIString &displayKey: This defines the content into the "Key for whole display field."
//
//   
//                 Example DisplayLettering(LETTERKEY, "ThisIsAKey", FAIL|ABORT);
//
// 
//  This example modifies an existing display by clicking the Advanced button, selecting
//  the continuation checkbox and placing the contents of &displayKey into the 
//  "Key for whole display field."
//
void _EXPORT DisplayLettering(Lettering letters, const TCIString &displayKey);



////////////////////////////////OTHER OBJECTS///////////////////////////////
// Please, oh, please tell me you don't need documentation for the next 5 functions.

////////////////////////////////// Create fraction///////////////////////////////////////////////
void  _EXPORT CreateFraction(const TCIString &numerator, const TCIString &denominator);

////////////////////////////////// Create radical///////////////////////////////////////////////
void  _EXPORT CreateRadical(const TCIString &root, const TCIString &radicand);

 ///////////////////////////////  Create a Superscript ///////////////////////////////////////////
void  _EXPORT CreateSuperscript(const TCIString &superScript);
  
 ///////////////////////////////  Create a Subscript /////////////////////////////////////////////
void  _EXPORT CreateSubscript(const TCIString &subScript);

/////////////////////////////// Create a Marker field //////////////////////////////////////  
void  _EXPORT CreateMarker(const TCIString &markerContent, const TCIString &remarkContent);


///////////////////////////////  Create Operator /////////////////////////////////////////////

//  Overview of the CreateOperator function:
//
//  This function creates a specified operator of a given size and with specified limit positions.
//
//  Arguments:
//  
//          operatorSymbol symbol: Specifies the kind of numbering for the display.
//                            The following list are valid symbol options:
//   
//                                  INTEGRAL,
//                                  DOUBLE_INTEGRAL,
//                                  TRIPLE_INTEGRAL,
//                                  QUAD_INTEGRAL,
//                                  DOTSINTEGRAL,
//                                  OINTEGRAL,
//                                  SUM,
//                                  PRODUCT,
//                                  BIGCAP,
//                                  BIGWEDGE,
//                                  BIGOPLUS,
//                                  BIGODOT,
//                                  BIGSQCUP,
//                                  COPRODUCT,
//                                  BIGCUP,
//                                  BIGVEE,
//                                  BIGOTIMES,
//                                  BIGUPLUS
//
//  operatorLimitPosition position: This variable controls wheter the limits of an operator 
//                                  are set above, to the right, or automatically." 
//                                  Valid settings are: LIMIT_AUTO, LIMIT_ABOVEBELOW, 
//                                  and LIMIT_ATRIGHT.
//
//          operatorLimitSize size: This variable controls the operator limit size. Valid
//                                  settings are: SIZE_AUTO, SIZE_BIG,and SIZE_SMALL. 
// 
//                         Example: CreateOperator(INTEGRAL, LIMIT_ABOVEBELOW, SIZE_SMALL);
//
// 
//  This example creates a small integral with the limits above and below. 
//
void _EXPORT CreateOperator (operatorSymbol symbol, operatorLimitPosition position, operatorLimitSize size);


///////////////// TABLES ////////////// TABLES ///////////// TABLES ///////////////
//
// The table functions allow you to:
//
//   * create tables,
//   * set the internal horizontal and vertical alignment of cell content,
//   * set the vertical alignment of the table relative to text surrounding the table,
//   * place lines around any set of table cells,
//   * set the width of any individual column.
//
/////////////////////////////////////////////////////////////////////////////////////////////////////  


//  Overview of Create table function:
//
//  This function creates tables. 
//
//  Arguments:
//  
//       TCIString rows: Specifies the number of rows in the table.
//
//  TCIString &columns: Specifies the number of columns in the table.
//
//              Example: CreateTable("1","2", FAIL|ABORT);
//
// 
//  This example creates a 1 x 2 table.
void _EXPORT CreateTable(const TCIString &rows, const TCIString &columns);




//  Overview of SetAlignment function:
//
//  This function sets the horizontal alignment of content within cells
//  and the baseline alignment of tables relative to surrounding text. 
//
//  Arguments:
//  
//  ColumnAlignment columnAlignment: Specifies the horizontal alignment of content within cells.
//                                   Valid settings are: COLUMN_LEFT, COLUMN_CENTER and COLUMN_RIGHT.
//
//      BaseAlignment baseAlignment: Specifies the baseline alignment of the table relative 
//                                   to surrounding text. Valid settings are:
//                                   BASE_BOTTOM,BASE_MIDDLE, and BASE_TOP.  
//
//                          Example: SetAlignment(LEFT, BASE_BOTTOM);
//
// 
//  This example modifies the table (or selected cells) to have left aligned content, and for the entire table to have
//  itself bottom aligned relative to text..
void _EXPORT SetAlignment(ColumnAlignment columnAlignment, BaseAlignment baseAlignment);




//  Overview of SetLines function:
//
//  This function sets visible single or double lines around selected cells
//  or tables.
//
//  Arguments:
//  
//          LineType lineType  Specifies the horizontal alignment of content within cells.
//                             Valid settings are: NO_LINE, SINGLE and DOUBLE..
//
//  LinePosition linePosition: Specifies where you want to put the lines..
//                             Valid settngs are:LINE_TOP, LINE_BOTTOM, LINE_LEFT, LINE_RIGHT, LINE_ALL, and LINE_OUTLINE. 
//
//                    Example: SetLines(SINGLE, LINE_ALL);
//
// 
//  This example modifies the table (or selected cells) to have single lines all around.
void _EXPORT SetLines(LineType lineType, LinePosition linePosition);



//  Overview of SetWidth function:
//
//  This function sets visible single or double lines around selected cells
//  or tables.
//
//  Arguments:
//  
//  ColumnWidth columnWidth  Specifies an absolute column width..
//                           Valid settings are:  AUTO_WIDTH and FIXED_WIDTH..
//                                                          
//              Units units: Specifies the units you wish to use to set column width.. 
//                           Valid settings are: UINCHES, UPICAS, UCENTIMETERS, and UPOINTS.
//
//       TCIString quantity: This is the quantity you specify for the column width. Normally,
//                           this would be an integer like "1", but this argument is 
//                           typed as a string for testing purposes (i.e. so you can
//                           put ANYTHING in there and see what happens..
// 
// VerticalAlignment verticalAlignment: This determines the vertical alignment of the
//                           table or selected cells. 
//                           Valid settings are VERTICAL_TOP, VERTICAL_MIDDLE, and VERTICAL_BOTTOM.
//
    
//                  Example: SetWidth(FIXED_WIDTH, UINCHES, "1", VERTICAL_TOP,FAIL|ABORT);
//
// 
//  This example modifies the table (or selected cells) a fixed widch of one inch. 
//  with content within cells top aligned.
void _EXPORT SetWidth(ColumnWidth columnWidth, Units units, const TCIString &quantity, VerticalAlignment verticalAlignment);


//  Overview of InsertColumns function:
//
//  This function inserts n columns at position m.
//
//  Arguments:
//  
//  TCIString &columnsToInsert: Specifies an absolute column width..
//                                                          
//  TCIString &columnPositionToInsert: Specifies the units you wish to use to set column width.. 
//
//                     Example: InsertColumns("1", "1");
//
// 
//  This example inserts 1 column at position 1. 
//
void _EXPORT InsertColumns(const TCIString &columnsToInsert, const TCIString &columnPositionToInsert);



//  Overview of InsertRows function:
//
//  This function inserts n rows at position m.
//
//  Arguments:
//  
//  TCIString &rowsToInsert: Specifies an absolute column width..
//                                                          
//  TCIString &rowsPositionToInsert: Specifies the units you wish to use to set column width.. 
//
//                     Example: InsertRows("1", "1");
//
// 
//  This example inserts 1 row at position 1. 
//
void _EXPORT InsertRows(const TCIString &rowsToInsert, const TCIString &rowPositionToInsert);

void _EXPORT CreateMatrix(const TCIString &rows, const TCIString &columns);



//
// Get the message string from a Scientific Work Place Note
//
_EXPORT TCIString  GetSWPNoteText(void);


// NEED DESCRIPTION
void _EXPORT FileOpen(const TCIString &theFileName);

//
// Given a tex file, (full path name) this function will delete 
// TeX generated files (.aux .dvi .log .lot .lof .toc .bbl .idx )
//
_EXPORT void  BlowAwayTeXTurds(const TCIString& texFile);
_BOOL _EXPORT UndefinedMenuExist(const TCIString &name);

// NEED DESCRIPTION
//_EXPORT _BOOL Preview(int TimeInSeconds = 1);
enum previewType { MFC, TYPESET, AUTODETECT };
void _EXPORT Preview(int timeInSeconds);
void _EXPORT TypesetPreview(int timeInSeconds);
_BOOL _EXPORT MFC_Preview();

#endif

//Use this TypesetPreview if you want logging control or a return value.
//else
//Use the TypesetPreview above.
_BOOL _EXPORT TypesetPreview(int timeInSeconds, long logStatus /*= NOACTION*/);


//
// Deletes all files of name filename in directory filepath.
// filepath: may end with a backslash or not
// filename: may contain wildcards
// Ex: to delete all wmf files in temp directory
//     FileSpec wmfdir(getenv("TEMP"));
//     DeleteFiles(wmfdir, "*.wmf");
// 
void _EXPORT DeleteFiles(const FileSpec& filepath, const TCIString& filename);


//
//  Kill application works by searching for captions (you only
//  need part of the caption), sending a keystroke sequence to 
//  kill the application, waiting for the app to die, and then
//  switching back to the application.
//
//  Ex: HWND rv = KillApplication( "Scientific W", <--Application you're testing.
//                                 "INITEX",       <--Application caption
//                                 "{ALT}{F4}",    <--Application killing keystroke sequence
//                                 1000,           <--Wait one second
//                                 "Scientific",   <--Switch back to application containing "Scientific"
//                                 "There was problem with initex ); <--The error message of your choice.  
//
HWND _EXPORT KillApplication(  TCIString appCaption,
                                  TCIString killString,
                                  int timeAfterKill,
                                  TCIString appBackCaption,
                                  TCIString probMessage,
                                  int appKillAttempts);

void _EXPORT TCISleep(time_t timeSeconds);


//void _EXPORT StdButtonClick(stdButton button);
//  Overview of StdButtonClick function:
//
//  This function clicks one of 5 standard buttons.
//
//  Arguments:
//
//  Valid choices are: OK, YES, NO, CANCEL, and CLOSE.
//  
//
//  Example: StdButtonClick(OK);  <---Note: No quotes. It's an enumerated type.
//
// 
//  This example inserts 1 column at position 1. 

TCIString _EXPORT GetOS();

//  This function returns the current OS as a string.
//
//  Arguments:
//
//  Valid choices are: OK, YES, NO, CANCEL, and CLOSE.
//  
//  Strings are "Win95", "WinNT" and "Win32s"
//
//  Example: 
//  
//  TCIString theCurrentOS = GetOS();
//
//  if (theCurrentOS == "Win95")
//  {
//    ButtonClick("Yes");
//  }
//  else 
//  {
//    ButtonClick("OK");
//  }
//
// 
//  This example inserts 1 column at position 1.
 
////////////////////////////////////////////////////////////
//                    ClearToolbars                       //
//Gets rid of all toolbars on the SWP display.            //
////////////////////////////////////////////////////////////
void _EXPORT ClearToolbars();

////////////////////////////////////////////////////////////
//                    ResetToolbars                       //
//Resets the toolbars on the SWP display.  Equivalent of  //
//pressing Reset button in Toolbars dialog box.            //
////////////////////////////////////////////////////////////
void _EXPORT ResetToolbars();

////////////////////////////////////////////////////////////
//                    CloseAllDocs                        //
//  Closes all open documents without saving them.        //
//                                                        //   
////////////////////////////////////////////////////////////
void _EXPORT CloseAllDocs();

////////////////////////////////////////////////////////////
//             DetermineTestAppByCaption                  //
//  Determines whether the open app is SNB, WorkPlace,    //
//  Active Calculus or other application.                 //
//                                                        //   
////////////////////////////////////////////////////////////
CurrentApp _EXPORT DetermineTestAppByCaption();
Hosted by www.Geocities.ws

1