Technical Design Report For Microsoft WordPad Issue: 1 Revision: 1 Reference: MS-WORDPAD-1 Created: 12th November 1999 Last Modified: 14th November 1999 Prepared By: Chan Chi Hang Collaboration United States of America Microsoft Corporation, Redmond People Republic of China Kenneth’s Corporation, Hong Kong SAR Acknowledgements The Editors would like to thank Kenneth Leung for preparing the template upon which this document is based. The Editors also warmly thank Kenneth’s Corporation staff for the helpful, friendly and efficient service. Revision Record Issue Revision Date Comments 1 0 12th November 1999 Original printing 1 1 14th November 1999 Editorial changes Table of Contents 1. Collaboration ii Acknowledgements ii Revision Record ii Introduction 1 1.1 Purpose and Scope of the Technical Design Report 1 1.2 Organization of the Technical Design Report 1 2. Progress of the Project 2 3. Design Approach 3 4. Structure in HIPO Diagram 4 4.1 Hierarchy Chart 4 4.2 IPO Diagram – Module 4.1 4 5. Design Details 5 5.1 File Structure 5 5.1.1 RTF File Format 5 5.1.2 TXT File Format 6 5.1.3 DOC File Format 6 5.2 5.3 6. Data Structure 6 5.2.1 6 Text Buffer Data Flow 6 5.3.1 7 Data Flow Diagram Module Design 6.1 8 Module 4.1 – Font 8 6.1.1 Abstract 8 6.1.2 Implementation 8 6.1.3 Design 8 6.1.4 Exports 8 6.1.5 Imports 9 6.1.6 Input/Output 9 6.1.7 Pre and Post Conditions 9 6.1.8 Error Handling 9 6.1.9 Test Cases 9 1. Introduction 1.1 Purpose and Scope of the Technical Design Report The purpose of this document is to describe the design of the Microsoft WordPad, as well as the plans for its construction. The Technical Design Report documents the Microsoft WordPad design at the system level, describing functional components at the level of data flow, interface and their interconnections. In order to keep the Technical Design Report at a reasonable size, not all of the details are given in this document. 1.2 Organization of the Technical Design Report The Microsoft WordPad Technical Design Report is organized as follows. Chapter 2 gives a brief introduction of the progress of the project. Chapter 3 discusses the analysis method being applied in this project. Chapter 4 – 6 state out all the design details of the project, including the data structures, software and hardware configuration, user-interface design and clear definition of each system modules, etc. Chapter 7 lists some of the ideas that might break the module or system design. 2. Progress of the Project Day Number Deliverable 0 1 2 3 4 5 Acceptance and test specification Data definition specification Hardware / Software limitations specification Coding Documentation System test The project will continue as planned above. And it will be finished within 6 days. 3. Design Approach The expediency approach (ad hoc approach) is being used in this project. As we recognized that immediate changes must be made. This approach produces a quick solution as it improves the situation right away. (The current situation is well defined in the Technical Proposal for Microsoft WordPad.) Such an approach is also inexpensive since it takes much less time and effort to take a larger view, which sometimes may be unnecessary. The most important reason that such an approach is chosen is that the project is comparatively small. This approach as a result provides the greatest efficiency. 4. Structure in HIPO Diagram 4.1 Hierarchy Chart WordPad File 1.0 Edit 2.0 Insert 3.0 Format Open; Close; Save 1.1 Date; Time 3.1 Print; Print Preview 1.2 OLE Object 3.2 Undo; Redo 2.1 Font 4.1 Cut; Paste; Copy 2.2 Bullet 4.2 Search; Replace 2.3 Paragraph 4.3 OLE Object 2.4 Tabulation 4.4 4.0 Help 5.0 4.2 IPO Diagram – Module 1.1 INPUT PROCESS OUTPUT 1. Read the file of the chosen font. 2. Change the font of selected text 1. Font File with specified size, color and all the 2. Text Buffer selected properties. 1. Updated Text Buffer 2. 5. Design Details 5.1 File Structure 5.1.1 RTF File Format An RTF file consists of unformatted text, control words, control symbols, and groups. For ease of transport, a standard RTF file can consist of only 7-bit ASCII characters. There is no set maximum line length for an RTF file. A control word is a specially formatted command that RTF uses to mark printer control codes and information that applications use to manage documents. A control word cannot be longer than 32 characters. A control word takes the following form: \LetterSequence<Delimiter> Note that a backslash begins each control word. The LetterSequence is made up of lowercase alphabetic characters between "a" and "z" inclusive. RTF is case sensitive, and all RTF control words must be lowercase. The delimiter marks the end of an RTF control word, and can be one of the following: A space. In this case, the space is part of the control word. A digit or a hyphen, which indicates that a numeric parameter follows. A space or any character other than a letter or a digit then delimits the subsequent digital sequence. Any character other than a letter or a digit. In this case, the delimiting character terminates the control word but is not actually part of the control word. If a space delimits the control word, the space does not appear in the document. Any characters following the delimiter, including spaces, will appear in the document. For this reason, you should use spaces only where necessary; do not use spaces merely to break up RTF code. A control symbol consists of a backslash followed by a single, non-alphabetic character. For example, \~ represents a non-breaking space. Control symbols take no delimiters. A group consists of text and control words or control symbols enclosed in braces {}. The opening brace indicates the start of the group and the closing brace indicates the end of the group. Each group specifies the text affected by the group and the different attributes of that text. The RTF file can also include groups for fonts, styles, screen color, pictures, footnotes, comments (annotations), headers and footers, summary information, fields, and bookmarks, as well as document-, section-, paragraph-, and character-formatting properties. If the font, file, style, screen-color, revision mark, and summary-information groups and document-formatting properties are included, they must precede the first plain-text character in the document. These groups form the RTF file header. If the group for fonts is included, it should precede the group for styles. If any group is not used, it can be omitted. The groups are not going to discuss here, since it is a little bit complex. It will be described in a separated specification document. 5.1.2 TXT File Format A text file contains ASCII characters. The text format for text files is to separate each line with a carriage return/line feed sequence (a CR/LF for short). 5.1.3 DOC File Format The specification is already described in the Microsoft Word Document – File Format Specification and not going to be discussed here for a second time. 5.2 Data Structure 5.2.1 Text Buffer The text buffer is being stored in the Rich Text Format (RTF), which is already described in the file structure. 5.3 Data Flow 5.3.1 6. Data Flow Diagram Text File Edited Text User Editing Text Buffer Searching Tools Formatting Tools 6. Module Design 6.1 Module 4.1 – Font 6.1.1 Abstract In this module, the selected will be changed to a specified format, including font, size, color, style, and etc. 6.1.2 Implementation Documentation This module is quite independent of the others. Only the main module would send the selected text to this module and get the formatted text as return. No special awareness is needed for the design of other modules. 6.1.3 Design Selected text will be sent from the main module to module 4.1. The text will be formatted as what the user has specified by inserting suitable controls word before and after the text in the text buffer. For the redoing and undoing in module 2.1 to work well, control words added or deleted will be stored along with their position in the procedure queue, which is part of the main module. By this, the module 2.1 will not actually use the function of this module and is only needed to access the queue. 6.1.4 Exports This module is independent of the others. None of the functions in this module will be made available to the others. 6.1.5 Imports This module is independent of the others. No procedure of the others would be used. 6.1.6 Input/Output The only input is the selected text, or paragraph. The outputs included the formatted text buffer and the procedure queue. 6.1.7 Pre and Post Conditions No special condition is required to be considered in this module. 6.1.8 Error Handling The font inputted should be included in the list of fonts installed in the system. The style inputted should be provided by the chosen font. When any one of the cases above is not satisfied, the font or style is not changed. The size can be any value between 1 and 1638 inclusively. Otherwise, a dialog box will be pop out to inform user about the error and no change would be made. 6.1.9 Test Cases Open a file with the fonts, which are not available in the system. The document is extremely large. A complicated OLE object is insert to the document. This document has been prepared with Release 9 of the Microsoft Word ® using the Technical Design Report template prepared by Kenneth Leung of Kenneth’s Corporation. To facilitate multiple author editing and electronic distribution of documents, only widely available fonts have been used. The principal ones are: Running text: Arial 10 point on 18 point line spacing Chapter headings: Arial Bold 14 point 2nd, 3rd and 4th level headings: Arial Bold 12, 11 and 10 point respectively Figure and table captions: Arial 10 point