Top | ![]() |
![]() |
![]() |
![]() |
InfTextDeleteOperation is implemented by InfTextDefaultDeleteOperation and InfTextRemoteDeleteOperation.
InfTextDeleteOperation is an interface for an operation removing text from the document. It implements the transformation logic for transformation against other delete operations or insert operations.
This interface does not make any assumption on what kind of text is removed, it works only with character offsets and lengths. This information is enough to perform transformation of this operation or other operations against this operation. Whether the actual operation only knows about the offsets, too, or actually knows the text that is being erased (and if so, in what representation), is up to the implementation.
guint
inf_text_delete_operation_get_position
(InfTextDeleteOperation *operation
);
Returns the position at which operation
starts to delete dext.
guint
inf_text_delete_operation_get_length (InfTextDeleteOperation *operation
);
Returns the number of characters deleted by operation
.
gboolean inf_text_delete_operation_need_concurrency_id (InfTextDeleteOperation *op
,InfAdoptedOperation *against
);
Returns whether transforming op
against against
requires a concurrency ID
(see inf_adopted_operation_need_concurrency_id()
for further information).
InfAdoptedOperation * inf_text_delete_operation_transform_insert (InfTextDeleteOperation *operation
,InfTextInsertOperation *against
);
Returns a new operation that includes the effect of against
into
operation
.
InfAdoptedOperation * inf_text_delete_operation_transform_delete (InfTextDeleteOperation *operation
,InfTextDeleteOperation *against
);
Returns a new operation that includes the effect of against
into
operation
.
typedef struct _InfTextDeleteOperation InfTextDeleteOperation;
InfTextDeleteOperation is an opaque data type. You should only access it via the public API functions.
struct InfTextDeleteOperationInterface { /* Virtual table */ guint(*get_position)(InfTextDeleteOperation* operation); guint(*get_length)(InfTextDeleteOperation* operation); InfTextDeleteOperation*(*transform_position)(InfTextDeleteOperation* op, guint position); InfTextDeleteOperation*(*transform_overlap)(InfTextDeleteOperation* op, InfTextDeleteOperation* other, guint position, guint begin, guint other_begin, guint length); InfAdoptedSplitOperation*(*transform_split)(InfTextDeleteOperation* op, guint split_pos, guint split_length); };
This structure contains virtual methods of the InfTextDeleteOperation interface.
Virtual function to retrieve the start position of the delete operation. |
||
Virtual function to retrieve the end position of the number of characters removed by the delete operation. |
||
Virtual function to transform the operation such that the start position of the operation changes. |
||
Virtual function to transform the operation against another delete operation with overlapping regions. |
||
Virtual function to transform the operation against an insert operation such that this operation needs to be split in two. |