edbee - Qt Editor Library v0.11.1
All Classes Namespaces Files Functions Variables Typedefs Enumerations Enumerator Friends Macros Pages
abstractrangedchange.h
Go to the documentation of this file.
1// edbee - Copyright (c) 2012-2025 by Rick Blommers and contributors
2// SPDX-License-Identifier: MIT
3
4#pragma once
5
6#include "edbee/exports.h"
7
9
10namespace edbee {
11
16{
17public:
18 virtual ~AbstractRangedChange();
19
21 virtual int offset() const = 0;
22
24 virtual void setOffset( int value ) = 0;
25 void addOffset( int amount );
26
28 virtual void setDocLength( int value ) = 0;
29
31 virtual int docLength() const = 0;
32
34 virtual int storedLength() const = 0;
35
36
37protected:
38
45 virtual void mergeStoredData( AbstractRangedChange* change ) = 0;
46
47
50 void mergeStoredDataViaMemcopy(void* targetData, void* data, void* changeData, AbstractRangedChange* change, int itemSize );
51 bool merge( AbstractRangedChange* change );
52
53public:
54 bool isOverlappedBy( AbstractRangedChange* secondChange );
55 bool isTouchedBy( AbstractRangedChange* secondChange );
56
57};
58
59
60} // edbee
This is an abstract class for ranged changes This are changes (text changes and line changes) that sp...
Definition abstractrangedchange.h:16
virtual int offset() const =0
this method should return the offset of the change
int getMergedDocLength(AbstractRangedChange *change)
Calculates the merged length.
Definition abstractrangedchange.cpp:26
virtual int docLength() const =0
this method should return the length in the document
int getMergedStoredLength(AbstractRangedChange *change)
Calculates the merge data size, that's required for merging the given change.
Definition abstractrangedchange.cpp:48
virtual void setDocLength(int value)=0
this method should set the old length
void addOffset(int amount)
Adds the given amount to the offset.
Definition abstractrangedchange.cpp:18
virtual int storedLength() const =0
this method should return the length of this item in memory
void mergeStoredDataViaMemcopy(void *targetData, void *data, void *changeData, AbstractRangedChange *change, int itemSize)
This method merges the data via a memcopy. I really don't like this way of merging the data....
Definition abstractrangedchange.cpp:89
virtual void setOffset(int value)=0
this method should set the offset
bool isTouchedBy(AbstractRangedChange *secondChange)
Touched ranges are ranges that are next to eachother Touching means the end offset of one range is th...
Definition abstractrangedchange.cpp:156
virtual void mergeStoredData(AbstractRangedChange *change)=0
implement this method to merge to old data. Sample implementation
bool merge(AbstractRangedChange *change)
This method merges the change.
Definition abstractrangedchange.cpp:116
bool isOverlappedBy(AbstractRangedChange *secondChange)
This method checks if this textchange is overlapped by the second textchange overlapping is an exclus...
Definition abstractrangedchange.cpp:143
A basic change.
Definition change.h:18
#define EDBEE_EXPORT
Definition exports.h:15
QT Acessibility has an issue with reporting blank lines between elements lines. defining 'WINDOWS_EMP...
Definition commentcommand.cpp:20