LibreOffice Module svx (master)  1
Public Member Functions | Static Public Member Functions | Private Types | Private Member Functions | Private Attributes | List of all members
sdr::table::SvxTableController Class Reference

#include <tablecontroller.hxx>

Inheritance diagram for sdr::table::SvxTableController:
[legend]
Collaboration diagram for sdr::table::SvxTableController:
[legend]

Public Member Functions

SVX_DLLPRIVATE SvxTableController (SdrView &rView, const SdrTableObj &rObj)
 
virtual SVX_DLLPRIVATE ~SvxTableController () override
 
virtual SVX_DLLPRIVATE bool onKeyInput (const KeyEvent &rKEvt, vcl::Window *pWin) override
 
virtual SVX_DLLPRIVATE bool onMouseButtonDown (const MouseEvent &rMEvt, vcl::Window *pWin) override
 
virtual SVX_DLLPRIVATE bool onMouseButtonUp (const MouseEvent &rMEvt, vcl::Window *pWin) override
 
virtual SVX_DLLPRIVATE bool onMouseMove (const MouseEvent &rMEvt, vcl::Window *pWin) override
 
SVX_DLLPRIVATE bool HasMarked () const
 
virtual SVX_DLLPRIVATE bool DeleteMarked () override
 
virtual SVX_DLLPRIVATE void onSelectionHasChanged () override
 
virtual SVX_DLLPRIVATE void GetState (SfxItemSet &rSet) override
 
virtual SVX_DLLPRIVATE void Execute (SfxRequest &rReq) override
 
virtual SVX_DLLPRIVATE bool GetStyleSheet (SfxStyleSheet *&rpStyleSheet) const override
 
virtual SVX_DLLPRIVATE bool SetStyleSheet (SfxStyleSheet *pStyleSheet, bool bDontRemoveHardAttr) override
 
virtual SVX_DLLPRIVATE bool ApplyFormatPaintBrush (SfxItemSet &rFormatSet, bool bNoCharacterFormats, bool bNoParagraphFormats) override
 applies a format paint brush set from the current selection. More...
 
SVX_DLLPRIVATE void onInsert (sal_uInt16 nSId, const SfxItemSet *pArgs=nullptr)
 
SVX_DLLPRIVATE void onDelete (sal_uInt16 nSId)
 
SVX_DLLPRIVATE void onSelect (sal_uInt16 nSId)
 
SVX_DLLPRIVATE void onFormatTable (const SfxRequest &rReq)
 
SVX_DLLPRIVATE void MergeMarkedCells ()
 
SVX_DLLPRIVATE void SplitMarkedCells (const SfxRequest &rReq)
 
SVX_DLLPRIVATE void DistributeColumns (const bool bOptimize, const bool bMinimize)
 
SVX_DLLPRIVATE void DistributeRows (const bool bOptimize, const bool bMinimize)
 
SVX_DLLPRIVATE void SetVertical (sal_uInt16 nSId)
 
SVX_DLLPRIVATE void changeTableEdge (const SfxRequest &rReq)
 
SVX_DLLPRIVATE void MergeAttrFromSelectedCells (SfxItemSet &rAttr, bool bOnlyHardAttr) const
 
SVX_DLLPRIVATE void SetAttrToSelectedCells (const SfxItemSet &rAttr, bool bReplaceAll)
 
SVX_DLLPRIVATE void FillCommonBorderAttrFromSelectedCells (SvxBoxItem &rBox, SvxBoxInfoItem &rBoxInfo) const
 Fill the values that are common for all selected cells. More...
 
virtual SVX_DLLPRIVATE bool GetAttributes (SfxItemSet &rTargetSet, bool bOnlyHardAttr) const override
 
virtual SVX_DLLPRIVATE bool SetAttributes (const SfxItemSet &rSet, bool bReplaceAll) override
 
virtual SVX_DLLPRIVATE SdrObjectGetMarkedSdrObjClone (SdrModel &rTargetModel) override
 
virtual SVX_DLLPRIVATE bool PasteObjModel (const SdrModel &rModel) override
 
virtual SVX_DLLPRIVATE bool hasSelectedCells () const override
 This is a table object, and one or more of its cells are selected. More...
 
virtual SVX_DLLPRIVATE bool setCursorLogicPosition (const Point &rPosition, bool bPoint) override
 
void getSelectedCells (CellPos &rFirstPos, CellPos &rLastPos) override
 
void setSelectedCells (const CellPos &rFirstPos, const CellPos &rLastPos)
 
virtual bool ChangeFontSize (bool bGrow, const FontList *pFontList) override
 Changes the font (grow/shrink) according to the input parameters. More...
 
