/*File: page.h Author: Matthew Small Description: Specification for Page class that manages a page of text */ #ifndef PAGE_H #define PAGE_H #include #define MAX_VERT 30 #define MAX_HORI 80 using namespace std; //The 'COMMAND' type is used for a Page's edit function to return //keyboard requests to the Document's edit function typedef enum {EDIT_DONE, EDIT_CONT, PREV_PAGE, NEXT_PAGE, SAVE} COMMAND; class Page{ public: Page(int); int GetPageNumber(); void SetCurrentLine(int cline); void SetText(char *line, int num); void Display(ostream& os, bool ShowCurrentLine = true) const; COMMAND Edit(); Page *next; //next page in a linked list of pages private: char text[MAX_VERT][MAX_HORI+1];//two-dimentional char array representing a //page with MAX_VERT lines and MAX_HORI //characters on each line int current_line; //cuurent line being edited (0 - (MAX_VERT-1)) int page_number; //number of page (1 - INF) }; #endif