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/EditorCommands.h
Go to fileThis commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
70 lines (63 sloc)
1.25 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 EDITOR_COMMANDS_H | |
#define EDITOR_COMMANDS_H | |
#include "Command.h" | |
#include "EditorDataController.h" | |
#include "EditorTextViewCont.h" | |
class EditorCommand: public Command | |
{ | |
public: | |
typedef EditorDataController EDC; | |
EditorCommand(EditorDataController *edc, FormatterInterface *formatter); | |
~EditorCommand(); | |
protected: | |
EditorDataController *edc; | |
FormatterInterface *formatter; | |
int row, col; | |
}; | |
class BackspaceCommand: public EditorCommand | |
{ | |
public: | |
BackspaceCommand(EDC *edc, FormatterInterface *formatter); | |
void Execute(); | |
void UnExecute(); | |
private: | |
enum DType { | |
DUD, | |
NEWLINE, | |
STANDARD, | |
}; | |
DType mode; | |
int record; | |
}; | |
class DeleteCommand: public EditorCommand | |
{ | |
public: | |
DeleteCommand(EDC *edc, FormatterInterface *formatter); | |
void Execute(); | |
void UnExecute(); | |
private: | |
enum DType { | |
DUD, | |
ENDOFLINE, | |
MIDDLEOFLINE, | |
}; | |
DType mode; | |
char record; | |
}; | |
class InsertCommand: public EditorCommand | |
{ | |
public: | |
InsertCommand(EDC *edc, FormatterInterface *formatter, char c); | |
void Execute(); | |
void UnExecute(); | |
private: | |
char c; | |
}; | |
class NewLineCommand: public EditorCommand | |
{ | |
public: | |
NewLineCommand(EDC *edc, FormatterInterface *formatter); | |
void Execute(); | |
void UnExecute(); | |
}; | |
#endif /* EDITOR_COMMANDS_H */ |