void clearSelection ()
 
void selectAll ()
 
SVX_DLLPRIVATE void onTableModified ()
 
bool selectRow (sal_Int32 row)
 
bool selectColumn (sal_Int32 column)
 
bool deselectRow (sal_Int32 row)
 
bool deselectColumn (sal_Int32 column)
 
bool isRowSelected (sal_Int32 nRow)
 
bool isColumnSelected (sal_Int32 nColumn)
 
bool isRowHeader ()
 
bool isColumnHeader ()
 
sdr::table::SdrTableObjGetTableObj ()
 
- Public Member Functions inherited from cppu::OWeakObject
 OWeakObject ()
 
 OWeakObject (const OWeakObject &)
 
OWeakObject &SAL_CALL operator= (const OWeakObject &)
 
virtual css::uno::Any SAL_CALL queryInterface (const css::uno::Type &rType) SAL_OVERRIDE
 
virtual void SAL_CALL acquire () SAL_OVERRIDE
 
virtual void SAL_CALL release () SAL_OVERRIDE
 
virtual css::uno::Reference< css::uno::XAdapter > SAL_CALL queryAdapter () SAL_OVERRIDE
 
SAL_CALL operator css::uno::Reference< css::uno::XInterface > ()
 

Static Public Member Functions

static SVX_DLLPRIVATE rtl::Reference< sdr::SelectionControllercreate (SdrView &rView, const SdrTableObj &rObj, const rtl::Reference< sdr::SelectionController > &xRefController)
 

Private Types

enum  TblAction {
  TblAction::NONE,
  TblAction::GotoFirstCell,
  TblAction::GotoFirstColumn,
  TblAction::GotoFirstRow,
  TblAction::GotoLeftCell,
  TblAction::GotoUpCell,
  TblAction::GotoRightCell,
  TblAction::GotoDownCell,
  TblAction::GotoLastCell,
  TblAction::GotoLastColumn,
  TblAction::GotoLastRow,
  TblAction::EditCell,
  TblAction::StopTextEdit,
  TblAction::RemoveSelection,
  TblAction::HandledByView,
  TblAction::Tab
}
 

Private Member Functions

 SvxTableController (SvxTableController const &)=delete
 
SvxTableControlleroperator= (SvxTableController const &)=delete
 
SVX_DLLPRIVATE void ApplyBorderAttr (const SfxItemSet &rAttr)
 
SVX_DLLPRIVATE void UpdateTableShape ()
 
SVX_DLLPRIVATE void SetTableStyle (const SfxItemSet *pArgs)
 
SVX_DLLPRIVATE void SetTableStyleSettings (const SfxItemSet *pArgs)
 
SVX_DLLPRIVATE bool PasteObject (SdrTableObj const *pPasteTableObj)
 
SVX_DLLPRIVATE bool checkTableObject ()
 
SVX_DLLPRIVATE const CellPosgetSelectionStart ()
 
SVX_DLLPRIVATE void setSelectionStart (const CellPos &rPos)
 
SVX_DLLPRIVATE const CellPosgetSelectionEnd ()
 
SVX_DLLPRIVATE void checkCell (CellPos &rPos)
 
SVX_DLLPRIVATE void MergeRange (sal_Int32 nFirstCol, sal_Int32 nFirstRow, sal_Int32 nLastCol, sal_Int32 nLastRow)
 
SVX_DLLPRIVATE void EditCell (const CellPos &rPos, vcl::Window *pWindow, TblAction nAction)
 
SVX_DLLPRIVATE void StopTextEdit ()
 
SVX_DLLPRIVATE TblAction getKeyboardAction (const KeyEvent &rKEvt)
 
SVX_DLLPRIVATE bool executeAction (TblAction nAction, bool bSelect, vcl::Window *pWindow)
 
SVX_DLLPRIVATE void gotoCell (const CellPos &rCell, bool bSelect, vcl::Window *pWindow, TblAction nAction=TblAction::NONE)
 
SVX_DLLPRIVATE void StartSelection (const CellPos &rPos)
 
SVX_DLLPRIVATE void UpdateSelection (const CellPos &rPos)
 
SVX_DLLPRIVATE void RemoveSelection ()
 
SVX_DLLPRIVATE void updateSelectionOverlay ()
 
SVX_DLLPRIVATE void destroySelectionOverlay ()
 
SVX_DLLPRIVATE void findMergeOrigin (CellPos &rPos)
 
 DECL_LINK (UpdateHdl, void *, void)
 

Private Attributes

rtl::Reference< TableModelmxTable
 
CellPos maCursorFirstPos
 
