| 1 |
/* Copyright (C) 2006,2007 by Marc Maurer <[email protected]> |
| 2 |
* Copyright (C) 2007 One Laptop Per Child |
| 3 |
* |
| 4 |
* This program is free software; you can redistribute it and/or |
| 5 |
* modify it under the terms of the GNU General Public License |
| 6 |
* as published by the Free Software Foundation; either version 2 |
| 7 |
* of the License, or (at your option) any later version. |
| 8 |
* |
| 9 |
* This program is distributed in the hope that it will be useful, |
| 10 |
* but WITHOUT ANY WARRANTY; without even the implied warranty of |
| 11 |
* MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the |
| 12 |
* GNU General Public License for more details. |
| 13 |
* |
| 14 |
* You should have received a copy of the GNU General Public License |
| 15 |
* along with this program; if not, write to the Free Software |
| 16 |
* Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA |
| 17 |
* 02110-1301 USA. |
| 18 |
*/ |
| 19 |
|
| 20 |
#include <string> |
| 21 |
#include <vector> |
| 22 |
|
| 23 |
#include <libxml/parser.h> |
| 24 |
#include <libxml/tree.h> |
| 25 |
#include <libxml/xmlreader.h> |
| 26 |
|
| 27 |
#include "ut_vector.h" |
| 28 |
#include "pd_Document.h" |
| 29 |
#include "px_ChangeRecord.h" |
| 30 |
#include "px_CR_SpanChange.h" |
| 31 |
#include "px_CR_FmtMarkChange.h" |
| 32 |
#include "px_CR_SpanChange.h" |
| 33 |
#include "px_CR_FmtMark.h" |
| 34 |
#include "px_CR_Span.h" |
| 35 |
#include "px_CR_Glob.h" |
| 36 |
#include "px_CR_StruxChange.h" |
| 37 |
#include "px_CR_ObjectChange.h" |
| 38 |
#include "px_CR_Strux.h" |
| 39 |
#include "px_CR_Object.h" |
| 40 |
#include "DocHandle.h" |
| 41 |
#include <packet/xp/AbiCollab_Packet.h> |
| 42 |
#include "Event.h" |
| 43 |
#include "SessionEvent.h" |
| 44 |
|
| 45 |
void StartSessionEvent::serialize(Archive & ar) |
| 46 |
{ |
| 47 |
Event::serialize( ar ); |
| 48 |
} |
| 49 |
|
| 50 |
void GetSessionsEvent::serialize(Archive & ar) |
| 51 |
{ |
| 52 |
Event::serialize( ar ); |
| 53 |
} |
| 54 |
|
| 55 |
void GetSessionsResponseEvent::serialize(Archive & ar) |
| 56 |
{ |
| 57 |
Event::serialize( ar ); |
| 58 |
ar << m_Sessions; |
| 59 |
} |
| 60 |
|
| 61 |
void JoinSessionEvent::serialize(Archive & ar) |
| 62 |
{ |
| 63 |
Event::serialize( ar ); |
| 64 |
ar << m_sSessionId; |
| 65 |
} |
| 66 |
|
| 67 |
std::string JoinSessionEvent::toStr() const |
| 68 |
{ |
| 69 |
return |
| 70 |
Event::toStr() + |
| 71 |
str(boost::format("JoinSessionEvent: m_sSessionId: %1%\n") % m_sSessionId.utf8_str()); |
| 72 |
} |
| 73 |
|
| 74 |
void JoinSessionRequestEvent::serialize(Archive & ar) |
| 75 |
{ |
| 76 |
JoinSessionEvent::serialize( ar ); |
| 77 |
} |
| 78 |
|
| 79 |
void JoinSessionRequestResponseEvent::serialize(Archive & ar) |
| 80 |
{ |
| 81 |
Event::serialize( ar ); |
| 82 |
ar << m_sSessionId << m_sZABW << m_iRev << m_sDocumentId << m_sDocumentName << m_iAuthorId; |
| 83 |
} |
| 84 |
|
| 85 |
std::string JoinSessionRequestResponseEvent::toStr() const |
| 86 |
{ |
| 87 |
return |
| 88 |
Event::toStr() + |
| 89 |
str(boost::format("JoinSessionRequestResponseEvent: m_sZABW: %1% bytes, m_iRev: %2%, m_sDocumentId: %3%, m_sDocumentName: %4%, m_iAuthorId: %5%\n") % |
| 90 |
m_sZABW.size() % m_iRev % m_sDocumentId.utf8_str() % m_sDocumentName.utf8_str() % m_iAuthorId ); |
| 91 |
} |
| 92 |
|
| 93 |
void DisjoinSessionEvent::serialize(Archive & ar) |
| 94 |
{ |
| 95 |
Event::serialize( ar ); |
| 96 |
ar << m_sSessionId; |
| 97 |
} |
| 98 |
|
| 99 |
std::string DisjoinSessionEvent::toStr() const |
| 100 |
{ |
| 101 |
return |
| 102 |
Event::toStr() + |
| 103 |
str(boost::format("DisjoinSessionEvent: m_sSessionId: %1%\n") % m_sSessionId.utf8_str()); |
| 104 |
} |
| 105 |
|
| 106 |
void CloseSessionEvent::serialize(Archive & ar) |
| 107 |
{ |
| 108 |
Event::serialize( ar ); |
| 109 |
ar << m_sSessionId; |
| 110 |
} |
| 111 |
|
| 112 |
std::string CloseSessionEvent::toStr() const |
| 113 |
{ |
| 114 |
return |
| 115 |
Event::toStr() + |
| 116 |
str(boost::format("CloseSessionEvent: m_sSessionId: %1%\n") % m_sSessionId.utf8_str()); |
| 117 |
} |