38#include <com/sun/star/i18n/BreakIterator.hpp>
39#include <com/sun/star/i18n/CharacterIteratorMode.hpp>
40#include <com/sun/star/i18n/WordType.hpp>
41#include <com/sun/star/datatransfer/XTransferable.hpp>
42#include <com/sun/star/datatransfer/clipboard/XClipboard.hpp>
44#include <com/sun/star/datatransfer/dnd/DNDConstants.hpp>
45#include <com/sun/star/datatransfer/dnd/XDragGestureRecognizer.hpp>
46#include <com/sun/star/datatransfer/dnd/XDropTarget.hpp>
48#include <com/sun/star/i18n/InputSequenceChecker.hpp>
49#include <com/sun/star/i18n/InputSequenceCheckMode.hpp>
50#include <com/sun/star/i18n/ScriptType.hpp>
52#include <com/sun/star/uno/Any.hxx>
66#include <officecfg/Office/Common.hxx>
82#define EDIT_ALIGN_LEFT 1
83#define EDIT_ALIGN_CENTER 2
84#define EDIT_ALIGN_RIGHT 3
86#define EDIT_DEL_LEFT 1
87#define EDIT_DEL_RIGHT 2
89#define EDIT_DELMODE_SIMPLE 11
90#define EDIT_DELMODE_RESTOFWORD 12
91#define EDIT_DELMODE_RESTOFCONTENT 13
117 std::unique_ptr<ExtTextInputAttr[]>
131 : aOldTextAfterStartPos(
std::move(_aOldTextAfterStartPos)),
135 bWasCursorOverwrite(false)
185 if (rKey ==
"width-chars")
187 else if (rKey ==
"max-width-chars")
189 else if (rKey ==
"max-length")
191 sal_Int32 nTextLen = rValue.toInt32();
194 else if (rKey ==
"editable")
198 else if (rKey ==
"overwrite-mode")
202 else if (rKey ==
"visibility")
208 else if (rKey ==
"placeholder-text")
210 else if (rKey ==
"shadow-type")
243 uno::Reference< datatransfer::dnd::XDragGestureListener> xDGL(
mxDnDListener, uno::UNO_QUERY );
248 uno::Reference< datatransfer::dnd::XDropTargetListener> xDTL(
mxDnDListener, uno::UNO_QUERY );
333 uno::Reference< datatransfer::dnd::XDragGestureListener> xDGL(
mxDnDListener, uno::UNO_QUERY );
337 xDGR->addDragGestureListener( xDGL );
338 uno::Reference< datatransfer::dnd::XDropTargetListener> xDTL(
mxDnDListener, uno::UNO_QUERY );
341 GetDropTarget()->setDefaultActions( datatransfer::dnd::DNDConstants::ACTION_COPY_OR_MOVE );
359 return ((cCharCode >= 32) && (cCharCode != 127) &&
435 cEchoChar =
u'\x2022';
436 OUStringBuffer aText(
maText.getLength());
438 return aText.makeStringAndClear();
474 const sal_Int32 nLen = aText.getLength();
484 bool bVisCursor = pCursor && pCursor->
IsVisible();
494 if (!
IsEnabled() || bPaintPlaceholderText)
505 rRenderContext.
Pop();
519 if (bPaintPlaceholderText)
525 rRenderContext.
DrawText(aPos, aText, 0, nLen);
530 rRenderContext.
Push();
537 for(sal_Int32
i = 0;
i < nLen; ++
i)
543 bool bHighlight =
false;
544 if (
i >= aTmpSel.
Min() &&
i < aTmpSel.
Max())
555 aHighlightClipRegion.
Union(aRect);
557 aNormalClipRegion.
Union(aRect);
580 rRenderContext.
DrawText(aPos, aText, 0, nLen);
586 rRenderContext.
DrawText(aPos, aText, 0, nLen);
591 for(
int n = 0;
n < 2;
n++)
601 aRegion = aNormalClipRegion;
607 aRegion = aHighlightClipRegion;
652 rRenderContext.
DrawText(aPos, aText, 0, nLen);
659 rRenderContext.
Pop();
668 const sal_Int32 nTextLen =
ImplGetText().getLength();
671 if ( !rSelection.
Len() &&
681 if ( !aSelection.
Len() )
688 const OUString sText =
maText.toString();
689 i18n::Boundary aBoundary = xBI->getWordBoundary( sText, aSelection.
Min(),
691 auto startPos = aBoundary.startPos;
692 if ( startPos == aSelection.
Min() )
694 aBoundary = xBI->previousWord( sText, aSelection.
Min(),
696 startPos = std::max(aBoundary.startPos, sal_Int32(0));
698 aSelection.
Min() = startPos;
702 aSelection.
Min() = 0;
707 aSelection.
Min() = xBI->previousCharacters(
maText.toString(), aSelection.
Min(),
715 i18n::Boundary aBoundary = xBI->nextWord(
maText.toString(), aSelection.
Max(),
717 aSelection.
Max() = aBoundary.startPos;
721 aSelection.
Max() = nTextLen;
726 aSelection.
Max() = xBI->nextCharacters(
maText.toString(), aSelection.
Max(),
732 const auto nSelectionMin = aSelection.
Min();
733 maText.remove( nSelectionMin, aSelection.
Len() );
742 OUString aValidString = rString.replaceAll(
"\n",
"").replaceAll(
"\r",
"");
743 aValidString = aValidString.replace(
'\t',
' ');
750 mxBreakIterator = i18n::BreakIterator::create(::comphelper::getProcessComponentContext());
757 mxISC = i18n::InputSequenceChecker::create(::comphelper::getProcessComponentContext());
770 bool bWasTruncated =
false;
774 rStr = rStr.copy( 0, nErasePos );
775 bWasTruncated =
true;
777 return bWasTruncated;
789 auto nSelectionLen = aSelection.
Len();
796 if ( aSelection.
Len() )
802 if (bIsUserInput && !rStr.isEmpty())
804 SAL_WARN_IF( rStr.getLength() != 1,
"vcl",
"unexpected string length. User input is expected to provide 1 char only!" );
809 bool bIsInputSequenceChecking = rStr.getLength() == 1 &&
810 officecfg::Office::Common::I18N::CTL::CTLFont::get() &&
811 officecfg::Office::Common::I18N::CTL::CTLSequenceChecking::get() &&
812 aSelection.
Min() > 0 &&
813 xBI.is() && i18n::ScriptType::COMPLEX == xBI->getScriptType( rStr, 0 );
815 if (bIsInputSequenceChecking)
821 sal_Int32 nTmpPos = aSelection.
Min();
822 sal_Int16 nCheckMode = officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get()?
823 i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
827 const OUString aOldText(
maText.subView(0, nTmpPos) );
828 OUString aTmpText( aOldText );
829 if (officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingTypeAndReplace::get())
831 xISC->correctInputSequence( aTmpText, nTmpPos - 1, cChar, nCheckMode );
834 sal_Int32 nOldLen = aOldText.getLength();
835 sal_Int32 nTmpLen = aTmpText.getLength();
838 sal_Int32 nChgPos = 0;
839 while ( nChgPos < nOldLen && nChgPos < nTmpLen &&
840 pOldTxt[nChgPos] == pTmpTxt[nChgPos] )
843 const OUString aChgText( aTmpText.copy( nChgPos ) );
846 maText.remove( nChgPos, nTmpPos - nChgPos );
848 if (!aChgText.isEmpty())
851 aSelection.
Min() = nChgPos;
859 if (!xISC->checkInputSequence( aOldText, nTmpPos - 1, cChar, nCheckMode ))
868 if ( !aNewText.isEmpty() )
869 maText.insert( aSelection.
Min(), aNewText );
893 ( std::u16string_view(rText) == std::u16string_view(
maText)
894 && (!pNewSelection || (*pNewSelection ==
maSelection)) ) )
983 rRenderContext.
Erase(aRect);
1004 if (pBorder ==
this)
1009 if (pBorder ==
this)
1028 aClipRgn.
Move(xNew - aBounds.
Left(), 0);
1032 aClipRgn.
Move(aBorderOffs.
X(), aBorderOffs.
Y());
1038 aClipRgn.
Move(aBorderOffs.
X(), aBorderOffs.
Y());
1064 if( !aText.isEmpty() )
1072 nTextPos = aDX[ 2*aText.getLength()-1 ];
1082 if ( (nCursorPosX < 0) || (nCursorPosX >= aOutSize.
Width()) )
1086 if ( nCursorPosX < 0 )
1108 if ( nCursorPosX == aOutSize.
Width() )
1119 pCursor->
SetPos(
Point( nCursorPosX, nCursorPosY ) );
1120 pCursor->
SetSize(
Size( nCursorWidth, nTextHeight ) );
1138 if (nTextWidth < nOutWidth)
1149 if( nTextWidth < nOutWidth )
1154 if( nTextWidth < nOutWidth )
1163 mnXOffset = (nOutWidth - nTextWidth) / 2;
1179 if (aText.isEmpty())
1185 for (sal_Int32
i = 0;
i < aText.getLength(); aText.iterateCodePoints(&
i))
1187 if( (aDX[2*
i] >= nX && aDX[2*
i+1] <= nX) ||
1188 (aDX[2*
i+1] >= nX && aDX[2*
i] <= nX))
1191 if( aDX[2*
i] < aDX[2*
i+1] )
1193 if( nX > (aDX[2*
i]+aDX[2*
i+1])/2 )
1194 aText.iterateCodePoints(&
nIndex);
1198 if( nX < (aDX[2*
i]+aDX[2*
i+1])/2 )
1199 aText.iterateCodePoints(&
nIndex);
1207 sal_Int32 nFinalIndex = 0;
1210 if (!aText.isEmpty())
1212 aText.iterateCodePoints(&
i);
1214 while (
i < aText.getLength())
1218 if( nNewDiff < nDiff )
1226 aText.iterateCodePoints(&
i);
1228 if (
nIndex == nFinalIndex && std::abs( aDX[2*
nIndex+1] - nX ) < nDiff)
1238 aSelection.
Max() = nChar;
1240 aSelection.
Min() = aSelection.
Max();
1253void Edit::ImplCopy( uno::Reference< datatransfer::clipboard::XClipboard >
const & rxClipboard )
1258void Edit::ImplPaste( uno::Reference< datatransfer::clipboard::XClipboard >
const & rxClipboard )
1260 if ( !rxClipboard.is() )
1263 uno::Reference< datatransfer::XTransferable > xDataObj;
1268 xDataObj = rxClipboard->getContents();
1270 catch(
const css::uno::Exception& )
1274 if ( !xDataObj.is() )
1277 datatransfer::DataFlavor aFlavor;
1289 const sal_Int32 aTextLen = aText.getLength();
1305 catch(
const css::uno::Exception& )
1334 i18n::Boundary aBoundary = xBI->getWordBoundary(
maText.toString(), aSelection.
Max(),
1341 else if ( rMEvt.
IsLeft() )
1453 if ( nCode ==
KEY_A )
1465 if ( !aChars.isEmpty() )
1479 case css::awt::Key::SELECT_ALL:
1490 case css::awt::Key::MOVE_WORD_FORWARD:
1491 case css::awt::Key::SELECT_WORD_FORWARD:
1492 case css::awt::Key::MOVE_WORD_BACKWARD:
1493 case css::awt::Key::SELECT_WORD_BACKWARD:
1494 case css::awt::Key::MOVE_TO_BEGIN_OF_LINE:
1495 case css::awt::Key::MOVE_TO_END_OF_LINE:
1496 case css::awt::Key::SELECT_TO_BEGIN_OF_LINE:
1497 case css::awt::Key::SELECT_TO_END_OF_LINE:
1498 case css::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
1499 case css::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
1500 case css::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
1501 case css::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
1502 case css::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
1503 case css::awt::Key::MOVE_TO_END_OF_DOCUMENT:
1504 case css::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
1505 case css::awt::Key::SELECT_TO_END_OF_DOCUMENT:
1515 bool bGoLeft = (nCode ==
KEY_LEFT);
1517 bool bGoHome = (nCode ==
KEY_HOME);
1518 bool bGoEnd = (nCode ==
KEY_END);
1522 case css::awt::Key::MOVE_WORD_FORWARD:
1523 bGoRight = bWord =
true;
break;
1524 case css::awt::Key::SELECT_WORD_FORWARD:
1525 bGoRight = bSelect = bWord =
true;
break;
1526 case css::awt::Key::MOVE_WORD_BACKWARD:
1527 bGoLeft = bWord =
true;
break;
1528 case css::awt::Key::SELECT_WORD_BACKWARD:
1529 bGoLeft = bSelect = bWord =
true;
break;
1530 case css::awt::Key::SELECT_TO_BEGIN_OF_LINE:
1531 case css::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
1532 case css::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
1535 case css::awt::Key::MOVE_TO_BEGIN_OF_LINE:
1536 case css::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
1537 case css::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
1538 bGoHome =
true;
break;
1539 case css::awt::Key::SELECT_TO_END_OF_LINE:
1540 case css::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
1541 case css::awt::Key::SELECT_TO_END_OF_DOCUMENT:
1544 case css::awt::Key::MOVE_TO_END_OF_LINE:
1545 case css::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
1546 case css::awt::Key::MOVE_TO_END_OF_DOCUMENT:
1547 bGoEnd =
true;
break;
1553 if ( bGoLeft && aSel.
Max() )
1557 const OUString sText =
maText.toString();
1558 i18n::Boundary aBoundary = xBI->getWordBoundary( sText, aSel.
Max(),
1560 if ( aBoundary.startPos == aSel.
Max() )
1561 aBoundary = xBI->previousWord( sText, aSel.
Max(),
1563 aSel.
Max() = aBoundary.startPos;
1568 aSel.
Max() = xBI->previousCharacters(
maText.toString(), aSel.
Max(),
1572 else if ( bGoRight && ( aSel.
Max() <
maText.getLength() ) )
1576 i18n::Boundary aBoundary = xBI->nextWord(
maText.toString(), aSel.
Max(),
1578 aSel.
Max() = aBoundary.startPos;
1583 aSel.
Max() = xBI->nextCharacters(
maText.toString(), aSel.
Max(),
1618 case css::awt::Key::DELETE_WORD_BACKWARD:
1619 case css::awt::Key::DELETE_WORD_FORWARD:
1620 case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
1621 case css::awt::Key::DELETE_TO_END_OF_LINE:
1633 case css::awt::Key::DELETE_WORD_BACKWARD:
1637 case css::awt::Key::DELETE_WORD_FORWARD:
1641 case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
1645 case css::awt::Key::DELETE_TO_END_OF_LINE:
1651 sal_Int32 nOldLen =
maText.getLength();
1653 if (
maText.getLength() != nOldLen )
1751 if ( bBorder || bBackground )
1803 ((nOffY+nTextHeight) > aSize.
Height()) ||
1804 ((nOffX+nTextWidth) > aSize.
Width()) )
1807 if ( nTextHeight > aSize.
Height() )
1812 pDev->
DrawText( aTextRect, aText, nTextStyle );
1831 if (pBorder == pInvalWin || !pBorder ||
1834 pInvalWin = pBorder;
1934 bool bEnableCut =
true;
1935 bool bEnableCopy =
true;
1936 bool bEnableDelete =
true;
1937 bool bEnablePaste =
true;
1938 bool bEnableSpecialChar =
true;
1943 bEnableCopy =
false;
1944 bEnableDelete =
false;
1950 bEnablePaste =
false;
1951 bEnableDelete =
false;
1952 bEnableSpecialChar =
false;
1958 uno::Reference< datatransfer::clipboard::XClipboard > xClipboard =
GetClipboard();
1960 if ( xClipboard.is() )
1962 uno::Reference< datatransfer::XTransferable > xDataObj;
1965 xDataObj = xClipboard->getContents();
1967 if ( xDataObj.is() )
1969 datatransfer::DataFlavor aFlavor;
1971 bData = xDataObj->isDataFlavorSupported( aFlavor );
1974 bEnablePaste = bData;
1998 sal_uInt16
n = pPopup->
Execute(
this, aPos );
2001 if (sCommand ==
"undo")
2006 else if (sCommand ==
"cut")
2011 else if (sCommand ==
"copy")
2015 else if (sCommand ==
"paste")
2020 else if (sCommand ==
"delete")
2025 else if (sCommand ==
"selectall")
2035 if (!aChars.isEmpty())
2054 bool bInsertMode = !
mpIMEInfos->bWasCursorOverwrite;
2079 const sal_Int32 nOldIMETextLen =
mpIMEInfos->nLen;
2080 const sal_Int32 nNewIMETextLen =
pData->GetText().getLength();
2081 if ( ( nOldIMETextLen > nNewIMETextLen ) &&
2082 ( nNewIMETextLen < mpIMEInfos->aOldTextAfterStartPos.getLength() ) )
2085 const sal_Int32 nRestore = nOldIMETextLen - nNewIMETextLen;
2088 else if ( ( nOldIMETextLen < nNewIMETextLen ) &&
2089 ( nOldIMETextLen < mpIMEInfos->aOldTextAfterStartPos.getLength() ) )
2091 const sal_Int32 nOverwrite = ( nNewIMETextLen >
mpIMEInfos->aOldTextAfterStartPos.getLength()
2092 ?
mpIMEInfos->aOldTextAfterStartPos.getLength() : nNewIMETextLen ) - nOldIMETextLen;
2097 if (
pData->GetTextAttr() )
2112 if (
pData->IsCursorVisible() )
2146 std::vector<tools::Rectangle> aRects(
mpIMEInfos->nLen);
2151 aRects[
nIndex ] = aRect;
2190 sal_uInt16 nOldAlign =
mnAlign;
2266 mpDDInfo->aCursor.SetWindow(
this );
2284 : sForbiddenChars(
std::move(_aForbiddenChars))
2294 OUString sTemp(rText);
2305 const OUString sOrig =
GetText();
2309 sal_Int32 nDiff = sOrig.getLength() - sNew.getLength();
2427 if ( aNew.
Min() < 0 )
2429 if ( aNew.
Max() < 0 )
2442 bool bCaret =
false, bSelection =
false;
2447 if (nGap != 0 || oGap != 0)
2509 return OUString(
maText.getStr() + aSelection.
Min(), aSelection.
Len() );
2526 css::uno::Reference<css::datatransfer::clipboard::XClipboard> aClipboard(
GetClipboard());
2533 css::uno::Reference<css::datatransfer::clipboard::XClipboard> aClipboard(
GetClipboard());
2543 const OUString aText(
maText.toString() );
2575 return maText.toString();
2655 aControlValue, aBound, aContent))
2689 return nOutWidth / fUnitWidth;
2741 Point aMousePos( rDGE.DragOriginX, rDGE.DragOriginY );
2743 if ( (nCharPos < aSel.
Min()) || (nCharPos >= aSel.
Max()) )
2756 sal_Int8 nActions = datatransfer::dnd::DNDConstants::ACTION_COPY;
2758 nActions |= datatransfer::dnd::DNDConstants::ACTION_MOVE;
2759 rDGE.DragSource->startDrag( rDGE, nActions, 0 , 0 , pDataObj,
mxDnDListener );
2769 if (rDSDE.DropSuccess && (rDSDE.DropAction & datatransfer::dnd::DNDConstants::ACTION_MOVE) &&
mpDDInfo)
2790void Edit::drop(
const css::datatransfer::dnd::DropTargetDropEvent& rDTDE )
2794 bool bChanges =
false;
2811 uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable;
2812 if ( xDataObj.is() )
2814 datatransfer::DataFlavor aFlavor;
2816 if ( xDataObj->isDataFlavorSupported( aFlavor ) )
2833 rDTDE.Context->dropComplete( bChanges );
2843 const Sequence< css::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors );
2844 mpDDInfo->bIsStringSupported = std::any_of(rFlavors.begin(), rFlavors.end(),
2845 [](
const css::datatransfer::DataFlavor& rFlavor) {
2846 sal_Int32 nIndex = 0;
2847 const std::u16string_view aMimetype = o3tl::getToken(rFlavor.MimeType, 0,
';', nIndex );
2848 return aMimetype == u
"text/plain";
2863 Point aMousePos( rDTDE.LocationX, rDTDE.LocationY );
2865 sal_Int32 nPrevDropPos =
mpDDInfo->nDropPos;
2884 rDTDE.Context->rejectDrag();
2894 rDTDE.Context->acceptDrag( rDTDE.DropAction );
2902 return maText.toString();
2932 rJsonWriter.
put(
"password",
true);
static bool toBool(std::string_view rValue)
const LanguageTag & GetLanguageTag() const
const StyleSettings & GetStyleSettings() const
static bool GetLayoutRTL()
static OUString GetUIRootDir()
static const AllSettings & GetSettings()
Gets the application's settings.
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
const CommandSelectionChangeData * GetSelectionChangeData() const
const CommandExtTextInputData * GetExtTextInputData() const
bool IsMouseEvent() const
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
std::optional< vcl::ControlLayoutData > mxLayoutData
SAL_DLLPRIVATE void ImplClearLayoutData() const
bool ImplCallEventListenersAndHandler(VclEventId nEvent, std::function< void()> const &callHandler)
this calls both our event listeners, and a specified handler
virtual void StateChanged(StateChangedType nStateChange) override
virtual void Resize() override
virtual void EnableRTL(bool bEnable=true) override
SAL_DLLPRIVATE void ImplDrawFrame(OutputDevice *pDev, tools::Rectangle &rRect)
draws a frame around the give rectangle, onto the given device
void CallEventListeners(VclEventId nEvent, void *pData=nullptr)
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
DataChangedEventType GetType() const
AllSettingsFlags GetFlags() const
static std::unique_ptr< UIObject > create(vcl::Window *pWindow)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
SAL_DLLPRIVATE void ImplPaste(css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &rxClipboard)
Link< Edit &, bool > maActivateHdl
virtual void dragDropEnd(const css::datatransfer::dnd::DragSourceDropEvent &dsde) override
virtual bool DeleteSurroundingText(const Selection &rSelection) override
static bool IsCharInput(const KeyEvent &rKEvt)
sal_Int32 mnMaxWidthChars
virtual void ReplaceSelected(const OUString &rStr)
void SetWidthInChars(sal_Int32 nWidthInChars)
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle)
SAL_DLLPRIVATE void ImplAlign()
std::unique_ptr< DDInfo, o3tl::default_delete< DDInfo > > mpDDInfo
SAL_DLLPRIVATE tools::Long ImplGetTextYPosition() const
SAL_DLLPRIVATE css::uno::Reference< css::i18n::XBreakIterator > const & ImplGetBreakIterator()
virtual void dispose() override
This is intended to be used to clear any locally held references to other Window-subclass objects.
void SetPlaceholderText(const OUString &rStr)
virtual Size CalcSize(sal_Int32 nChars) const
virtual void SetText(const OUString &rStr) override
virtual Selection GetSurroundingTextSelection() const override
bool mbClickedInSelection
virtual void dragGestureRecognized(const css::datatransfer::dnd::DragGestureEvent &dge) override
css::uno::Reference< css::i18n::XExtendedInputSequenceChecker > mxISC
SAL_DLLPRIVATE css::uno::Reference< css::i18n::XExtendedInputSequenceChecker > const & ImplGetInputSequenceChecker()
SAL_DLLPRIVATE void ImplDelete(const Selection &rSelection, sal_uInt8 nDirection, sal_uInt8 nMode)
virtual OUString GetSurroundingText() const override
virtual Size GetOptimalSize() const override
virtual bool set_property(const OUString &rKey, const OUString &rValue) override
SAL_DLLPRIVATE void ImplCopyToSelectionClipboard()
void setMaxWidthChars(sal_Int32 nWidth)
std::unique_ptr< Impl_IMEInfos > mpIMEInfos
virtual bool PreNotify(NotifyEvent &rNEvt) override
SAL_DLLPRIVATE void ImplSetText(const OUString &rStr, const Selection *pNewSelection)
SAL_DLLPRIVATE tools::Long ImplGetExtraYOffset() const
SAL_DLLPRIVATE void ImplPaintBorder(vcl::RenderContext const &rRenderContext)
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual const Selection & GetSelection() const
virtual void DeleteSelected()
css::uno::Reference< css::i18n::XBreakIterator > mxBreakIterator
bool mbForceControlBackground
void SetInsertMode(bool bInsert)
static SAL_DLLPRIVATE WinBits ImplInitStyle(WinBits nStyle)
SAL_DLLPRIVATE void ImplRepaint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRectangle)
virtual void SetMaxTextLen(sal_Int32 nMaxLen)
virtual void GetFocus() override
virtual Size CalcMinimumSize() const
css::uno::Reference< css::datatransfer::dnd::XDragSourceListener > mxDnDListener
SAL_DLLPRIVATE void ImplShowCursor(bool bOnlyIfVisible=true)
virtual void dragEnter(const css::datatransfer::dnd::DropTargetDragEnterEvent &dtdee) override
SAL_DLLPRIVATE void filterText()
virtual void DumpAsPropertyTree(tools::JsonWriter &rJsonWriter) override
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
Edit * GetSubEdit() const
virtual void Tracking(const TrackingEvent &rTEvt) override
SAL_DLLPRIVATE tools::Long ImplGetExtraXOffset() const
virtual void SetSelection(const Selection &rSelection)
static SAL_DLLPRIVATE void ImplInvalidateOutermostBorder(vcl::Window *pWin)
SAL_DLLPRIVATE void ImplShowDDCursor()
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
OUString maPlaceholderText
virtual void LoseFocus() override
bool IsInsertMode() const
Link< Edit &, void > maAutocompleteHdl
SAL_DLLPRIVATE bool ImplUseNativeBorder(vcl::RenderContext const &rRenderContext, WinBits nStyle) const
SAL_DLLPRIVATE void ImplCopy(css::uno::Reference< css::datatransfer::clipboard::XClipboard > const &rxClipboard)
SAL_DLLPRIVATE void ImplSetCursorPos(sal_Int32 nChar, bool bSelect)
SAL_DLLPRIVATE bool ImplTruncateToMaxLen(OUString &, sal_Int32 nSelectionLen) const
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
virtual void SetReadOnly(bool bReadOnly=true)
void SetSubEdit(Edit *pEdit)
SAL_DLLPRIVATE void ImplClearBackground(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRectangle, tools::Long nXStart, tools::Long nXEnd)
virtual void KeyInput(const KeyEvent &rKEvt) override
virtual void dragExit(const css::datatransfer::dnd::DropTargetEvent &dte) override
TextFilter * mpFilterText
static void ShowTruncationWarning(weld::Widget *pParent)
virtual OUString GetSelected() const
virtual void dragOver(const css::datatransfer::dnd::DropTargetDragEvent &dtde) override
SAL_DLLPRIVATE void ImplInvalidateOrRepaint()
virtual Size CalcMinimumSizeForText(const OUString &rString) const
sal_Int32 GetMaxVisChars() const
SAL_DLLPRIVATE void ImplHideDDCursor()
std::unique_ptr< VclBuilder > mpUIBuilder
virtual bool IsReadOnly() const
virtual void SetModifyFlag()
SAL_DLLPRIVATE void ImplSetSelection(const Selection &rSelection, bool bPaint=true)
SAL_DLLPRIVATE ControlType ImplGetNativeControlType() const
virtual void FillLayoutData() const override
SAL_DLLPRIVATE void ImplInsertText(const OUString &rStr, const Selection *pNewSelection=nullptr, bool bIsUserInput=false)
virtual FactoryFunction GetUITestFactory() const override
virtual void Draw(OutputDevice *pDev, const Point &rPos, SystemTextColorFlags nFlags) override
virtual void ApplySettings(vcl::RenderContext &rRenderContext) override
VclPtr< PopupMenu > CreatePopupMenu()
virtual void Command(const CommandEvent &rCEvt) override
SAL_DLLPRIVATE void ImplAlignAndPaint()
virtual void Resize() override
virtual void StateChanged(StateChangedType nType) override
virtual OUString GetText() const override
static SAL_DLLPRIVATE OUString ImplGetValidString(const OUString &rString)
Link< Edit &, void > maModifyHdl
SAL_DLLPRIVATE sal_Int32 ImplGetCharPos(const Point &rWindowPos) const
SAL_DLLPRIVATE void ImplInitEditData()
virtual void drop(const css::datatransfer::dnd::DropTargetDropEvent &dtde) override
void SetEchoChar(sal_Unicode c)
SAL_DLLPRIVATE bool ImplHandleKeyEvent(const KeyEvent &rKEvt)
SAL_DLLPRIVATE OUString ImplGetText() const
sal_Unicode GetCharCode() const
const vcl::KeyCode & GetKeyCode() const
const css::lang::Locale & getLocale(bool bResolveSystem=true) const
bool IsEnterWindow() const
bool IsLeaveWindow() const
sal_uInt16 GetClicks() const
sal_uInt16 GetButtons() const
const Point & GetPosPixel() const
bool IsModifierChanged() const
const MouseEvent * GetMouseEvent() const
NotifyEventType GetType() const
Some things multiple-inherit from VclAbstractDialog and OutputDevice, so we need to use virtual inher...
void GetCaretPositions(const OUString &, KernArray &rCaretXArray, sal_Int32 nIndex, sal_Int32 nLen, const SalLayoutGlyphs *pGlyphs=nullptr) const
vcl::Region GetClipRegion() const
const vcl::Font & GetFont() const
void SetFont(const vcl::Font &rNewFont)
void DrawRect(const tools::Rectangle &rRect)
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
void SetTextColor(const Color &rColor)
SAL_WARN_UNUSED_RESULT Point LogicToPixel(const Point &rLogicPt) const
const Color & GetTextColor() const
void Push(vcl::PushFlags nFlags=vcl::PushFlags::ALL)
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
void DrawText(const Point &rStartPt, const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, std::vector< tools::Rectangle > *pVector=nullptr, OUString *pDisplayText=nullptr, const SalLayoutGlyphs *pLayoutCache=nullptr)
void SetLayoutMode(vcl::text::ComplexTextLayoutFlags nTextLayoutMode)
const AllSettings & GetSettings() const
void IntersectClipRegion(const tools::Rectangle &rRect)
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
constexpr tools::Long Y() const
void setX(tools::Long nX)
constexpr tools::Long X() const
bool Contains(tools::Long nIs) const
tools::Long getMin() const
void setMin(tools::Long nMin)
void setMax(tools::Long nMax)
constexpr tools::Long Height() const
tools::Long AdjustHeight(tools::Long n)
void setWidth(tools::Long nWidth)
tools::Long AdjustWidth(tools::Long n)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
A helper class that calls Application::ReleaseSolarMutex() in its constructor and restores the mutex ...
static bool GetFormatDataFlavor(SotClipboardFormatId nFormat, css::datatransfer::DataFlavor &rFlavor)
SelectionOptions GetSelectionOptions() const
const Color & GetFieldTextColor() const
bool GetContextMenuShortcuts() const
const Color & GetFieldColor() const
const vcl::Font & GetFieldFont() const
const Color & GetHighlightColor() const
const Color & GetHighlightTextColor() const
const Color & GetDisableColor() const
bool GetHideDisabledMenuItems() const
virtual OUString filter(const OUString &rText)
TextFilter(OUString aForbiddenChars=OUString(" "))
bool IsTrackingEnded() const
const MouseEvent & GetMouseEvent() const
Creates a hierarchy of vcl::Windows (widgets) from a .ui file for dialogs, sidebar,...
void set(reference_type *pBody)
void SetStyle(sal_uInt16 nStyle)
void SetPos(const Point &rNewPos)
void SetSize(const Size &rNewSize)
void SetUnderline(FontLineStyle)
sal_uInt16 GetCode() const
sal_uInt16 GetModifier() const
KeyFuncType GetFunction() const
Sets up the buffer to have settings matching the window, and restores the original state in the dtor.
void Move(tools::Long nHorzMove, tools::Long nVertMove)
void Intersect(const tools::Rectangle &rRegion)
tools::Rectangle GetBoundRect() const
void Union(const tools::Rectangle &rRegion)
Point OutputToScreenPixel(const Point &rPos) const
Size CalcOutputSize(const Size &rWinSz) const
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
Width of the text.
void SetStyle(WinBits nStyle)
void SetCursorRect(const tools::Rectangle *pRect=nullptr, tools::Long nExtTextInputWidth=0)
SAL_DLLPRIVATE void ImplGrabFocus(GetFocusFlags nFlags)
bool IsNativeWidgetEnabled() const
void SetInputContext(const InputContext &rInputContext)
bool IsReallyVisible() const
void StartTracking(StartTrackingFlags nFlags=StartTrackingFlags::NONE)
vcl::Window * GetParent() const
GetFocusFlags GetGetFocusFlags() const
void EndTracking(TrackingEventFlags nFlags=TrackingEventFlags::NONE)
bool IsPaintTransparent() const
WindowType GetType() const
bool SupportsDoubleBuffering() const
Can the widget derived from this Window do the double-buffering via RenderContext properly?
float approximate_digit_width() const
virtual void SetSizePixel(const Size &rNewSize)
virtual void Command(const CommandEvent &rCEvt)
vcl::Window * GetWindow(GetWindowType nType) const
void SetCursor(vcl::Cursor *pCursor)
virtual void queue_resize(StateChangedType eReason=StateChangedType::Layout)
bool IsUpdateMode() const
virtual void MouseButtonDown(const MouseEvent &rMEvt)
bool GetNativeControlRegion(ControlType nType, ControlPart nPart, const tools::Rectangle &rControlRegion, ControlState nState, const ImplControlValue &aValue, tools::Rectangle &rNativeBoundingRegion, tools::Rectangle &rNativeContentRegion) const
Query the native control's actual drawing region (including adornment)
vcl::Cursor * GetCursor() const
vcl::Font GetDrawPixelFont(::OutputDevice const *pDev) const
tools::Long GetTextHeight() const
Height where any character of the current font fits; in logic coordinates.
const AllSettings & GetSettings() const
virtual void KeyInput(const KeyEvent &rKEvt)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
void SetCompositionCharRect(const tools::Rectangle *pRect, tools::Long nCompositionLength, bool bVertical=false)
Size CalcWindowSize(const Size &rOutSz) const
virtual bool PreNotify(NotifyEvent &rNEvt)
bool IsNativeControlSupported(ControlType nType, ControlPart nPart) const
Query the platform layer for control support.
::OutputDevice const * GetOutDev() const
const vcl::Font & GetFont() const
SAL_DLLPRIVATE float approximate_char_width() const
SAL_DLLPRIVATE WindowImpl * ImplGetWindowImpl() const
tools::Long GetDrawPixel(::OutputDevice const *pDev, tools::Long nPixels) const
const Color & GetTextColor() const
std::unique_ptr< WindowImpl > mpWindowImpl
SalFrame * ImplGetFrame() const
virtual void DumpAsPropertyTree(tools::JsonWriter &)
Dumps itself and potentially its children to a property tree, to be written easily to JSON.
bool IsRTLEnabled() const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
bool IsControlBackground() const
virtual void DataChanged(const DataChangedEvent &rDCEvt)
const Color & GetControlBackground() const
virtual void SetPointer(PointerStyle)
vcl::Region GetPaintRegion() const
bool HasPaintEvent() const
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
weld::Window * GetFrameWeld() const
css::uno::Reference< css::datatransfer::clipboard::XClipboard > GetClipboard()
void SetBorderStyle(WindowBorderStyle nBorderStyle)
void ApplyControlFont(vcl::RenderContext &rRenderContext, const vcl::Font &rDefaultFont)
css::uno::Reference< css::datatransfer::dnd::XDropTarget > GetDropTarget()
void SetType(WindowType nType)
virtual bool set_property(const OUString &rKey, const OUString &rValue)
Point ScreenToOutputPixel(const Point &rPos) const
void ApplyControlForeground(vcl::RenderContext &rRenderContext, const Color &rDefaultColor)
css::uno::Reference< css::datatransfer::dnd::XDragGestureRecognizer > GetDragGestureRecognizer()
SAL_DLLPRIVATE void ImplInit(vcl::Window *pParent, WinBits nStyle, SystemParentData *pSystemParentData)
SAL_DLLPRIVATE void CompatStateChanged(StateChangedType nStateChange)
static void CopyStringTo(const OUString &rContent, const css::uno::Reference< css::datatransfer::clipboard::XClipboard > &rxClipboard, const vcl::ILibreOfficeKitNotifier *pNotifier=nullptr)
copies a given string to a given clipboard
constexpr ::Color COL_RED(0x80, 0x00, 0x00)
constexpr ::Color COL_LIGHTGRAY(0xC0, 0xC0, 0xC0)
constexpr ::Color COL_BLACK(0x00, 0x00, 0x00)
static FncGetSpecialChars pImplFncGetSpecialChars
#define EDIT_DELMODE_SIMPLE
#define EDIT_ALIGN_CENTER
#define EDIT_DELMODE_RESTOFCONTENT
#define EDIT_DELMODE_RESTOFWORD
std::function< std::unique_ptr< UIObject >(vcl::Window *)> FactoryFunction
constexpr sal_uInt16 KEY_RETURN
constexpr sal_uInt16 KEY_HOME
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_S
constexpr sal_uInt16 KEY_A
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DELETE
constexpr sal_uInt16 KEY_INSERT
constexpr sal_uInt16 KEY_BACKSPACE
constexpr sal_uInt16 KEY_END
#define SAL_WARN_IF(condition, area, stream)
std::unique_ptr< sal_Int32[]> pData
constexpr OUStringLiteral aData
double getLength(const B2DPolygon &rCandidate)
const LanguageTag & getLocale()
OStringBuffer & padToLength(OStringBuffer &rBuffer, sal_Int32 nLength, char cFill='\0')
FncGetSpecialChars GetGetSpecialCharsFunction()
void SetGetSpecialCharsFunction(FncGetSpecialChars fn)
OUString(* FncGetSpecialChars)(weld::Widget *pWin, const vcl::Font &rFont)
void CopyAttribs(const ExtTextInputAttr *pA, sal_Int32 nL)
std::unique_ptr< ExtTextInputAttr[]> pAttribs
OUString aOldTextAfterStartPos
Impl_IMEInfos(sal_Int32 nPos, OUString aOldTextAfterStartPos)
ImplSVData * ImplGetSVData()
OUString VclResId(TranslateId aId)
Reference< XClipboard > GetSystemPrimarySelection()
@ Update
The invalidated area is updated immediately.
@ Children
The child windows are invalidated, too.
WinBits const WB_NOTABSTOP
WinBits const WB_READONLY
WinBits const WB_NOBORDER
WinBits const WB_NOHIDESELECTION