CellPos maCursorLastPos
 
bool mbCellSelectionMode
 
bool mbHasJustMerged
 
CellPos maMouseDownPos
 
bool mbLeftButtonDown
 
std::unique_ptr< sdr::overlay::OverlayObjectListmpSelectionOverlay
 
SdrViewmrView
 
tools::WeakReference< SdrTableObjmxTableObj
 
css::uno::Reference< css::util::XModifyListener > mxModifyListener
 
ImplSVEventmnUpdateEvent
 

Additional Inherited Members

- Protected Member Functions inherited from cppu::OWeakObject
virtual ~OWeakObject () COVERITY_NOEXCEPT_FALSE
 
void disposeWeakConnectionPoint ()
 
- Protected Attributes inherited from cppu::OWeakObject
oslInterlockedCount m_refCount
 

Detailed Description

Definition at line 42 of file tablecontroller.hxx.

Member Enumeration Documentation

Enumerator
NONE 
GotoFirstCell 
GotoFirstColumn 
GotoFirstRow 
GotoLeftCell 
GotoUpCell 
GotoRightCell 
GotoDownCell 
GotoLastCell 
GotoLastColumn 
GotoLastRow 
EditCell 
StopTextEdit 
RemoveSelection 
HandledByView 
Tab 

Definition at line 130 of file tablecontroller.hxx.

Constructor & Destructor Documentation

sdr::table::SvxTableController::SvxTableController ( SdrView rView,
const SdrTableObj rObj 
)
sdr::table::SvxTableController::~SvxTableController ( )
overridevirtual
sdr::table::SvxTableController::SvxTableController ( SvxTableController const &  )
privatedelete

Member Function Documentation

void sdr::table::SvxTableController::ApplyBorderAttr ( const SfxItemSet rAttr)
private
bool sdr::table::SvxTableController::ApplyFormatPaintBrush ( SfxItemSet rFormatSet,
bool  bNoCharacterFormats,
bool  bNoParagraphFormats 
)
overridevirtual

applies a format paint brush set from the current selection.

if bNoCharacterFormats is true, no character attributes are changed. if bNoParagraphFormats is true, no paragraph attributes are changed.

Reimplemented from sdr::SelectionController.

Definition at line 2814 of file tablecontroller.cxx.

References ApplyBorderAttr(), SdrObjEditView::ApplyFormatPaintBrushToText(), SdrModel::BegUndo(), checkTableObject(), SfxItemSet::GetItemState(), getSelectedCells(), mbCellSelectionMode, sdr::table::CellPos::mnCol, sdr::table::CellPos::mnRow, mxTable, mxTableObj, SDRATTR_TABLE_BORDER, SDRATTR_TABLE_BORDER_INNER, SvxResId(), and UpdateTableShape().

bool sdr::table::SvxTableController::ChangeFontSize ( bool  bGrow,
const FontList pFontList 
)
overridevirtual
void sdr::table::SvxTableController::changeTableEdge ( const SfxRequest rReq)
void sdr::table::SvxTableController::checkCell ( CellPos rPos)
private
bool sdr::table::SvxTableController::checkTableObject ( )
private
void sdr::table::SvxTableController::clearSelection ( )
rtl::Reference< sdr::SelectionController > sdr::table::SvxTableController::create ( SdrView rView,
const SdrTableObj rObj,
const rtl::Reference< sdr::SelectionController > &  xRefController 
)
static

Definition at line 162 of file tablecontroller.cxx.

References mrView, and mxTableObj.

Referenced by sdr::table::CreateTableController().

sdr::table::SvxTableController::DECL_LINK ( UpdateHdl  ,
void ,
void   
)
private
bool sdr::table::SvxTableController::DeleteMarked ( )
overridevirtual
bool sdr::table::SvxTableController::deselectColumn ( sal_Int32  column)
bool sdr::table::SvxTableController::deselectRow ( sal_Int32  row)
void sdr::table::SvxTableController::destroySelectionOverlay ( )
private
void sdr::table::SvxTableController::DistributeColumns ( const bool  bOptimize,
const bool  bMinimize 
)
void sdr::table::SvxTableController::DistributeRows ( const bool  bOptimize,
const bool  bMinimize 
)
void sdr::table::SvxTableController::EditCell ( const CellPos rPos,
vcl::Window pWindow,
TblAction  nAction 
)
private
void sdr::table::SvxTableController::Execute ( SfxRequest rReq)
overridevirtual
bool sdr::table::SvxTableController::executeAction ( TblAction  nAction,
bool  bSelect,
vcl::Window pWindow 
)
private
void sdr::table::SvxTableController::FillCommonBorderAttrFromSelectedCells ( SvxBoxItem rBox,
SvxBoxInfoItem rBoxInfo 
) const

