LibreOffice Module dbaccess (master) 1
genericcontroller.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
21#include <browserids.hxx>
22#include <vcl/svapp.hxx>
23#include <vcl/weld.hxx>
25#include <dbaccess/dataview.hxx>
27#include <osl/diagnose.h>
28#include <vcl/stdtext.hxx>
33#include <com/sun/star/sdbc/XDataSource.hpp>
34#include <com/sun/star/sdb/DatabaseContext.hpp>
35#include <com/sun/star/beans/XPropertySet.hpp>
36#include <com/sun/star/util/URLTransformer.hpp>
37#include <com/sun/star/util/XCloseable.hpp>
38
39#include <com/sun/star/ui/XSidebarProvider.hpp>
40
42#include <com/sun/star/frame/FrameSearchFlag.hpp>
43#include <com/sun/star/frame/status/Visibility.hpp>
44#include <com/sun/star/frame/XUntitledNumbers.hpp>
45#include <com/sun/star/util/XModifiable.hpp>
46#include <rtl/ustring.hxx>
47#include <sal/log.hxx>
48#include <limits>
49#include <unordered_map>
50#include <set>
51
52using namespace ::com::sun::star;
53using namespace ::com::sun::star::uno;
54using namespace ::com::sun::star::beans;
55using namespace ::com::sun::star::frame;
56using namespace ::com::sun::star::frame::status;
57using namespace ::com::sun::star::util;
58using namespace ::com::sun::star::lang;
59using namespace ::com::sun::star::container;
60using namespace ::com::sun::star::sdbc;
61using namespace ::com::sun::star::sdb;
62using namespace ::com::sun::star::task;
63using namespace ::com::sun::star::awt;
64using namespace ::com::sun::star::ui;
65using namespace ::dbtools;
66using namespace ::comphelper;
67
68#define ALL_FEATURES -1
69
70typedef std::unordered_map< sal_Int16, sal_Int16 > CommandHashMap;
71
72namespace dbaui
73{
74
76{
77 try
78 {
80 Reference< XDispatchProvider > xDispatchProvider( xController->getFrame(), UNO_QUERY_THROW );
81 Reference< XDispatch > xDispatch( xDispatchProvider->queryDispatch(
82 _rFeatureURL,
83 "_self",
84 FrameSearchFlag::AUTO
85 ) );
86
87 if ( xDispatch == xController )
88 {
89 SAL_WARN("dbaccess.ui", "UserDefinedFeatures::execute: the controller shouldn't be the dispatcher here!" );
90 xDispatch.clear();
91 }
92
93 if ( xDispatch.is() )
94 xDispatch->dispatch( _rFeatureURL, _rArgs );
95 }
96 catch( const Exception& )
97 {
98 DBG_UNHANDLED_EXCEPTION("dbaccess");
99 }
100}
101
102// OGenericUnoController
105 ,m_aUserInputInterception(*this, getMutex())
106 ,m_pView(nullptr)
107#ifdef DBG_UTIL
108 ,m_bDescribingSupportedFeatures( false )
109#endif
110 ,m_aAsyncInvalidateAll(LINK(this, OGenericUnoController, OnAsyncInvalidateAll))
111 ,m_aAsyncCloseTask(LINK(this, OGenericUnoController, OnAsyncCloseTask))
112 ,m_xContext(_rM)
113 ,m_aCurrentFrame( *this )
114 ,m_bPreview(false)
115 ,m_bReadOnly(false)
116 ,m_bCurrentlyModified(false)
117 ,m_bExternalTitle(false)
118{
119
120 try
121 {
122 m_xUrlTransformer = URLTransformer::create(_rM);
123 }
124 catch(Exception&)
125 {
126 DBG_UNHANDLED_EXCEPTION("dbaccess");
127 }
128}
129
131{
132
133}
134
136{
137 OSL_ENSURE( getView(), "the view is NULL!" );
138
139 if ( getView() )
140 {
141 getView()->Construct();
142 getView()->Show();
143 }
144
145 m_aSupportedFeatures.clear();
147
148 // create the database context
149 OSL_ENSURE(getORB().is(), "OGenericUnoController::Construct need a service factory!");
150 try
151 {
152 m_xDatabaseContext = DatabaseContext::create(getORB());
153 }
154 catch(const Exception&)
155 {
156 SAL_WARN("dbaccess.ui","OGenericUnoController::Construct: could not create (or start listening at) the database context!");
157 // at least notify the user. Though the whole component does not make any sense without the database context ...
158 ShowServiceNotAvailableError(getFrameWeld(), u"com.sun.star.sdb.DatabaseContext", true);
159 }
160
161 return true;
162}
163
164IMPL_LINK_NOARG(OGenericUnoController, OnAsyncInvalidateAll, void*, void)
165{
166 if ( !OGenericUnoController_Base::rBHelper.bInDispose && !OGenericUnoController_Base::rBHelper.bDisposed )
167 InvalidateFeature_Impl();
168}
169
171{
172}
173
175{
176 SolarMutexGuard aSolarGuard;
177 ::osl::MutexGuard aGuard( getMutex() );
178
180
181 PropertyValue aValue;
182 const Any* pIter = aArguments.getConstArray();
183 const Any* pEnd = pIter + aArguments.getLength();
184
185 for ( ; pIter != pEnd; ++pIter )
186 {
187 if ( ( *pIter >>= aValue ) && aValue.Name == "Frame" )
188 {
189 xFrame.set(aValue.Value,UNO_QUERY_THROW);
190 }
191 else if ( ( *pIter >>= aValue ) && aValue.Name == "Preview" )
192 {
193 aValue.Value >>= m_bPreview;
194 m_bReadOnly = true;
195 }
196 }
197 try
198 {
199 if ( !xFrame.is() )
200 throw IllegalArgumentException("need a frame", *this, 1 );
201
202 Reference<XWindow> xParent = xFrame->getContainerWindow();
203 VclPtr<vcl::Window> pParentWin = VCLUnoHelper::GetWindow(xParent);
204 if (!pParentWin)
205 {
206 throw IllegalArgumentException("Parent window is null", *this, 1 );
207 }
208
210 Construct( pParentWin );
211
212 ODataView* pView = getView();
213 if ( !pView )
214 throw RuntimeException("unable to create a view", *this );
215
216 if ( m_bReadOnly || m_bPreview )
217 pView->EnableInput( false );
218
220 }
221 catch(Exception&)
222 {
223 // no one clears my view if I won't
224 m_pView = nullptr;
225 throw;
226 }
227}
228
229void SAL_CALL OGenericUnoController::acquire( ) noexcept
230{
231 OGenericUnoController_Base::acquire();
232}
233
234void SAL_CALL OGenericUnoController::release( ) noexcept
235{
236 OGenericUnoController_Base::release();
237}
238
240{
241 if ( _rxFrame.is() )
242 _rxFrame->addFrameActionListener( this );
243}
244
246{
247 if ( _rxFrame.is() )
248 _rxFrame->removeFrameActionListener( this );
249}
250
251void OGenericUnoController::disposing(const EventObject& Source)
252{
253 // our frame ?
254 if ( Source.Source == getFrame() )
256}
257
258void OGenericUnoController::modified(const EventObject& aEvent)
259{
260 ::osl::MutexGuard aGuard( getMutex() );
261 if ( !isDataSourceReadOnly() )
262 {
263 Reference<XModifiable> xModi(aEvent.Source,UNO_QUERY);
264 if ( xModi.is() )
265 m_bCurrentlyModified = xModi->isModified(); // can only be reset by save
266 else
268 }
271}
272
274{
277}
278
280{
281 return nullptr;
282}
283
285{
286 return "Default";
287}
288
290{
291 // currently we do not support any creation args, so anything passed to XModel2::createViewController would be
292 // lost, so we can equally return an empty sequence here
294}
295
297{
298 SolarMutexGuard aSolarGuard;
299 ::osl::MutexGuard aGuard( getMutex() );
300
304
305 loadMenu( xFrame );
306
307 if ( getView() )
309}
310
311namespace
312{
313 typedef std::vector< Any > States;
314
315 void lcl_notifyMultipleStates( XStatusListener& _rListener, FeatureStateEvent& _rEvent, const States& _rStates )
316 {
317 for (auto const& elem : _rStates)
318 {
319 _rEvent.State = elem;
320 _rListener.statusChanged( _rEvent );
321 }
322 }
323
324 void lcl_collectStates( const FeatureState& _rFeatureState, States& _out_rStates )
325 {
326 // order matters, due to a bug in framework which resets the check state when any non-boolean event
327 // arrives
328 // #i68215# is the bug to (re-)introduce this "ordered" notification here
329 // #i67882# is the bug which was caused by the real fix which we did in framework
330 // #i68216# is the bug which requests to fix the code in Draw which relies on
331 // framework's implementation details
332 if ( !!_rFeatureState.sTitle )
333 _out_rStates.push_back( Any( *_rFeatureState.sTitle ) );
334 if ( !!_rFeatureState.bChecked )
335 _out_rStates.push_back( Any( *_rFeatureState.bChecked ) );
336 if ( !!_rFeatureState.bInvisible )
337 _out_rStates.push_back( Any( Visibility( !*_rFeatureState.bInvisible ) ) );
338 if ( _rFeatureState.aValue.hasValue() )
339 _out_rStates.push_back( _rFeatureState.aValue );
340 if ( _out_rStates.empty() )
341 _out_rStates.emplace_back( );
342 }
343}
344
345void OGenericUnoController::ImplBroadcastFeatureState(const OUString& _rFeature, const Reference< XStatusListener > & xListener, bool _bIgnoreCache)
346{
347 sal_uInt16 nFeat = m_aSupportedFeatures[ _rFeature ].nFeatureId;
348 FeatureState aFeatState( GetState( nFeat ) );
349
350 FeatureState& rCachedState = m_aStateCache[nFeat]; // creates if necessary
351 if ( !_bIgnoreCache )
352 {
353 // check if we really need to notify the listeners : this method may be called much more often than needed, so check
354 // the cached state of the feature
355 bool bAlreadyCached = ( m_aStateCache.find(nFeat) != m_aStateCache.end() );
356 if ( bAlreadyCached )
357 if ( ( rCachedState.bEnabled == aFeatState.bEnabled )
358 && ( rCachedState.bChecked == aFeatState.bChecked )
359 && ( rCachedState.bInvisible == aFeatState.bInvisible )
360 && ( rCachedState.sTitle == aFeatState.sTitle )
361 )
362 return;
363 }
364 rCachedState = aFeatState;
365
366 FeatureStateEvent aEvent;
367 aEvent.FeatureURL.Complete = _rFeature;
368 if (m_xUrlTransformer.is())
369 m_xUrlTransformer->parseStrict(aEvent.FeatureURL);
370 aEvent.Source = static_cast<XDispatch*>(this);
371 aEvent.IsEnabled = aFeatState.bEnabled;
372
373 // collect all states to be notified
374 States aStates;
375 lcl_collectStates( aFeatState, aStates );
376
377 // a special listener ?
378 if ( xListener.is() )
379 lcl_notifyMultipleStates( *xListener, aEvent, aStates );
380 else
381 { // no -> iterate through all listeners responsible for the URL
382 std::set<OUString> aFeatureCommands;
383 for( const auto& rFeature : m_aSupportedFeatures )
384 {
385 if( rFeature.second.nFeatureId == nFeat )
386 aFeatureCommands.insert( rFeature.first );
387 }
388
389 // it is possible that listeners are registered or revoked while
390 // we are notifying them, so we must use a copy of m_arrStatusListener, not
391 // m_arrStatusListener itself
392 Dispatch aNotifyLoop( m_arrStatusListener );
393
394 for (auto const& elem : aNotifyLoop)
395 {
396 if ( aFeatureCommands.find( elem.aURL.Complete ) != aFeatureCommands.end() )
397 {
398 aEvent.FeatureURL = elem.aURL;
399 lcl_notifyMultipleStates( *elem.xListener, aEvent, aStates );
400 }
401 }
402 }
403
404}
405
407{
408 SupportedFeatures::const_iterator aFeaturePos = std::find_if(
409 m_aSupportedFeatures.begin(),
412 );
413
414 return ( m_aSupportedFeatures.end() != aFeaturePos && !aFeaturePos->first.isEmpty());
415}
416
418{
419 bool bEmpty = true;
420 FeatureListener aNextFeature;
421 {
422 std::unique_lock aGuard( m_aFeatureMutex);
423 bEmpty = m_aFeaturesToInvalidate.empty();
424 if (!bEmpty)
425 aNextFeature = m_aFeaturesToInvalidate.front();
426 }
427 while(!bEmpty)
428 {
429 if ( ALL_FEATURES == aNextFeature.nId )
430 {
432 break;
433 }
434 else
435 {
436 SupportedFeatures::const_iterator aFeaturePos = std::find_if(
437 m_aSupportedFeatures.begin(),
439 CompareFeatureById( aNextFeature.nId )
440 );
441
442#if OSL_DEBUG_LEVEL > 0
443 if ( m_aSupportedFeatures.end() == aFeaturePos )
444 {
445 SAL_WARN( "dbaccess.ui", "OGenericUnoController::InvalidateFeature_Impl: feature id "
446 << aNextFeature.nId
447 << " has been invalidated, but is not supported!" );
448 }
449#endif
450 if ( m_aSupportedFeatures.end() != aFeaturePos )
451 // we really know this feature
452 ImplBroadcastFeatureState( aFeaturePos->first, aNextFeature.xListener, aNextFeature.bForceBroadcast );
453 }
454
455 std::unique_lock aGuard( m_aFeatureMutex);
456 m_aFeaturesToInvalidate.pop_front();
457 bEmpty = m_aFeaturesToInvalidate.empty();
458 if (!bEmpty)
459 aNextFeature = m_aFeaturesToInvalidate.front();
460 }
461}
462
463void OGenericUnoController::ImplInvalidateFeature( sal_Int32 _nId, const Reference< XStatusListener >& _xListener, bool _bForceBroadcast )
464{
465#if OSL_DEBUG_LEVEL > 0
466 if ( _nId != -1 )
467 {
468 auto isSupportedFeature = std::any_of(
469 m_aSupportedFeatures.begin(),
471 CompareFeatureById( _nId )
472 );
473 OSL_ENSURE( isSupportedFeature, "OGenericUnoController::ImplInvalidateFeature: invalidating an unsupported feature is suspicious, at least!" );
474 }
475#endif
476
477 FeatureListener aListener;
478 aListener.nId = _nId;
479 aListener.xListener = _xListener;
480 aListener.bForceBroadcast = _bForceBroadcast;
481
482 bool bWasEmpty;
483 {
484 std::unique_lock aGuard( m_aFeatureMutex );
485 bWasEmpty = m_aFeaturesToInvalidate.empty();
486 m_aFeaturesToInvalidate.push_back( aListener );
487 }
488
489 if ( bWasEmpty )
491}
492
493void OGenericUnoController::InvalidateFeature(sal_uInt16 _nId, const Reference< XStatusListener > & _xListener, bool _bForceBroadcast)
494{
495 ImplInvalidateFeature( _nId, _xListener, _bForceBroadcast );
496}
497
499{
500 ImplInvalidateFeature( ALL_FEATURES, nullptr, true );
501}
502
504{
505 // invalidate all supported features
506 for (auto const& supportedFeature : m_aSupportedFeatures)
507 ImplBroadcastFeatureState( supportedFeature.first, nullptr, true );
508
509 {
510 std::unique_lock aGuard( m_aFeatureMutex);
511 OSL_ENSURE(m_aFeaturesToInvalidate.size(), "OGenericUnoController::InvalidateAll_Impl: to be called from within InvalidateFeature_Impl only!");
512 m_aFeaturesToInvalidate.pop_front();
513 if(!m_aFeaturesToInvalidate.empty())
515 }
516}
517
518Reference< XDispatch > OGenericUnoController::queryDispatch(const URL& aURL, const OUString& aTargetFrameName, sal_Int32 nSearchFlags)
519{
521
522 OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::queryDispatch: shouldn't this be filled at construction time?" );
523 if ( m_aSupportedFeatures.empty() )
525
526 // URL's we can handle ourself?
527 if ( aURL.Complete == ".uno:FormSlots/ConfirmDeletion"
528 || ( ( m_aSupportedFeatures.find( aURL.Complete ) != m_aSupportedFeatures.end() )
529 && !isUserDefinedFeature( aURL.Complete )
530 )
531 )
532 {
533 xReturn = this;
534 }
535 // no? -> ask the slave dispatcher
536 else if ( m_xSlaveDispatcher.is() )
537 {
538 xReturn = m_xSlaveDispatcher->queryDispatch(aURL, aTargetFrameName, nSearchFlags);
539 }
540
541 // outta here
542 return xReturn;
543}
544
546{
548 sal_Int32 nLen = aDescripts.getLength();
549 if ( nLen )
550 {
551 aReturn.realloc( nLen );
552 Reference< XDispatch >* pReturn = aReturn.getArray();
553 const Reference< XDispatch >* pReturnEnd = aReturn.getArray() + nLen;
554 const DispatchDescriptor* pDescripts = aDescripts.getConstArray();
555
556 for ( ; pReturn != pReturnEnd; ++ pReturn, ++pDescripts )
557 {
558 *pReturn = queryDispatch( pDescripts->FeatureURL, pDescripts->FrameName, pDescripts->SearchFlags );
559 }
560 }
561
562 return aReturn;
563}
564
566{
567 return m_xSlaveDispatcher;
568}
569
571{
572 m_xSlaveDispatcher = _xNewProvider;
573}
574
576{
577 return m_xMasterDispatcher;
578}
579
581{
582 m_xMasterDispatcher = _xNewProvider;
583}
584
586{
587 SolarMutexGuard aSolarGuard;
588 // The SolarMutex is not locked anymore when the framework calls into
589 // here. So, lock it ourself. The real solution would be to lock it only in the places
590 // where it's needed, but a) this might turn out difficult, since we then also need to care
591 // for locking in the proper order (SolarMutex and m_aMutex), and b) this would be too many places
592 // for the time frame of the fix.
593 // #i52602#
594 executeChecked(_aURL,aArgs);
595}
596
598{
599 // parse the URL now and here, this saves later parsing in each notification round
600 URL aParsedURL( _rURL );
601 if ( m_xUrlTransformer.is() )
602 m_xUrlTransformer->parseStrict( aParsedURL );
603
604 // remember the listener together with the URL
605 m_arrStatusListener.insert( m_arrStatusListener.end(), DispatchTarget( aParsedURL, aListener ) );
606
607 // initially broadcast the state
608 ImplBroadcastFeatureState( aParsedURL.Complete, aListener, true );
609 // force the new state to be broadcast to the new listener
610}
611
613{
614 if (_rURL.Complete.isEmpty())
615 {
616 m_arrStatusListener.erase(std::remove_if(m_arrStatusListener.begin(), m_arrStatusListener.end(),
617 [&aListener](const DispatchTarget& rCurrent) { return rCurrent.xListener == aListener; }),
618 m_arrStatusListener.end());
619 }
620 else
621 {
622 // remove the listener only for the given URL
623 Dispatch::iterator iterSearch = std::find_if(m_arrStatusListener.begin(), m_arrStatusListener.end(),
624 [&aListener, &_rURL](const DispatchTarget& rCurrent) {
625 return (rCurrent.xListener == aListener) && (rCurrent.aURL.Complete == _rURL.Complete); });
626 if (iterSearch != m_arrStatusListener.end())
627 m_arrStatusListener.erase(iterSearch);
628 }
629
630 OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::removeStatusListener: shouldn't this be filled at construction time?" );
631 if ( m_aSupportedFeatures.empty() )
633
634 SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find(_rURL.Complete);
635 if (aIter != m_aSupportedFeatures.end())
636 { // clear the cache for that feature
637 StateCache::const_iterator aCachePos = m_aStateCache.find( aIter->second.nFeatureId );
638 if ( aCachePos != m_aStateCache.end() )
639 m_aStateCache.erase( aCachePos );
640 }
641
642 // now remove the listener from the deque
643 std::unique_lock aGuard( m_aFeatureMutex );
645 std::remove_if( m_aFeaturesToInvalidate.begin(),
647 FindFeatureListener(aListener))
649}
650
652{
653 try
654 {
655 Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY );
656 if ( xUntitledProvider.is() )
657 xUntitledProvider->releaseNumberForComponent(static_cast<XWeak*>(this));
658 }
659 catch( const Exception& )
660 {
661 // NII
662 }
663}
664
666{
667 {
668 EventObject aDisposeEvent;
669 aDisposeEvent.Source = static_cast<XWeak*>(this);
670 Dispatch aStatusListener = m_arrStatusListener;
671 for (auto const& statusListener : aStatusListener)
672 {
673 statusListener.xListener->disposing(aDisposeEvent);
674 }
675 m_arrStatusListener.clear();
676 }
677
678 m_xDatabaseContext = nullptr;
679 {
680 std::unique_lock aGuard( m_aFeatureMutex);
683 }
684
686
687 // check out from all the objects we are listening
688 // the frame
690 m_aCurrentFrame.attachFrame( nullptr );
691
692 m_xMasterDispatcher = nullptr;
693 m_xSlaveDispatcher = nullptr;
694 m_xTitleHelper.clear();
695 m_xUrlTransformer.clear();
697}
698
700{
701 // disambiguate
702 OGenericUnoController_Base::WeakComponentImplHelperBase::addEventListener( xListener );
703}
704
706{
707 // disambiguate
708 OGenericUnoController_Base::WeakComponentImplHelperBase::removeEventListener( xListener );
709}
710
711void OGenericUnoController::frameAction(const FrameActionEvent& aEvent)
712{
713 ::osl::MutexGuard aGuard( getMutex() );
714 if ( aEvent.Frame == m_aCurrentFrame.getFrame() )
716}
717
719 sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup )
720{
721#ifdef DBG_UTIL
722 OSL_ENSURE( m_bDescribingSupportedFeatures, "OGenericUnoController::implDescribeSupportedFeature: bad timing for this call!" );
723#endif
724 OSL_PRECOND( _nFeatureId < ( std::numeric_limits< sal_uInt16 >::max() - 1000 ), // FIRST_USER_DEFINED_FEATURE
725 "OGenericUnoController::implDescribeSupportedFeature: invalid feature id!" );
726
727 ControllerFeature aFeature;
728 aFeature.Command = _rCommandURL;
729 aFeature.nFeatureId = _nFeatureId;
730 aFeature.GroupId = _nCommandGroup;
731
732#if OSL_DEBUG_LEVEL > 0
733 OSL_ENSURE( m_aSupportedFeatures.find( aFeature.Command ) == m_aSupportedFeatures.end(),
734 "OGenericUnoController::implDescribeSupportedFeature: this feature is already there!" );
735#endif
736 m_aSupportedFeatures[ aFeature.Command ] = aFeature;
737}
738
740{
741 // add all supported features
742 implDescribeSupportedFeature( ".uno:Copy", ID_BROWSER_COPY, CommandGroup::EDIT );
743 implDescribeSupportedFeature( ".uno:Cut", ID_BROWSER_CUT, CommandGroup::EDIT );
744 implDescribeSupportedFeature( ".uno:Paste", ID_BROWSER_PASTE, CommandGroup::EDIT );
746 implDescribeSupportedFeature( ".uno:DSBEditDoc", ID_BROWSER_EDITDOC, CommandGroup::DOCUMENT );
747}
748
750{
751 FeatureState aReturn;
752 // (disabled automatically)
753
754 switch ( _nId )
755 {
756 case ID_BROWSER_UNDO:
758 aReturn.bEnabled = true;
759 break;
760 default:
761 // for now, enable all the time
762 // TODO: we should ask the dispatcher. However, this is laborious, since you cannot ask a dispatcher
763 // directly, but need to add a status listener.
764 aReturn.bEnabled = true;
765 break;
766 }
767
768 return aReturn;
769}
770
771void OGenericUnoController::Execute( sal_uInt16 _nId, const Sequence< PropertyValue>& _rArgs )
772{
773 OSL_ENSURE( isUserDefinedFeature( _nId ),
774 "OGenericUnoController::Execute: responsible for user defined features only!" );
775
776 // user defined features can be handled by dispatch interceptors resp. protocol handlers only.
777 // So, we need to do a queryDispatch, and dispatch the URL
778 executeUserDefinedFeatures( getURLForId( _nId ), _rArgs );
779}
780
782{
783 URL aReturn;
784 if ( m_xUrlTransformer.is() )
785 {
786 SupportedFeatures::const_iterator aIter = std::find_if(
787 m_aSupportedFeatures.begin(),
789 CompareFeatureById( _nId )
790 );
791
792 if ( m_aSupportedFeatures.end() != aIter && !aIter->first.isEmpty() )
793 {
794 aReturn.Complete = aIter->first;
795 m_xUrlTransformer->parseStrict( aReturn );
796 }
797 }
798 return aReturn;
799}
800
801bool OGenericUnoController::isUserDefinedFeature( const sal_uInt16 _nFeatureId )
802{
803 return
804 (_nFeatureId >= ( std::numeric_limits< sal_uInt16 >::max() - 1000 )) // test if >= FIRST_USER_DEFINED_FEATURE
805 &&
806 ( _nFeatureId < (std::numeric_limits< sal_uInt16 >::max())) // test if < LAST_USER_DEFINED_FEATURE
807 ;
808}
809
810bool OGenericUnoController::isUserDefinedFeature( const OUString& _rFeatureURL ) const
811{
812 SupportedFeatures::const_iterator pos = m_aSupportedFeatures.find( _rFeatureURL );
813 OSL_PRECOND( pos != m_aSupportedFeatures.end(),
814 "OGenericUnoController::isUserDefinedFeature: this is no supported feature at all!" );
815
816 return ( pos != m_aSupportedFeatures.end() ) && isUserDefinedFeature( pos->second.nFeatureId );
817}
818
819sal_Bool SAL_CALL OGenericUnoController::supportsService(const OUString& ServiceName)
820{
822}
823
825{
826 // we have to remove ourself before disposing the connection
827 Reference< XComponent > xComponent(_rxConnection, UNO_QUERY);
828 if (xComponent.is())
829 xComponent->addEventListener(static_cast<XFrameActionListener*>(this));
830}
831
833{
834 // we have to remove ourself before disposing the connection
835 Reference< XComponent > xComponent(_rxConnection, UNO_QUERY);
836 if (xComponent.is())
837 xComponent->removeEventListener(static_cast<XFrameActionListener*>(this));
838}
839
841{
842 weld::WaitObject aWaitCursor(getFrameWeld());
843
844 ODatasourceConnector aConnector( getORB(), getFrameWeld(), OUString() );
845 Reference< XConnection > xConnection = aConnector.connect( _xDataSource, nullptr );
846 startConnectionListening( xConnection );
847
848 return xConnection;
849}
850
852 const OUString& _rContextInformation, ::dbtools::SQLExceptionInfo* _pErrorInfo )
853{
854 weld::WaitObject aWaitCursor(getFrameWeld());
855
856 ODatasourceConnector aConnector( getORB(), getFrameWeld(), _rContextInformation );
857 Reference<XConnection> xConnection = aConnector.connect( _rDataSourceName, _pErrorInfo );
858 startConnectionListening( xConnection );
859
860 return xConnection;
861}
862
864{
865 m_pView = i_rView;
866}
867
869{
870 m_pView = nullptr;
871}
872
874{
875 ::dbtools::showError(_rInfo,VCLUnoHelper::GetInterface(getView()),getORB());
876}
877
879{
880 Reference< XPropertySet > xPropSet( _xFrame, UNO_QUERY );
881 Reference< XLayoutManager > xLayoutManager;
882 if ( xPropSet.is() )
883 {
884 try
885 {
886 xLayoutManager.set(xPropSet->getPropertyValue("LayoutManager"),UNO_QUERY);
887 }
888 catch ( Exception& )
889 {
890 }
891 }
892 return xLayoutManager;
893}
894
896{
897 Reference< XLayoutManager > xLayoutManager = getLayoutManager(_xFrame);
898 if ( xLayoutManager.is() )
899 {
900 xLayoutManager->lock();
901 xLayoutManager->createElement( "private:resource/menubar/menubar" );
902 xLayoutManager->createElement( "private:resource/toolbar/toolbar" );
903 xLayoutManager->unlock();
904 xLayoutManager->doLayout();
905 }
906
907 onLoadedMenu( xLayoutManager );
908}
909
911{
912 // not interested in
913}
914
916{
918}
919
920IMPL_LINK_NOARG(OGenericUnoController, OnAsyncCloseTask, void*, void)
921{
922 if ( !OGenericUnoController_Base::rBHelper.bInDispose )
923 {
924 try
925 {
926 Reference< util::XCloseable > xCloseable( m_aCurrentFrame.getFrame(), UNO_QUERY_THROW );
927 xCloseable->close( false ); // false - holds the owner ship for this frame inside this object!
928 }
929 catch( const Exception& )
930 {
931 DBG_UNHANDLED_EXCEPTION("dbaccess");
932 }
933 }
934}
935
937{
938 return Any();
939}
940
941void SAL_CALL OGenericUnoController::restoreViewData(const Any& /*Data*/)
942{
943}
944
946{
947 return Reference< XModel >();
948}
949
951{
952 ::osl::MutexGuard aGuard( getMutex() );
953 return m_aCurrentFrame.getFrame();
954}
955
957{
958 SAL_WARN("dbaccess.ui", "OGenericUnoController::attachModel: not supported!" );
959 return false;
960}
961
962void OGenericUnoController::executeUnChecked(sal_uInt16 _nCommandId, const Sequence< PropertyValue >& aArgs)
963{
964 Execute(_nCommandId, aArgs);
965}
966
967void OGenericUnoController::executeUnChecked(const util::URL& _rCommand, const Sequence< PropertyValue >& aArgs)
968{
969 OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::executeUnChecked: shouldn't this be filled at construction time?" );
970 if ( m_aSupportedFeatures.empty() )
972
973 SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCommand.Complete );
974 if (aIter != m_aSupportedFeatures.end())
975 Execute( aIter->second.nFeatureId, aArgs );
976}
977
978void OGenericUnoController::executeChecked(const util::URL& _rCommand, const Sequence< PropertyValue >& aArgs)
979{
980 OSL_PRECOND( !m_aSupportedFeatures.empty(), "OGenericUnoController::executeChecked: shouldn't this be filled at construction time?" );
981 if ( m_aSupportedFeatures.empty() )
983
984 SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCommand.Complete );
985 if ( aIter != m_aSupportedFeatures.end() )
986 {
987 sal_uInt16 nFeatureId = aIter->second.nFeatureId;
988 if ( GetState( nFeatureId ).bEnabled )
989 Execute( nFeatureId, aArgs );
990 }
991}
992
994{
996
997 // get the top most window
999 if ( xFrame.is() )
1000 {
1001 xWindow = xFrame->getContainerWindow();
1002
1003 while ( xFrame.is() && !xFrame->isTop() )
1004 {
1005 xFrame = xFrame->getCreator();
1006 }
1007 if ( xFrame.is() )
1008 xWindow = xFrame->getContainerWindow();
1009 }
1010 return xWindow;
1011}
1012
1014{
1015 SolarMutexGuard aSolarGuard;
1016 ::osl::MutexGuard aGuard( getMutex() );
1017
1018 if (!m_xTitleHelper.is() && bCreateIfNecessary)
1019 {
1020 Reference< XUntitledNumbers > xUntitledProvider(getPrivateModel(), UNO_QUERY );
1021
1022 m_xTitleHelper = new ::framework::TitleHelper( m_xContext, Reference< XController >(this), xUntitledProvider );
1023 }
1024
1025 return m_xTitleHelper;
1026}
1027
1028// XTitle
1030{
1031 ::osl::MutexGuard aGuard( getMutex() );
1032 if ( m_bExternalTitle )
1033 return impl_getTitleHelper_throw()->getTitle ();
1034 return getPrivateTitle() + impl_getTitleHelper_throw()->getTitle ();
1035}
1036
1037// XTitle
1038void SAL_CALL OGenericUnoController::setTitle(const OUString& sTitle)
1039{
1040 SolarMutexGuard aSolarGuard;
1041 ::osl::MutexGuard aGuard( getMutex() );
1042 m_bExternalTitle = true;
1043 impl_getTitleHelper_throw()->setTitle (sTitle);
1044}
1045
1046// XTitleChangeBroadcaster
1048{
1050 if (xBroadcaster.is ())
1051 xBroadcaster->addTitleChangeListener (xListener);
1052}
1053
1055{
1057 if (xBroadcaster.is ())
1058 xBroadcaster->removeTitleChangeListener (xListener);
1059}
1060
1061// XUserInputInterception
1063{
1064 if ( _rxHandler.is() )
1066}
1067
1069{
1071}
1072
1074{
1075 if ( _rxHandler.is() )
1077}
1078
1080{
1082}
1083
1084void OGenericUnoController::executeChecked(sal_uInt16 _nCommandId, const Sequence< PropertyValue >& aArgs)
1085{
1086 if ( isCommandEnabled(_nCommandId) )
1087 Execute(_nCommandId, aArgs);
1088}
1089
1090bool OGenericUnoController::isCommandEnabled(sal_uInt16 _nCommandId) const
1091{
1092 return GetState( _nCommandId ).bEnabled;
1093}
1094
1096{
1097 return false;
1098}
1099
1101{
1102 return this;
1103}
1104
1106{
1108}
1109
1110bool OGenericUnoController::isCommandChecked(sal_uInt16 _nCommandId) const
1111{
1112 FeatureState aState = GetState( _nCommandId );
1113
1114 return aState.bChecked && *aState.bChecked;
1115}
1116
1117bool OGenericUnoController::isCommandEnabled( const OUString& _rCompleteCommandURL ) const
1118{
1119 OSL_ENSURE( !_rCompleteCommandURL.isEmpty(), "OGenericUnoController::isCommandEnabled: Empty command url!" );
1120
1121 bool bIsEnabled = false;
1122 SupportedFeatures::const_iterator aIter = m_aSupportedFeatures.find( _rCompleteCommandURL );
1123 if ( aIter != m_aSupportedFeatures.end() )
1124 bIsEnabled = isCommandEnabled( aIter->second.nFeatureId );
1125
1126 return bIsEnabled;
1127}
1128
1130{
1131 CommandHashMap aCmdHashMap;
1132 for (auto const& supportedFeature : m_aSupportedFeatures)
1133 if ( supportedFeature.second.GroupId != CommandGroup::INTERNAL )
1134 aCmdHashMap.emplace( supportedFeature.second.GroupId, 0 );
1135
1136 return comphelper::mapKeysToSequence( aCmdHashMap );
1137}
1138
1140{
1141 std::vector< DispatchInformation > aInformationVector;
1142 for (auto const& supportedFeature : m_aSupportedFeatures)
1143 {
1144 if ( sal_Int16( supportedFeature.second.GroupId ) == CommandGroup )
1145 {
1146 aInformationVector.push_back( supportedFeature.second );
1147 }
1148 }
1149
1150 return comphelper::containerToSequence( aInformationVector );
1151}
1152
1154{
1155#ifdef DBG_UTIL
1157#endif
1159#ifdef DBG_UTIL
1161#endif
1162}
1163
1165{
1166 SolarMutexGuard aSolarGuard;
1167 OGenericUnoController_Base::dispose();
1168}
1169
1171{
1172 return m_pView ? m_pView->GetFrameWeld() : nullptr;
1173}
1174
1175} // namespace dbaui
1176
1177/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
AnyEventRef aEvent
#define ID_BROWSER_EDITDOC
Definition: browserids.hxx:26
#define ID_BROWSER_SAVEDOC
Definition: browserids.hxx:32
#define ID_BROWSER_UNDO
Definition: browserids.hxx:35
#define ID_BROWSER_CLIPBOARD_FORMAT_ITEMS
Definition: browserids.hxx:30
#define ID_BROWSER_PASTE
Definition: browserids.hxx:29
#define ID_BROWSER_CUT
Definition: browserids.hxx:25
#define ID_BROWSER_COPY
Definition: browserids.hxx:24
static css::uno::Reference< css::awt::XWindow > GetInterface(vcl::Window *pWindow)
static vcl::Window * GetWindow(const css::uno::Reference< css::awt::XWindow > &rxWindow)
void assign(const css::uno::Sequence< css::uno::Any > &_rArguments)
const css::uno::Reference< css::frame::XFrame > & getFrame() const
void frameAction(css::frame::FrameAction _eAction)
notifies the instance that a certain frame action happened with our frame
const css::uno::Reference< css::frame::XFrame > & attachFrame(const css::uno::Reference< css::frame::XFrame > &_rxFrame)
attaches a new frame
void attachFrame(const css::uno::Reference< css::frame::XFrame > &_xFrame)
Definition: dataview.cxx:146
virtual void Construct()
late construction
Definition: dataview.cxx:49
css::uno::Reference< css::sdbc::XConnection > connect(const OUString &_rDataSourceName, ::dbtools::SQLExceptionInfo *_pErrorInfo) const
creates a connection to the data source, displays the possible error to the user, or returns it
virtual void SAL_CALL removeStatusListener(const css::uno::Reference< css::frame::XStatusListener > &aListener, const css::util::URL &aURL) override
weld::Window * getFrameWeld() const
virtual void stopFrameListening(const css::uno::Reference< css::frame::XFrame > &_rxFrame)
void ImplBroadcastFeatureState(const OUString &_rFeature, const css::uno::Reference< css::frame::XStatusListener > &xListener, bool _bIgnoreCache)
virtual sal_Bool SAL_CALL supportsService(const OUString &ServiceName) override
virtual void SAL_CALL setMasterDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &_xNewProvider) override
virtual FeatureState GetState(sal_uInt16 nId) const
virtual void SAL_CALL modified(const css::lang::EventObject &aEvent) override
css::uno::Reference< css::util::XURLTransformer > m_xUrlTransformer
virtual void SAL_CALL addMouseClickHandler(const css::uno::Reference< css::awt::XMouseClickHandler > &xHandler) override
css::uno::Reference< css::frame::XTitle > m_xTitleHelper
virtual void startFrameListening(const css::uno::Reference< css::frame::XFrame > &_rxFrame)
virtual void SAL_CALL dispatch(const css::util::URL &aURL, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
virtual void onLoadedMenu(const css::uno::Reference< css::frame::XLayoutManager > &_xLayoutManager)
called when our menu has been loaded into our frame, can be used to load sub toolbars
virtual void SAL_CALL removeTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override
virtual bool isDataSourceReadOnly() const override
checks if the selected data source is read only
css::uno::Reference< css::sdb::XDatabaseContext > m_xDatabaseContext
void ImplInvalidateFeature(sal_Int32 _nId, const css::uno::Reference< css::frame::XStatusListener > &_xListener, bool _bForceBroadcast)
virtual void SAL_CALL attachFrame(const css::uno::Reference< css::frame::XFrame > &xFrame) override
virtual OUString getPrivateTitle() const
::std::deque< FeatureListener > m_aFeaturesToInvalidate
virtual css::uno::Any SAL_CALL getViewData() override
virtual OUString SAL_CALL getViewControllerName() override
virtual void SAL_CALL release() noexcept override
css::uno::Reference< css::sdbc::XConnection > connect(const css::uno::Reference< css::sdbc::XDataSource > &_xDataSource)
::sfx2::UserInputInterception m_aUserInputInterception
css::uno::Reference< css::frame::XTitle > impl_getTitleHelper_throw(bool bCreateIfNecessary=true)
virtual css::uno::Reference< css::awt::XWindow > SAL_CALL getComponentWindow() override
virtual css::uno::Reference< css::frame::XController > getXController() override
provides access to the model of the controller
virtual void SAL_CALL setTitle(const OUString &sTitle) override
std::vector< DispatchTarget > Dispatch
virtual css::uno::Reference< css::ui::XSidebarProvider > SAL_CALL getSidebar() override
bool isFeatureSupported(sal_Int32 _nId)
returns <TRUE> if the feature is supported, otherwise <FALSE>
virtual bool isCommandEnabled(sal_uInt16 _nCommandId) const override
checks if the given Command is enabled
void executeUserDefinedFeatures(const css::util::URL &_rFeatureURL, const css::uno::Sequence< css::beans::PropertyValue > &_rArgs)
bool isCommandChecked(sal_uInt16 _nCommandId) const
virtual css::uno::Sequence< ::sal_Int16 > SAL_CALL getSupportedCommandGroups() override
virtual void SAL_CALL acquire() noexcept override
virtual css::uno::Reference< css::frame::XFrame > SAL_CALL getFrame() override
virtual ~OGenericUnoController() override
void showError(const ::dbtools::SQLExceptionInfo &_rInfo)
css::uno::Reference< css::frame::XDispatchProvider > m_xSlaveDispatcher
::comphelper::NamedValueCollection m_aInitParameters
virtual css::uno::Reference< css::frame::XModel > SAL_CALL getModel() override
void implDescribeSupportedFeature(const OUString &_rCommandURL, sal_uInt16 _nFeatureId, sal_Int16 _nCommandGroup=css::frame::CommandGroup::INTERNAL)
describes a feature supported by the controller
void setView(const VclPtr< ODataView > &i_rView)
virtual bool interceptUserInput(const NotifyEvent &_rEvent) override
allows interception of user input, aka mouse clicks and key events
virtual void SAL_CALL initialize(const css::uno::Sequence< css::uno::Any > &aArguments) override
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getMasterDispatchProvider() override
virtual void SAL_CALL dispose() override
virtual void executeChecked(const css::util::URL &_rCommand, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
executes the given command only when it is allowed
virtual void SAL_CALL addKeyHandler(const css::uno::Reference< css::awt::XKeyHandler > &xHandler) override
void stopConnectionListening(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
virtual css::uno::Sequence< css::uno::Reference< css::frame::XDispatch > > SAL_CALL queryDispatches(const css::uno::Sequence< css::frame::DispatchDescriptor > &aDescripts) override
virtual OUString SAL_CALL getTitle() override
virtual void loadMenu(const css::uno::Reference< css::frame::XFrame > &_xFrame)
void InvalidateFeature(sal_uInt16 nId, const css::uno::Reference< css::frame::XStatusListener > &xListener=nullptr, bool _bForceBroadcast=false)
virtual void Execute(sal_uInt16 nId, const css::uno::Sequence< css::beans::PropertyValue > &aArgs)
virtual css::uno::Reference< css::frame::XModel > getPrivateModel() const
css::uno::Reference< css::frame::XDispatchProvider > m_xMasterDispatcher
virtual bool Construct(vcl::Window *pParent)
virtual void SAL_CALL addEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
virtual void SAL_CALL frameAction(const css::frame::FrameActionEvent &aEvent) override
virtual void SAL_CALL restoreViewData(const css::uno::Any &Data) override
OAsynchronousLink m_aAsyncInvalidateAll
virtual sal_Bool SAL_CALL attachModel(const css::uno::Reference< css::frame::XModel > &xModel) override
virtual css::uno::Reference< css::frame::XDispatch > SAL_CALL queryDispatch(const css::util::URL &aURL, const OUString &aTargetFrameName, sal_Int32 nSearchFlags) override
virtual void SAL_CALL setSlaveDispatchProvider(const css::uno::Reference< css::frame::XDispatchProvider > &_xNewProvider) override
virtual css::uno::Sequence< css::frame::DispatchInformation > SAL_CALL getConfigurableDispatchInformation(::sal_Int16) override
virtual void SAL_CALL addTitleChangeListener(const css::uno::Reference< css::frame::XTitleChangeListener > &xListener) override
virtual void SAL_CALL addStatusListener(const css::uno::Reference< css::frame::XStatusListener > &aListener, const css::util::URL &aURL) override
virtual void executeUnChecked(const css::util::URL &_rCommand, const css::uno::Sequence< css::beans::PropertyValue > &aArgs) override
executes the given command without checking if it is allowed
::osl::Mutex & getMutex() const
virtual void SAL_CALL removeKeyHandler(const css::uno::Reference< css::awt::XKeyHandler > &xHandler) override
css::util::URL getURLForId(sal_Int32 _nId) const
virtual void SAL_CALL disposing() override
virtual void SAL_CALL removeMouseClickHandler(const css::uno::Reference< css::awt::XMouseClickHandler > &xHandler) override
void startConnectionListening(const css::uno::Reference< css::sdbc::XConnection > &_rxConnection)
css::uno::Reference< css::uno::XComponentContext > m_xContext
virtual css::uno::Reference< css::frame::XDispatchProvider > SAL_CALL getSlaveDispatchProvider() override
void InvalidateAll()
InvalidateAll invalidates all features currently known.
virtual css::uno::Sequence< css::beans::PropertyValue > SAL_CALL getCreationArguments() override
static css::uno::Reference< css::frame::XLayoutManager > getLayoutManager(const css::uno::Reference< css::frame::XFrame > &_xFrame)
get the layout manager
const css::uno::Reference< css::uno::XComponentContext > & getORB() const
virtual void SAL_CALL removeEventListener(const css::uno::Reference< css::lang::XEventListener > &aListener) override
static bool isUserDefinedFeature(const sal_uInt16 nFeatureId)
determines whether the given feature ID denotes a user-defined feature
SupportedFeatures m_aSupportedFeatures
css::uno::Reference< css::awt::XWindow > getTopMostContainerWindow() const
return the container window of the top most frame
void removeMouseClickHandler(const css::uno::Reference< css::awt::XMouseClickHandler > &xHandler)
bool handleNotifyEvent(const NotifyEvent &_rEvent)
void removeKeyHandler(const css::uno::Reference< css::awt::XKeyHandler > &xHandler)
void addMouseClickHandler(const css::uno::Reference< css::awt::XMouseClickHandler > &xHandler)
void addKeyHandler(const css::uno::Reference< css::awt::XKeyHandler > &xHandler)
void Show(bool bVisible=true, ShowFlags nFlags=ShowFlags::NONE)
void EnableInput(bool bEnable=true, bool bChild=true)
Reference< XComponentContext > m_xContext
#define DBG_UNHANDLED_EXCEPTION(...)
Reference< XDispatch > xDispatch
float u
std::unordered_map< sal_Int16, sal_Int16 > CommandHashMap
#define ALL_FEATURES
bool m_bReadOnly
URL aURL
Definition: intercept.cxx:87
Sequence< PropertyValue > aArguments
Definition: intercept.cxx:88
#define SAL_WARN(area, stream)
@ Exception
css::uno::Sequence< typename M::key_type > mapKeysToSequence(M const &map)
css::uno::Sequence< DstElementType > containerToSequence(const SrcType &i_Container)
bool CPPUHELPER_DLLPUBLIC supportsService(css::lang::XServiceInfo *implementation, rtl::OUString const &name)
IMPL_LINK_NOARG(OApplicationController, OnClipboardChanged, TransferableDataHelper *, void)
::cppu::WeakComponentImplHelper< css::frame::XDispatch, css::frame::XDispatchProviderInterceptor, css::util::XModifyListener, css::frame::XFrameActionListener, css::lang::XInitialization, css::lang::XServiceInfo, css::frame::XDispatchInformationProvider, css::frame::XController2, css::frame::XTitle, css::frame::XTitleChangeBroadcaster, css::awt::XUserInputInterception > OGenericUnoController_Base
::osl::Mutex & getMutex()
Visibility
void VCL_DLLPUBLIC ShowServiceNotAvailableError(weld::Widget *pParent, std::u16string_view rServiceName, bool bError)
css::uno::Reference< css::frame::XStatusListener > xListener
describes the state of a feature
std::optional< bool > bChecked
std::optional< OUString > sTitle
std::optional< bool > bInvisible
Reference< XController > xController
the controller of the sub component. Must not be <NULL>
Reference< XFrame > xFrame
the frame which the component resides in. Must not be <NULL>
bool bIsEnabled
unsigned char sal_Bool
size_t pos