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/EditorObserver.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
52 lines (46 sloc)
1.03 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
/** | |
* This is the cursor observer class | |
* | |
* This observer will be responsible for handling the cursor | |
* position for the text editor | |
* | |
* Author: Jamey Calabrese | |
* Date: 04/04/2020 | |
*/ | |
#ifndef CURSOR_OBSERVER_H | |
#define CURSOR_OBSERVER_H | |
#include "CommandHistory.h" | |
#include "ECObserver.h" | |
#include "ECTextViewImp.h" | |
#include "EditorCommands.h" | |
#include "EditorDataController.h" | |
#include "EditorTextViewCont.h" | |
#include <vector> | |
#include <string> | |
class EditorObserver: public ECObserver | |
{ | |
public: | |
EditorObserver(ECTextViewImp *view, EditorDataController *edc); | |
virtual void Update(); | |
enum MODE | |
{ | |
EDIT, | |
COMMAND | |
}; | |
private: | |
void HandleEditInput(); | |
void HandleCommandInput(); | |
void HandleBackspaceCharacter(); | |
void HandleDeleteCharacter(); | |
void HandleInsertText(int key); | |
void HandleNewLine(); | |
void ToggleWordWrap(); | |
MODE mode; | |
ECTextViewImp *view; | |
EditorDataController *edc; | |
EditorTextViewCont vc; | |
CommandHistory hist; | |
FormatterInterface formatter; | |
bool wordWrap; | |
}; | |
#endif /* CURSOR_OBSERVER_H */ |