Infinity.AdoptedUndoGrouping¶
- Subclasses:
None
Methods¶
- Inherited:
- Structs:
class |
|
|
|
|
|
|
Virtual Methods¶
- Inherited:
|
Properties¶
Name |
Type |
Flags |
Short Description |
---|---|---|---|
r/w |
The algorithm for which to group requests |
||
r/w |
The user for which to group requests |
Signals¶
- Inherited:
Name |
Short Description |
---|---|
This signal is emitted whenever the |
Fields¶
- Inherited:
Name |
Type |
Access |
Description |
---|---|---|---|
parent |
r |
Class Details¶
- class Infinity.AdoptedUndoGrouping(**kwargs)¶
- Bases:
- Abstract:
No
- Structure:
Infinity.AdoptedUndoGrouping
is an opaque data type. You should only access it via the public API functions.- classmethod new()¶
- Returns:
A new
Infinity.AdoptedUndoGrouping
, to be freed viaGObject.Object.unref
().- Return type:
Creates a new
Infinity.AdoptedUndoGrouping
. To start grouping requests, set a user whose requests to group viaInfinity.AdoptedUndoGrouping.set_algorithm
(). Before doing so you might want to connect toInfinity.AdoptedUndoGrouping
::group-requests
, so the user’s initial requests can be grouped correctly.
- end_group(allow_group_with_next)¶
- Parameters:
allow_group_with_next (
bool
) – Whether subsequent requests are allow to be part of this group ifInfinity.AdoptedUndoGrouping
::group-requests
allows.
When
Infinity.AdoptedUndoGrouping.start_group
() was called before, then this function restores the normal behaviour of grouping requests.
- get_algorithm()¶
- Returns:
self's algorithm.
- Return type:
Returns the
Infinity.AdoptedAlgorithm
for self.
- get_redo_size()¶
- Returns:
The number of requests in the current redo group.
- Return type:
Returns the number of requests to redo so that a whole group is being redone. This takes into account that possibly not the whole group cannot be undone due to the
Infinity.AdoptedAlgorithm
:max-total-log-size
constraint.
- get_undo_size()¶
- Returns:
The number of requests in the current undo group.
- Return type:
Returns the number of requests to undo so that a whole group is being undone. This takes into account that possibly not the whole group cannot be undone due to the
Infinity.AdoptedAlgorithm
:max-total-log-size
constraint.
- set_algorithm(algorithm, user)¶
- Parameters:
algorithm (
Infinity.AdoptedAlgorithm
) – TheInfinity.AdoptedAlgorithm
for the document to group requests, orNone
.user (
Infinity.AdoptedUser
) – The user for which to group requests, orNone
. Ignored if algorithm isNone
.
Sets the algorithm and user to group requests for. This function will group all requests in user’s request log, and also each new request that is added to it’s log. Requests that cannot be undone anymore (because they are too old), will be correctly taken care off.
- start_group(allow_group_with_prev)¶
- Parameters:
allow_group_with_prev (
bool
) – Whether the new group can be part of the previous group ifInfinity.AdoptedUndoGrouping
::group-requests
allows.
Makes all requests issued after this call belong into the same group, i.e. they will be undone at once. This can make sense for example when the user copy+pastes something into the document which causes multiple requests to be generated. A call to
Infinity.AdoptedUndoGrouping.end_group
() restores the normal behavior.
- do_group_requests(first, second) virtual¶
- Parameters:
first (
Infinity.AdoptedRequest
) –second (
Infinity.AdoptedRequest
) –
- Return type:
Signal Details¶
- Infinity.AdoptedUndoGrouping.signals.group_requests(adopted_undo_grouping, first, second)¶
- Signal Name:
group-requests
- Flags:
- Parameters:
adopted_undo_grouping (
Infinity.AdoptedUndoGrouping
) – The object which received the signalfirst (
Infinity.AdoptedRequest
) – The previous request.second (
Infinity.AdoptedRequest
) – The current request.
- Return type:
This signal is emitted whenever the
Infinity.AdoptedUndoGrouping
needs to decide whether to put two requests into the same undo group or not. A signal handler should returnTrue
if they belong into the same group orFalse
otherwise. Note however that the two requests may not immediately follow each other because other users may have issued requests inbetween. Check the vector times of the requests to find out, usingInfinity.AdoptedRequest.get_vector
().
Property Details¶
- Infinity.AdoptedUndoGrouping.props.algorithm¶
- Name:
algorithm
- Type:
- Default Value:
- Flags:
The algorithm for which to group requests
- Infinity.AdoptedUndoGrouping.props.user¶
- Name:
user
- Type:
- Default Value:
- Flags:
The user for which to group requests