Fill the values that are common for all selected cells.

This lets the Borders dialog to display the line arrangement properly.

Definition at line 3054 of file tablecontroller.cxx.

References getSelectedCells(), sdr::table::CellPos::mnCol, sdr::table::CellPos::mnRow, mxTable, svx::nColCount, sdr::table::NONE, and SvxBoxInfoItem::SetValid().

Referenced by onFormatTable().

void sdr::table::SvxTableController::findMergeOrigin ( CellPos rPos)
private
bool sdr::table::SvxTableController::GetAttributes ( SfxItemSet rTargetSet,
bool  bOnlyHardAttr 
) const
overridevirtual
SvxTableController::TblAction sdr::table::SvxTableController::getKeyboardAction ( const KeyEvent rKEvt)
private
SdrObject * sdr::table::SvxTableController::GetMarkedSdrObjClone ( SdrModel rTargetModel)
overridevirtual
void sdr::table::SvxTableController::getSelectedCells ( CellPos rFirstPos,
CellPos rLastPos 
)
overridevirtual
const CellPos & sdr::table::SvxTableController::getSelectionEnd ( )
private

Definition at line 1883 of file tablecontroller.cxx.

References checkCell(), and maCursorLastPos.

Referenced by executeAction().

const CellPos & sdr::table::SvxTableController::getSelectionStart ( )
private

Definition at line 1870 of file tablecontroller.cxx.

References checkCell(), and maCursorFirstPos.

Referenced by executeAction(), and getSelectedCells().

void sdr::table::SvxTableController::GetState ( SfxItemSet rSet)
overridevirtual
bool sdr::table::SvxTableController::GetStyleSheet ( SfxStyleSheet *&  rpStyleSheet) const
overridevirtual
sdr::table::SdrTableObj* sdr::table::SvxTableController::GetTableObj ( )
inline
void sdr::table::SvxTableController::gotoCell ( const CellPos rCell,
bool  bSelect,
vcl::Window pWindow,
TblAction  nAction = TblAction::NONE 
)
private
bool sdr::table::SvxTableController::HasMarked ( ) const

Definition at line 1364 of file tablecontroller.cxx.

References mbCellSelectionMode, and mxTable.

Referenced by DeleteMarked().

virtual SVX_DLLPRIVATE bool sdr::table::SvxTableController::hasSelectedCells ( ) const
inlineoverridevirtual
bool sdr::table::SvxTableController::isColumnHeader ( )
bool sdr::table::SvxTableController::isColumnSelected ( sal_Int32  nColumn)
bool sdr::table::SvxTableController::isRowHeader ( )
bool sdr::table::SvxTableController::isRowSelected ( sal_Int32  nRow)
void sdr::table::SvxTableController::MergeAttrFromSelectedCells ( SfxItemSet rAttr,
bool  bOnlyHardAttr 
) const
void sdr::table::SvxTableController::MergeMarkedCells ( )
void sdr::table::SvxTableController::MergeRange ( sal_Int32  nFirstCol,
sal_Int32  nFirstRow,
sal_Int32  nLastCol,
sal_Int32  nLastRow 
)
private
void sdr::table::SvxTableController::onDelete ( sal_uInt16  nSId)
void sdr::table::SvxTableController::onFormatTable ( const SfxRequest rReq)
void sdr::table::SvxTableController::onInsert ( sal_uInt16  nSId,
const SfxItemSet pArgs = nullptr 
)
bool sdr::table::SvxTableController::onKeyInput ( const KeyEvent rKEvt,
vcl::Window pWin 
)
overridevirtual
bool sdr::table::SvxTableController::onMouseButtonDown ( const MouseEvent rMEvt,
vcl::Window pWin 
)
overridevirtual
bool sdr::table::SvxTableController::onMouseButtonUp ( const MouseEvent rMEvt,
vcl::Window pWin 
)
overridevirtual

Reimplemented from sdr::SelectionController.

Definition at line 352 of file tablecontroller.cxx.

References checkTableObject(), MouseEvent::GetClicks(), and mbLeftButtonDown.

bool sdr::table::SvxTableController::onMouseMove ( const MouseEvent rMEvt,
vcl::Window pWin 
)
overridevirtual
void sdr::table::SvxTableController::onSelect ( sal_uInt16  nSId)
void sdr::table::SvxTableController::onSelectionHasChanged ( )
overridevirtual
void sdr::table::SvxTableController::onTableModified ( )

Definition at line 2229 of file tablecontroller.cxx.

