Permalink
Cannot retrieve contributors at this time
Name already in use
A tag already exists with the provided branch name. Many Git commands accept both tag and branch names, so creating this branch may cause unexpected behavior. Are you sure you want to create this branch?
CSE3150_Project/DocumentFormatter.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
50 lines (40 sloc)
1.18 KB
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#ifndef DOCUMENT_FORMATTER_H | |
#define DOCUMENT_FORMATTER_H | |
#include "Document.h" | |
#include "EditorDataController.h" | |
#include "FormatterInterface.h" | |
class DocumentFormatter: public FormatterImplementation | |
{ | |
public: | |
DocumentFormatter(EditorDataController *edc); | |
~DocumentFormatter(); | |
// Settings | |
virtual void SetMaxWidth(int maxWidth); | |
virtual int GetMaxWidth(); | |
virtual void SetMaxHeight(int maxHeight); | |
virtual int GetMaxHeight(); | |
// Render Methods | |
virtual void Build(); | |
virtual int GetRenderableLineCount(); | |
virtual std::shared_ptr<std::string> GetLine(int x); | |
virtual void GetCursorPosition(int &row, int &col); | |
virtual void SetCursorPosition(int row, int col); | |
virtual void GridToCursor(int &row, int &col); | |
virtual void CursorToGrid(int &row, int &col); | |
// Actions | |
virtual void HandleMoveLeft(); | |
virtual void HandleMoveRight(); | |
virtual void HandleMoveUp(); | |
virtual void HandleMoveDown(); | |
// Special Actions | |
virtual void HandlePageUp(); | |
virtual void HandlePageDown(); | |
virtual void HandleHome(); | |
virtual void HandleEnd(); | |
private: | |
void AdjustCoordinates(); | |
Document doc; | |
// Cursor Position | |
int x,y; | |
}; | |
#endif /* DOCUMENT_FORMATTER_H */ |