Helper class to store single byte commands
| 4 | |
| 5 | // Helper class to store single byte commands |
| 6 | class CharCommand : public QUndoCommand |
| 7 | { |
| 8 | public: |
| 9 | enum CCmd {insert, removeAt, overwrite}; |
| 10 | |
| 11 | CharCommand(Chunks * chunks, CCmd cmd, qint64 charPos, char newChar, |
| 12 | QUndoCommand *parent=0); |
| 13 | |
| 14 | void undo(); |
| 15 | void redo(); |
| 16 | bool mergeWith(const QUndoCommand *command); |
| 17 | int id() const { return 1234; } |
| 18 | |
| 19 | private: |
| 20 | Chunks * _chunks; |
| 21 | qint64 _charPos; |
| 22 | bool _wasChanged; |
| 23 | char _newChar; |
| 24 | char _oldChar; |
| 25 | CCmd _cmd; |
| 26 | }; |
| 27 | |
| 28 | CharCommand::CharCommand(Chunks * chunks, CCmd cmd, qint64 charPos, char newChar, QUndoCommand *parent) |
| 29 | : QUndoCommand(parent) |
nothing calls this directly
no outgoing calls
no test coverage detected