References LINK, mnUpdateEvent, and Application::PostUserEvent().

SvxTableController& sdr::table::SvxTableController::operator= ( SvxTableController const &  )
privatedelete
bool sdr::table::SvxTableController::PasteObject ( SdrTableObj const *  pPasteTableObj)
private
bool sdr::table::SvxTableController::PasteObjModel ( const SdrModel rModel)
overridevirtual
void sdr::table::SvxTableController::RemoveSelection ( )
private
void sdr::table::SvxTableController::selectAll ( )
bool sdr::table::SvxTableController::selectColumn ( sal_Int32  column)
bool sdr::table::SvxTableController::selectRow ( sal_Int32  row)
bool sdr::table::SvxTableController::SetAttributes ( const SfxItemSet rSet,
bool  bReplaceAll 
)
overridevirtual

Reimplemented from sdr::SelectionController.

Definition at line 2696 of file tablecontroller.cxx.

References SdrObjEditView::IsTextEdit(), mbCellSelectionMode, mrView, and SetAttrToSelectedCells().

Referenced by Execute().

void sdr::table::SvxTableController::SetAttrToSelectedCells ( const SfxItemSet rAttr,
bool  bReplaceAll 
)
bool sdr::table::SvxTableController::setCursorLogicPosition ( const Point rPosition,
bool  bPoint 
)
overridevirtual
void sdr::table::SvxTableController::setSelectedCells ( const CellPos rFirstPos,
const CellPos rLastPos 
)
void sdr::table::SvxTableController::setSelectionStart ( const CellPos rPos)
private

Definition at line 1877 of file tablecontroller.cxx.

References maCursorFirstPos.

Referenced by getKeyboardAction().

bool sdr::table::SvxTableController::SetStyleSheet ( SfxStyleSheet pStyleSheet,
bool  bDontRemoveHardAttr 
)
overridevirtual
void sdr::table::SvxTableController::SetTableStyle ( const SfxItemSet pArgs)
private
void sdr::table::SvxTableController::SetTableStyleSettings ( const SfxItemSet pArgs)
private

Definition at line 1144 of file tablecontroller.cxx.

References checkTableObject(), SfxItemSet::GetItemState(), mxTableObj, and SvxResId().

Referenced by Execute().

void sdr::table::SvxTableController::SetVertical ( sal_uInt16  nSId)
void sdr::table::SvxTableController::SplitMarkedCells ( const SfxRequest rReq)
void sdr::table::SvxTableController::StartSelection ( const CellPos rPos)
private
void sdr::table::SvxTableController::StopTextEdit ( )
private
void sdr::table::SvxTableController::UpdateSelection ( const CellPos rPos)
private
void sdr::table::SvxTableController::updateSelectionOverlay ( )
private
void sdr::table::SvxTableController::UpdateTableShape ( )
private

Member Data Documentation

CellPos sdr::table::SvxTableController::maCursorFirstPos
private
CellPos sdr::table::SvxTableController::maCursorLastPos
private
CellPos sdr::table::SvxTableController::maMouseDownPos
private

Definition at line 180 of file tablecontroller.hxx.

Referenced by onMouseButtonDown(), onMouseMove(), and setCursorLogicPosition().

bool sdr::table::SvxTableController::mbCellSelectionMode
private
bool sdr::table::SvxTableController::mbHasJustMerged
private

Definition at line 179 of file tablecontroller.hxx.

Referenced by MergeRange(), and updateSelectionOverlay().

bool sdr::table::SvxTableController::mbLeftButtonDown
private

Definition at line 181 of file tablecontroller.hxx.

Referenced by onMouseButtonDown(), onMouseButtonUp(), and onMouseMove().

ImplSVEvent* sdr::table::SvxTableController::mnUpdateEvent
private

Definition at line 186 of file tablecontroller.hxx.

Referenced by onTableModified(), and ~SvxTableController().

std::unique_ptr<sdr::overlay::OverlayObjectList> sdr::table::SvxTableController::mpSelectionOverlay
private

Definition at line 182 of file tablecontroller.hxx.

Referenced by destroySelectionOverlay(), and updateSelectionOverlay().

SdrView& sdr::table::SvxTableController::mrView
private
css::uno::Reference< css::util::XModifyListener > sdr::table::SvxTableController::mxModifyListener
private

Definition at line 185 of file tablecontroller.hxx.

Referenced by SvxTableController(), and ~SvxTableController().

rtl::Reference< TableModel > sdr::table::SvxTableController::mxTable
private
tools::WeakReference<SdrTableObj> sdr::table::SvxTableController::mxTableObj
private

The documentation for this class was generated from the following files: