Skip to content
Permalink
master
Switch branches/tags

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?
Go to file
 
 
Cannot retrieve contributors at this time
/**
* Document.h
*
* Author: Jamey Calabrese
*
* Description: This is the document structure
*/
#ifndef DOCUMENT_H
#define DOCUMENT_H
#include "DocumentPage.h"
#include "EditorDataController.h"
#include <memory>
#include <string>
#include <vector>
class Document
{
public:
Document(EditorDataController *edc);
~Document();
// Update Methods
void BuildDocument();
int GetPageNum();
int GetPageNumContainingLine(int lineNum);
std::shared_ptr<DocumentPage> GetPage(int pageNum);
std::shared_ptr<DocumentPage> GetActivePage();
int GetNumPages();
int GetNumParagraphs();
// Tracking Methods
void PageUp();
void PageDown();
void CursorToGrid(int &row, int &col);
// Configuration Methods
int GetMaxHeight();
void SetMaxHeight(int maxHeight);
int GetMaxWidth();
void SetMaxWidth(int maxWidth);
static std::vector<std::shared_ptr<std::string>> SplitString(const std::string &str);
private:
void CorrectPageNum();
std::vector<std::shared_ptr<DocumentPage>> pages;
EditorDataController *edc;
// Attributes
int maxHeight;
int maxWidth;
int activePage;
};
#endif /* DOCUMENT_H */