LibreOffice Module basctl (master) 1
bastypes.cxx
Go to the documentation of this file.
1/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2/*
3 * This file is part of the LibreOffice project.
4 *
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 *
9 * This file incorporates work covered by the following license notice:
10 *
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 */
19
20#include <sal/config.h>
21
22#include <string_view>
23
24#include <strings.hrc>
25#include <helpids.h>
26#include <iderid.hxx>
27
28#include "baside2.hxx"
29#include <baside3.hxx>
30#include <basidesh.hxx>
31#include <basobj.hxx>
32#include <iderdll.hxx>
33#include "iderdll2.hxx"
34
35#include <com/sun/star/script/XLibraryContainerPassword.hpp>
36#include <sal/log.hxx>
37#include <sfx2/dispatch.hxx>
38#include <sfx2/infobar.hxx>
39#include <sfx2/passwd.hxx>
40#include <sfx2/sfxsids.hrc>
41#include <sfx2/viewfrm.hxx>
42#include <svl/intitem.hxx>
43#include <svl/stritem.hxx>
44#include <svl/srchdefs.hxx>
45#include <utility>
46#include <vcl/commandevent.hxx>
47#include <vcl/event.hxx>
48#include <vcl/svapp.hxx>
49#include <vcl/weld.hxx>
50#include <tools/stream.hxx>
51#include <o3tl/hash_combine.hxx>
52
53namespace basctl
54{
55
56// ID used for the read-only infobar
57constexpr OUStringLiteral BASIC_IDE_READONLY_INFOBAR = u"readonly";
58
59using namespace ::com::sun::star::uno;
60using namespace ::com::sun::star;
61
62BaseWindow::BaseWindow( vcl::Window* pParent, ScriptDocument aDocument, OUString aLibName, OUString aName )
63 :Window( pParent, WinBits( WB_3DLOOK ) )
64 ,pShellHScrollBar( nullptr)
65 ,pShellVScrollBar( nullptr)
66 ,nStatus( 0)
67 ,m_aDocument(std::move( aDocument ))
68 ,m_aLibName(std::move( aLibName ))
69 ,m_aName(std::move( aName ))
70{
71}
72
74{
76}
77
79{
80 if (pShellVScrollBar && !pShellVScrollBar->isDisposed())
82 if (pShellHScrollBar && !pShellHScrollBar->isDisposed())
87}
88
90{
91 if ( pShellVScrollBar )
92 pShellVScrollBar->SetScrollHdl( LINK( this, BaseWindow, VertScrollHdl ) );
93 if ( pShellHScrollBar )
94 pShellHScrollBar->SetScrollHdl( LINK( this, BaseWindow, HorzScrollHdl ) );
95
96 // Show the read-only infobar if the module/dialog is read-only
98 if (IsReadOnly())
100
101 DoInit(); // virtual...
102}
103
105{
106}
107
109{
110 pShellHScrollBar = pHScroll;
111 pShellVScrollBar = pVScroll;
112}
113
115{
116 DoScroll(pShellVScrollBar);
117}
118
120{
121 DoScroll(pShellHScrollBar);
122}
123
125{
126}
127
129{
130}
131
133{
134 bool bDone = false;
135
136 if ( rNEvt.GetType() == NotifyEventType::KEYINPUT )
137 {
138 KeyEvent aKEvt = *rNEvt.GetKeyEvent();
139 vcl::KeyCode aCode = aKEvt.GetKeyCode();
140 sal_uInt16 nCode = aCode.GetCode();
141
142 switch ( nCode )
143 {
144 case KEY_PAGEUP:
145 case KEY_PAGEDOWN:
146 {
147 if ( aCode.IsMod1() )
148 {
149 if (Shell* pShell = GetShell())
150 pShell->NextPage( nCode == KEY_PAGEUP );
151 bDone = true;
152 }
153 }
154 break;
155 }
156 }
157
158 return bDone || Window::EventNotify( rNEvt );
159}
160
162{
163 if (bVisible)
164 {
166 {
167 pShellHScrollBar->Enable();
168 pShellHScrollBar->Show();
169 }
171 {
172 pShellVScrollBar->Enable();
173 pShellVScrollBar->Show();
174 }
175 }
176 else
177 {
179 {
180 pShellHScrollBar->Disable();
181 pShellHScrollBar->Hide();
182 }
184 {
185 pShellVScrollBar->Disable();
186 pShellVScrollBar->Hide();
187 }
188 }
189}
190
192{
193}
194
196{
197}
198
200{
201 return true;
202}
203
205{
206}
207
209{
210 return OUString();
211}
212
214{
215 OUString aName;
216 if ( !m_aLibName.isEmpty() )
217 {
219 aName = m_aDocument.getTitle(eLocation) + "." + m_aLibName + "." +
220 GetTitle();
221 }
222 return aName;
223}
224
226{
227}
228
230{
231 return false;
232}
233
234// Show the read-only warning messages for module and dialog windows
236{
237 OUString aMsg;
238 if (dynamic_cast<ModulWindow*>(this))
239 aMsg = IDEResId(RID_STR_MODULE_READONLY);
240 else
241 aMsg = IDEResId(RID_STR_DIALOG_READONLY);
242
244 aMsg, InfobarType::INFO, true);
245}
246
248{
249}
250
252{
253}
254
256{
257 return true;
258}
259
261{
262 return nullptr;
263}
264
266{
267 return SearchOptionFlags::NONE;
268}
269
271{
272 return 0;
273}
274
276{ }
277
279{
281 pData->GetLibInfo().InsertInfo(m_aDocument, m_aLibName, m_aName, GetType());
282}
283
285 ScriptDocument const& rDocument,
286 std::u16string_view rLibName, std::u16string_view rName,
287 ItemType eType, bool bFindSuspended
288)
289{
290 if (bFindSuspended || !IsSuspended())
291 {
292 // any non-suspended window is ok
293 if (rLibName.empty() || rName.empty() || eType == TYPE_UNKNOWN)
294 return true;
295 // ok if the parameters match
296 if (m_aDocument == rDocument && m_aLibName == rLibName && m_aName == rName && GetType() == eType)
297 return true;
298 }
299 return false;
300}
301
303{
304 return false;
305}
306
307
308// DockingWindow
309
310
311// style bits for DockingWindow
315
316DockingWindow::DockingWindow(vcl::Window* pParent, const OUString& rUIXMLDescription, const OUString& rID)
317 : ResizableDockingWindow(pParent)
318 , m_xBuilder(Application::CreateInterimBuilder(m_xBox.get(), rUIXMLDescription, true))
319 , pLayout(nullptr)
320 , nShowCount(0)
321{
322 m_xContainer = m_xBuilder->weld_container(rID);
323}
324
326 : ResizableDockingWindow(pParent, StyleBits)
327 , pLayout(pParent)
328 , nShowCount(0)
329{ }
330
332{
333 disposeOnce();
334}
335
337{
338 m_xContainer.reset();
339 m_xBuilder.reset();
340 pLayout.clear();
342}
343
344// Sets the position and the size of the docking window. This property is saved
345// when the window is floating. Called by Layout.
346void DockingWindow::ResizeIfDocking (Point const& rPos, Size const& rSize)
347{
348 tools::Rectangle const rRect(rPos, rSize);
349 if (rRect != aDockingRect)
350 {
351 // saving the position and the size
352 aDockingRect = rRect;
353 // resizing if actually docking
354 if (!IsFloatingMode())
355 SetPosSizePixel(rPos, rSize);
356 }
357}
359{
361}
362
363// Sets the parent Layout window.
364// The physical parent is set only when the window is docking.
366{
367 pLayout = pLayout_;
368 if (!IsFloatingMode())
370
371}
372
373// Increases the "show" reference count.
374// The window is shown when the reference count is positive.
375void DockingWindow::Show (bool bShow) // = true
376{
377 if (bShow)
378 {
379 if (++nShowCount == 1)
381 }
382 else
383 {
384 if (--nShowCount == 0)
386 }
387}
388
389// Decreases the "show" reference count.
390// The window is hidden when the reference count reaches zero.
392{
393 Show(false);
394}
395
397{
398 if (aDockingRect.Contains(rPos))
399 {
401 return false; // dock
402 }
403 else // adjust old size
404 {
405 if (!aFloatingRect.IsEmpty())
407 return true; // float
408 }
409}
410
411void DockingWindow::EndDocking( const tools::Rectangle& rRect, bool bFloatMode )
412{
413 if ( bFloatMode )
414 ResizableDockingWindow::EndDocking( rRect, bFloatMode );
415 else
416 {
417 SetFloatingMode(false);
418 DockThis();
419 }
420}
421
423{
424 if (IsFloatingMode())
425 {
426 if (!aFloatingRect.IsEmpty())
430 );
431 }
432 DockThis();
433}
434
436{
437 if (IsFloatingMode())
438 {
439 // memorize position and size on the desktop...
443 );
444 }
445 return true;
446}
447
449{
450 if (IsFloatingMode())
451 {
455 );
456 }
457}
458
460{
461 // resizing when floating -> docking
462 if (!IsFloatingMode())
463 {
464 Point const aPos = aDockingRect.TopLeft();
465 Size const aSize = aDockingRect.GetSize();
466 if (aSize != GetSizePixel() || aPos != GetPosPixel())
467 SetPosSizePixel(aPos, aSize);
468 }
469
470 if (pLayout)
471 {
472 if (!IsFloatingMode() && GetParent() != pLayout)
474 pLayout->ArrangeWindows();
475 }
476}
477
479 ::TabBar( pParent, WinBits( WB_3DLOOK | WB_SCROLL | WB_BORDER | WB_DRAG ) )
480{
482
484}
485
487{
488 if ( rMEvt.IsLeft() && ( rMEvt.GetClicks() == 2 ) && !IsInEditMode() )
489 {
490 if (SfxDispatcher* pDispatcher = GetDispatcher())
491 pDispatcher->Execute( SID_BASICIDE_MODULEDLG );
492 }
493 else
494 {
495 ::TabBar::MouseButtonDown( rMEvt ); // base class version
496 }
497}
498
499void TabBar::Command( const CommandEvent& rCEvt )
500{
501 if ( ( rCEvt.GetCommand() == CommandEventId::ContextMenu ) && !IsInEditMode() )
502 {
503 Point aPos( rCEvt.IsMouseEvent() ? rCEvt.GetMousePosPixel() : Point(1,1) );
504 if ( rCEvt.IsMouseEvent() ) // select right tab
505 {
506 Point aP = PixelToLogic( aPos );
507 MouseEvent aMouseEvent( aP, 1, MouseEventModifiers::SIMPLECLICK, MOUSE_LEFT );
508 ::TabBar::MouseButtonDown( aMouseEvent ); // base class
509 }
510 if (SfxDispatcher* pDispatcher = GetDispatcher())
511 pDispatcher->ExecutePopup("tabbar", this, &aPos);
512 }
513}
514
516{
517 bool const bValid = IsValidSbxName(GetEditText());
518
519 if ( !bValid )
520 {
521 std::unique_ptr<weld::MessageDialog> xError(Application::CreateMessageDialog(GetFrameWeld(),
522 VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_BADSBXNAME)));
523 xError->run();
524 }
525
526 return bValid ? TABBAR_RENAMING_YES : TABBAR_RENAMING_NO;
527}
528
529
531{
532 if ( !IsEditModeCanceled() )
533 {
534 SfxUInt16Item aID( SID_BASICIDE_ARG_TABID, GetEditPageId() );
535 SfxStringItem aNewName( SID_BASICIDE_ARG_MODULENAME, GetEditText() );
536 if (SfxDispatcher* pDispatcher = GetDispatcher())
537 pDispatcher->ExecuteList( SID_BASICIDE_NAMECHANGEDONTAB,
538 SfxCallMode::SYNCHRON, { &aID, &aNewName });
539 }
540}
541
542
543namespace
544{
545
546// helper class for sorting TabBar
547struct TabBarSortHelper
548{
549 sal_uInt16 nPageId;
550 OUString aPageText;
551
552 bool operator < (TabBarSortHelper const& rComp) const
553 {
554 return aPageText.compareToIgnoreAsciiCase(rComp.aPageText) < 0;
555 }
556};
557
558} // namespace
559
561{
562 Shell* pShell = GetShell();
563 if (!pShell)
564 return;
565
566 Shell::WindowTable& aWindowTable = pShell->GetWindowTable();
567 TabBarSortHelper aTabBarSortHelper;
568 std::vector<TabBarSortHelper> aModuleList;
569 std::vector<TabBarSortHelper> aDialogList;
570 sal_uInt16 nPageCount = GetPageCount();
571 sal_uInt16 i;
572
573 // create module and dialog lists for sorting
574 for ( i = 0; i < nPageCount; i++)
575 {
576 sal_uInt16 nId = GetPageId( i );
577 aTabBarSortHelper.nPageId = nId;
578 aTabBarSortHelper.aPageText = GetPageText( nId );
579 BaseWindow* pWin = aWindowTable[ nId ].get();
580
581 if (dynamic_cast<ModulWindow*>(pWin))
582 {
583 aModuleList.push_back( aTabBarSortHelper );
584 }
585 else if (dynamic_cast<DialogWindow*>(pWin))
586 {
587 aDialogList.push_back( aTabBarSortHelper );
588 }
589 }
590
591 // sort module and dialog lists by page text
592 std::sort( aModuleList.begin() , aModuleList.end() );
593 std::sort( aDialogList.begin() , aDialogList.end() );
594
595
596 sal_uInt16 nModules = sal::static_int_cast<sal_uInt16>( aModuleList.size() );
597 sal_uInt16 nDialogs = sal::static_int_cast<sal_uInt16>( aDialogList.size() );
598
599 // move module pages to new positions
600 for (i = 0; i < nModules; i++)
601 {
602 MovePage( aModuleList[i].nPageId , i );
603 }
604
605 // move dialog pages to new positions
606 for (i = 0; i < nDialogs; i++)
607 {
608 MovePage( aDialogList[i].nPageId , nModules + i );
609 }
610}
611
612void CutLines( OUString& rStr, sal_Int32 nStartLine, sal_Int32 nLines )
613{
614 sal_Int32 nStartPos = 0;
615 sal_Int32 nLine = 0;
616 while ( nLine < nStartLine )
617 {
618 nStartPos = searchEOL( rStr, nStartPos );
619 if( nStartPos == -1 )
620 break;
621 nStartPos++; // not the \n.
622 nLine++;
623 }
624
625 SAL_WARN_IF( nStartPos == -1, "basctl.basicide", "CutLines: Start line not found!" );
626
627 if ( nStartPos == -1 )
628 return;
629
630 sal_Int32 nEndPos = nStartPos;
631
632 for ( sal_Int32 i = 0; i < nLines; i++ )
633 nEndPos = searchEOL( rStr, nEndPos+1 );
634
635 if ( nEndPos == -1 ) // might happen at the last line
636 nEndPos = rStr.getLength();
637 else
638 nEndPos++;
639
640 rStr = OUString::Concat(rStr.subView( 0, nStartPos )) + rStr.subView( nEndPos );
641
642 // erase trailing empty lines
643 {
644 sal_Int32 n = nStartPos;
645 sal_Int32 nLen = rStr.getLength();
646 while ( ( n < nLen ) && ( rStr[ n ] == LINE_SEP ||
647 rStr[ n ] == LINE_SEP_CR ) )
648 {
649 n++;
650 }
651
652 if ( n > nStartPos )
653 {
654 rStr = OUString::Concat(rStr.subView( 0, nStartPos )) + rStr.subView( n );
655 }
656 }
657}
658
659sal_uInt32 CalcLineCount( SvStream& rStream )
660{
661 sal_uInt32 nLFs = 0;
662 sal_uInt32 nCRs = 0;
663 char c;
664
665 rStream.Seek( 0 );
666 rStream.ReadChar( c );
667 while ( !rStream.eof() )
668 {
669 if ( c == '\n' )
670 nLFs++;
671 else if ( c == '\r' )
672 nCRs++;
673 rStream.ReadChar( c );
674 }
675
676 rStream.Seek( 0 );
677 if ( nLFs > nCRs )
678 return nLFs;
679 return nCRs;
680}
681
682
683// LibInfo
684
685
687{ }
688
690{ }
691
693 ScriptDocument const& rDocument,
694 OUString const& rLibName,
695 OUString const& rCurrentName,
696 ItemType eCurrentType
697)
698{
699 Key aKey(rDocument, rLibName);
700 m_aMap.erase(aKey);
701 m_aMap.emplace(aKey, Item(rCurrentName, eCurrentType));
702}
703
705{
706 Map::iterator it = std::find_if(m_aMap.begin(), m_aMap.end(),
707 [&rDocument](Map::reference rEntry) { return rEntry.first.GetDocument() == rDocument; });
708 if (it != m_aMap.end())
709 m_aMap.erase(it);
710}
711
713 ScriptDocument const& rDocument, OUString const& rLibName
714)
715{
716 Map::iterator it = m_aMap.find(Key(rDocument, rLibName));
717 return it != m_aMap.end() ? &it->second : nullptr;
718}
719
721 m_aDocument(std::move(aDocument)), m_aLibName(std::move(aLibName))
722{ }
723
724bool LibInfo::Key::operator == (Key const& rKey) const
725{
726 return m_aDocument == rKey.m_aDocument && m_aLibName == rKey.m_aLibName;
727}
728
729size_t LibInfo::Key::Hash::operator () (Key const& rKey) const
730{
731 std::size_t seed = 0;
733 o3tl::hash_combine(seed, rKey.m_aLibName.hashCode());
734 return seed;
735}
736
738 OUString aCurrentName,
739 ItemType eCurrentType
740) :
741 m_aCurrentName(std::move(aCurrentName)),
742 m_eCurrentType(eCurrentType)
743{ }
744
745static bool QueryDel(std::u16string_view rName, const OUString &rStr, weld::Widget* pParent)
746{
747 OUString aName = OUString::Concat("\'") + rName + "\'";
748 OUString aQuery = rStr.replaceAll("XX", aName);
749 std::unique_ptr<weld::MessageDialog> xQueryBox(Application::CreateMessageDialog(pParent,
750 VclMessageType::Question, VclButtonsType::YesNo, aQuery));
751 return (xQueryBox->run() == RET_YES);
752}
753
754bool QueryDelMacro( std::u16string_view rName, weld::Widget* pParent )
755{
756 return QueryDel( rName, IDEResId( RID_STR_QUERYDELMACRO ), pParent );
757}
758
759bool QueryReplaceMacro( std::u16string_view rName, weld::Widget* pParent )
760{
761 return QueryDel( rName, IDEResId( RID_STR_QUERYREPLACEMACRO ), pParent );
762}
763
764bool QueryDelDialog( std::u16string_view rName, weld::Widget* pParent )
765{
766 return QueryDel( rName, IDEResId( RID_STR_QUERYDELDIALOG ), pParent );
767}
768
769bool QueryDelLib( std::u16string_view rName, bool bRef, weld::Widget* pParent )
770{
771 return QueryDel( rName, IDEResId( bRef ? RID_STR_QUERYDELLIBREF : RID_STR_QUERYDELLIB ), pParent );
772}
773
774bool QueryDelModule( std::u16string_view rName, weld::Widget* pParent )
775{
776 return QueryDel( rName, IDEResId( RID_STR_QUERYDELMODULE ), pParent );
777}
778
779bool QueryPassword(weld::Widget* pDialogParent, const Reference< script::XLibraryContainer >& xLibContainer, const OUString& rLibName, OUString& rPassword, bool bRepeat, bool bNewTitle)
780{
781 bool bOK = false;
782 sal_uInt16 nRet = 0;
783
784 do
785 {
786 // password dialog
787 SfxPasswordDialog aDlg(pDialogParent);
788 aDlg.SetMinLen(1);
789
790 // set new title
791 if ( bNewTitle )
792 {
793 OUString aTitle(IDEResId(RID_STR_ENTERPASSWORD));
794 aTitle = aTitle.replaceAll("XX", rLibName);
795 aDlg.set_title(aTitle);
796 }
797
798 // execute dialog
799 nRet = aDlg.run();
800
801 // verify password
802 if ( nRet == RET_OK )
803 {
804 if ( xLibContainer.is() && xLibContainer->hasByName( rLibName ) )
805 {
806 Reference< script::XLibraryContainerPassword > xPasswd( xLibContainer, UNO_QUERY );
807 if ( xPasswd.is() && xPasswd->isLibraryPasswordProtected( rLibName ) && !xPasswd->isLibraryPasswordVerified( rLibName ) )
808 {
809 rPassword = aDlg.GetPassword();
810 bOK = xPasswd->verifyLibraryPassword( rLibName, rPassword );
811
812 if ( !bOK )
813 {
814 std::unique_ptr<weld::MessageDialog> xErrorBox(Application::CreateMessageDialog(pDialogParent,
815 VclMessageType::Warning, VclButtonsType::Ok, IDEResId(RID_STR_WRONGPASSWORD)));
816 xErrorBox->run();
817 }
818 }
819 }
820 }
821 }
822 while ( bRepeat && !bOK && nRet == RET_OK );
823
824 return bOK;
825}
826
827
828} // namespace basctl
829
830/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
ScriptDocument aDocument
Definition: basobj2.cxx:194
OUString aPageText
Definition: bastypes.cxx:550
sal_uInt16 nPageId
Definition: bastypes.cxx:549
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
bool IsMouseEvent() const
Point GetPosPixel() const override
bool IsFloatingMode() const
void SetFloatingMode(bool bFloatMode)
Size GetSizePixel() const override
virtual void EndDocking(const tools::Rectangle &rRect, bool bFloatMode)
const vcl::KeyCode & GetKeyCode() const
sal_uInt16 GetClicks() const
bool IsLeft() const
const KeyEvent * GetKeyEvent() const
NotifyEventType GetType() const
virtual void dispose() override
OUString GetPassword() const
virtual short run() override
void SetMinLen(sal_uInt16 Len)
void RemoveInfoBar(std::u16string_view sId)
VclPtr< SfxInfoBarWindow > AppendInfoBar(const OUString &sId, const OUString &sPrimaryMessage, const OUString &sSecondaryMessage, InfobarType aInfobarType, bool bShowCloseButton=true)
SfxViewFrame & GetViewFrame() const
bool eof() const
SvStream & ReadChar(char &rChar)
sal_uInt64 Seek(sal_uInt64 nPos)
sal_uInt16 GetEditPageId() const
bool IsInEditMode() const
void MovePage(sal_uInt16 nPageId, sal_uInt16 nNewPos)
const OUString & GetEditText() const
void EnableEditMode()
bool IsEditModeCanceled() const
OUString GetPageText(sal_uInt16 nPageId) const
sal_uInt16 GetPageCount() const
sal_uInt16 GetPageId(sal_uInt16 nPos) const
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
void clear()
virtual bool AllowUndo()
Definition: bastypes.cxx:199
virtual void BasicStopped()
Definition: bastypes.cxx:251
virtual ItemType GetType() const =0
virtual bool IsReadOnly()
Definition: bastypes.cxx:229
virtual OUString GetTitle()
Definition: bastypes.cxx:208
void GrabScrollBars(ScrollAdaptor *pHScroll, ScrollAdaptor *pVScroll)
Definition: bastypes.cxx:108
virtual void dispose() override
Definition: bastypes.cxx:78
virtual void DoScroll(Scrollable *pCurScrollBar)
Definition: bastypes.cxx:191
ScriptDocument m_aDocument
Definition: bastypes.hxx:166
virtual void SetReadOnly(bool bReadOnly)
Definition: bastypes.cxx:225
OUString CreateQualifiedName()
Definition: bastypes.cxx:213
VclPtr< ScrollAdaptor > pShellHScrollBar
Definition: bastypes.hxx:159
void ShowShellScrollBars(bool bVisible=true)
Definition: bastypes.cxx:161
VclPtr< ScrollAdaptor > pShellVScrollBar
Definition: bastypes.hxx:160
virtual SearchOptionFlags GetSearchOptions()
Definition: bastypes.cxx:265
virtual void UpdateData()
Definition: bastypes.cxx:204
virtual bool HasActiveEditor() const
Definition: bastypes.cxx:302
virtual void ExecuteGlobal(SfxRequest &)
Definition: bastypes.cxx:128
virtual void DoInit()
Definition: bastypes.cxx:104
virtual void ExecuteCommand(SfxRequest &)
Definition: bastypes.cxx:124
virtual bool IsModified()
Definition: bastypes.cxx:255
virtual bool EventNotify(NotifyEvent &rNEvt) override
Definition: bastypes.cxx:132
BaseWindow(vcl::Window *pParent, ScriptDocument aDocument, OUString aLibName, OUString aName)
Definition: bastypes.cxx:62
OUString m_aLibName
Definition: bastypes.hxx:167
void ShowReadOnlyInfoBar()
Definition: bastypes.cxx:235
virtual SfxUndoManager * GetUndoManager()
Definition: bastypes.cxx:260
virtual void OnNewDocument()
Definition: bastypes.cxx:275
virtual void StoreData()
Definition: bastypes.cxx:195
virtual void BasicStarted()
Definition: bastypes.cxx:247
bool IsSuspended() const
Definition: bastypes.hxx:229
virtual ~BaseWindow() override
Definition: bastypes.cxx:73
void InsertLibInfo() const
Definition: bastypes.cxx:278
virtual sal_uInt16 StartSearchAndReplace(SvxSearchItem const &, bool bFromStart=false)
Definition: bastypes.cxx:270
bool Is(ScriptDocument const &, std::u16string_view, std::u16string_view, ItemType, bool bFindSuspended)
Definition: bastypes.cxx:284
virtual void StartDocking() override
Definition: bastypes.cxx:448
static WinBits const StyleBits
Definition: bastypes.hxx:118
virtual void ToggleFloatingMode() override
Definition: bastypes.cxx:422
std::unique_ptr< weld::Container > m_xContainer
Definition: bastypes.hxx:106
void SetLayoutWindow(Layout *)
Definition: bastypes.cxx:365
virtual bool Docking(const Point &rPos, tools::Rectangle &rRect) override
Definition: bastypes.cxx:396
virtual ~DockingWindow() override
Definition: bastypes.cxx:331
tools::Rectangle aFloatingRect
Definition: bastypes.hxx:110
virtual bool PrepareToggleFloatingMode() override
Definition: bastypes.cxx:435
std::unique_ptr< weld::Builder > m_xBuilder
Definition: bastypes.hxx:105
virtual void EndDocking(const tools::Rectangle &rRect, bool bFloatMode) override
Definition: bastypes.cxx:411
void Show(bool=true)
Definition: bastypes.cxx:375
void ResizeIfDocking(Point const &, Size const &)
Definition: bastypes.cxx:346
VclPtr< Layout > pLayout
Definition: bastypes.hxx:114
tools::Rectangle aDockingRect
Definition: bastypes.hxx:112
virtual void dispose() override
Definition: bastypes.cxx:336
Item(OUString aCurrentName, ItemType eCurrentType)
Definition: bastypes.cxx:737
Key(ScriptDocument, OUString aLibName)
Definition: bastypes.cxx:720
bool operator==(Key const &) const
Definition: bastypes.cxx:724
ScriptDocument m_aDocument
Definition: bastypes.hxx:263
void InsertInfo(ScriptDocument const &, OUString const &rLibName, OUString const &rCurrentName, ItemType eCurrentType)
Definition: bastypes.cxx:692
Item const * GetInfo(ScriptDocument const &, OUString const &rLibName)
Definition: bastypes.cxx:712
void RemoveInfoFor(ScriptDocument const &)
Definition: bastypes.cxx:704
encapsulates a document which contains Basic scripts and dialogs
OUString getTitle(LibraryLocation _eLocation, LibraryType _eType=LibraryType::All) const
returns the title for the document
sal_Int32 hashCode() const
retrieves a (pretty simple) hash code for the document
LibraryLocation getLibraryLocation(const OUString &_rLibName) const
returns the location of a library given by name
std::map< sal_uInt16, VclPtr< BaseWindow > > WindowTable
Definition: basidesh.hxx:63
WindowTable & GetWindowTable()
Definition: basidesh.hxx:167
virtual void Command(const CommandEvent &rCEvt) override
Definition: bastypes.cxx:499
TabBar(vcl::Window *pParent)
Definition: bastypes.cxx:478
virtual void EndRenaming() override
Definition: bastypes.cxx:530
virtual TabBarAllowRenamingReturnCode AllowRenaming() override
Definition: bastypes.cxx:515
virtual void MouseButtonDown(const MouseEvent &rMEvt) override
Definition: bastypes.cxx:486
bool Contains(const Point &rPOINT) const
void SetSize(const Size &)
constexpr Point TopLeft() const
constexpr Size GetSize() const
constexpr bool IsEmpty() const
bool IsMod1() const
sal_uInt16 GetCode() const
Point OutputToScreenPixel(const Point &rPos) const
virtual void dispose() override
vcl::Window * GetParent() const
friend friend class DockingWindow
void SetParent(vcl::Window *pNewParent)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
Point ScreenToOutputPixel(const Point &rPos) const
virtual void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize)
weld::Window * GetFrameWeld(const SfxFrame *pFrame)
virtual void SetHelpId(const OUString &) override
float u
#define MOUSE_LEFT
DocumentType eType
constexpr OUStringLiteral HID_BASICIDE_TABBAR
Definition: helpids.h:34
OUString aName
sal_Int64 n
constexpr sal_uInt16 KEY_PAGEDOWN
constexpr sal_uInt16 KEY_PAGEUP
#define SAL_WARN_IF(condition, area, stream)
std::unique_ptr< sal_Int32[]> pData
constexpr auto LINE_SEP_CR
Definition: bastypes.hxx:53
bool QueryReplaceMacro(std::u16string_view rName, weld::Widget *pParent)
Definition: bastypes.cxx:759
static bool QueryDel(std::u16string_view rName, const OUString &rStr, weld::Widget *pParent)
Definition: bastypes.cxx:745
bool QueryDelLib(std::u16string_view rName, bool bRef, weld::Widget *pParent)
Definition: bastypes.cxx:769
bool IsValidSbxName(std::u16string_view rName)
Definition: basobj2.cxx:81
bool QueryPassword(weld::Widget *pDialogParent, const Reference< script::XLibraryContainer > &xLibContainer, const OUString &rLibName, OUString &rPassword, bool bRepeat, bool bNewTitle)
Definition: bastypes.cxx:779
sal_Int32 searchEOL(std::u16string_view rStr, sal_Int32 fromIndex)
Definition: baside2b.cxx:1008
ExtraData * GetExtraData()
Definition: iderdll.cxx:101
Shell * GetShell()
Definition: iderdll.cxx:80
constexpr auto LINE_SEP
Definition: bastypes.hxx:54
SfxDispatcher * GetDispatcher()
Definition: basobj3.cxx:454
sal_uInt32 CalcLineCount(SvStream &rStream)
Definition: bastypes.cxx:659
bool QueryDelMacro(std::u16string_view rName, weld::Widget *pParent)
Definition: bastypes.cxx:754
bool QueryDelDialog(std::u16string_view rName, weld::Widget *pParent)
Definition: bastypes.cxx:764
IMPL_LINK_NOARG(EditorWindow, SetSourceInBasicHdl, void *, void)
Definition: baside2b.cxx:987
ItemType
Definition: sbxitem.hxx:28
@ TYPE_UNKNOWN
Definition: sbxitem.hxx:29
OUString IDEResId(TranslateId aId)
Definition: iderdll.cxx:108
void CutLines(OUString &rStr, sal_Int32 nStartLine, sal_Int32 nLines)
Definition: bastypes.cxx:612
bool QueryDelModule(std::u16string_view rName, weld::Widget *pParent)
Definition: bastypes.cxx:774
constexpr OUStringLiteral BASIC_IDE_READONLY_INFOBAR
Definition: bastypes.cxx:57
int i
std::enable_if_t<(sizeof(N)==4)> hash_combine(N &nSeed, T const *pValue, size_t nCount)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)
sal_Int16 nId
OUString m_aName
SearchOptionFlags
size_t operator()(Key const &) const
Definition: bastypes.cxx:729
TabBarAllowRenamingReturnCode
TABBAR_RENAMING_NO
TABBAR_RENAMING_YES
bool bVisible
RET_OK
RET_YES
sal_Int64 WinBits
WinBits const WB_MOVEABLE
WinBits const WB_DOCKABLE
WinBits const WB_DRAG
WinBits const WB_SIZEABLE
WinBits const WB_3DLOOK
WinBits const WB_BORDER
WinBits const WB_SCROLL
WinBits const WB_CLIPCHILDREN