20#include <osl/diagnose.h>
39#include <LibreOfficeKit/LibreOfficeKitEnums.h>
44 , DropTargetHelper(this)
45 , DragSourceHelper(this)
47 , nMouseClickPageId(
TabBar::PAGE_NOT_FOUND)
48 , nSelPageIdByMouse(
TabBar::PAGE_NOT_FOUND)
63 InsertPage(
static_cast<sal_uInt16
>(
i)+1, aString, TabBarPageBits::Blue);
65 InsertPage(
static_cast<sal_uInt16
>(
i)+1, aString );
98 std::unique_ptr<weld::Menu> xPopup(xBuilder->weld_menu(
"menu"));
100 sal_uInt16 nCurPageId = GetCurPageId();
111 sal_uInt16
nId =
static_cast<sal_uInt16
>(
i)+1;
112 OUString
sId = OUString::number(
nId);
113 xPopup->append_radio(
sId, aString);
114 if (
nId == nCurPageId)
115 xPopup->set_active(
sId,
true);
118 OUString sIdent(xPopup->popup_at_rect(pPopupParent, aRect));
119 if (!sIdent.isEmpty())
120 SwitchToPageId(sIdent.toUInt32());
130 DragSourceHelper::dispose();
131 DropTargetHelper::dispose();
156 sal_uInt16 nViewPos=0;
209 pDispatcher->
Execute( FID_TAB_MENU_RENAME, SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
217 pDispatcher->
Execute( FID_TAB_DESELECTALL, SfxCallMode::SYNCHRON | SfxCallMode::RECORD );
272 sal_uInt16 nPage = nCurId - 1;
295 SfxCallMode::SLOT | SfxCallMode::RECORD, { &aItem });
353 bool bModified =
false;
354 for (
i=0;
i<nMaxCnt && !bModified;
i++)
380 InsertPage(
static_cast<sal_uInt16
>(
i)+1, aString, TabBarPageBits::Blue);
382 InsertPage(
static_cast<sal_uInt16
>(
i)+1, aString );
401 for (
i=0;
i<nMaxCnt && !bModified;
i++)
439 OString aPayload = OString::number(
nId - 1);
453 if (rCEvt.
GetCommand() != CommandEventId::ContextMenu || bDisable)
478 CommandEvent aCEvt( rPosPixel, CommandEventId::StartDrag,
true );
497 rDoc.
CopyToClip(aClipParam, pClipDoc.get(), &aTabMark,
false,
false);
508 pTransferObj->SetDragSource( pDocSh, aTabMark );
513 SC_MOD()->SetDragObject( pTransferObj.get(),
nullptr );
519 sal_uInt16 nShellCnt = 0;
523 if (
auto pDocShell =
dynamic_cast<const ScDocShell *
>(pShell) )
525 if ( &pDocShell->GetDocument() == &rDoc )
533 OSL_FAIL(
"Document not found");
609 OSL_ENSURE( pViewSh,
"pViewData->GetViewShell()" );
617 bool bDone = pViewSh->
RenameTable( aNewName, nTab );
625 OSL_FAIL(
"ScTabControl::AllowRenaming: nested calls");
661 SetPointerPosPixel( aRect.
Center() );
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
CommandEventId GetCommand() const
const Point & GetMousePosPixel() const
OUString GetURLNoPass(DecodeMechanism eMechanism=DecodeMechanism::ToIUri, rtl_TextEncoding eCharset=RTL_TEXTENCODING_UTF8) const
sal_uInt16 GetModifier() const
sal_uInt16 GetClicks() const
const Point & GetPosPixel() const
const ScDocument & GetDocument() const
SC_DLLPUBLIC bool IsScenario(SCTAB nTab) const
SC_DLLPUBLIC Color GetTabBgColor(SCTAB nTab) const
SC_DLLPUBLIC bool IsTabProtected(SCTAB nTab) const
SC_DLLPUBLIC SCCOL MaxCol() const
SC_DLLPUBLIC SCROW MaxRow() const
bool IsDocEditable() const
SC_DLLPUBLIC void CopyToClip(const ScClipParam &rClipParam, ScDocument *pClipDoc, const ScMarkData *pMarks, bool bKeepScenarioFlags, bool bIncludeObjects)
SC_DLLPUBLIC void CreateValidTabName(OUString &rName) const
SfxObjectShell * GetDocumentShell() const
SC_DLLPUBLIC bool IsVisible(SCTAB nTab) const
ScChangeTrack * GetChangeTrack() const
SC_DLLPUBLIC bool GetName(SCTAB nTab, OUString &rName) const
SC_DLLPUBLIC bool IsDefaultTabBgColor(SCTAB nTab) const
SC_DLLPUBLIC SCTAB GetTableCount() const
todo: It should be possible to have MarkArrays for each table, in order to enable "search all" across...
void SelectTable(SCTAB nTab, bool bNew)
bool GetTableSelect(SCTAB nTab) const
void SetMarkArea(const ScRange &rRange)
void SetReference(const ScRange &rRef, ScDocument &rDoc, const ScMarkData *pMarkData=nullptr)
bool IsModalMode(SfxObjectShell *pDocSh=nullptr)
SC_DLLPUBLIC void InputEnterHandler(ScEnterMode nBlockMode=ScEnterMode::NORMAL, bool bBeforeSavingInLOK=false)
virtual TabBarAllowRenamingReturnCode AllowRenaming() override
virtual void Command(const CommandEvent &rCEvt) override
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
SCTAB GetPrivatDropPos(const Point &rPos)
virtual bool StartRenaming() override
virtual void EndRenaming() override
bool bErrorShown
Selected page ID, if selected with mouse.
virtual void StartDrag(sal_Int8 nAction, const Point &rPosPixel) override
virtual void AddTabClick() override
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
ScTabControl(vcl::Window *pParent, ScViewData *pData)
void SetSheetLayoutRTL(bool bSheetRTL)
sal_uInt16 GetMaxId() const
virtual void dispose() override
virtual sal_Int8 ExecuteDrop(const ExecuteDropEvent &rEvt) override
virtual ~ScTabControl() override
void SwitchToPageId(sal_uInt16 nId)
virtual void Select() override
virtual sal_Int8 AcceptDrop(const AcceptDropEvent &rEvt) override
void UpdateInputContext()
sal_uInt16 nMouseClickPageId
virtual void Mirror() override
sal_uInt16 nSelPageIdByMouse
Last page ID after mouse button down/up.
void ErrorMessage(TranslateId pGlobStrId)
SC_DLLPUBLIC void SetTabNo(SCTAB nTab, bool bNew=false, bool bExtendSelection=false, bool bSameTabButMoved=false)
void DrawMarkListHasChanged()
void SetDragWasInternal()
SCTAB GetVisibleTab() const
ScDocument * GetSourceDocument()
ScDragSrc GetDragSourceFlags() const
SfxDispatcher & GetDispatcher()
ScMarkData & GetMarkData()
ScDocument & GetDocument() const
SCCOL GetRefStartX() const
ScRefType GetRefType() const
ScDocShell * GetDocShell() const
ScGridWindow * GetActiveWin()
ScTabViewShell * GetViewShell() const
ScDBFunc * GetView() const
SCTAB GetRefStartZ() const
SCROW GetRefStartY() const
SfxBindings & GetBindings()
void MoveTable(sal_uInt16 nDestDocNo, SCTAB nDestTab, bool bCopy, const OUString *pNewTabName=nullptr)
bool RenameTable(const OUString &rName, SCTAB nTabNr)
bool InsertTable(const OUString &rName, SCTAB nTabNr, bool bRecord=true)
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 * >())
void ExecutePopup(const OUString &rResName, vcl::Window *pWin=nullptr, const Point *pPos=nullptr)
const INetURLObject & GetURLObject() const
void FillTransferableObjectDescriptor(TransferableObjectDescriptor &rDesc) const
bool IsInModalMode() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetNext(const SfxObjectShell &rPrev, const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
SfxMedium * GetMedium() const
static SAL_WARN_UNUSED_RESULT SfxObjectShell * GetFirst(const std::function< bool(const SfxObjectShell *)> &isObjectShell=nullptr, bool bOnlyVisible=true)
bool HasChildWindow(sal_uInt16)
SfxDispatcher * GetDispatcher()
virtual void libreOfficeKitViewCallback(int nType, const OString &pPayload) const override
SfxViewFrame & GetViewFrame() const
sal_uInt16 GetEditPageId() const
void SetTabBgColor(sal_uInt16 nPageId, const Color &aTabBgColor)
bool IsInEditMode() const
bool IsPageSelected(sal_uInt16 nPageId) const
void SetCurPageId(sal_uInt16 nPageId)
sal_uInt16 ShowDropPos(const Point &rPos)
static const sal_uInt16 PAGE_NOT_FOUND
void SelectPage(sal_uInt16 nPageId, bool bSelect)
virtual void MouseButtonUp(const MouseEvent &rMEvt) override
void SetScrollAlwaysEnabled(bool bScrollAlwaysEnabled)
void SetEffectiveRTL(bool bRTL)
void SetStyle(WinBits nStyle)
tools::Rectangle GetPageRect(sal_uInt16 nPageId) const
const OUString & GetEditText() const
void SetScrollAreaContextHdl(const Link< const CommandEvent &, void > &rLink)
OUString GetPageText(sal_uInt16 nPageId) const
sal_uInt16 GetPageCount() const
virtual void InsertPage(sal_uInt16 nPageId, const OUString &rText, TabBarPageBits nBits=TabBarPageBits::NONE, sal_uInt16 nPos=TabBar::APPEND)
bool StartDrag(const CommandEvent &rCEvt, vcl::Region &rRegion)
sal_uInt16 GetPageId(sal_uInt16 nPos) const
void SwitchPage(const Point &rPos)
void SetSplitHdl(const Link< TabBar *, void > &rLink)
sal_uInt16 GetCurPageId() const
void SetProtectionSymbol(sal_uInt16 nPageId, bool bProtection)
Color GetTabBgColor(sal_uInt16 nPageId) const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
virtual void AddTabClick()
virtual void dispose() override
std::unique_ptr< ScDocument, o3tl::default_delete< ScDocument > > ScDocumentUniquePtr
#define LINK(Instance, Class, Member)
std::unique_ptr< sal_Int32[]> pData
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
This struct stores general clipboard parameters associated with a ScDocument instance created in clip...
ScTransferObj * pCellTransfer
TabBarAllowRenamingReturnCode
IMPL_LINK(ScTabControl, ShowPageList, const CommandEvent &, rEvent, void)
static sal_uInt16 lcl_DocShellNr(const ScDocument &rDoc)
#define SC_TABBAR_DEFWIDTH
#define DND_ACTION_COPYMOVE