#include <xad_Document.h>
Public Member Functions | |
AD_Document () | |
void | ref (void) |
void | unref (void) |
virtual AD_DOCUMENT_TYPE | getType () const =0 |
XAP_ResourceManager & | resourceManager () const |
const std::string & | getFilename (void) const |
const std::string & | getPrintFilename (void) const |
void | setPrintFilename (const std::string &sFile) |
void | clearFilename (void) |
virtual UT_Error | readFromFile (const char *szFilename, int ieft, const char *props=NULL)=0 |
virtual UT_Error | importFile (const char *szFilename, int ieft, bool markClean=false, bool bImportStylesFirst=true, const char *props=NULL)=0 |
virtual UT_Error | newDocument ()=0 |
virtual bool | isDirty (void) const =0 |
virtual void | forceDirty () |
bool | isForcedDirty () const |
virtual bool | canDo (bool bUndo) const =0 |
virtual bool | undoCmd (UT_uint32 repeatCount)=0 |
virtual bool | redoCmd (UT_uint32 repeatCount)=0 |
UT_Error | saveAs (const char *szFilename, int ieft, const char *props=NULL) |
UT_Error | saveAs (const char *szFilename, int ieft, bool cpy, const char *props=NULL) |
UT_Error | save (void) |
virtual bool | createDataItem (const char *szName, bool bBase64, const UT_ConstByteBufPtr &pByteBuf, const std::string &mime_type, PD_DataItemHandle *ppHandle)=0 |
virtual bool | replaceDataItem (const char *szName, const UT_ConstByteBufPtr &pByteBuf)=0 |
virtual bool | getDataItemDataByName (const char *szName, UT_ConstByteBufPtr &pByteBuf, std::string *mime_type, PD_DataItemHandle *ppHandle) const =0 |
time_t | getTimeSinceSave () const |
Returns the # of seconds since the last save of this file. | |
time_t | getLastSavedTime () const |
void | setLastSavedTime (time_t t) |
virtual UT_uint32 | getLastSavedAsType () const =0 |
time_t | getTimeSinceOpen () const |
time_t | getLastOpenedTime () const |
void | setLastOpenedTime (time_t t) |
time_t | getEditTime () const |
void | setEditTime (UT_uint32 t) |
void | setDocVersion (UT_uint32 i) |
UT_uint32 | getDocVersion () const |
void | setEncodingName (const char *szEncodingName) |
const char * | getEncodingName () const |
bool | isPieceTableChanging (void) const |
virtual void | setMetaDataProp (const std::string &key, const std::string &value)=0 |
virtual bool | getMetaDataProp (const std::string &key, std::string &outProp) const =0 |
virtual void | setAnnotationProp (const std::string &key, const std::string &value)=0 |
virtual bool | getAnnotationProp (const std::string &key, std::string &outProp) const =0 |
void | addRecordToHistory (const AD_VersionData &v) |
void | purgeHistory () |
UT_sint32 | getHistoryCount () const |
UT_uint32 | getHistoryNthId (UT_sint32 i) const |
time_t | getHistoryNthTime (UT_sint32 i) const |
time_t | getHistoryNthTimeStarted (UT_sint32 i) const |
time_t | getHistoryNthEditTime (UT_sint32 i) const |
const UT_UUID & | getHistoryNthUID (UT_sint32 i) const |
bool | getHistoryNthAutoRevisioned (UT_sint32 i) const |
UT_uint32 | getHistoryNthTopXID (UT_sint32 i) const |
AD_HISTORY_STATE | verifyHistoryState (UT_uint32 &iVersion) const |
const AD_VersionData * | findHistoryRecord (UT_uint32 iVersion) const |
bool | showHistory (AV_View *pView) |
bool | areDocumentsRelated (const AD_Document &d) const |
bool | areDocumentHistoriesEqual (const AD_Document &d, UT_uint32 &iVer) const |
virtual bool | areDocumentContentsEqual (const AD_Document &d, UT_uint32 &pos) const =0 |
virtual bool | areDocumentFormatsEqual (const AD_Document &d, UT_uint32 &pos) const =0 |
virtual bool | areDocumentStylesheetsEqual (const AD_Document &d) const =0 |
void | setDocUUID (const char *u) |
const char * | getDocUUIDString () const |
const UT_UUID * | getDocUUID () const |
void | setOrigUUID (const char *u) |
const char * | getOrigDocUUIDString () const |
const UT_UUID * | getOrigDocUUID () const |
void | setMyUUID (const char *u) |
std::string | getMyUUIDString () const |
const UT_UUID * | getMyUUID () const |
UT_UUIDPtr | getNewUUID () const |
UT_uint32 | getNewUUID32 () const |
UT_uint64 | getNewUUID64 () const |
bool | addRevision (UT_uint32 iId, UT_UCS4Char *pDesc, time_t tStart, UT_uint32 iVersion, bool bGenCR=true) |
bool | addRevision (UT_uint32 iId, const UT_UCS4Char *pDesc, UT_uint32 iLen, time_t tStart, UT_uint32 iVersion, bool bGenCR=true) |
bool | addRevision (AD_Revision *pRev, bool bGenCR=true) |
virtual bool | createAndSendDocPropCR (const gchar **pAtts, const gchar **pProps)=0 |
const UT_GenericVector < AD_Revision * > & | getRevisions () |
UT_uint32 | getHighestRevisionId () const |
const AD_Revision * | getHighestRevision () const |
UT_sint32 | getRevisionIndxFromId (UT_uint32 iId) const |
bool | usingChangeTracking () const |
Should we pay attention to change tracking? | |
bool | isMarkRevisions () const |
bool | isShowRevisions () const |
UT_uint32 | getShowRevisionId () const |
UT_uint32 | getRevisionId () const |
UT_uint32 | findAutoRevisionId (UT_uint32 iVersion) const |
UT_uint32 | findNearestAutoRevisionId (UT_uint32 iVersion, bool bLesser=true) const |
void | toggleMarkRevisions () |
void | toggleShowRevisions () |
virtual void | setMarkRevisions (bool bMark) |
void | setShowRevisions (bool bShow) |
void | setShowRevisionId (UT_uint32 iId) |
void | setRevisionId (UT_uint32 iId) |
bool | isAutoRevisioning () const |
virtual void | setAutoRevisioning (bool autorev) |
virtual void | purgeRevisionTable (bool bUnconditional=false)=0 |
virtual bool | acceptRejectRevision (bool bReject, UT_uint32 iStart, UT_uint32 iEnd, UT_uint32 iLevel)=0 |
virtual bool | rejectAllHigherRevisions (UT_uint32 iLevel)=0 |
virtual bool | acceptAllRevisions ()=0 |
bool | purgeAllRevisions (AV_View *pView) |
bool | isOrigUUID (void) const |
void | setFilename (const char *name) |
virtual UT_uint32 | getXID () const =0 |
virtual UT_uint32 | getTopXID () const =0 |
Protected Member Functions | |
virtual UT_Error | _saveAs (const char *szFilename, int ieft, const char *props=NULL)=0 |
virtual UT_Error | _saveAs (const char *szFilename, int ieft, bool cpy, const char *props=NULL)=0 |
virtual UT_Error | _save (void)=0 |
void | _purgeRevisionTable () |
void | _adjustHistoryOnSave () |
void | _setFilename (const char *name) |
void | _setForceDirty (bool b) |
void | _setPieceTableChanging (bool b) |
void | _setMarkRevisions (bool bMark) |
bool | _restoreVersion (XAP_Frame *pFrame, UT_uint32 iVersion) |
virtual void | _clearUndo ()=0 |
virtual | ~AD_Document () |
Private Attributes | |
XAP_ResourceManager * | m_pResourceManager |
int | m_iRefCount |
std::string | m_szFilename |
UT_String | m_szEncodingName |
bool | m_bPieceTableChanging |
time_t | m_lastSavedTime |
time_t | m_lastOpenedTime |
time_t | m_iEditTime |
UT_uint32 | m_iVersion |
bool | m_bHistoryWasSaved |
UT_Vector | m_vHistory |
UT_GenericVector< AD_Revision * > | m_vRevisions |
bool | m_bMarkRevisions |
bool | m_bShowRevisions |
UT_uint32 | m_iRevisionID |
UT_uint32 | m_iShowRevisionID |
bool | m_bAutoRevisioning |
bool | m_bForcedDirty |
UT_UUID * | m_pUUID |
UT_UUID * | m_pOrigUUID |
UT_UUID * | m_pMyUUID |
bool | m_bDoNotAdjustHistory |
bool | m_bAfterFirstSave |
std::string | m_sMyUUIDString |
std::string | m_sOrigUUIDString |
std::string | m_sPrintFilename |
AD_Document::AD_Document | ( | ) |
AD_Document::~AD_Document | ( | ) | [protected, virtual] |
References DELETEP, m_iRefCount, m_pMyUUID, m_pOrigUUID, m_pResourceManager, m_pUUID, m_vHistory, m_vRevisions, UT_ASSERT, and UT_VECTOR_PURGEALL.
void AD_Document::_adjustHistoryOnSave | ( | ) | [protected] |
Update document history and version information; should only be called inside save() and saveAs()
References addRecordToHistory(), addRevision(), XAP_App::getApp(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), getRevisionId(), XAP_App::getStringSet(), AD_VersionData::getTime(), getTopXID(), XAP_StringSet::getValue(), m_bAutoRevisioning, m_bDoNotAdjustHistory, m_bHistoryWasSaved, m_iVersion, m_lastOpenedTime, m_lastSavedTime, m_vHistory, setRevisionId(), time, UT_return_if_fail, and v.
Referenced by PD_Document::_save(), and PD_Document::_saveAs().
virtual void AD_Document::_clearUndo | ( | ) | [protected, pure virtual] |
Implemented in PD_Document.
Referenced by _restoreVersion(), and purgeAllRevisions().
void AD_Document::_purgeRevisionTable | ( | ) | [protected] |
References UT_GenericVector< T >::clear(), m_vRevisions, and UT_VECTOR_PURGEALL.
Referenced by PD_Document::purgeRevisionTable(), and setAutoRevisioning().
References _clearUndo(), _setMarkRevisions(), XAP_Dialog_MessageBox::a_YES, XAP_Dialog_MessageBox::b_YN, UT_GenericVector< T >::deleteNthItem(), extension, findAutoRevisionId(), getFilename(), getHistoryCount(), AD_VersionData::getId(), getLastSavedAsType(), UT_GenericVector< T >::getNthItem(), AD_VersionData::getStartTime(), AD_VersionData::getTime(), isDirty(), m_bAutoRevisioning, m_bDoNotAdjustHistory, m_iEditTime, m_vHistory, rejectAllHigherRevisions(), save(), saveAs(), setDocVersion(), setLastOpenedTime(), setLastSavedTime(), XAP_Frame::showMessageBox(), time, UT_ASSERT, UT_ASSERT_HARMLESS, UT_isRegularFile(), UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, UT_std_string_sprintf(), and v.
Referenced by showHistory().
virtual UT_Error AD_Document::_save | ( | void | ) | [protected, pure virtual] |
Implemented in PD_Document.
Referenced by save().
virtual UT_Error AD_Document::_saveAs | ( | const char * | szFilename, | |
int | ieft, | |||
const char * | props = NULL | |||
) | [protected, pure virtual] |
Implemented in PD_Document.
Referenced by saveAs().
virtual UT_Error AD_Document::_saveAs | ( | const char * | szFilename, | |
int | ieft, | |||
bool | cpy, | |||
const char * | props = NULL | |||
) | [protected, pure virtual] |
Implemented in PD_Document.
void AD_Document::_setFilename | ( | const char * | name | ) | [inline, protected] |
Referenced by PD_Document::_importFile(), and PD_Document::_saveAs().
void AD_Document::_setForceDirty | ( | bool | b | ) | [inline, protected] |
Referenced by PD_Document::_importFile(), PD_Document::_setClean(), and PD_Document::forceDirty().
void AD_Document::_setMarkRevisions | ( | bool | bMark | ) | [inline, protected] |
Referenced by PD_Document::_acceptRejectRevision(), _restoreVersion(), and setAutoRevisioning().
void AD_Document::_setPieceTableChanging | ( | bool | b | ) | [inline, protected] |
Referenced by PD_Document::notifyPieceTableChangeEnd(), and PD_Document::notifyPieceTableChangeStart().
virtual bool AD_Document::acceptAllRevisions | ( | ) | [pure virtual] |
Implemented in PD_Document.
Referenced by purgeAllRevisions(), and setAutoRevisioning().
virtual bool AD_Document::acceptRejectRevision | ( | bool | bReject, | |
UT_uint32 | iStart, | |||
UT_uint32 | iEnd, | |||
UT_uint32 | iLevel | |||
) | [pure virtual] |
Implemented in PD_Document.
void AD_Document::addRecordToHistory | ( | const AD_VersionData & | vd | ) |
Add given version data to the document history.
References UT_GenericVector< T >::addItem(), m_vHistory, UT_return_if_fail, and v.
Referenced by _adjustHistoryOnSave(), setAutoRevisioning(), and IE_Imp_AbiWord_1::startElement().
bool AD_Document::addRevision | ( | UT_uint32 | iId, | |
UT_UCS4Char * | pDesc, | |||
time_t | tStart, | |||
UT_uint32 | iVersion, | |||
bool | bGenCR = true | |||
) |
References AD_Revision::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), m_iRevisionID, and m_vRevisions.
Referenced by _adjustHistoryOnSave(), IE_Imp_MsWord_97::_beginChar(), addRevision(), AP_Dialog_MarkRevisions::addRevision(), PD_Document::changeDocPropeties(), IE_Imp_RTF::ReadRevisionTable(), and setAutoRevisioning().
bool AD_Document::addRevision | ( | UT_uint32 | iId, | |
const UT_UCS4Char * | pDesc, | |||
UT_uint32 | iLen, | |||
time_t | tStart, | |||
UT_uint32 | iVersion, | |||
bool | bGenCR = true | |||
) |
bool AD_Document::addRevision | ( | AD_Revision * | pRev, | |
bool | bGenCR = true | |||
) |
virtual bool AD_Document::areDocumentContentsEqual | ( | const AD_Document & | d, | |
UT_uint32 & | pos | |||
) | const [pure virtual] |
Implemented in PD_Document.
Referenced by XAP_Dialog_DocComparison::calculate().
virtual bool AD_Document::areDocumentFormatsEqual | ( | const AD_Document & | d, | |
UT_uint32 & | pos | |||
) | const [pure virtual] |
Implemented in PD_Document.
Referenced by XAP_Dialog_DocComparison::calculate().
bool AD_Document::areDocumentHistoriesEqual | ( | const AD_Document & | d, | |
UT_uint32 & | iVersion | |||
) | const |
Returns true if both documents are based on the same root document and all version records have identical UID's on return, the last identical version id is found in iVersion
References getDocUUID(), getHistoryCount(), AD_VersionData::getId(), UT_GenericVector< T >::getNthItem(), m_pUUID, m_vHistory, UT_MAX, and UT_MIN.
Referenced by XAP_Dialog_DocComparison::calculate().
bool AD_Document::areDocumentsRelated | ( | const AD_Document & | d | ) | const |
Returns true if both documents are based on the same root document
References getDocUUID(), and m_pUUID.
Referenced by XAP_Dialog_DocComparison::calculate().
virtual bool AD_Document::areDocumentStylesheetsEqual | ( | const AD_Document & | d | ) | const [pure virtual] |
Implemented in PD_Document.
Referenced by XAP_Dialog_DocComparison::calculate().
virtual bool AD_Document::canDo | ( | bool | bUndo | ) | const [pure virtual] |
Implemented in PD_Document.
void AD_Document::clearFilename | ( | void | ) | [inline] |
Referenced by XAP_App::retrieveState().
virtual bool AD_Document::createAndSendDocPropCR | ( | const gchar ** | pAtts, | |
const gchar ** | pProps | |||
) | [pure virtual] |
Implemented in PD_Document.
Referenced by addRevision().
virtual bool AD_Document::createDataItem | ( | const char * | szName, | |
bool | bBase64, | |||
const UT_ConstByteBufPtr & | pByteBuf, | |||
const std::string & | mime_type, | |||
PD_DataItemHandle * | ppHandle | |||
) | [pure virtual] |
Implemented in PD_Document.
Find revision id that corresponds to given document version
References AD_Revision::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), AD_Revision::getVersion(), m_vRevisions, UT_DEBUGMSG, and UT_return_val_if_fail.
Referenced by _restoreVersion().
const AD_VersionData * AD_Document::findHistoryRecord | ( | UT_uint32 | iVersion | ) | const |
References getHistoryCount(), AD_VersionData::getId(), UT_GenericVector< T >::getNthItem(), m_vHistory, and v.
Referenced by XAP_Dialog_DocComparison::calculate(), and PD_Document::getFragXIDforVersion().
Finds the nearest autorevision for the given document version
UT_uint32 | iVersion: the document version | |
bool | bLesser: indicates whether nearest lesser or nearest greater autorevision is required |
References AD_Revision::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), AD_Revision::getVersion(), m_vRevisions, UT_DEBUGMSG, and UT_return_val_if_fail.
virtual void AD_Document::forceDirty | ( | ) | [inline, virtual] |
Reimplemented in PD_Document.
Referenced by addRevision(), XAP_App::retrieveState(), setMarkRevisions(), setShowRevisionId(), and setShowRevisions().
virtual bool AD_Document::getAnnotationProp | ( | const std::string & | key, | |
std::string & | outProp | |||
) | const [pure virtual] |
Implemented in PD_Document.
virtual bool AD_Document::getDataItemDataByName | ( | const char * | szName, | |
UT_ConstByteBufPtr & | pByteBuf, | |||
std::string * | mime_type, | |||
PD_DataItemHandle * | ppHandle | |||
) | const [pure virtual] |
Implemented in PD_Document.
Referenced by GR_EmbedView::getSnapShots().
const UT_UUID* AD_Document::getDocUUID | ( | ) | const [inline] |
Referenced by areDocumentHistoriesEqual(), areDocumentsRelated(), and XAP_Dialog_History::getHeaderValue().
const char * AD_Document::getDocUUIDString | ( | ) | const |
Get the UID of this document represented as a string (this function is primarily for exporters)
References m_pUUID, s, UT_UUID::toString(), and UT_return_val_if_fail.
Referenced by s_AbiWord_1_Listener::_handleHistory(), AccountHandler::_handlePacket(), AbiCollab::_handleSessionTakeover(), AbiCollab::_restartAsMaster(), AbiCollab::_shutdownAsMaster(), IE_Exp_EPUB::_writeDocument(), XAP_Dialog_History::getHeaderValue(), AbiCollabSessionManager::getSessionFromDocumentId(), AbiCollab::initiateSessionTakeover(), AbiCollab::startRecording(), AbiCollabSessionManager::startSession(), and IE_Imp_EPUB::uncompress().
UT_uint32 AD_Document::getDocVersion | ( | ) | const [inline] |
time_t AD_Document::getEditTime | ( | ) | const [inline] |
References time.
Referenced by s_AbiWord_1_Listener::_handleHistory(), and XAP_Dialog_History::getHeaderValue().
const char * AD_Document::getEncodingName | ( | void | ) | const |
References UT_String::c_str(), m_szEncodingName, and UT_String::size().
Referenced by IE_Imp_MsWord_97::_generateCharProps(), IE_Exp_Text::IE_Exp_Text(), and IE_Imp_Text::IE_Imp_Text().
const std::string & AD_Document::getFilename | ( | void | ) | const |
References m_szFilename.
Referenced by XAP_Dialog_ListDocuments::_getNthDocumentName(), AccountHandler::_handlePacket(), PD_Document::_importFile(), _restoreVersion(), PD_Document::_save(), AbiCollabSessionManager::_setupFrame(), XAP_FrameImpl::_updateTitle(), IE_Exp_HTML::_writeDocument(), fp_FieldShortFileNameRun::calculateValue(), fp_FieldFileNameRun::calculateValue(), Defun_EV_GetMenuItemState_Fn(), TelepathyChatroom::getDocName(), XAP_Frame::getFilename(), XAP_Dialog_History::getHeaderValue(), XAP_Dialog_DocComparison::getPath1(), XAP_Dialog_DocComparison::getPath2(), XAP_Frame::makeBackupName(), AbiCollabSessionManager::processPacket(), purgeAllRevisions(), AbiCollabSessionManager::removeBuddy(), s_doListDocuments(), s_doPrint(), XAP_App::saveState(), XAP_UnixDialog_Print::setupPrint(), AbiCollab::startRecording(), and ServiceAccountHandler::startSession().
const AD_Revision * AD_Document::getHighestRevision | ( | ) | const |
References AD_Revision::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), and m_vRevisions.
Referenced by AP_Dialog_MarkRevisions::_initRevision().
UT_uint32 AD_Document::getHighestRevisionId | ( | ) | const |
UT_sint32 AD_Document::getHistoryCount | ( | ) | const [inline] |
bool AD_Document::getHistoryNthAutoRevisioned | ( | UT_sint32 | i | ) | const |
time_t AD_Document::getHistoryNthEditTime | ( | UT_sint32 | i | ) | const |
Get get cumulative edit time for n-th record in version history
References UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), AD_VersionData::getStartTime(), AD_VersionData::getTime(), m_pUUID, m_vHistory, UT_ASSERT, and v.
Get the version number for n-th record in version history
References AD_VersionData::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), m_vHistory, and v.
Referenced by s_AbiWord_1_Listener::_handleHistory(), XAP_Dialog_History::getListItemId(), and XAP_Dialog_History::getListValue().
time_t AD_Document::getHistoryNthTime | ( | UT_sint32 | i | ) | const |
Get time stamp for n-th record in version history NB: the time stamp represents the last save time
References UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), AD_VersionData::getTime(), m_vHistory, and v.
time_t AD_Document::getHistoryNthTimeStarted | ( | UT_sint32 | i | ) | const |
References UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), AD_VersionData::getTopXID(), m_vHistory, and v.
Referenced by s_AbiWord_1_Listener::_handleHistory().
Get the UID for n-th record in version history
References UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), UT_UUID::getNull(), AD_VersionData::getUID(), m_vHistory, and v.
Referenced by s_AbiWord_1_Listener::_handleHistory().
time_t AD_Document::getLastOpenedTime | ( | ) | const [inline] |
virtual UT_uint32 AD_Document::getLastSavedAsType | ( | ) | const [pure virtual] |
Implemented in PD_Document.
Referenced by _restoreVersion().
time_t AD_Document::getLastSavedTime | ( | ) | const [inline] |
Referenced by s_AbiWord_1_Listener::_handleHistory(), and XAP_Dialog_History::getHeaderValue().
virtual bool AD_Document::getMetaDataProp | ( | const std::string & | key, | |
std::string & | outProp | |||
) | const [pure virtual] |
Implemented in PD_Document.
Referenced by XAP_FrameImpl::_updateTitle().
const UT_UUID* AD_Document::getMyUUID | ( | ) | const [inline] |
Referenced by PX_ChangeRecord::setDocument().
std::string AD_Document::getMyUUIDString | ( | ) | const |
Get the UID of the users of this document represented as a string (this function is primarily for exporters)
NOTE: don't make this a static variable, as this value might change over the life of the document
References m_pMyUUID, m_sMyUUIDString, and UT_return_val_if_fail.
Referenced by ABI_Collab_Export::_handleNewPacket(), FV_View::addCaret(), ABI_Collab_Export::change(), FV_View::FV_View(), FV_View::isActive(), and FV_View::updateCarets().
UT_UUIDPtr AD_Document::getNewUUID | ( | ) | const |
Creates a new UUID; this uuid has the 'MAC' portion set to the same value as the main doc uuid -- this guarantees that all id's generated this way will be document unique even though withou using MAC in the uuid we cannot absolutely guarantee universal uniqueness.
References UT_UUIDGenerator::createUUID(), XAP_App::getApp(), XAP_App::getUUIDGenerator(), UT_UUID::isValid(), m_pUUID, UT_UUID::resetTime(), UT_ASSERT, and UT_return_val_if_fail.
Referenced by s_RTF_ListenerWriteDoc::_openTag(), FV_View::cmdInsertEmbed(), FV_View::cmdInsertGraphic(), FV_View::cmdInsertGraphicAtStrux(), FV_View::cmdInsertLatexMath(), FV_View::cmdInsertPositionedGraphic(), FV_View::cmdUpdateEmbed(), getNewUUID32(), and getNewUUID64().
UT_uint32 AD_Document::getNewUUID32 | ( | ) | const |
see notes on getNewUUID()
References XAP_App::getApp(), getNewUUID(), UT_UUIDGenerator::getNewUUID32(), XAP_App::getUUIDGenerator(), and UT_return_val_if_fail.
UT_uint64 AD_Document::getNewUUID64 | ( | ) | const |
see notes on getNewUUID()
References XAP_App::getApp(), getNewUUID(), UT_UUIDGenerator::getNewUUID64(), XAP_App::getUUIDGenerator(), and UT_return_val_if_fail.
const UT_UUID* AD_Document::getOrigDocUUID | ( | ) | const [inline] |
Referenced by PX_ChangeRecord::isFromThisDoc().
const char * AD_Document::getOrigDocUUIDString | ( | ) | const |
Get the Original UID of this document represented as a string (this function is primarily for exporters)
References m_pOrigUUID, m_sOrigUUIDString, and UT_return_val_if_fail.
Referenced by ABI_Collab_Import::_handleCollision(), PacketFactory< _PacketType >::create(), ABI_Collab_Import::import(), and ABI_Collab_Export::signal().
const std::string & AD_Document::getPrintFilename | ( | void | ) | const |
References m_sPrintFilename.
Referenced by XAP_UnixDialog_Print::setupPrint().
UT_uint32 AD_Document::getRevisionId | ( | ) | const [inline] |
find revision with id iId and return its index in revision table
iId | -- id of revision we are interested in |
References AD_Revision::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), and m_vRevisions.
Referenced by IE_Exp_RTF::_output_revision().
const UT_GenericVector<AD_Revision*>& AD_Document::getRevisions | ( | ) | [inline] |
Referenced by s_DocBook_Listener::_handleRevisions(), s_AbiWord_1_Listener::_handleRevisions(), PD_Document::_importFile(), IE_Exp_RTF::_output_revision(), IE_Exp_RTF::_write_rtf_header(), AP_Dialog_ListRevisions::getItemCount(), AP_Dialog_ListRevisions::getNthItemId(), AP_Dialog_ListRevisions::getNthItemText(), AP_Dialog_ListRevisions::getNthItemTimeT(), IE_Imp_RTF::HandleRevisedTextTimestamp(), and PD_Document::purgeRevisionTable().
UT_uint32 AD_Document::getShowRevisionId | ( | ) | const [inline] |
time_t AD_Document::getTimeSinceOpen | ( | ) | const [inline] |
References time.
time_t AD_Document::getTimeSinceSave | ( | ) | const [inline] |
Returns the # of seconds since the last save of this file.
References time.
Referenced by XAP_Frame::getTimeSinceSave().
virtual UT_uint32 AD_Document::getTopXID | ( | ) | const [pure virtual] |
Implemented in PD_Document.
Referenced by _adjustHistoryOnSave(), and setAutoRevisioning().
virtual AD_DOCUMENT_TYPE AD_Document::getType | ( | ) | const [pure virtual] |
Implemented in PD_Document.
Referenced by PD_Document::areDocumentContentsEqual(), PD_Document::areDocumentFormatsEqual(), and PD_Document::areDocumentStylesheetsEqual().
virtual UT_uint32 AD_Document::getXID | ( | ) | const [pure virtual] |
Implemented in PD_Document.
virtual UT_Error AD_Document::importFile | ( | const char * | szFilename, | |
int | ieft, | |||
bool | markClean = false , |
|||
bool | bImportStylesFirst = true , |
|||
const char * | props = NULL | |||
) | [pure virtual] |
Implemented in PD_Document.
Referenced by AP_Frame::_importDocument().
bool AD_Document::isAutoRevisioning | ( | ) | const [inline] |
Referenced by s_AbiWord_1_Listener::_handleRevisions(), Defun1(), and FV_View::updateRevisionMode().
virtual bool AD_Document::isDirty | ( | void | ) | const [pure virtual] |
Implemented in PD_Document.
Referenced by _restoreVersion(), XAP_FrameImpl::_updateTitle(), XAP_Frame::isDirty(), and XAP_App::saveState().
bool AD_Document::isForcedDirty | ( | ) | const [inline] |
Referenced by PD_Document::isDirty().
bool AD_Document::isMarkRevisions | ( | ) | const [inline] |
Referenced by PD_Document::_acceptRejectRevision(), FV_View::_fixInsertionPointAfterRevision(), s_AbiWord_1_Listener::_handleRevisions(), PD_Document::_importFile(), pt_PieceTable::_translateRevisionAttribute(), pt_PieceTable::changeSpanFmt(), pt_PieceTable::changeStruxFmt(), pt_PieceTable::deleteHdrFtrStrux(), pt_PieceTable::deleteSpan(), PD_Document::explodeRevisions(), PD_Document::getAttrProp(), PD_Document::getSpanAttrProp(), pt_PieceTable::insertObject(), pt_PieceTable::insertSpan(), pt_PieceTable::insertStrux(), FV_View::isMarkRevisions(), fl_ShadowListener::populateStrux(), PD_Document::setMarkRevisions(), and usingChangeTracking().
bool AD_Document::isOrigUUID | ( | void | ) | const |
bool AD_Document::isPieceTableChanging | ( | void | ) | const |
References m_bPieceTableChanging.
Referenced by FV_View::_actuallyScroll(), FV_View::_autoScroll(), AP_TopRuler::_draw(), fl_DocSectionLayout::_HdrFtrChangeCallback(), FL_DocLayout::_redrawUpdate(), FV_View::_saveAndNotifyPieceTableChange(), FV_View::_setPoint(), autoSaveCallback(), AP_Dialog_SplitCells::autoUpdateMC(), AP_Dialog_MergeCells::autoUpdateMC(), fp_FieldTableSumCols::calculateValue(), fp_FieldTableSumRows::calculateValue(), FV_Selection::checkSelectAll(), fl_Squiggles::clear(), FL_DocLayout::deletePage(), AP_LeftRuler::drawLU(), FV_View::getLeftRulerInfo(), FV_View::getTopRulerInfo(), AP_TopRuler::isMouseOverTab(), AP_LeftRuler::mouseMotion(), AP_TopRuler::mousePress(), AP_LeftRuler::mousePress(), AP_LeftRuler::mouseRelease(), AP_TopRuler::setTableLineDrag(), AP_LeftRuler::setTableLineDrag(), and FL_DocLayout::updateLayout().
bool AD_Document::isShowRevisions | ( | ) | const [inline] |
virtual UT_Error AD_Document::newDocument | ( | ) | [pure virtual] |
Implemented in PD_Document.
Referenced by AP_Frame::_importDocument(), and AP_Frame::_loadDocument().
bool AD_Document::purgeAllRevisions | ( | AV_View * | pView | ) |
void AD_Document::purgeHistory | ( | ) |
References m_bHistoryWasSaved, m_vHistory, and UT_VECTOR_PURGEALL.
virtual void AD_Document::purgeRevisionTable | ( | bool | bUnconditional = false |
) | [pure virtual] |
Implemented in PD_Document.
Referenced by purgeAllRevisions().
virtual UT_Error AD_Document::readFromFile | ( | const char * | szFilename, | |
int | ieft, | |||
const char * | props = NULL | |||
) | [pure virtual] |
Implemented in PD_Document.
Referenced by AP_Frame::_loadDocument().
virtual bool AD_Document::redoCmd | ( | UT_uint32 | repeatCount | ) | [pure virtual] |
Implemented in PD_Document.
void AD_Document::ref | ( | void | ) |
References m_iRefCount, and UT_ASSERT.
virtual bool AD_Document::rejectAllHigherRevisions | ( | UT_uint32 | iLevel | ) | [pure virtual] |
Implemented in PD_Document.
Referenced by _restoreVersion().
virtual bool AD_Document::replaceDataItem | ( | const char * | szName, | |
const UT_ConstByteBufPtr & | pByteBuf | |||
) | [pure virtual] |
Implemented in PD_Document.
XAP_ResourceManager& AD_Document::resourceManager | ( | ) | const [inline] |
Referenced by IE_Imp_AbiWord_1::_handleImage(), IE_Imp_AbiWord_1::_handleResource(), and IE_Imp_XML::charData().
UT_Error AD_Document::save | ( | void | ) |
References _save(), m_bAfterFirstSave, and UT_OK.
Referenced by _restoreVersion(), FV_View::cmdSave(), XAP_App::saveState(), and setAutoRevisioning().
UT_Error AD_Document::saveAs | ( | const char * | szFilename, | |
int | ieft, | |||
bool | cpy, | |||
const char * | props = NULL | |||
) |
References _saveAs(), m_bAfterFirstSave, and UT_OK.
UT_Error AD_Document::saveAs | ( | const char * | szFilename, | |
int | ieft, | |||
const char * | props = NULL | |||
) |
References _saveAs(), m_bAfterFirstSave, and UT_OK.
Referenced by AP_Frame::_loadDocument(), _restoreVersion(), XAP_Frame::backup(), and XAP_App::saveState().
virtual void AD_Document::setAnnotationProp | ( | const std::string & | key, | |
const std::string & | value | |||
) | [pure virtual] |
Implemented in PD_Document.
void AD_Document::setAutoRevisioning | ( | bool | autorev | ) | [virtual] |
Reimplemented in PD_Document.
References _purgeRevisionTable(), _setMarkRevisions(), acceptAllRevisions(), addRecordToHistory(), addRevision(), XAP_App::getApp(), getHighestRevisionId(), getRevisionId(), XAP_App::getStringSet(), getTopXID(), XAP_StringSet::getValue(), m_bAfterFirstSave, m_bAutoRevisioning, m_bDoNotAdjustHistory, m_iVersion, PD_MAX_REVISION, save(), setMarkRevisions(), setRevisionId(), setShowRevisionId(), setShowRevisions(), time, UT_return_if_fail, and v.
void AD_Document::setDocUUID | ( | const char * | s | ) |
Set UID for the present document
References UT_UUID::isValid(), m_pUUID, UT_UUID::makeUUID(), UT_UUID::setUUID(), and UT_return_if_fail.
Referenced by IE_Imp_AbiWord_1::startElement().
void AD_Document::setDocVersion | ( | UT_uint32 | i | ) | [inline] |
Referenced by _restoreVersion(), PD_Document::newDocument(), and IE_Imp_AbiWord_1::startElement().
void AD_Document::setEditTime | ( | UT_uint32 | t | ) | [inline] |
Referenced by PD_Document::newDocument(), and IE_Imp_AbiWord_1::startElement().
void AD_Document::setEncodingName | ( | const char * | szEncodingName | ) |
void AD_Document::setFilename | ( | const char * | name | ) | [inline] |
void AD_Document::setLastOpenedTime | ( | time_t | t | ) | [inline] |
Referenced by PD_Document::_importFile(), _restoreVersion(), and PD_Document::newDocument().
void AD_Document::setLastSavedTime | ( | time_t | t | ) | [inline] |
Referenced by _restoreVersion(), and IE_Imp_AbiWord_1::startElement().
void AD_Document::setMarkRevisions | ( | bool | bMark | ) | [virtual] |
Reimplemented in PD_Document.
References forceDirty(), and m_bMarkRevisions.
Referenced by purgeAllRevisions(), setAutoRevisioning(), PD_Document::setMarkRevisionsNoNotify(), and toggleMarkRevisions().
virtual void AD_Document::setMetaDataProp | ( | const std::string & | key, | |
const std::string & | value | |||
) | [pure virtual] |
Implemented in PD_Document.
void AD_Document::setMyUUID | ( | const char * | s | ) |
Set Orig UID for the present document
References UT_UUID::isValid(), m_pMyUUID, m_sMyUUIDString, UT_UUID::makeUUID(), UT_UUID::setUUID(), UT_UUID::toString(), and UT_return_if_fail.
Referenced by ABI_Collab_Import::import().
void AD_Document::setOrigUUID | ( | const char * | s | ) |
Set Orig UID for the present document
References UT_UUID::isValid(), m_pOrigUUID, m_sOrigUUIDString, UT_UUID::makeUUID(), UT_UUID::setUUID(), UT_UUID::toString(), and UT_return_if_fail.
void AD_Document::setPrintFilename | ( | const std::string & | sFile | ) |
References m_sPrintFilename.
Referenced by XAP_UnixDialog_Print::cleanup().
void AD_Document::setRevisionId | ( | UT_uint32 | iId | ) |
References m_iRevisionID.
Referenced by _adjustHistoryOnSave(), and setAutoRevisioning().
void AD_Document::setShowRevisionId | ( | UT_uint32 | iId | ) |
References forceDirty(), and m_iShowRevisionID.
Referenced by IE_Imp_MsWord_97::_docProc(), FV_View::cmdSetRevisionLevel(), setAutoRevisioning(), FV_View::setRevisionLevel(), and IE_Imp_AbiWord_1::startElement().
void AD_Document::setShowRevisions | ( | bool | bShow | ) |
References forceDirty(), and m_bShowRevisions.
Referenced by IE_Imp_MsWord_97::_docProc(), setAutoRevisioning(), FV_View::setShowRevisions(), IE_Imp_AbiWord_1::startElement(), and toggleShowRevisions().
bool AD_Document::showHistory | ( | AV_View * | pView | ) |
References _restoreVersion(), XAP_Dialog_MessageBox::a_CANCEL, XAP_Dialog_MessageBox::a_NO, XAP_Dialog_MessageBox::a_OK, XAP_Dialog_MessageBox::a_YES, ADHIST_FULL_RESTORE, ADHIST_NO_RESTORE, ADHIST_PARTIAL_RESTORE, UT_String::c_str(), XAP_Dialog_History::getAnswer(), XAP_App::getApp(), XAP_Frame::getDialogFactory(), AV_View::getParentData(), XAP_Dialog_History::getSelectionId(), XAP_App::getStringSet(), XAP_StringSet::getValue(), XAP_Frame::raise(), XAP_DialogFactory::releaseDialog(), XAP_DialogFactory::requestDialog(), XAP_Dialog_History::runModal(), XAP_Dialog_History::setDocument(), XAP_Frame::showMessageBox(), UT_ASSERT_HARMLESS, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, UT_String_sprintf(), and verifyHistoryState().
Referenced by Defun1().
void AD_Document::toggleMarkRevisions | ( | ) |
References m_bMarkRevisions, and setMarkRevisions().
Referenced by FV_View::toggleMarkRevisions().
void AD_Document::toggleShowRevisions | ( | ) |
References m_bShowRevisions, and setShowRevisions().
virtual bool AD_Document::undoCmd | ( | UT_uint32 | repeatCount | ) | [pure virtual] |
Implemented in PD_Document.
void AD_Document::unref | ( | void | ) |
References m_iRefCount, and UT_ASSERT.
Referenced by AP_Win32Clipboard::setClipboardDoc(), TFTEST_MAIN(), and AP_Win32Clipboard::~AP_Win32Clipboard().
bool AD_Document::usingChangeTracking | ( | ) | const |
Should we pay attention to change tracking?
References getHighestRevisionId(), and isMarkRevisions().
AD_HISTORY_STATE AD_Document::verifyHistoryState | ( | UT_uint32 & | iVersion | ) | const |
Verifies to what extent we are able to restore given version of the document
UT_uint32 | & iVersion: on entry contains the version number user wants to revert to; if return value indicates partial restore iVersion indicates which nearest (greater) version can be restored fully, or 0 if no such version exists |
References ADHIST_NO_RESTORE, getHistoryCount(), AD_VersionData::getId(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), AD_VersionData::isAutoRevisioned(), m_vHistory, UT_ASSERT_HARMLESS, UT_SHOULD_NOT_HAPPEN, and v.
Referenced by showHistory().
bool AD_Document::m_bAfterFirstSave [private] |
Referenced by save(), saveAs(), and setAutoRevisioning().
bool AD_Document::m_bAutoRevisioning [private] |
Referenced by _adjustHistoryOnSave(), _restoreVersion(), and setAutoRevisioning().
bool AD_Document::m_bDoNotAdjustHistory [private] |
Referenced by _adjustHistoryOnSave(), _restoreVersion(), and setAutoRevisioning().
bool AD_Document::m_bForcedDirty [private] |
bool AD_Document::m_bHistoryWasSaved [private] |
Referenced by _adjustHistoryOnSave(), and purgeHistory().
bool AD_Document::m_bMarkRevisions [private] |
Referenced by setMarkRevisions(), and toggleMarkRevisions().
bool AD_Document::m_bPieceTableChanging [private] |
Referenced by isPieceTableChanging().
bool AD_Document::m_bShowRevisions [private] |
Referenced by setShowRevisions(), and toggleShowRevisions().
time_t AD_Document::m_iEditTime [private] |
Referenced by _restoreVersion().
int AD_Document::m_iRefCount [private] |
Referenced by ref(), unref(), and ~AD_Document().
UT_uint32 AD_Document::m_iRevisionID [private] |
Referenced by addRevision(), and setRevisionId().
UT_uint32 AD_Document::m_iShowRevisionID [private] |
Referenced by setShowRevisionId().
UT_uint32 AD_Document::m_iVersion [private] |
Referenced by _adjustHistoryOnSave(), and setAutoRevisioning().
time_t AD_Document::m_lastOpenedTime [private] |
Referenced by _adjustHistoryOnSave().
time_t AD_Document::m_lastSavedTime [private] |
Referenced by _adjustHistoryOnSave().
UT_UUID* AD_Document::m_pMyUUID [private] |
Referenced by AD_Document(), getMyUUIDString(), isOrigUUID(), setMyUUID(), and ~AD_Document().
UT_UUID* AD_Document::m_pOrigUUID [private] |
Referenced by AD_Document(), getOrigDocUUIDString(), isOrigUUID(), setOrigUUID(), and ~AD_Document().
Referenced by ~AD_Document().
UT_UUID* AD_Document::m_pUUID [private] |
std::string AD_Document::m_sMyUUIDString [private] |
Referenced by AD_Document(), getMyUUIDString(), and setMyUUID().
std::string AD_Document::m_sOrigUUIDString [private] |
Referenced by AD_Document(), getOrigDocUUIDString(), and setOrigUUID().
std::string AD_Document::m_sPrintFilename [private] |
Referenced by getPrintFilename(), and setPrintFilename().
UT_String AD_Document::m_szEncodingName [private] |
Referenced by getEncodingName(), and setEncodingName().
std::string AD_Document::m_szFilename [private] |
Referenced by getFilename().
UT_Vector AD_Document::m_vHistory [private] |
Referenced by _adjustHistoryOnSave(), _restoreVersion(), addRecordToHistory(), areDocumentHistoriesEqual(), findHistoryRecord(), getHistoryNthAutoRevisioned(), getHistoryNthEditTime(), getHistoryNthId(), getHistoryNthTime(), getHistoryNthTimeStarted(), getHistoryNthTopXID(), getHistoryNthUID(), purgeHistory(), verifyHistoryState(), and ~AD_Document().
UT_GenericVector<AD_Revision*> AD_Document::m_vRevisions [private] |