HYPERWAG: A PROGRAMMER'S GUIDE





Hyperwag Graphics Hierarchy

Main

Client Program

Hyperwag

responsible for reading in user reference and appointment file and then outputing the schedule file

Week

stores all appointment information about a user's week

ReadPref


reads in the users preference file

Factory


creates the appropriate Readtools and PrintFiles according to file names

ReadTool


reads in appointment file
superclass to WagTool, and YawlTool

PrinFile


outputs schedule
Day- a day in a Week

Apt-a appointment in a day

Time- time of an appointment

Pref-a users preferences WagTool-reads in Wagalang appointment files

YawTool- reads in YAWL appointment files

PrintText- outputs text file

PrintHtml- outputs html file

PrintLatex- outputs Latex file

CLASS DISCRIPTIONS


HYPERWAG
located in hyperwag.cc and hyperwag.h
This class is responsible for identifying and creating a reader and a printer of the correct subclass of ReadTool and PrintFile. It allows all virtual functions of Hyperwag to be hidden from the client program. Given the input file name it will read in appointment file with Readfile(infile) regardless of the language the file is written in. Similarly, given the output file name, Print(outfile) will print out either in Text or HTML format.
FACTORY
This class implements a singleton (factory) pattern. It is used to identify input appointment files and output schedule files and create the correct tools. It has the capablities of producing both ReadTools (readers) and PrintFiles (printer).
READTOOL
located in Readfile.cc, Readfile.h
This is the virtual super class WagTool and YawTool. And is responsible for reading in files and add appointments to a week.
PRINTFILE
located in printfile.h and printfile.cc
This class is the virtual super class of PrintText PrintLatexand PrintHtml.Printfile an abstraction of these other specific printing classes. Printfile takes a week structure that stores all the activity information about the time table that's about to be printed. This abstraction provides functions like open and clone, so it would fit into a typical implementation of the singleton pattern. This class allow late binding of specific Printers. In short it is used to print out the week schedule in the desired form

WEEK
located in week.h week.cc
A week is a collection of days, which are in turn collection of appointments. A week is useful in returning the appointment now in "FOCUS"(this means it keep track and can return the current day and appointment) . Week allow horizontal and vertical traversion of the appointments. Horizontally, the current FOCUS would move to the next day of the week. Vertically, the current FOCUS would advance to the next appointment of the day. In short, this class stores the "days" which store the particular appointments. It performs the neccasary functions on them to build and print the schedule.
READPREF
located in readpref.h and readpref.cc This class is responsible for reading in the ".hyperrc" files and storing it as a Pref.
PREF
located in pref.h
This class stores the particular preferences of the user as entered in the .hyerrc file. Pref stores all the user-specific information, or preference. It functions just like a structure with all its variables declared public. In this file we can set the Begin and End day of a week schedule. The time at which activities starts (BeginTime, EndTIme). The Interval at which we want the tables to be printed. It also store information for tablename, whether the time is displayed in AMPM or 00:00 to 24:00 mode. The colors of different block in a color sensitive printing method(html, for example)
WAGTOOL
located in wagtool.cc and wagtool.h
This class, as a subclass of ReadTool is a reader tool used to read in appointment files and store that information in a class week for future use. It is specifically designed to read in appointment files written in Wagalang appointment language.
YAWLTOOL
located in yawtool.cc and yawtool.h
This class, as a sub class of ReadTool, is a tool used to read in appointment files and store the information in a week class. It is specifically designed to read the appointment language YAWL.
PRINTTEXT
located in printtext.h and printext.cc PrintText is a subclass of PrintFile that is used to print table (written in a Unix text file). The text file produced by the program is basic. It represent free time as "f", an activity with it's description name. If the activity is span across many time intervals, it would be denoted by "|" as continuation of an activity. PrintText does not handle conflict, but neither does it crash under conflict. It's open to conflict extension.
PRINTHTML
PrintHtml is a subclass of PrintFile that is used to print table (written in Hypertext Markup Language). The html file produced by this class can then be viewed by any browser. PrintHtml support color fields given in myPref. It also intergrate graphical effects such as pictures and blinking to the table. When there's a conflict in activities, the block would show an internal link to a list of conflicts listed below. Clicking on it would cause the corresponding conflict to appear on the page, if is isn't already. Many private functions are created to reduce complexity
PRINTLATEX
located in printlatex.cc and printlatex.h
PrintLatex is a subclass of PrintFile that is used to print a table in latex format. When it sees a conflict, it would put it at the bottom of the latex document and put "conflict" in the table instead. Many private helper functions are used to reduce complexity. Many of them are borrowed from PrintHtml class, written by Jessie Stumpfel and Ngai Wong.
DAY
located in day.h
Representation of a logical day, which is consisted of appointment which occur on the same day of the week. The data in a day is supposed to be sorted at all time.
APT
located in apt.h
Apt class is reponsible for storing info for a logical appointment. It is accesssed like a struct with all the variables being public. it has field to specify the day, the beginning time, the ending time, the description about the appointment. it also holds a IsUrgent variable that is used to flag important appointments.
TIME located in time.h
Time is a representation of a "time" correct to minute. It is implemented like a structure with all variables declared public. Time contains Hour and Min. It allows + - and / operations to be performed by instances of itself. comparison operation == and < works too.