#include <ap_Frame.h>
Public Member Functions | |
AP_Frame (XAP_FrameImpl *pFrameImpl) | |
AP_Frame (AP_Frame *pFrame) | |
virtual | ~AP_Frame () |
virtual bool | initialize (XAP_FrameMode frameMode=XAP_NormalFrame)=0 |
virtual XAP_Frame * | buildFrame (XAP_Frame *pFrame) |
virtual UT_Error | loadDocument (AD_Document *pDoc) |
virtual UT_Error | loadDocument (const char *szFilename, int ieft) |
virtual UT_Error | loadDocument (const char *szFilename, int ieft, bool createNew) |
virtual UT_Error | loadDocument (GsfInput *input, int ieft) |
virtual UT_Error | importDocument (const char *szFilename, int ieft, bool markClean) |
virtual bool | initFrameData (void) |
virtual void | killFrameData (void) |
UT_uint32 | getNewZoom (XAP_Frame::tZoomType *tZoom) |
virtual void | setZoomPercentage (UT_uint32 iZoom) |
virtual UT_uint32 | getZoomPercentage (void) |
virtual void | quickZoom (UT_uint32 iZoom) |
bool | isShowMargin (void) const |
void | setShowMargin (bool b) |
void | setDoWordSelections (bool b) |
bool | getDoWordSelections (void) const |
UT_sint32 | registerListener (AP_FrameListener *pListener) |
void | unregisterListener (UT_sint32 iListenerId) |
Protected Member Functions | |
UT_Error | _loadDocument (const char *szFilename, IEFileType ieft, bool createNew) |
UT_Error | _loadDocument (GsfInput *input, IEFileType ieft) |
virtual UT_Error | _importDocument (const char *szFilename, int ieft, bool markClean) |
UT_Error | _replaceDocument (AD_Document *pDoc) |
virtual UT_Error | _showDocument (UT_uint32 iZoom=100) |
virtual bool | _createViewGraphics (GR_Graphics *&pG, UT_uint32 iZoom)=0 |
virtual void | _replaceView (GR_Graphics *pG, FL_DocLayout *pDocLayout, AV_View *pView, AV_ScrollObj *pScrollObj, ap_ViewListener *pViewListener, AD_Document *pOldDoc, ap_Scrollbar_ViewListener *pScrollbarViewListener, AV_ListenerId lid, AV_ListenerId lidScrollbarViewListener, UT_uint32 iZoom) |
virtual bool | _createScrollBarListeners (AV_View *pView, AV_ScrollObj *&pScrollObj, ap_ViewListener *&pViewListener, ap_Scrollbar_ViewListener *&pScrollbarViewListener, AV_ListenerId &lid, AV_ListenerId &lidScrollbarViewListener)=0 |
virtual void | _bindToolbars (AV_View *pView)=0 |
virtual void | _setViewFocus (AV_View *pView)=0 |
virtual UT_sint32 | _getDocumentAreaWidth ()=0 |
virtual UT_sint32 | _getDocumentAreaHeight ()=0 |
void | _signal (AP_FrameSignal sig) |
Private Attributes | |
bool | m_bShowMargin |
bool | m_bWordSelections |
std::vector< AP_FrameListener * > | m_listeners |
AP_Frame::AP_Frame | ( | XAP_FrameImpl * | pFrameImpl | ) | [inline] |
AP_Frame::AP_Frame | ( | AP_Frame * | pFrame | ) | [inline] |
AP_Frame::~AP_Frame | ( | ) | [virtual] |
virtual void AP_Frame::_bindToolbars | ( | AV_View * | pView | ) | [protected, pure virtual] |
Implemented in AP_CocoaFrame, AP_UnixFrame, AP_QtFrame, and AP_Win32Frame.
Referenced by _showDocument().
virtual bool AP_Frame::_createScrollBarListeners | ( | AV_View * | pView, | |
AV_ScrollObj *& | pScrollObj, | |||
ap_ViewListener *& | pViewListener, | |||
ap_Scrollbar_ViewListener *& | pScrollbarViewListener, | |||
AV_ListenerId & | lid, | |||
AV_ListenerId & | lidScrollbarViewListener | |||
) | [protected, pure virtual] |
Implemented in AP_CocoaFrame, AP_UnixFrame, AP_QtFrame, and AP_Win32Frame.
Referenced by _showDocument().
virtual bool AP_Frame::_createViewGraphics | ( | GR_Graphics *& | pG, | |
UT_uint32 | iZoom | |||
) | [protected, pure virtual] |
Implemented in AP_CocoaFrame, AP_UnixFrame, AP_QtFrame, and AP_Win32Frame.
Referenced by _showDocument().
virtual UT_sint32 AP_Frame::_getDocumentAreaHeight | ( | ) | [protected, pure virtual] |
Implemented in AP_CocoaFrame, AP_UnixFrame, AP_QtFrame, and AP_Win32Frame.
Referenced by _replaceView().
virtual UT_sint32 AP_Frame::_getDocumentAreaWidth | ( | ) | [protected, pure virtual] |
Implemented in AP_CocoaFrame, AP_UnixFrame, AP_QtFrame, and AP_Win32Frame.
Referenced by _replaceView().
UT_Error AP_Frame::_importDocument | ( | const char * | szFilename, | |
int | ieft, | |||
bool | markClean | |||
) | [protected, virtual] |
UT_Error AP_Frame::_loadDocument | ( | const char * | szFilename, | |
IEFileType | ieft, | |||
bool | createNew | |||
) | [protected] |
References XAP_Frame::_getNextUntitledNumber(), XAP_App::forgetClones(), XAP_App::getApp(), XAP_Frame::m_iUntitled, XAP_Frame::m_pDoc, AD_Document::newDocument(), AD_Document::readFromFile(), XAP_App::rememberFrame(), AD_Document::saveAs(), UNREFP, UT_DEBUGMSG, UT_ERROR, UT_IE_FILENOTFOUND, UT_INVALIDFILENAME, UT_IS_IE_SUCCESS, and UT_return_val_if_fail.
Referenced by loadDocument().
UT_Error AP_Frame::_loadDocument | ( | GsfInput * | input, | |
IEFileType | ieft | |||
) | [protected] |
UT_Error AP_Frame::_replaceDocument | ( | AD_Document * | pDoc | ) | [protected] |
References _showDocument(), _signal(), APF_ReplaceDocument, getNewZoom(), XAP_Frame::m_pDoc, and XAP_Frame::setZoomType().
Referenced by importDocument(), and loadDocument().
void AP_Frame::_replaceView | ( | GR_Graphics * | pG, | |
FL_DocLayout * | pDocLayout, | |||
AV_View * | pView, | |||
AV_ScrollObj * | pScrollObj, | |||
ap_ViewListener * | pViewListener, | |||
AD_Document * | pOldDoc, | |||
ap_Scrollbar_ViewListener * | pScrollbarViewListener, | |||
AV_ListenerId | lid, | |||
AV_ListenerId | lidScrollbarViewListener, | |||
UT_uint32 | iZoom | |||
) | [protected, virtual] |
Reimplemented in AP_Win32Frame.
References _getDocumentAreaHeight(), _getDocumentAreaWidth(), _signal(), AV_View::addScrollListener(), APF_ReplaceView, FV_View::cmdSelect(), DELETEP, FL_DocLayout::fillLayouts(), XAP_App::findFrame(), XAP_App::getApp(), FV_View::getDocument(), FV_View::getDocumentRangeOfCurrentSelection(), XAP_Frame::getFrameImpl(), XAP_Frame::getFrameMode(), FV_View::getInsPoint(), FV_View::isSelectionEmpty(), AV_View::isSelectionEmpty(), XAP_Frame::m_lid, XAP_Frame::m_lidScrollbarViewListener, XAP_Frame::m_pData, XAP_Frame::m_pDoc, PD_DocumentRange::m_pos1, PD_DocumentRange::m_pos2, XAP_Frame::m_pScrollbarViewListener, XAP_Frame::m_pScrollObj, XAP_Frame::m_pView, XAP_Frame::m_pViewListener, FV_View::moveInsPtTo(), XAP_App::rememberFrame(), REPLACEP, AV_View::setInsertMode(), XAP_App::setViewSelection(), AV_View::setWindowSize(), UNREFP, XAP_Frame::updateTitle(), and XAP_NoMenusWindowLess.
Referenced by _showDocument().
virtual void AP_Frame::_setViewFocus | ( | AV_View * | pView | ) | [protected, pure virtual] |
Implemented in AP_CocoaFrame, AP_UnixFrame, AP_QtFrame, and AP_Win32Frame.
Referenced by _showDocument().
References _bindToolbars(), _createScrollBarListeners(), _createViewGraphics(), _replaceView(), _setViewFocus(), AV_CHG_ALL, AV_FOCUS_HERE, AV_View::calculateZoomPercentForPageWidth(), AV_View::calculateZoomPercentForWholePage(), DELETEP, AV_View::draw(), ENSUREP_C, AV_View::focusChange(), XAP_App::getApp(), XAP_Frame::getFrameMode(), XAP_Frame::getZoomType(), XAP_Frame::isFrameLocked(), XAP_Frame::isStatusBarShown(), XAP_Frame::m_pData, XAP_Frame::m_pDoc, XAP_Frame::m_pView, AV_View::notifyListeners(), XAP_Frame::setFrameLocked(), XAP_Frame::setXScrollRange(), XAP_Frame::setYScrollRange(), setZoomPercentage(), GR_Graphics::setZoomPercentage(), UNREFP, UT_ASSERT_HARMLESS, UT_DEBUGMSG, UT_IE_ADDLISTENERERROR, UT_return_val_if_fail, UT_SHOULD_NOT_HAPPEN, XAP_DLG_ZOOM_MAXIMUM_ZOOM, XAP_DLG_ZOOM_MINIMUM_ZOOM, XAP_NormalFrame, xxx_UT_DEBUGMSG, XAP_Frame::z_PAGEWIDTH, and XAP_Frame::z_WHOLEPAGE.
Referenced by _replaceDocument(), buildFrame(), importDocument(), loadDocument(), and setZoomPercentage().
void AP_Frame::_signal | ( | AP_FrameSignal | sig | ) | [protected] |
References m_listeners, and AP_FrameListener::signalFrame().
Referenced by _replaceDocument(), and _replaceView().
bool AP_Frame::getDoWordSelections | ( | void | ) | const [inline] |
Referenced by Defun(), and sActualDragToXY().
UT_uint32 AP_Frame::getNewZoom | ( | XAP_Frame::tZoomType * | tZoom | ) |
This method returns the zoomPercentage of the new frame. Logic goes like this. If there is a valid last focussed frame return the zoom and zoom type for that. Otherwise use the preference value.
References UT_String::c_str(), XAP_App::getApp(), XAP_App::getClones(), UT_GenericVector< T >::getItemCount(), XAP_App::getLastFocussedFrame(), UT_GenericVector< T >::getNthItem(), XAP_App::getPrefsValue(), XAP_Frame::getViewNumber(), XAP_Frame::getZoomPercentage(), XAP_Frame::getZoomType(), UT_return_val_if_fail, and XAP_PREF_KEY_ZoomType.
Referenced by _replaceDocument(), importDocument(), and loadDocument().
UT_uint32 AP_Frame::getZoomPercentage | ( | void | ) | [virtual] |
Reimplemented from XAP_Frame.
References XAP_Frame::m_pData.
Referenced by AP_Win32FrameImpl::_toggleLeftRuler(), AP_Win32FrameImpl::_toggleTopRuler(), abi_widget_get_zoom_percentage(), buildFrame(), and quickZoom().
UT_Error AP_Frame::importDocument | ( | const char * | szFilename, | |
int | ieft, | |||
bool | markClean | |||
) | [virtual] |
Implements XAP_Frame.
References _importDocument(), _replaceDocument(), _showDocument(), XAP_App::getApp(), XAP_App::getClones(), UT_GenericVector< T >::getItemCount(), getNewZoom(), UT_GenericVector< T >::getNthItem(), XAP_Frame::getViewNumber(), XAP_Frame::m_pDoc, XAP_Frame::setZoomType(), UT_IE_TRY_RECOVER, UT_IS_IE_SUCCESS, and UT_OK.
bool AP_Frame::initFrameData | ( | void | ) | [virtual] |
References XAP_Frame::m_pData, and UT_ASSERT_HARMLESS.
Referenced by AP_Win32Frame::initialize(), AP_UnixFrame::initialize(), AP_QtFrame::initialize(), and AP_CocoaFrame::initialize().
virtual bool AP_Frame::initialize | ( | XAP_FrameMode | frameMode = XAP_NormalFrame |
) | [pure virtual] |
Implemented in AP_CocoaFrame, AP_UnixFrame, AP_QtFrame, and AP_Win32Frame.
Referenced by buildFrame().
bool AP_Frame::isShowMargin | ( | void | ) | const [inline] |
void AP_Frame::killFrameData | ( | void | ) | [virtual] |
References DELETEP, and XAP_Frame::m_pData.
Referenced by AP_CocoaFrame::~AP_CocoaFrame(), AP_UnixFrame::~AP_UnixFrame(), and AP_Win32Frame::~AP_Win32Frame().
UT_Error AP_Frame::loadDocument | ( | const char * | szFilename, | |
int | ieft | |||
) | [virtual] |
Implements XAP_Frame.
References loadDocument().
UT_Error AP_Frame::loadDocument | ( | const char * | szFilename, | |
int | ieft, | |||
bool | createNew | |||
) | [virtual] |
Implements XAP_Frame.
References _loadDocument(), _replaceDocument(), _showDocument(), XAP_App::findFrame(), XAP_App::getApp(), XAP_App::getClones(), UT_GenericVector< T >::getItemCount(), getNewZoom(), UT_GenericVector< T >::getNthItem(), XAP_Frame::getViewNumber(), XAP_Frame::m_pDoc, XAP_App::rememberFrame(), XAP_Frame::setZoomType(), UT_IE_TRY_RECOVER, UT_IS_IE_SUCCESS, and UT_OK.
UT_Error AP_Frame::loadDocument | ( | AD_Document * | pDoc | ) | [virtual] |
Implements XAP_Frame.
References _replaceDocument(), XAP_App::findFrame(), XAP_App::getApp(), XAP_App::getClones(), UT_GenericVector< T >::getItemCount(), UT_GenericVector< T >::getNthItem(), XAP_Frame::getViewNumber(), and XAP_App::rememberFrame().
Referenced by abi_widget_load_file(), abi_widget_load_file_from_gsf(), abi_widget_load_file_from_memory(), loadDocument(), and s_abi_widget_map_cb().
UT_Error AP_Frame::loadDocument | ( | GsfInput * | input, | |
int | ieft | |||
) | [virtual] |
Implements XAP_Frame.
References _loadDocument(), _replaceDocument(), _showDocument(), XAP_App::findFrame(), XAP_App::getApp(), XAP_App::getClones(), UT_GenericVector< T >::getItemCount(), getNewZoom(), UT_GenericVector< T >::getNthItem(), XAP_Frame::getViewNumber(), XAP_Frame::m_pDoc, XAP_App::rememberFrame(), XAP_Frame::setZoomType(), and UT_IS_IE_SUCCESS.
void AP_Frame::quickZoom | ( | UT_uint32 | iZoom | ) | [virtual] |
This zooms an existing document in a frame by just changing the zoom in the graphics class.
Implements XAP_Frame.
References AV_CHG_ALL, FV_View::calculateNumHorizPages(), FV_View::calculateZoomPercentForPageWidth(), GR_Graphics::clearFont(), FV_View::ensureInsertionPointOnScreen(), FL_DocLayout::formatAll(), XAP_Frame::getCurrentView(), fp_PageSize::getDims(), FL_DocLayout::getDocument(), FL_DocLayout::getFirstSection(), FV_View::getGraphics(), FV_View::getLayout(), FV_View::getLeftRuler(), fl_ContainerLayout::getNext(), FV_View::getPoint(), FV_View::getTopRuler(), FV_View::getViewMode(), getZoomPercentage(), fp_PageSize::Height(), FL_DocLayout::incrementGraphicTick(), AP_LeftRuler::isHidden(), AP_TopRuler::isHidden(), fp_PageSize::isPortrait(), fl_ContainerLayout::lookupMarginProperties(), PD_Document::m_docPageSize, FL_DocLayout::m_docViewPageSize, FV_View::notifyListeners(), fp_PageSize::psCustom, XAP_CustomWidget::queueDraw(), FV_View::rebuildLayout(), fp_PageSize::Set(), fp_PageSize::setLandscape(), FV_View::setPoint(), fp_PageSize::setPortrait(), XAP_Frame::setXScrollRange(), XAP_Frame::setYScrollRange(), AP_LeftRuler::setZoom(), AP_TopRuler::setZoom(), GR_Graphics::setZoomPercentage(), setZoomPercentage(), FV_View::updateScreen(), UT_DEBUGMSG, and fp_PageSize::Width().
Referenced by _abi_widget_set_show_margin(), and abi_widget_set_zoom_percentage().
UT_sint32 AP_Frame::registerListener | ( | AP_FrameListener * | pListener | ) |
References m_listeners, and UT_return_val_if_fail.
Referenced by AbiWidget_FrameListener::AbiWidget_FrameListener().
void AP_Frame::setDoWordSelections | ( | bool | b | ) | [inline] |
Referenced by abi_widget_set_word_selections(), and s_abi_widget_map_cb().
void AP_Frame::setShowMargin | ( | bool | b | ) | [inline] |
void AP_Frame::setZoomPercentage | ( | UT_uint32 | iZoom | ) | [virtual] |
Reimplemented from XAP_Frame.
References _showDocument().
Referenced by _showDocument(), and quickZoom().
void AP_Frame::unregisterListener | ( | UT_sint32 | iListenerId | ) |
References m_listeners, and UT_return_if_fail.
bool AP_Frame::m_bShowMargin [private] |
bool AP_Frame::m_bWordSelections [private] |
std::vector<AP_FrameListener*> AP_Frame::m_listeners [private] |
Referenced by _signal(), registerListener(), and unregisterListener().