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
/**
* 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 */