LibreOffice Module dbaccess (master) 1
TableWindow.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 <TableWindow.hxx>
22#include <TableWindowData.hxx>
23#include <imageprovider.hxx>
24#include <JoinController.hxx>
25#include <JoinTableView.hxx>
26#include <JoinDesignView.hxx>
27#include <osl/diagnose.h>
28#include <utility>
29#include <vcl/svapp.hxx>
30#include <vcl/settings.hxx>
31#include <vcl/commandevent.hxx>
32#include <vcl/event.hxx>
33#include <vcl/ptrstyle.hxx>
34#include <vcl/wall.hxx>
35#include <vcl/weldutils.hxx>
37
38#include <com/sun/star/container/XContainer.hpp>
39#include <com/sun/star/container/XNameAccess.hpp>
40#include <com/sun/star/beans/XPropertySet.hpp>
41#include <com/sun/star/sdb/application/DatabaseObject.hpp>
42#include <bitmaps.hlst>
43#include <TableWindowAccess.hxx>
45
46using namespace dbaui;
47using namespace ::utl;
48using namespace ::com::sun::star;
49using namespace ::com::sun::star::sdb;
50using namespace ::com::sun::star::sdbc;
51using namespace ::com::sun::star::sdbcx;
52using namespace ::com::sun::star::uno;
53using namespace ::com::sun::star::beans;
54using namespace ::com::sun::star::container;
55using namespace ::com::sun::star::lang;
56using namespace ::com::sun::star::accessibility;
57
58namespace DatabaseObject = css::sdb::application::DatabaseObject;
59
60#define TABWIN_SIZING_AREA 4
61#define TABWIN_WIDTH_MIN 90
62#define TABWIN_HEIGHT_MIN 80
63
64namespace {
65
66void Draw3DBorder(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
67{
68 // Use the System Style-Settings for my colours
70
71 // Black lines for bottom and right
72 rRenderContext.SetLineColor(aSystemStyle.GetDarkShadowColor());
73 rRenderContext.DrawLine(rRect.BottomLeft(), rRect.BottomRight());
74 rRenderContext.DrawLine(rRect.BottomRight(), rRect.TopRight());
75
76 // Dark grey lines over the black lines
77 rRenderContext.SetLineColor(aSystemStyle.GetShadowColor());
78 Point aEHvector(1, 1);
79 rRenderContext.DrawLine(rRect.BottomLeft() + Point(1, -1), rRect.BottomRight() - aEHvector);
80 rRenderContext.DrawLine(rRect.BottomRight() - aEHvector, rRect.TopRight() + Point(-1, 1));
81
82 // Light grey lines for top and left
83 rRenderContext.SetLineColor(aSystemStyle.GetLightColor());
84 rRenderContext.DrawLine(rRect.BottomLeft() + Point(1, -2), rRect.TopLeft() + aEHvector);
85 rRenderContext.DrawLine(rRect.TopLeft() + aEHvector, rRect.TopRight() + Point(-2, 1));
86}
87
88}
89
90OTableWindow::OTableWindow( vcl::Window* pParent, TTableWindowData::value_type pTabWinData )
92 , Window( pParent, WB_3DLOOK|WB_MOVEABLE )
93 , m_xTitle( VclPtr<OTableWindowTitle>::Create(this) )
94 , m_pData(std::move( pTabWinData ))
95 , m_nMoveCount(0)
96 , m_nMoveIncrement(1)
97 , m_nSizingFlags( SizingFlags::NONE )
98{
99 // Set position and size
100 if( GetData()->HasPosition() )
101 SetPosPixel( GetData()->GetPosition() );
102
103 if( GetData()->HasSize() )
104 SetSizePixel( GetData()->GetSize() );
105
106 // Set background
108 SetBackground(Wallpaper(aSystemStyle.GetFaceColor()));
109 // Set the text colour even though there is no text,
110 // because derived classes might need it
111 SetTextColor(aSystemStyle.GetButtonTextColor());
112
114}
115
117{
118 disposeOnce();
119}
120
122{
123 if (m_xListBox)
124 {
125 OSL_ENSURE(m_xListBox->get_widget().n_children()==0,"Forgot to call EmptyListbox()!");
126 }
127 m_xListBox.disposeAndClear();
128 if ( m_pContainerListener.is() )
129 m_pContainerListener->dispose();
130
131 m_xTitle.disposeAndClear();
133}
134
136{
137 OSL_ENSURE(static_cast<OJoinTableView*>(GetParent()),"No OJoinTableView!");
138 return static_cast<OJoinTableView*>(GetParent());
139}
140
142{
143 OSL_ENSURE(static_cast<OJoinTableView*>(GetParent()),"No OJoinTableView!");
144 return static_cast<OJoinTableView*>(GetParent());
145}
146
148{
149 OSL_ENSURE(static_cast<OJoinDesignView*>(GetParent()->GetParent()->GetParent()),"No OJoinDesignView!");
150 return static_cast<OJoinDesignView*>(GetParent()->GetParent()->GetParent());
151}
152
153void OTableWindow::SetPosPixel( const Point& rNewPos )
154{
155 Point aNewPosData = rNewPos + getTableView()->GetScrollOffset();
156 GetData()->SetPosition( aNewPosData );
157 Window::SetPosPixel( rNewPos );
158}
159
160void OTableWindow::SetSizePixel( const Size& rNewSize )
161{
162 Size aOutSize(rNewSize);
163 if( aOutSize.Width() < TABWIN_WIDTH_MIN )
164 aOutSize.setWidth( TABWIN_WIDTH_MIN );
165 if( aOutSize.Height() < TABWIN_HEIGHT_MIN )
166 aOutSize.setHeight( TABWIN_HEIGHT_MIN );
167
168 GetData()->SetSize( aOutSize );
169 Window::SetSizePixel( aOutSize );
170}
171
172void OTableWindow::SetPosSizePixel( const Point& rNewPos, const Size& rNewSize )
173{
174 SetPosPixel( rNewPos );
175 SetSizePixel( rNewSize );
176}
177
179{
180 clearListBox();
181 weld::TreeView& rTreeView = m_xListBox->get_widget();
182 assert(!rTreeView.n_children());
183
184 if ( !m_pContainerListener.is() )
185 {
186 Reference< XContainer> xContainer(m_pData->getColumns(),UNO_QUERY);
187 if ( xContainer.is() )
188 m_pContainerListener = new ::comphelper::OContainerListenerAdapter(this,xContainer);
189 }
190
191 // mark all primary keys with special image
192 OUString aPrimKeyImage(BMP_PRIMARY_KEY);
193
194 if (GetData()->IsShowAll())
195 {
196 rTreeView.append(weld::toId(createUserData(nullptr,false)), OUString("*"));
197 }
198
199 Reference<XNameAccess> xPKeyColumns;
200 try
201 {
202 xPKeyColumns = dbtools::getPrimaryKeyColumns_throw(m_pData->getTable());
203 }
204 catch(Exception&)
205 {
206 TOOLS_WARN_EXCEPTION( "dbaccess", "");
207 }
208 try
209 {
210 Reference< XNameAccess > xColumns = m_pData->getColumns();
211 if( xColumns.is() )
212 {
213 Sequence< OUString> aColumns = xColumns->getElementNames();
214 const OUString* pIter = aColumns.getConstArray();
215 const OUString* pEnd = pIter + aColumns.getLength();
216
217 for (; pIter != pEnd; ++pIter)
218 {
219 bool bPrimaryKeyColumn = xPKeyColumns.is() && xPKeyColumns->hasByName( *pIter );
220
221 OUString sId;
222 Reference<XPropertySet> xColumn(xColumns->getByName(*pIter),UNO_QUERY);
223 if (xColumn.is())
224 sId = weld::toId(createUserData(xColumn, bPrimaryKeyColumn));
225
226 rTreeView.append(sId, *pIter);
227
228 // is this column in the primary key
229 if ( bPrimaryKeyColumn )
230 rTreeView.set_image(rTreeView.n_children() - 1, aPrimKeyImage);
231 }
232
233 }
234 }
235 catch(Exception&)
236 {
237 TOOLS_WARN_EXCEPTION( "dbaccess", "");
238 }
239}
240
241void* OTableWindow::createUserData(const Reference< XPropertySet>& /*_xColumn*/,bool /*_bPrimaryKey*/)
242{
243 return nullptr;
244}
245
246void OTableWindow::deleteUserData(void*& _pUserData)
247{
248 OSL_ENSURE(!_pUserData,"INVALID call. Need to delete the userclass!");
249 _pUserData = nullptr;
250}
251
253{
254 if ( !m_xListBox )
255 return;
256
257 weld::TreeView& rTreeView = m_xListBox->get_widget();
258 rTreeView.all_foreach([this, &rTreeView](weld::TreeIter& rEntry){
259 void* pUserData = weld::fromId<void*>(rTreeView.get_id(rEntry));
260 deleteUserData(pUserData);
261 return false;
262 });
263
264 rTreeView.clear();
265}
266
268{
269 weld::Image& rImage = m_xTitle->GetImage();
270 ImageProvider aImageProvider( getDesignView()->getController().getConnection() );
271 rImage.set_from_icon_name(aImageProvider.getImageId(GetComposedName(), m_pData->isQuery() ? DatabaseObject::QUERY : DatabaseObject::TABLE));
272 rImage.show();
273}
274
276{
277 // create list box if necessary
278 if ( !m_xListBox )
279 {
281 assert(m_xListBox && "OTableWindow::Init() : CreateListBox returned NULL !");
282 m_xListBox->get_widget().set_selection_mode(SelectionMode::Multiple);
283 }
284
285 // Set the title
286 weld::Label& rLabel = m_xTitle->GetLabel();
287 rLabel.set_label(m_pData->GetWinName());
289 m_xTitle->Show();
290
291 m_xListBox->Show();
292
293 // add the fields to the ListBox
294 FillListBox();
295 m_xListBox->get_widget().unselect_all();
296
298
299 return true;
300}
301
303{
304 if (rDCEvt.GetType() == DataChangedEventType::SETTINGS)
305 {
306 // In the worst-case the colours have changed so
307 // adapt myself to the new colours
309 SetBackground(Wallpaper(aSystemStyle.GetFaceColor()));
310 SetTextColor(aSystemStyle.GetButtonTextColor());
311 }
312}
313
314void OTableWindow::Paint(vcl::RenderContext& rRenderContext, const tools::Rectangle& rRect)
315{
317 Window::Paint(rRenderContext, rRect);
318 Draw3DBorder(rRenderContext, aRect);
319}
320
321tools::Rectangle OTableWindow::getSizingRect(const Point& _rPos,const Size& _rOutputSize) const
322{
323 tools::Rectangle aSizingRect( GetPosPixel(), GetSizePixel() );
324
326 {
327 if( _rPos.Y() < 0 )
328 aSizingRect.SetTop( 0 );
329 else
330 aSizingRect.SetTop( _rPos.Y() );
331 }
332
334 {
335 if( _rPos.Y() > _rOutputSize.Height() )
336 aSizingRect.SetBottom( _rOutputSize.Height() );
337 else
338 aSizingRect.SetBottom( _rPos.Y() );
339 }
340
342 {
343 if( _rPos.X() > _rOutputSize.Width() )
344 aSizingRect.SetRight( _rOutputSize.Width() );
345 else
346 aSizingRect.SetRight( _rPos.X() );
347 }
348
350 {
351 if( _rPos.X() < 0 )
352 aSizingRect.SetLeft( 0 );
353 else
354 aSizingRect.SetLeft( _rPos.X() );
355 }
356 return aSizingRect;
357}
358
360{
361 Size aOutSize = GetOutputSizePixel();
362 // Set the flags when the mouse cursor is in the sizing area
364
365 if( _rPos.X() < TABWIN_SIZING_AREA )
367
368 if( _rPos.Y() < TABWIN_SIZING_AREA )
370
371 if( _rPos.X() > aOutSize.Width()-TABWIN_SIZING_AREA )
373
374 if( _rPos.Y() > aOutSize.Height()-TABWIN_SIZING_AREA )
376}
377
379{
380 Window::MouseMove(rEvt);
381
382 OJoinTableView* pCont = getTableView();
383 if (pCont->getDesignView()->getController().isReadOnly())
384 return;
385
386 Point aPos = rEvt.GetPosPixel();
387 setSizingFlag(aPos);
388 PointerStyle aPointer = PointerStyle::Arrow;
389
390 // Set the mouse cursor when it is in the sizing area
393 aPointer = PointerStyle::SSize;
394 else if ( m_nSizingFlags == SizingFlags::Left ||
396 aPointer = PointerStyle::ESize;
399 aPointer = PointerStyle::SESize;
402 aPointer = PointerStyle::NESize;
403
404 SetPointer( aPointer );
405}
406
408{
409 // When resizing, the parent must be informed that
410 // the window size of its child has changed
413
415}
416
418{
419 // The window must not disappear so we enforce a minimum size
420 Size aOutSize = GetOutputSizePixel();
421 aOutSize = Size(CalcZoom(aOutSize.Width()),CalcZoom(aOutSize.Height()));
422
423 tools::Long nTitleHeight = CalcZoom( GetTextHeight() )+ CalcZoom( 4 );
424
425 // Set the title and ListBox
426 tools::Long n5Pos = CalcZoom(5);
427 tools::Long nPositionX = n5Pos;
428 tools::Long nPositionY = n5Pos;
429
430 Size aPreferredSize = m_xTitle->get_preferred_size();
431 if (nTitleHeight < aPreferredSize.Height())
432 nTitleHeight = aPreferredSize.Height();
433
434 m_xTitle->SetPosSizePixel( Point( nPositionX, nPositionY ), Size( aOutSize.Width() - nPositionX - n5Pos, nTitleHeight ) );
435
436 tools::Long nTitleToList = CalcZoom( 3 );
437
438 m_xListBox->SetPosSizePixel(
439 Point( n5Pos, nPositionY + nTitleHeight + nTitleToList ),
440 Size( aOutSize.Width() - 2 * n5Pos, aOutSize.Height() - ( nPositionY + nTitleHeight + nTitleToList ) - n5Pos )
441 );
442
444}
445
447{
448 weld::Label& rLabel = m_xTitle->GetLabel();
449 vcl::Font aFont = rLabel.get_font();
450 aFont.SetWeight(bBold ? WEIGHT_BOLD : WEIGHT_NORMAL);
451 rLabel.set_font(aFont);
452}
453
455{
457 // we have to forward the focus to our listbox to enable keystrokes
458 if(m_xListBox)
459 m_xListBox->GrabFocus();
460}
461
462void OTableWindow::setActive(bool _bActive)
463{
464 SetBoldTitle( _bActive );
465 if (_bActive || !m_xListBox)
466 return;
467
468 weld::TreeView& rTreeView = m_xListBox->get_widget();
469 if (rTreeView.get_selected_index() != -1)
470 rTreeView.unselect_all();
471}
472
474{
475 // Delete the window
476 OJoinTableView* pTabWinCont = getTableView();
477 VclPtr<OTableWindow> aHoldSelf(this); // keep ourselves alive during the RemoveTabWin process
478 pTabWinCont->RemoveTabWin( this );
479 pTabWinCont->Invalidate();
480}
481
483{
484 return getTableView()->ExistsAConn(this);
485}
486
487void OTableWindow::EnumValidFields(std::vector< OUString>& arrstrFields)
488{
489 arrstrFields.clear();
490 weld::TreeView& rTreeView = m_xListBox->get_widget();
491
492 // This default implementation counts every item in the ListBox ... for any other behaviour it must be over-written
493 rTreeView.all_foreach([&rTreeView, &arrstrFields](weld::TreeIter& rEntry){
494 arrstrFields.push_back(rTreeView.get_text(rEntry));
495 return false;
496 });
497}
498
500{
502
503 // FIXME RenderContext
504
505 if ( nType != StateChangedType::Zoom )
506 return;
507
508 const StyleSettings& rStyleSettings = GetSettings().GetStyleSettings();
509
510 vcl::Font aFont = rStyleSettings.GetGroupFont();
511 if ( IsControlFont() )
512 aFont.Merge( GetControlFont() );
513 SetZoomedPointFont(*GetOutDev(), aFont);
514
515 m_xTitle->SetZoom(GetZoom());
516 m_xListBox->SetZoom(GetZoom());
517 Resize();
518 Invalidate();
519}
520
522{
523 return new OTableWindowAccess(this);
524}
525
527{
528 switch (rEvt.GetCommand())
529 {
530 case CommandEventId::ContextMenu:
531 {
532 OJoinController& rController = getDesignView()->getController();
533 if(!rController.isReadOnly() && rController.isConnected())
534 {
535 Point ptWhere;
536 if ( rEvt.IsMouseEvent() )
537 ptWhere = rEvt.GetMousePosPixel();
538 else
539 {
540 weld::TreeView& rTreeView = m_xListBox->get_widget();
541 std::unique_ptr<weld::TreeIter> xCurrent = rTreeView.make_iterator();
542 if (rTreeView.get_cursor(xCurrent.get()))
543 ptWhere = rTreeView.get_row_area(*xCurrent).Center();
544 else
545 ptWhere = m_xTitle->GetPosPixel();
546 }
547
548 ::tools::Rectangle aRect(ptWhere, Size(1, 1));
549 weld::Window* pPopupParent = weld::GetPopupParent(*this, aRect);
550 std::unique_ptr<weld::Builder> xBuilder(Application::CreateBuilder(pPopupParent, "dbaccess/ui/jointablemenu.ui"));
551 std::unique_ptr<weld::Menu> xContextMenu(xBuilder->weld_menu("menu"));
552 if (!xContextMenu->popup_at_rect(pPopupParent, aRect).isEmpty())
553 Remove();
554 }
555 break;
556 }
557 default:
558 Window::Command(rEvt);
559 }
560}
561
563{
564 bool bHandled = false;
565 switch (rNEvt.GetType())
566 {
567 case NotifyEventType::KEYINPUT:
568 {
569 if ( getDesignView()->getController().isReadOnly() )
570 break;
571
572 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
573 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
574 if ( rCode.IsMod1() )
575 {
576 Point aStartPoint = GetPosPixel();
577 if ( rCode.IsShift() )
578 {
579 aStartPoint.setX( GetSizePixel().Width() );
580 aStartPoint.setY( GetSizePixel().Height() );
581 }
582
583 switch( rCode.GetCode() )
584 {
585 case KEY_DOWN:
586 bHandled = true;
587 aStartPoint.AdjustY(m_nMoveIncrement );
588 break;
589 case KEY_UP:
590 bHandled = true;
591 aStartPoint.AdjustY(-m_nMoveIncrement );
592 break;
593 case KEY_LEFT:
594 bHandled = true;
595 aStartPoint.AdjustX(-m_nMoveIncrement );
596 break;
597 case KEY_RIGHT:
598 bHandled = true;
599 aStartPoint.AdjustX(m_nMoveIncrement );
600 break;
601 }
602 if ( bHandled )
603 {
604 if ( rCode.IsShift() )
605 {
606 OJoinTableView* pView = getTableView();
607 Point ptOld = GetPosPixel();
608 Size aSize = pView->getRealOutputSize();
609 Size aNewSize(aStartPoint.X(),aStartPoint.Y());
610 if ( ((ptOld.X() + aNewSize.Width()) <= aSize.Width())
611 && ((ptOld.Y() + aNewSize.Height()) <= aSize.Height()) )
612 {
613 if ( aNewSize.Width() < TABWIN_WIDTH_MIN )
614 aNewSize.setWidth( TABWIN_WIDTH_MIN );
615 if ( aNewSize.Height() < TABWIN_HEIGHT_MIN )
616 aNewSize.setHeight( TABWIN_HEIGHT_MIN );
617
618 Size szOld = GetSizePixel();
619
620 aNewSize = Size(pView->CalcZoom(aNewSize.Width()),pView->CalcZoom(aNewSize.Height()));
621 SetPosSizePixel( ptOld, aNewSize );
622 pView->TabWinSized(this, ptOld, szOld);
623 Invalidate( InvalidateFlags::NoChildren );
624 }
625 }
626 else
627 {
628 // remember how often the user moved our window
629 ++m_nMoveCount;
630 if( m_nMoveCount == 5 )
631 m_nMoveIncrement = 10;
632 else if( m_nMoveCount > 15 )
634
635 Point aOldDataPoint = GetData()->GetPosition();
636 Point aNewDataPoint = aStartPoint + getTableView()->GetScrollOffset();
637 if ( aNewDataPoint.X() > -1 && aNewDataPoint.Y() > -1 )
638 {
639 OJoinTableView* pView = getTableView();
640 if ( pView->isMovementAllowed(aNewDataPoint, GetData()->GetSize()) )
641 {
642 SetPosPixel(aStartPoint);
643
644 // aNewDataPoint can not be used here because SetPosPixel reset it
645 pView->EnsureVisible(GetData()->GetPosition(), GetData()->GetSize());
646 pView->TabWinMoved(this,aOldDataPoint);
647 Invalidate(InvalidateFlags::NoChildren);
648 getDesignView()->getController().setModified( true );
649 }
650 else
651 {
652 m_nMoveCount = 0; // reset our movement count
654 }
655 }
656 else
657 {
658 m_nMoveCount = 0; // reset our movement count
660 }
661 }
663 }
664 else
665 {
666 m_nMoveCount = 0; // reset our movement count
668 }
669 }
670 else
671 {
672 m_nMoveCount = 0; // reset our movement count
674 }
675 break;
676 }
677 case NotifyEventType::KEYUP:
678 {
679 const KeyEvent* pKeyEvent = rNEvt.GetKeyEvent();
680 const vcl::KeyCode& rCode = pKeyEvent->GetKeyCode();
681 sal_uInt16 nKeyCode = rCode.GetCode();
682 if ( rCode.IsMod2() && nKeyCode != KEY_UP && nKeyCode != KEY_DOWN && nKeyCode != KEY_LEFT && nKeyCode != KEY_RIGHT )
683 {
684 m_nMoveCount = 0; // reset our movement count
686 }
687 break;
688 }
689 default:
690 break;
691 }
692 if (!bHandled)
693 return Window::PreNotify(rNEvt);
694 return true;
695}
696
698{
699 return m_xTitle->GetLabel().get_label();
700}
701
702void OTableWindow::_elementInserted( const container::ContainerEvent& /*_rEvent*/ )
703{
704 FillListBox();
705}
706
707void OTableWindow::_elementRemoved( const container::ContainerEvent& /*_rEvent*/ )
708{
709 FillListBox();
710}
711
712void OTableWindow::_elementReplaced( const container::ContainerEvent& /*_rEvent*/ )
713{
714 FillListBox();
715}
716
717/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define TABWIN_HEIGHT_MIN
Definition: TableWindow.cxx:62
#define TABWIN_WIDTH_MIN
Definition: TableWindow.cxx:61
#define TABWIN_SIZING_AREA
Definition: TableWindow.cxx:60
SizingFlags
Definition: TableWindow.hxx:35
const StyleSettings & GetStyleSettings() const
static const AllSettings & GetSettings()
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
bool IsMouseEvent() const
DataChangedEventType GetType() const
const vcl::KeyCode & GetKeyCode() const
const Point & GetPosPixel() const
const KeyEvent * GetKeyEvent() const
NotifyEventType GetType() const
void DrawLine(const Point &rStartPt, const Point &rEndPt)
void SetLineColor()
constexpr tools::Long Y() const
void setX(tools::Long nX)
void setY(tools::Long nY)
tools::Long AdjustY(tools::Long nVertMove)
tools::Long AdjustX(tools::Long nHorzMove)
constexpr tools::Long X() const
constexpr tools::Long Height() const
void setWidth(tools::Long nWidth)
void setHeight(tools::Long nHeight)
constexpr tools::Long Width() const
const Color & GetDarkShadowColor() const
const Color & GetShadowColor() const
const vcl::Font & GetGroupFont() const
const Color & GetLightColor() const
const Color & GetFaceColor() const
const Color & GetButtonTextColor() const
static VclPtr< reference_type > Create(Arg &&... arg)
OJoinController & getController() const
void TabWinMoved(OTableWindow *ptWhich, const Point &ptOldPosition)
Hook that is called after moving/resizing TabWins.
const Point & GetScrollOffset() const
void TabWinSized(OTableWindow *ptWhich, const Point &ptOldPosition, const Size &szOldSize)
virtual void EnsureVisible(const OTableWindow *_pWin)
bool ExistsAConn(const OTableWindow *pFromWin) const
void BeginChildSizing(OTableWindow *pTabWin, PointerStyle nPointer)
OJoinDesignView * getDesignView() const
const Size & getRealOutputSize() const
bool isMovementAllowed(const Point &_rPoint, const Size &_rSize)
check if the given window is visible.
virtual void RemoveTabWin(OTableWindow *pTabWin)
the class OTableWindowAccess represents the accessible object for table windows like they are used in...
virtual void deleteUserData(void *&_pUserData)
delete the user data with the equal type as created within createUserData
OJoinDesignView * getDesignView()
TTableWindowData::value_type m_pData
Definition: TableWindow.hxx:66
OJoinTableView * getTableView()
bool ExistsAConn() const
virtual ~OTableWindow() override
virtual void dispose() override
sal_Int32 m_nMoveCount
Definition: TableWindow.hxx:69
const TTableWindowData::value_type & GetData() const
tools::Rectangle getSizingRect(const Point &_rPos, const Size &_rOutputSize) const
returns the new sizing
void SetPosPixel(const Point &rNewPos) override
void SetBoldTitle(bool bBold)
virtual css::uno::Reference< css::accessibility::XAccessible > CreateAccessible() override
void clearListBox()
clears the listbox inside.
virtual void Command(const CommandEvent &rEvt) override
virtual void StateChanged(StateChangedType nStateChange) override
virtual void _elementInserted(const css::container::ContainerEvent &_rEvent) override
void SetSizePixel(const Size &rNewSize) override
sal_Int32 m_nMoveIncrement
Definition: TableWindow.hxx:70
void impl_updateImage()
updates image
virtual void DataChanged(const DataChangedEvent &rDCEvt) override
virtual void * createUserData(const css::uno::Reference< css::beans::XPropertySet > &_xColumn, bool _bPrimaryKey)
creates user information that will be append at the ListBoxentry
virtual bool Init()
virtual void _elementRemoved(const css::container::ContainerEvent &_rEvent) override
virtual void MouseMove(const MouseEvent &rEvt) override
VclPtr< OTableWindowListBox > m_xListBox
Definition: TableWindow.hxx:62
OUString getTitle() const
virtual void GetFocus() override
void setActive(bool _bActive=true)
virtual void _elementReplaced(const css::container::ContainerEvent &_rEvent) override
::rtl::Reference< comphelper::OContainerListenerAdapter > m_pContainerListener
Definition: TableWindow.hxx:68
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void MouseButtonDown(const MouseEvent &rEvt) override
void EnumValidFields(std::vector< OUString > &arrstrFields)
virtual void Resize() override
void SetPosSizePixel(const Point &rNewPos, const Size &rNewSize) override
OUString const & GetComposedName() const
void setSizingFlag(const Point &_rPos)
set the sizing flag to the direction
VclPtr< OTableWindowTitle > m_xTitle
Definition: TableWindow.hxx:61
virtual bool PreNotify(NotifyEvent &rNEvt) override
SizingFlags m_nSizingFlags
Definition: TableWindow.hxx:71
constexpr Point Center() const
constexpr void SetLeft(tools::Long v)
constexpr void SetTop(tools::Long v)
constexpr Point TopLeft() const
constexpr void SetRight(tools::Long v)
constexpr void SetBottom(tools::Long v)
constexpr Point BottomRight() const
constexpr Point TopRight() const
constexpr Point BottomLeft() const
void Merge(const Font &rFont)
void SetWeight(FontWeight)
bool IsMod1() const
sal_uInt16 GetCode() const
bool IsShift() const
bool IsMod2() const
virtual void dispose() override
virtual void GetFocus()
vcl::Window * GetParent() const
virtual void StateChanged(StateChangedType nStateChange)
bool IsControlFont() const
void SetZoomedPointFont(vcl::RenderContext &rRenderContext, const vcl::Font &rFont)
virtual void SetSizePixel(const Size &rNewSize)
virtual void Command(const CommandEvent &rCEvt)
tools::Long CalcZoom(tools::Long n) const
virtual void MouseButtonDown(const MouseEvent &rMEvt)
virtual Point GetPosPixel() const
tools::Long GetTextHeight() const
const Fraction & GetZoom() const
const AllSettings & GetSettings() const
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect)
virtual bool PreNotify(NotifyEvent &rNEvt)
vcl::Font GetControlFont() const
::OutputDevice const * GetOutDev() const
virtual void MouseMove(const MouseEvent &rMEvt)
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
virtual void SetPointer(PointerStyle)
void EnableClipSiblings(bool bClipSiblings=true)
void Invalidate(InvalidateFlags nFlags=InvalidateFlags::NONE)
virtual void SetPosPixel(const Point &rNewPos)
PointerStyle GetPointer() const
void SetTextColor(const Color &rColor)
void SetBackground()
virtual void set_from_icon_name(const OUString &rIconName)=0
virtual void set_font(const vcl::Font &rFont)=0
virtual void set_label(const OUString &rText)=0
virtual std::unique_ptr< TreeIter > make_iterator(const TreeIter *pOrig=nullptr) const=0
virtual OUString get_text(int row, int col=-1) const=0
virtual int n_children() const=0
void unselect_all()
virtual void clear()=0
virtual void set_image(int row, const OUString &rImage, int col=-1)=0
void append(TreeIter *pRet=nullptr)
virtual tools::Rectangle get_row_area(const weld::TreeIter &rIter) const=0
virtual bool get_cursor(TreeIter *pIter) const=0
virtual void all_foreach(const std::function< bool(TreeIter &)> &func)=0
virtual int get_selected_index() const=0
virtual OUString get_id(int pos) const=0
virtual void show()=0
virtual void set_tooltip_text(const OUString &rTip)=0
virtual vcl::Font get_font()=0
ControllerFrame_Data * m_pData
#define TOOLS_WARN_EXCEPTION(area, stream)
WEIGHT_BOLD
WEIGHT_NORMAL
Reference< XColumn > xColumn
std::mutex m_aMutex
constexpr sal_uInt16 KEY_LEFT
constexpr sal_uInt16 KEY_UP
constexpr sal_uInt16 KEY_RIGHT
constexpr sal_uInt16 KEY_DOWN
NONE
@ Exception
Reference< XConnection > getConnection(const Reference< XRowSet > &_rxRowSet)
Reference< XNameAccess > getPrimaryKeyColumns_throw(const Any &i_aTable)
void Create(SwFormatVertOrient &rItem, SvStream &rStrm, sal_uInt16 nVersionAbusedAsSize)
long Long
weld::Window * GetPopupParent(vcl::Window &rOutWin, tools::Rectangle &rRect)
OUString toId(const void *pValue)
PointerStyle
QPRO_FUNC_TYPE nType
OUString sId
Definition: unodatbr.cxx:1040
StateChangedType
WinBits const WB_MOVEABLE
WinBits const WB_3DLOOK