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();
476 sal_Int32 nDXBuffer[256];
477 std::unique_ptr<sal_Int32[]> pDXBuffer;
478 sal_Int32* pDX = nDXBuffer;
484 pDXBuffer.reset(
new sal_Int32[2 * (nLen + 1)]);
485 pDX = pDXBuffer.get();
495 bool bVisCursor = pCursor && pCursor->
IsVisible();
505 if (!
IsEnabled() || bPaintPlaceholderText)
516 rRenderContext.
Pop();
530 if (bPaintPlaceholderText)
536 rRenderContext.
DrawText(aPos, aText, 0, nLen);
541 rRenderContext.
Push();
548 for(sal_Int32
i = 0;
i < nLen; ++
i)
554 bool bHighlight =
false;
555 if (
i >= aTmpSel.
Min() &&
i < aTmpSel.
Max())
566 aHighlightClipRegion.
Union(aRect);
568 aNormalClipRegion.
Union(aRect);
591 rRenderContext.
DrawText(aPos, aText, 0, nLen);
597 rRenderContext.
DrawText(aPos, aText, 0, nLen);
602 for(
int n = 0;
n < 2;
n++)
612 aRegion = aNormalClipRegion;
618 aRegion = aHighlightClipRegion;
663 rRenderContext.
DrawText(aPos, aText, 0, nLen);
670 rRenderContext.
Pop();
679 const sal_Int32 nTextLen =
ImplGetText().getLength();
682 if ( !rSelection.
Len() &&
692 if ( !aSelection.
Len() )
699 const OUString sText =
maText.toString();
700 i18n::Boundary aBoundary = xBI->getWordBoundary( sText, aSelection.
Min(),
702 auto startPos = aBoundary.startPos;
703 if ( startPos == aSelection.
Min() )
705 aBoundary = xBI->previousWord( sText, aSelection.
Min(),
707 startPos = std::max(aBoundary.startPos, sal_Int32(0));
709 aSelection.
Min() = startPos;
713 aSelection.
Min() = 0;
718 aSelection.
Min() = xBI->previousCharacters(
maText.toString(), aSelection.
Min(),
726 i18n::Boundary aBoundary = xBI->nextWord(
maText.toString(), aSelection.
Max(),
728 aSelection.
Max() = aBoundary.startPos;
732 aSelection.
Max() = nTextLen;
737 aSelection.
Max() = xBI->nextCharacters(
maText.toString(), aSelection.
Max(),
743 const auto nSelectionMin = aSelection.
Min();
744 maText.remove( nSelectionMin, aSelection.
Len() );
753 OUString aValidString = rString.replaceAll(
"\n",
"").replaceAll(
"\r",
"");
754 aValidString = aValidString.replace(
'\t',
' ');
761 mxBreakIterator = i18n::BreakIterator::create(::comphelper::getProcessComponentContext());
768 mxISC = i18n::InputSequenceChecker::create(::comphelper::getProcessComponentContext());
781 bool bWasTruncated =
false;
785 rStr = rStr.copy( 0, nErasePos );
786 bWasTruncated =
true;
788 return bWasTruncated;
800 auto nSelectionLen = aSelection.
Len();
807 if ( aSelection.
Len() )
813 if (bIsUserInput && !rStr.isEmpty())
815 SAL_WARN_IF( rStr.getLength() != 1,
"vcl",
"unexpected string length. User input is expected to provide 1 char only!" );
820 bool bIsInputSequenceChecking = rStr.getLength() == 1 &&
821 officecfg::Office::Common::I18N::CTL::CTLFont::get() &&
822 officecfg::Office::Common::I18N::CTL::CTLSequenceChecking::get() &&
823 aSelection.
Min() > 0 &&
824 xBI.is() && i18n::ScriptType::COMPLEX == xBI->getScriptType( rStr, 0 );
826 if (bIsInputSequenceChecking)
832 sal_Int32 nTmpPos = aSelection.
Min();
833 sal_Int16 nCheckMode = officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingRestricted::get()?
834 i18n::InputSequenceCheckMode::STRICT : i18n::InputSequenceCheckMode::BASIC;
838 const OUString aOldText(
maText.subView(0, nTmpPos) );
839 OUString aTmpText( aOldText );
840 if (officecfg::Office::Common::I18N::CTL::CTLSequenceCheckingTypeAndReplace::get())
842 xISC->correctInputSequence( aTmpText, nTmpPos - 1, cChar, nCheckMode );
845 sal_Int32 nOldLen = aOldText.getLength();
846 sal_Int32 nTmpLen = aTmpText.getLength();
849 sal_Int32 nChgPos = 0;
850 while ( nChgPos < nOldLen && nChgPos < nTmpLen &&
851 pOldTxt[nChgPos] == pTmpTxt[nChgPos] )
854 const OUString aChgText( aTmpText.copy( nChgPos ) );
857 maText.remove( nChgPos, nTmpPos - nChgPos );
859 if (!aChgText.isEmpty())
862 aSelection.
Min() = nChgPos;
870 if (!xISC->checkInputSequence( aOldText, nTmpPos - 1, cChar, nCheckMode ))
879 if ( !aNewText.isEmpty() )
880 maText.insert( aSelection.
Min(), aNewText );
904 ( std::u16string_view(rText) == std::u16string_view(
maText)
905 && (!pNewSelection || (*pNewSelection ==
maSelection)) ) )
994 rRenderContext.
Erase(aRect);
1015 if (pBorder ==
this)
1020 if (pBorder ==
this)
1039 aClipRgn.
Move(xNew - aBounds.
Left(), 0);
1043 aClipRgn.
Move(aBorderOffs.X(), aBorderOffs.Y());
1049 aClipRgn.
Move(aBorderOffs.X(), aBorderOffs.Y());
1075 sal_Int32 nDXBuffer[256];
1076 std::unique_ptr<sal_Int32[]> pDXBuffer;
1077 sal_Int32* pDX = nDXBuffer;
1079 if( !aText.isEmpty() )
1083 pDXBuffer.reset(
new sal_Int32[2*(aText.getLength()+1)]);
1084 pDX = pDXBuffer.get();
1092 nTextPos = pDX[ 2*aText.getLength()-1 ];
1102 if ( (nCursorPosX < 0) || (nCursorPosX >= aOutSize.
Width()) )
1106 if ( nCursorPosX < 0 )
1128 if ( nCursorPosX == aOutSize.
Width() )
1139 pCursor->
SetPos(
Point( nCursorPosX, nCursorPosY ) );
1140 pCursor->
SetSize(
Size( nCursorWidth, nTextHeight ) );
1158 if (nTextWidth < nOutWidth)
1169 if( nTextWidth < nOutWidth )
1174 if( nTextWidth < nOutWidth )
1183 mnXOffset = (nOutWidth - nTextWidth) / 2;
1199 sal_Int32 nDXBuffer[256];
1200 std::unique_ptr<sal_Int32[]> pDXBuffer;
1201 sal_Int32* pDX = nDXBuffer;
1204 pDXBuffer.reset(
new sal_Int32[2*(aText.getLength()+1)]);
1205 pDX = pDXBuffer.get();
1210 for (sal_Int32
i = 0;
i < aText.getLength(); aText.iterateCodePoints(&
i))
1212 if( (pDX[2*
i] >= nX && pDX[2*
i+1] <= nX) ||
1213 (pDX[2*
i+1] >= nX && pDX[2*
i] <= nX))
1216 if( pDX[2*
i] < pDX[2*
i+1] )
1218 if( nX > (pDX[2*
i]+pDX[2*
i+1])/2 )
1219 aText.iterateCodePoints(&
nIndex);
1223 if( nX < (pDX[2*
i]+pDX[2*
i+1])/2 )
1224 aText.iterateCodePoints(&
nIndex);
1232 sal_Int32 nFinalIndex = 0;
1235 if (!aText.isEmpty())
1237 aText.iterateCodePoints(&
i);
1239 while (
i < aText.getLength())
1243 if( nNewDiff < nDiff )
1251 aText.iterateCodePoints(&
i);
1253 if (
nIndex == nFinalIndex && std::abs( pDX[2*
nIndex+1] - nX ) < nDiff)
1263 aSelection.
Max() = nChar;
1265 aSelection.
Min() = aSelection.
Max();
1278void Edit::ImplCopy( uno::Reference< datatransfer::clipboard::XClipboard >
const & rxClipboard )
1283void Edit::ImplPaste( uno::Reference< datatransfer::clipboard::XClipboard >
const & rxClipboard )
1285 if ( !rxClipboard.is() )
1288 uno::Reference< datatransfer::XTransferable > xDataObj;
1293 xDataObj = rxClipboard->getContents();
1295 catch(
const css::uno::Exception& )
1299 if ( !xDataObj.is() )
1302 datatransfer::DataFlavor aFlavor;
1314 const sal_Int32 aTextLen = aText.getLength();
1330 catch(
const css::uno::Exception& )
1359 i18n::Boundary aBoundary = xBI->getWordBoundary(
maText.toString(), aSelection.
Max(),
1366 else if ( rMEvt.
IsLeft() )
1490 if ( !aChars.isEmpty() )
1504 case css::awt::Key::SELECT_ALL:
1515 case css::awt::Key::MOVE_WORD_FORWARD:
1516 case css::awt::Key::SELECT_WORD_FORWARD:
1517 case css::awt::Key::MOVE_WORD_BACKWARD:
1518 case css::awt::Key::SELECT_WORD_BACKWARD:
1519 case css::awt::Key::MOVE_TO_BEGIN_OF_LINE:
1520 case css::awt::Key::MOVE_TO_END_OF_LINE:
1521 case css::awt::Key::SELECT_TO_BEGIN_OF_LINE:
1522 case css::awt::Key::SELECT_TO_END_OF_LINE:
1523 case css::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
1524 case css::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
1525 case css::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
1526 case css::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
1527 case css::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
1528 case css::awt::Key::MOVE_TO_END_OF_DOCUMENT:
1529 case css::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
1530 case css::awt::Key::SELECT_TO_END_OF_DOCUMENT:
1547 case css::awt::Key::MOVE_WORD_FORWARD:
1548 bGoRight = bWord =
true;
break;
1549 case css::awt::Key::SELECT_WORD_FORWARD:
1550 bGoRight = bSelect = bWord =
true;
break;
1551 case css::awt::Key::MOVE_WORD_BACKWARD:
1552 bGoLeft = bWord =
true;
break;
1553 case css::awt::Key::SELECT_WORD_BACKWARD:
1554 bGoLeft = bSelect = bWord =
true;
break;
1555 case css::awt::Key::SELECT_TO_BEGIN_OF_LINE:
1556 case css::awt::Key::SELECT_TO_BEGIN_OF_PARAGRAPH:
1557 case css::awt::Key::SELECT_TO_BEGIN_OF_DOCUMENT:
1560 case css::awt::Key::MOVE_TO_BEGIN_OF_LINE:
1561 case css::awt::Key::MOVE_TO_BEGIN_OF_PARAGRAPH:
1562 case css::awt::Key::MOVE_TO_BEGIN_OF_DOCUMENT:
1563 bGoHome =
true;
break;
1564 case css::awt::Key::SELECT_TO_END_OF_LINE:
1565 case css::awt::Key::SELECT_TO_END_OF_PARAGRAPH:
1566 case css::awt::Key::SELECT_TO_END_OF_DOCUMENT:
1569 case css::awt::Key::MOVE_TO_END_OF_LINE:
1570 case css::awt::Key::MOVE_TO_END_OF_PARAGRAPH:
1571 case css::awt::Key::MOVE_TO_END_OF_DOCUMENT:
1572 bGoEnd =
true;
break;
1578 if ( bGoLeft && aSel.
Max() )
1582 const OUString sText =
maText.toString();
1583 i18n::Boundary aBoundary = xBI->getWordBoundary( sText, aSel.
Max(),
1585 if ( aBoundary.startPos == aSel.
Max() )
1586 aBoundary = xBI->previousWord( sText, aSel.
Max(),
1588 aSel.
Max() = aBoundary.startPos;
1593 aSel.
Max() = xBI->previousCharacters(
maText.toString(), aSel.
Max(),
1597 else if ( bGoRight && ( aSel.
Max() <
maText.getLength() ) )
1601 i18n::Boundary aBoundary = xBI->nextWord(
maText.toString(), aSel.
Max(),
1603 aSel.
Max() = aBoundary.startPos;
1608 aSel.
Max() = xBI->nextCharacters(
maText.toString(), aSel.
Max(),
1643 case css::awt::Key::DELETE_WORD_BACKWARD:
1644 case css::awt::Key::DELETE_WORD_FORWARD:
1645 case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
1646 case css::awt::Key::DELETE_TO_END_OF_LINE:
1658 case css::awt::Key::DELETE_WORD_BACKWARD:
1662 case css::awt::Key::DELETE_WORD_FORWARD:
1666 case css::awt::Key::DELETE_TO_BEGIN_OF_LINE:
1670 case css::awt::Key::DELETE_TO_END_OF_LINE:
1676 sal_Int32 nOldLen =
maText.getLength();
1678 if (
maText.getLength() != nOldLen )
1776 if ( bBorder || bBackground )
1828 ((nOffY+nTextHeight) > aSize.
Height()) ||
1829 ((nOffX+nTextWidth) > aSize.
Width()) )
1832 if ( nTextHeight > aSize.
Height() )
1837 pDev->
DrawText( aTextRect, aText, nTextStyle );
1856 if (pBorder == pInvalWin || !pBorder ||
1859 pInvalWin = pBorder;
1959 bool bEnableCut =
true;
1960 bool bEnableCopy =
true;
1961 bool bEnableDelete =
true;
1962 bool bEnablePaste =
true;
1963 bool bEnableSpecialChar =
true;
1968 bEnableCopy =
false;
1969 bEnableDelete =
false;
1975 bEnablePaste =
false;
1976 bEnableDelete =
false;
1977 bEnableSpecialChar =
false;
1983 uno::Reference< datatransfer::clipboard::XClipboard > xClipboard =
GetClipboard();
1985 if ( xClipboard.is() )
1987 uno::Reference< datatransfer::XTransferable > xDataObj;
1990 xDataObj = xClipboard->getContents();
1992 if ( xDataObj.is() )
1994 datatransfer::DataFlavor aFlavor;
1996 bData = xDataObj->isDataFlavorSupported( aFlavor );
1999 bEnablePaste = bData;
2023 sal_uInt16
n = pPopup->
Execute(
this, aPos );
2026 if (sCommand ==
"undo")
2031 else if (sCommand ==
"cut")
2036 else if (sCommand ==
"copy")
2040 else if (sCommand ==
"paste")
2045 else if (sCommand ==
"delete")
2050 else if (sCommand ==
"selectall")
2060 if (!aChars.isEmpty())
2079 bool bInsertMode = !
mpIMEInfos->bWasCursorOverwrite;
2104 const sal_Int32 nOldIMETextLen =
mpIMEInfos->nLen;
2105 const sal_Int32 nNewIMETextLen =
pData->GetText().getLength();
2106 if ( ( nOldIMETextLen > nNewIMETextLen ) &&
2107 ( nNewIMETextLen < mpIMEInfos->aOldTextAfterStartPos.getLength() ) )
2110 const sal_Int32 nRestore = nOldIMETextLen - nNewIMETextLen;
2113 else if ( ( nOldIMETextLen < nNewIMETextLen ) &&
2114 ( nOldIMETextLen < mpIMEInfos->aOldTextAfterStartPos.getLength() ) )
2116 const sal_Int32 nOverwrite = ( nNewIMETextLen >
mpIMEInfos->aOldTextAfterStartPos.getLength()
2117 ?
mpIMEInfos->aOldTextAfterStartPos.getLength() : nNewIMETextLen ) - nOldIMETextLen;
2122 if (
pData->GetTextAttr() )
2137 if (
pData->IsCursorVisible() )
2165 std::vector<sal_Int32> aDX(2*(aText.getLength()+1));
2172 std::vector<tools::Rectangle> aRects(
mpIMEInfos->nLen);
2177 aRects[
nIndex ] = aRect;
2216 sal_uInt16 nOldAlign =
mnAlign;
2292 mpDDInfo->aCursor.SetWindow(
this );
2310 : sForbiddenChars(
std::move(_aForbiddenChars))
2320 OUString sTemp(rText);
2331 const OUString sOrig =
GetText();
2335 sal_Int32 nDiff = sOrig.getLength() - sNew.getLength();
2453 if ( aNew.
Min() < 0 )
2455 if ( aNew.
Max() < 0 )
2468 bool bCaret =
false, bSelection =
false;
2473 if (nGap != 0 || oGap != 0)
2535 return OUString(
maText.getStr() + aSelection.
Min(), aSelection.
Len() );
2552 css::uno::Reference<css::datatransfer::clipboard::XClipboard> aClipboard(
GetClipboard());
2559 css::uno::Reference<css::datatransfer::clipboard::XClipboard> aClipboard(
GetClipboard());
2569 const OUString aText(
maText.toString() );
2601 return maText.toString();
2681 aControlValue, aBound, aContent))
2715 return nOutWidth / fUnitWidth;
2767 Point aMousePos( rDGE.DragOriginX, rDGE.DragOriginY );
2769 if ( (nCharPos < aSel.
Min()) || (nCharPos >= aSel.
Max()) )
2782 sal_Int8 nActions = datatransfer::dnd::DNDConstants::ACTION_COPY;
2784 nActions |= datatransfer::dnd::DNDConstants::ACTION_MOVE;
2785 rDGE.DragSource->startDrag( rDGE, nActions, 0 , 0 , pDataObj,
mxDnDListener );
2795 if (rDSDE.DropSuccess && (rDSDE.DropAction & datatransfer::dnd::DNDConstants::ACTION_MOVE) &&
mpDDInfo)
2816void Edit::drop(
const css::datatransfer::dnd::DropTargetDropEvent& rDTDE )
2820 bool bChanges =
false;
2837 uno::Reference< datatransfer::XTransferable > xDataObj = rDTDE.Transferable;
2838 if ( xDataObj.is() )
2840 datatransfer::DataFlavor aFlavor;
2842 if ( xDataObj->isDataFlavorSupported( aFlavor ) )
2859 rDTDE.Context->dropComplete( bChanges );
2869 const Sequence< css::datatransfer::DataFlavor >& rFlavors( rDTDE.SupportedDataFlavors );
2870 mpDDInfo->bIsStringSupported = std::any_of(rFlavors.begin(), rFlavors.end(),
2871 [](
const css::datatransfer::DataFlavor& rFlavor) {
2872 sal_Int32 nIndex = 0;
2873 const std::u16string_view aMimetype = o3tl::getToken(rFlavor.MimeType, 0,
';', nIndex );
2874 return aMimetype == u
"text/plain";
2889 Point aMousePos( rDTDE.LocationX, rDTDE.LocationY );
2891 sal_Int32 nPrevDropPos =
mpDDInfo->nDropPos;
2910 rDTDE.Context->rejectDrag();
2920 rDTDE.Context->acceptDrag( rDTDE.DropAction );
2928 return maText.toString();
2958 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...
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 GetCaretPositions(const OUString &, sal_Int32 *pCaretXArray, sal_Int32 nIndex, sal_Int32 nLen, const SalLayoutGlyphs *pGlyphs=nullptr) 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.
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
virtual 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)
#define SAL_N_ELEMENTS(arr)
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')
constexpr std::enable_if_t< std::is_signed_v< T >, std::make_unsigned_t< T > > make_unsigned(T value)
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