--- /dev/null Thu Jan 01 00:00:00 1970 +0000 +++ b/src/eric7/Documentation/Source/eric7.Cooperation.SharedEditorController.html Mon May 05 17:45:44 2025 +0200 @@ -0,0 +1,527 @@ +<!DOCTYPE html> +<html><head> +<title>eric7.Cooperation.SharedEditorController</title> +<meta charset="UTF-8"> +<link rel="stylesheet" href="styles.css"> +</head> +<body> +<a NAME="top" ID="top"></a> +<h1>eric7.Cooperation.SharedEditorController</h1> +<p> +Module implementing a controller for shared editing. +</p> + +<h3>Global Attributes</h3> +<table> +<tr><td>None</td></tr> +</table> + +<h3>Classes</h3> +<table> +<tr> +<td><a href="#SharedEditorController">SharedEditorController</a></td> +<td>Class implementing a controller for shared editing.</td> +</tr> +</table> + +<h3>Functions</h3> +<table> +<tr><td>None</td></tr> +</table> + +<hr /> +<hr /> +<a NAME="SharedEditorController" ID="SharedEditorController"></a> +<h2>SharedEditorController</h2> +<p> + Class implementing a controller for shared editing. +</p> + +<h3>Derived from</h3> +QObject +<h3>Class Attributes</h3> +<table> +<tr><td>CancelEditToken</td></tr> +<tr><td>EndEditToken</td></tr> +<tr><td>RequestSyncToken</td></tr> +<tr><td>Separator</td></tr> +<tr><td>StartEditToken</td></tr> +<tr><td>SyncToken</td></tr> +</table> + +<h3>Class Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + +<h3>Methods</h3> +<table> +<tr> +<td><a href="#SharedEditorController.__init__">SharedEditorController</a></td> +<td>Constructor</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__calculateChanges">__calculateChanges</a></td> +<td>Private method to determine change commands to convert old text into new text.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__cancelSharedEdit">__cancelSharedEdit</a></td> +<td>Private method to cancel a shared edit session for the editor.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__dispatchCommand">__dispatchCommand</a></td> +<td>Private method to dispatch received commands.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__getSharedEditStatus">__getSharedEditStatus</a></td> +<td>Private method to get the shared edit status object of a given editor.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__processEndEditCommand">__processEndEditCommand</a></td> +<td>Private method to process a remote EndEdit command.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__processRequestSyncCommand">__processRequestSyncCommand</a></td> +<td>Private method to process a remote RequestSync command.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__processStartEditCommand">__processStartEditCommand</a></td> +<td>Private method to process a remote StartEdit command.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__processSyncCommand">__processSyncCommand</a></td> +<td>Private method to process a remote Sync command.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__send">__send</a></td> +<td>Private method to send an editor command to remote editors.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__sendSharedEdit">__sendSharedEdit</a></td> +<td>Private method to end a shared edit session for the editor and send the changes.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__shareConnected">__shareConnected</a></td> +<td>Private method to handle a change of the connected state.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__shareEditor">__shareEditor</a></td> +<td>Private method to set the shared status of the editor.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.__startSharedEdit">__startSharedEdit</a></td> +<td>Private method to start a shared edit session for the editor.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.cancelSharedEdit">cancelSharedEdit</a></td> +<td>Public slot to cancel a shared edit session for the current editor.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.getSharingStatus">getSharingStatus</a></td> +<td>Public method to get some share status info.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.receiveEditorCommand">receiveEditorCommand</a></td> +<td>Public method to handle received editor commands.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.sendSharedEdit">sendSharedEdit</a></td> +<td>Public slot to end a shared edit session for the current editor and send the changes.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.shareConnected">shareConnected</a></td> +<td>Public slot to handle a change of the connected state.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.shareEditor">shareEditor</a></td> +<td>Public slot to set the shared status of the current editor.</td> +</tr> +<tr> +<td><a href="#SharedEditorController.startSharedEdit">startSharedEdit</a></td> +<td>Public slot to start a shared edit session for the current editor.</td> +</tr> +</table> + +<h3>Static Methods</h3> +<table> +<tr><td>None</td></tr> +</table> + + +<a NAME="SharedEditorController.__init__" ID="SharedEditorController.__init__"></a> +<h4>SharedEditorController (Constructor)</h4> +<b>SharedEditorController</b>(<i>cooperationClient, chatWidget</i>) +<p> + Constructor +</p> + +<dl> + +<dt><i>cooperationClient</i> (CooperationClient)</dt> +<dd> +reference to the cooperation client object +</dd> +<dt><i>chatWidget</i> (ChatWidget)</dt> +<dd> +reference to the main cooperation widget +</dd> +</dl> +<a NAME="SharedEditorController.__calculateChanges" ID="SharedEditorController.__calculateChanges"></a> +<h4>SharedEditorController.__calculateChanges</h4> +<b>__calculateChanges</b>(<i>old, new</i>) +<p> + Private method to determine change commands to convert old text into + new text. +</p> + +<dl> + +<dt><i>old</i> (str)</dt> +<dd> +old text +</dd> +<dt><i>new</i> (str)</dt> +<dd> +new text +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +commands to change old into new +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +str +</dd> +</dl> +<a NAME="SharedEditorController.__cancelSharedEdit" ID="SharedEditorController.__cancelSharedEdit"></a> +<h4>SharedEditorController.__cancelSharedEdit</h4> +<b>__cancelSharedEdit</b>(<i>editor, send=True</i>) +<p> + Private method to cancel a shared edit session for the editor. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +<dt><i>send</i> (bool)</dt> +<dd> +flag indicating to send the CancelEdit command +</dd> +</dl> +<a NAME="SharedEditorController.__dispatchCommand" ID="SharedEditorController.__dispatchCommand"></a> +<h4>SharedEditorController.__dispatchCommand</h4> +<b>__dispatchCommand</b>(<i>editor, command</i>) +<p> + Private method to dispatch received commands. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the edior object +</dd> +<dt><i>command</i> (str)</dt> +<dd> +command to be processed +</dd> +</dl> +<a NAME="SharedEditorController.__getSharedEditStatus" ID="SharedEditorController.__getSharedEditStatus"></a> +<h4>SharedEditorController.__getSharedEditStatus</h4> +<b>__getSharedEditStatus</b>(<i>editor</i>) +<p> + Private method to get the shared edit status object of a given editor. +</p> +<p> + If the editor does not have such an object, a default one is created and + set for the editor. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +reference to the shared edit status +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +SharedEditStatus +</dd> +</dl> +<a NAME="SharedEditorController.__processEndEditCommand" ID="SharedEditorController.__processEndEditCommand"></a> +<h4>SharedEditorController.__processEndEditCommand</h4> +<b>__processEndEditCommand</b>(<i>editor, argsString</i>) +<p> + Private method to process a remote EndEdit command. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +<dt><i>argsString</i> (str)</dt> +<dd> +string containing the command parameters +</dd> +</dl> +<a NAME="SharedEditorController.__processRequestSyncCommand" ID="SharedEditorController.__processRequestSyncCommand"></a> +<h4>SharedEditorController.__processRequestSyncCommand</h4> +<b>__processRequestSyncCommand</b>(<i>editor, argsString</i>) +<p> + Private method to process a remote RequestSync command. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +<dt><i>argsString</i> (str)</dt> +<dd> +string containing the command parameters +</dd> +</dl> +<a NAME="SharedEditorController.__processStartEditCommand" ID="SharedEditorController.__processStartEditCommand"></a> +<h4>SharedEditorController.__processStartEditCommand</h4> +<b>__processStartEditCommand</b>(<i>editor, argsString</i>) +<p> + Private method to process a remote StartEdit command. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +<dt><i>argsString</i> (str)</dt> +<dd> +string containing the command parameters +</dd> +</dl> +<a NAME="SharedEditorController.__processSyncCommand" ID="SharedEditorController.__processSyncCommand"></a> +<h4>SharedEditorController.__processSyncCommand</h4> +<b>__processSyncCommand</b>(<i>editor, argsString</i>) +<p> + Private method to process a remote Sync command. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +<dt><i>argsString</i> (str)</dt> +<dd> +string containing the command parameters +</dd> +</dl> +<a NAME="SharedEditorController.__send" ID="SharedEditorController.__send"></a> +<h4>SharedEditorController.__send</h4> +<b>__send</b>(<i>editor, editToken, args=None</i>) +<p> + Private method to send an editor command to remote editors. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +<dt><i>editToken</i> (str)</dt> +<dd> +edit command token +</dd> +<dt><i>args</i> (str)</dt> +<dd> +arguments for the command +</dd> +</dl> +<a NAME="SharedEditorController.__sendSharedEdit" ID="SharedEditorController.__sendSharedEdit"></a> +<h4>SharedEditorController.__sendSharedEdit</h4> +<b>__sendSharedEdit</b>(<i>editor</i>) +<p> + Private method to end a shared edit session for the editor and + send the changes. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +</dl> +<a NAME="SharedEditorController.__shareConnected" ID="SharedEditorController.__shareConnected"></a> +<h4>SharedEditorController.__shareConnected</h4> +<b>__shareConnected</b>(<i>editor, connected</i>) +<p> + Private method to handle a change of the connected state. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +<dt><i>connected</i> (bool)</dt> +<dd> +flag indicating the connected state +</dd> +</dl> +<a NAME="SharedEditorController.__shareEditor" ID="SharedEditorController.__shareEditor"></a> +<h4>SharedEditorController.__shareEditor</h4> +<b>__shareEditor</b>(<i>editor, share</i>) +<p> + Private method to set the shared status of the editor. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +<dt><i>share</i> (bool)</dt> +<dd> +flag indicating the share status +</dd> +</dl> +<a NAME="SharedEditorController.__startSharedEdit" ID="SharedEditorController.__startSharedEdit"></a> +<h4>SharedEditorController.__startSharedEdit</h4> +<b>__startSharedEdit</b>(<i>editor</i>) +<p> + Private method to start a shared edit session for the editor. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +</dl> +<a NAME="SharedEditorController.cancelSharedEdit" ID="SharedEditorController.cancelSharedEdit"></a> +<h4>SharedEditorController.cancelSharedEdit</h4> +<b>cancelSharedEdit</b>(<i></i>) +<p> + Public slot to cancel a shared edit session for the current editor. +</p> + +<a NAME="SharedEditorController.getSharingStatus" ID="SharedEditorController.getSharingStatus"></a> +<h4>SharedEditorController.getSharingStatus</h4> +<b>getSharingStatus</b>(<i>editor</i>) +<p> + Public method to get some share status info. +</p> + +<dl> + +<dt><i>editor</i> (Editor)</dt> +<dd> +reference to the editor object +</dd> +</dl> +<dl> +<dt>Return:</dt> +<dd> +tuple indicating, if the editor is sharable, the sharing + status, if it is inside a locally initiated shared edit session + and if it is inside a remotely initiated shared edit session +</dd> +</dl> +<dl> +<dt>Return Type:</dt> +<dd> +tuple of (bool, bool, bool, bool) +</dd> +</dl> +<a NAME="SharedEditorController.receiveEditorCommand" ID="SharedEditorController.receiveEditorCommand"></a> +<h4>SharedEditorController.receiveEditorCommand</h4> +<b>receiveEditorCommand</b>(<i>projectHash, fileName, command</i>) +<p> + Public method to handle received editor commands. +</p> + +<dl> + +<dt><i>projectHash</i> (str)</dt> +<dd> +hash of the project +</dd> +<dt><i>fileName</i> (str)</dt> +<dd> +project relative file name of the editor +</dd> +<dt><i>command</i> (str)</dt> +<dd> +command string +</dd> +</dl> +<a NAME="SharedEditorController.sendSharedEdit" ID="SharedEditorController.sendSharedEdit"></a> +<h4>SharedEditorController.sendSharedEdit</h4> +<b>sendSharedEdit</b>(<i></i>) +<p> + Public slot to end a shared edit session for the current editor and + send the changes. +</p> + +<a NAME="SharedEditorController.shareConnected" ID="SharedEditorController.shareConnected"></a> +<h4>SharedEditorController.shareConnected</h4> +<b>shareConnected</b>(<i>connected</i>) +<p> + Public slot to handle a change of the connected state. +</p> + +<dl> + +<dt><i>connected</i> (bool)</dt> +<dd> +flag indicating the connected state +</dd> +</dl> +<a NAME="SharedEditorController.shareEditor" ID="SharedEditorController.shareEditor"></a> +<h4>SharedEditorController.shareEditor</h4> +<b>shareEditor</b>(<i>share</i>) +<p> + Public slot to set the shared status of the current editor. +</p> + +<dl> + +<dt><i>share</i> (bool)</dt> +<dd> +flag indicating the share status +</dd> +</dl> +<a NAME="SharedEditorController.startSharedEdit" ID="SharedEditorController.startSharedEdit"></a> +<h4>SharedEditorController.startSharedEdit</h4> +<b>startSharedEdit</b>(<i></i>) +<p> + Public slot to start a shared edit session for the current editor. +</p> + +<div align="right"><a href="#top">Up</a></div> +<hr /> +</body></html>