40#include <editeng/editeng.hxx>
42#include <svx/svxids.hrc>
46#include <osl/diagnose.h>
84 SID_ATTR_CHAR_POSTURE,
86 SID_ATTR_CHAR_SHADOWED,
87 SID_ATTR_CHAR_STRIKEOUT,
88 SID_ATTR_CHAR_UNDERLINE,
89 SID_ATTR_CHAR_FONTHEIGHT,
91 SID_ATTR_CHAR_KERNING,
92 SID_ATTR_CHAR_CASEMAP,
93 SID_ATTR_PARA_ADJUST_LEFT,
94 SID_ATTR_PARA_ADJUST_RIGHT,
95 SID_ATTR_PARA_ADJUST_CENTER,
96 SID_ATTR_PARA_ADJUST_BLOCK,
97 SID_ATTR_PARA_LINESPACE_10,
98 SID_ATTR_PARA_LINESPACE_15,
99 SID_ATTR_PARA_LINESPACE_20,
100 SID_ATTR_PARA_ULSPACE,
101 SID_ATTR_PARA_LRSPACE,
102 SID_ATTR_TRANSFORM_POS_X,
103 SID_ATTR_TRANSFORM_POS_Y,
104 SID_ATTR_TRANSFORM_WIDTH,
105 SID_ATTR_TRANSFORM_HEIGHT,
106 SID_ATTR_TRANSFORM_ROT_X,
107 SID_ATTR_TRANSFORM_ROT_Y,
108 SID_ATTR_TRANSFORM_ANGLE,
113 SID_ATTR_TRANSFORM_PROTECT_POS,
114 SID_ATTR_TRANSFORM_PROTECT_SIZE,
116 SID_SET_SUPER_SCRIPT,
118 SID_ATTR_TRANSFORM_AUTOWIDTH,
119 SID_ATTR_TRANSFORM_AUTOHEIGHT,
120 SID_HYPERLINK_GETLINK,
124 SID_TEXTDIRECTION_LEFT_TO_RIGHT,
125 SID_TEXTDIRECTION_TOP_TO_BOTTOM,
126 SID_ATTR_PARA_LEFT_TO_RIGHT,
127 SID_ATTR_PARA_RIGHT_TO_LEFT,
128 SID_PARASPACE_INCREASE,
129 SID_PARASPACE_DECREASE,
139, bFirstObjCreated(false)
140, bJustEndedEdit(false)
184 ToolbarId::Draw_Text_Toolbox_Sd);
227 bool bQuickDrag =
true;
235 && SfxItemState::SET == pArgs->
GetItemState(SID_TEXTEDIT)
237 && pArgs->
Get(SID_TEXTEDIT).GetValue() == 2)
268 if (
auto pURLField =
dynamic_cast< const SvxURLField *
>( pField ))
270 eHit = SdrHitKind::MarkedObject;
271 aVEvt.
meEvent = SdrEventKind::ExecuteUrl;
278 if (eHit == SdrHitKind::TextEdit)
287 if (
mpView->
IsTextEdit() && eHit != SdrHitKind::MarkedObject && eHit != SdrHitKind::Handle)
313 if (eHit == SdrHitKind::TextEdit)
320 bool bMarkChanges =
true;
322 if (eHit == SdrHitKind::TextEditObj && xSelectionController.is())
326 bMarkChanges =
false;
329 if (eHit != SdrHitKind::Handle)
332 if (!rMEvt.
IsShift() && eHit == SdrHitKind::TextEditObj)
342 if ( aVEvt.
meEvent == SdrEventKind::ExecuteUrl ||
343 eHit == SdrHitKind::Handle ||
344 eHit == SdrHitKind::MarkedObject ||
345 eHit == SdrHitKind::TextEditObj ||
350 if (eHit == SdrHitKind::TextEditObj)
364 else if (aVEvt.
meEvent == SdrEventKind::ExecuteUrl && !rMEvt.
IsMod2())
380 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
381 { &aStrItem, &aBrowseItem, &aReferer });
388 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD,
389 { &aStrItem, &aFrameItem, &aBrowseItem, &aReferer });
416 aVEvt.
mpHdl =
nullptr;
423 if( eHit == SdrHitKind::UnmarkedObject )
440 if( (eHit == SdrHitKind::Handle) || (eHit == SdrHitKind::MarkedObject) )
449 else if (
nSlotId != SID_TEXTEDIT &&
523 else if(
nSlotId == SID_ATTR_CHAR_VERTICAL )
566 bool bReturn =
false;
580 bool bEmptyTextObj =
false;
594 bEmptyTextObj =
true;
635 std::abs(aPnt.
X() -
aMDPos.
X()) < nDrgLog &&
636 std::abs(aPnt.
Y() -
aMDPos.
Y()) < nDrgLog)
665 ||
nSlotId == SID_ATTR_CHAR_VERTICAL
666 ||
nSlotId == SID_TEXT_FITTOSIZE_VERTICAL);
667 rOutl.SetVertical(bVertical);
696 else if (
nSlotId == SID_TEXT_FITTOSIZE)
702 else if (
nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
727 if ( std::abs(
aMDPos.
X() - aPnt.
X()) < nDrgLog1 &&
728 std::abs(
aMDPos.
Y() - aPnt.
Y()) < nDrgLog1 &&
756 aPnt.
AdjustX(nDrgLog + nDrgLog );
757 aPnt.
AdjustY(nDrgLog + nDrgLog );
783 if(
nSlotId == SID_ATTR_CHAR_VERTICAL)
818 if(SvxFrameDirection::Horizontal_RL_TB == eDirection || SvxFrameDirection::Vertical_RL_TB == eDirection)
838 if(SvxFrameDirection::Horizontal_RL_TB == eDirection)
864 SfxCallMode::ASYNCHRON | SfxCallMode::RECORD );
883 bool bReturn =
false;
907 if ( pTextObj->GetObjInventor() == SdrInventor::Default && pTextObj->GetObjIdentifier() == SdrObjKind::TitleText && rKEvt.
GetKeyCode().
GetCode() ==
KEY_RETURN )
913 sal_uInt16 nKey = nCode.
GetCode();
1000 bool bEmptyOutliner =
false;
1008 if (nParagraphCnt==1 && p1stPara)
1011 if (pOutl->
GetText(p1stPara).isEmpty())
1013 bEmptyOutliner =
true;
1022 SdrObjKind nSdrObjKind = pTextObj->GetObjIdentifier();
1024 if (nInv == SdrInventor::Default &&
GetTextObj()->HasTextEdit() &&
1025 (nSdrObjKind == SdrObjKind::Text ||
1026 nSdrObjKind == SdrObjKind::TitleText ||
1027 nSdrObjKind == SdrObjKind::OutlineText || !pTextObj->IsEmptyPresObj() ) )
1044 else if (
nSlotId == SID_ATTR_CHAR_VERTICAL ||
nSlotId == SID_TEXT_FITTOSIZE_VERTICAL)
1045 pOutl->SetVertical(
true );
1047 if( pTextObj->getTextCount() > 1 )
1051 pTextObj->setActiveText( pTextObj->CheckTextHit(aPnt ) );
1079 if (eHit == SdrHitKind::TextEdit)
1082 if (nSdrObjKind == SdrObjKind::Text ||
1083 nSdrObjKind == SdrObjKind::TitleText ||
1084 nSdrObjKind == SdrObjKind::OutlineText ||
1085 nSdrObjKind == SdrObjKind::Table ||
1103 if (pOLV !=
nullptr)
1146 if( bIsUndoEnabled )
1151 if( bIsUndoEnabled )
1163 bool bReturn =
false;
1174 if (
auto pURLField =
dynamic_cast< const SvxURLField *
>( pField ))
1179 if (!aHelpText.isEmpty())
1254 bool bQuickDrag =
true;
1262 && SfxItemState::SET == pArgs->
GetItemState(SID_TEXTEDIT)
1264 && pArgs->
Get(SID_TEXTEDIT).GetValue() == 2)
1293 pText->SetLogicRect(rRectangle);
1295 bool bVertical = (SID_ATTR_CHAR_VERTICAL == nID || SID_TEXT_FITTOSIZE_VERTICAL == nID);
1296 pText->SetVerticalWriting(bVertical);
1300 if (
nSlotId == SID_TEXT_FITTOSIZE)
1304 else if (
nSlotId == SID_TEXT_FITTOSIZE_VERTICAL )
1315 OSL_FAIL(
"Object is NO text object");
1347 if( !pFontList || !pView )
1357 pView->
BegUndo(
SdResId(bGrow ? STR_GROW_FONT_SIZE : STR_SHRINK_FONT_SIZE));
1359 for(
size_t nMark = 0; nMark < rMarkList.
GetMarkCount(); ++nMark )
1365 if (xSelectionController.is() && xSelectionController->ChangeFontSize(bGrow, pFontList))
1369 for( sal_Int32 nText = 0; nText < pTextObj->
getTextCount(); nText++ )
virtual bool BegDragObj(const Point &rPnt, OutputDevice *pOut, SdrHdl *pHdl, short nMinMov=-3, SdrDragMethod *pForcedMeth=nullptr) override
virtual void MovAction(const Point &rPnt) override
sal_Int32 GetParagraphCount() const
sal_Int32 GetTextLen() const
static bool DoesKeyChangeText(const KeyEvent &rKeyEvent)
void ChangeFontSize(bool bGrow, const FontList *pList)
EditEngine * GetEditEngine() const
const Point & GetMousePosPixel() const
static bool IsQuickHelpEnabled()
static bool IsBalloonHelpEnabled()
static void ShowQuickHelp(vcl::Window *pParent, const tools::Rectangle &rScreenRect, const OUString &rHelpText, QuickHelpFlags nStyle=QuickHelpFlags::NONE)
static void ShowBalloon(vcl::Window *pParent, const Point &rScreenPos, const tools::Rectangle &, const OUString &rHelpText)
static OUString decode(std::u16string_view rText, DecodeMechanism eMechanism, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8)
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
void SetVertical(bool bNew)
bool IsEffectivelyVertical() const
TextRotation GetRotation() const
bool MouseMove(const MouseEvent &)
void SetSelection(const ESelection &)
bool MouseButtonUp(const MouseEvent &)
void HideCursor(bool bDeactivate=false)
const SvxFieldItem * GetFieldUnderMousePointer() const
bool MouseButtonDown(const MouseEvent &)
EditView & GetEditView() const
void ShowCursor(bool bGotoCursor=true, bool bActivate=false)
void SetText(const OutlinerParaObject &)
OUString GetText(Paragraph const *pPara, sal_Int32 nParaCount=1) const
Paragraph * GetParagraph(sal_Int32 nAbsPos) const
void SetStyleSheet(sal_Int32 nPara, SfxStyleSheet *pStyle)
bool IsUndoEnabled() const
void SetStyleSheetPool(SfxStyleSheetPool *pSPool)
SfxStyleSheet * GetStyleSheet(sal_Int32 nPara)
void EnableUndo(bool bEnable)
sal_Int32 GetParagraphCount() const
constexpr tools::Long Y() const
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
PresObjKind GetPresObjKind(SdrObject *pObj) const
bool BegCreateObj(const Point &rPnt, OutputDevice *pOut=nullptr, short nMinMov=-3)
void SetEditMode(SdrViewEditMode eMode)
bool EndCreateObj(SdrCreateCmd eCmd)
SdrInventor GetCurrentObjInventor() const
SdrObjKind GetCurrentObjIdentifier() const
virtual bool IsAction() const override
void SetCurrentObj(SdrObjKind nIdent, SdrInventor nInvent=SdrInventor::Default)
SdrObject * GetCreateObj() const
virtual void EndAction() override
bool EndDragObj(bool bCopy=false)
sal_Int32 GetDragThresholdPixels() const
bool IsDragWithCopy() const
void SetDragWithCopy(bool bOn)
void ForceMarkedToAnotherPage()
size_t GetMarkCount() const
SdrMark * GetMark(size_t nNum) const
void SetDragMode(SdrDragMode eMode)
SdrHdl * PickHandle(const Point &rPnt) const
const SdrMarkList & GetMarkedObjectList() const
bool AreObjectsMarked() const
void BegMarkObj(const Point &rPnt, bool bUnmark=false)
SdrObject * PickObj(const Point &rPnt, short nTol, SdrPageView *&rpPV, SdrSearchOptions nOptions, SdrObject **ppRootObj, bool *pbHitPassDirect=nullptr) const
void UnmarkAllObj(SdrPageView const *pPV=nullptr)
void AdjustMarkHdl(SfxViewShell *pOtherShell=nullptr)
bool MarkObj(const Point &rPnt, short nTol=-2, bool bToggle=false, bool bDeep=false)
SdrObject * GetMarkedSdrObj() const
SfxStyleSheetBasePool * GetStyleSheetPool() const
SdrTextObj * GetTextEditObject() const
const OutlinerView * GetTextEditOutlinerView() const
const rtl::Reference< sdr::SelectionController > & getSelectionController() const
virtual bool IsTextEdit() const final override
void SetQuickTextEditMode(bool bOn)
const SdrOutliner * GetTextEditOutliner() const
static rtl::Reference< SdrObject > MakeNewObject(SdrModel &rSdrModel, SdrInventor nInventor, SdrObjKind nObjIdentifier, const tools::Rectangle *pSnapRect=nullptr)
virtual SdrInventor GetObjInventor() const
void SetMergedItemSet(const SfxItemSet &rSet, bool bClearAllItems=false)
virtual SdrObjKind GetObjIdentifier() const
const SfxItemSet & GetMergedItemSet() const
bool IsObjMarkable(SdrObject const *pObj) const
sal_uInt32 PageWindowCount() const
SdrPage * GetPage() const
SdrPageWindow * GetPageWindow(sal_uInt32 nIndex) const
rtl::Reference< sdr::overlay::OverlayManager > const & GetOverlayManager() const
SdrPaintWindow & GetPaintWindow() const
bool IsMasterPage() const
const SfxItemSet & GetDefaultAttr() const
SdrModel & getSdrModelFromSdrView() const
void SetHitTolerancePixel(sal_uInt16 nVal)
SdrPageView * GetSdrPageView() const
sal_uInt16 getHitTolLog() const
bool OutputToWindow() const
void SetSnapEnabled(bool bOn)
bool IsSnapEnabled() const
virtual bool AdjustTextFrameWidthAndHeight(tools::Rectangle &rR, bool bHgt=true, bool bWdt=true) const
virtual OutlinerParaObject * GetOutlinerParaObject() const override
void SetText(const OUString &rStr)
virtual sal_Int32 getTextCount() const override
virtual void setActiveText(sal_Int32 nIndex)
void ForceOutlinerParaObject()
void SetDisableAutoWidthOnDragging(bool bOn)
void SetObjectItemNoBroadcast(const SfxPoolItem &rItem)
virtual bool MouseButtonUp(const MouseEvent &rMEvt, OutputDevice *pWin) override
SdrHitKind PickAnything(const MouseEvent &rMEvt, SdrMouseEventKind nMouseDownOrMoveOrUp, SdrViewEvent &rVEvt) const
void Invalidate(sal_uInt16 nId)
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
const SfxPoolItem * ExecuteList(sal_uInt16 nSlot, SfxCallMode nCall, std::initializer_list< SfxPoolItem const * > args, std::initializer_list< SfxPoolItem const * > internalargs=std::initializer_list< SfxPoolItem const * >())
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
const OUString & GetName() const
SfxMedium * GetMedium() const
sal_uInt16 GetSlot() const
const SfxItemSet * GetArgs() const
SfxItemPool & GetPool() const
SfxBindings & GetBindings()
SfxDispatcher * GetDispatcher()
bool isLOKMobilePhone() const
static SAL_WARN_UNUSED_RESULT SfxViewShell * Current()
const SvxFieldData * GetField() const
const OUString & GetURL() const
virtual void Start(bool bStartTimer=true) override
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
virtual void Deactivate() override
deactivates the function
virtual void Activate() override
activates the function
bool IsIgnoreUnexpectedMouseButtonUp()
virtual bool KeyInput(const KeyEvent &rKEvt) override
Process keyboard input.
virtual bool RequestHelp(const HelpEvent &rHEvt) override
virtual bool MouseMove(const MouseEvent &rMEvt) override
virtual void ForcePointer(const MouseEvent *pMEvt=nullptr)
Toggle mouse-pointer.
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
VclPtr< ::sd::Window > mpWindow
Point aMDPos
position of MouseButtonDown
void ForceScroll(const Point &aPixPos)
scroll when approached the border of the window; is called by MouseMove
virtual void ReceiveRequest(SfxRequest &rReq)
Timer aDragTimer
for Drag&Drop
virtual bool cancel()
is called when the current function should be aborted.
SdrTextObj * GetTextObj()
virtual void DoubleClick(const MouseEvent &rMEvt) override
Response of doubleclick.
void InvalidateBindings()
void ImpSetAttributesFitToSizeVertical(SdrTextObj *pTxtObj)
virtual rtl::Reference< SdrObject > CreateDefaultObject(const sal_uInt16 nID, const ::tools::Rectangle &rRectangle) override
Removed the insertion of default text and putting a new text object directly into edit mode.
virtual void Activate() override
activates the function
virtual void disposing() override
void ImpSetAttributesFitToSize(SdrTextObj *pTxtObj)
virtual bool MouseMove(const MouseEvent &rMEvt) override
virtual bool MouseButtonDown(const MouseEvent &rMEvt) override
void SetInEditMode(const MouseEvent &rMEvt, bool bQuickDrag)
Sets the object into the edit mode.
void ImpSetAttributesForNewTextObject(SdrTextObj *pTxtObj)
::unotools::WeakReference< SdrTextObj > mxTextObj
virtual bool RequestHelp(const HelpEvent &rHEvt) override
virtual bool KeyInput(const KeyEvent &rKEvt) override
handle keyboard events
virtual bool MouseButtonUp(const MouseEvent &rMEvt) override
virtual void Deactivate() override
deactivates the function
virtual void ReceiveRequest(SfxRequest &rReq) override
virtual void DoExecute(SfxRequest &rReq) override
static void ChangeFontSize(bool, OutlinerView *, const FontList *, ::sd::View *)
static rtl::Reference< FuPoor > Create(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
void DeleteDefaultText()
Text entry is started, if necessary delete the default text.
FuText(ViewShell *pViewSh, ::sd::Window *pWin, ::sd::View *pView, SdDrawDocument *pDoc, SfxRequest &rReq)
base class for text functions
virtual bool cancel() override
is called when the current function should be aborted.
std::shared_ptr< ToolBarManager > const & GetToolBarManager() const
Base class of the stacked shell hierarchy.
FrameView * GetFrameView()
SD_DLLPUBLIC ViewShellBase & GetViewShellBase() const
SD_DLLPUBLIC SfxViewFrame * GetViewFrame() const
bool IsPresObjSelected(bool bOnPage=true, bool bOnMasterPage=true, bool bCheckPresObjListOnly=false, bool bCheckLayoutOnly=false) const
Is a presentation object selected?
virtual bool SdrBeginTextEdit(SdrObject *pObj, SdrPageView *pPV=nullptr, vcl::Window *pWin=nullptr, bool bIsNewObj=false, SdrOutliner *pGivenOutliner=nullptr, OutlinerView *pGivenOutlinerView=nullptr, bool bDontDeleteOutliner=false, bool bOnlyOneView=false, bool bGrabFocus=true) override
virtual SdrEndTextEditKind SdrEndTextEdit(bool bDontDeleteReally=false) override
ends current text editing
bool RestoreDefaultText(SdrTextObj *pTextObj)
restores the default text if the given text object is currently in edit mode and no text has been ent...
An SdWindow contains the actual working area of ViewShell.
sal_uInt16 GetCode() const
ESelection aNewSelection(GetSelection())
#define EE_PARA_NOT_FOUND
#define EE_INDEX_NOT_FOUND
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT(EE_CHAR_START+2)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CTL(EE_CHAR_START+20)
constexpr TypedWhichId< SvxFrameDirectionItem > EE_PARA_WRITINGDIR(EE_PARA_START+0)
constexpr TypedWhichId< SvxFontHeightItem > EE_CHAR_FONTHEIGHT_CJK(EE_CHAR_START+19)
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_ESCAPE
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_PAGEUP
const sal_uInt16 SidArray[]
OUString SdResId(TranslateId aId)
SdrOnOffItem makeSdrTextAutoGrowHeightItem(bool bAuto)
SdrOnOffItem makeSdrTextAutoGrowWidthItem(bool bAuto)
SdrMetricItem makeSdrTextMinFrameHeightItem(tools::Long mnHeight)
SdrMetricItem makeSdrTextMinFrameWidthItem(tools::Long mnWidth)
const SvxURLField * mpURLField
SVXCORE_DLLPUBLIC std::unique_ptr< SdrOutliner > SdrMakeOutliner(OutlinerMode nOutlinerMode, SdrModel &rMod)
SVXCORE_DLLPUBLIC SdrTextObj * DynCastSdrTextObj(SdrObject *)