67
67
/*! \brief Initializes the shared document. Only used if starting a new session; not when joining one. */
68
68
void initializeDocument(const QDomDocument &doc);
69
69
/*! \brief Processes the incoming SXE element and remembers its identifying information.*/
70
void processIncomingSxeElement(const QDomElement &, const Jid &sender);
70
void processIncomingSxeElement(const QDomElement &, const QString &id);
71
71
/*! \brief Returns a const reference to the target document.*/
72
72
const QDomDocument& document() const;
73
73
/*! \brief Returns true if the target is a groupchat.*/
74
const bool groupChat() const;
74
bool groupChat() const;
75
75
/*! \brief Returns true if the target is a groupchat.*/
76
const bool serverSupport() const;
76
bool serverSupport() const;
77
77
/*! \brief Returns the target contact's JID.*/
78
78
const Jid target() const;
79
79
/*! \brief Returns the session identifier.*/
82
82
const Jid ownJid() const;
83
83
/*! \brief Returns the session identifier.*/
84
84
const QList<QString> features() const;
85
86
/*! \brief Starts queueing new edits to the document.
86
87
* Queueing should be started just before sending <document-begin/>.
90
91
* Queueing should be stopped after sending <document-end/>.
92
93
void stopQueueing();
93
/*! \brief Erases the sxe elements from the incoming queue up to and including the sxe identified by the parameters.
94
* The parameters correspond to the attributes of the last-edit element.
96
void eraseQueueUntil(QString sender, QString id);
97
/*! \brief Sets whether configure edits are accepted regardless of version.
98
* Default is false. Should be set true if the session state is Negotiation::DocumentBegun.
99
* Initializes the document with \a doc if provided.
101
void setImporting(bool, const QDomDocument &doc = QDomDocument());
102
/*! \brief Return a id with information identifying the last processed sxe element.*/
103
QHash<QString, QString> lastSxe() const;
104
/*! \brief Sets the information identifying the last processed sxe.*/
105
void setLastSxe(const QString &sender, const QString &id);
95
/*! \brief Initializes the document with the prolog of \a doc if provided.
96
* Should be used when <document-begin/> is received when joining.
98
void startImporting(const QDomDocument &doc = QDomDocument());
99
/*! \brief Enters the normal editing mode.
100
* Should be used when <document-end/> is received when joining.
102
void stopImporting();
104
/*! \brief Add the given ID to the list of used IDs for <sxe/> elements.*/
105
void addUsedSxeId(QString id);
106
/*! \brief Return the list of used IDs for <sxe/> elements.*/
107
QList<QString> usedSxeIds();
109
void setUUIDPrefix(const QString uuidPrefix = QString());
107
110
/*! \brief Returns a random UUID without enclosing { }. */
108
111
static QString generateUUID();
109
112
/*! \brief Returns the prolog of the document as a string. */
183
186
Returns true iff \a meta1 was removed. */
184
187
bool removeSmaller(SxeRecord* meta1, SxeRecord* meta2);
185
188
/*! \brief Processes an incoming sxe element.*/
186
bool processSxe(const QDomElement &sxe);
189
bool processSxe(const QDomElement &sxe, const QString &id);
187
190
/*! \brief Queues an outgoing edit to be sent when flushed.*/
188
191
void queueOutgoingEdit(SxeEdit* edit);
189
192
/*! \brief Creates the record of node with rid \a id. Returns a pointer to it. */
237
240
/*! \brief A list of supported features for the session.*/
238
241
QList<QString> features_;
239
/*! \brief A string that identifies the last edit that was processed.*/
240
QHash<QString, QString> lastSxe_;
241
/*! \brief The highest primary weight value in the document.*/
242
/*! \brief Identifiers for the <sxe/> elements that have been processed already.*/
243
QList<QString> usedSxeIds_;
244
/*! \brief A unique id is generated as "uuidPrefix.counter".*/
243
247
/*! \brief The main DOM document.*/
244
248
QDomDocument doc_;