LibreOffice Module forms (master) 1
navtoolbar.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
21#include <navtoolbar.hxx>
22#include <frm_resource.hxx>
23#include <featuredispatcher.hxx>
24#include <strings.hrc>
26
27#include <com/sun/star/uno/Any.hxx>
28#include <com/sun/star/form/runtime/FormFeature.hpp>
29
31
32#include <utility>
34#include <vcl/toolbox.hxx>
35
36#include <sal/macros.h>
37#include <osl/diagnose.h>
38#include <tools/debug.hxx>
39
40#define LID_RECORD_LABEL 1000
41#define LID_RECORD_FILLER 1001
42
43
44namespace frm
45{
46
47
48 using ::com::sun::star::uno::Any;
49 namespace FormFeature = ::com::sun::star::form::runtime::FormFeature;
50
51
52 namespace
53 {
54 bool isArtificialItem( sal_Int16 _nFeatureId )
55 {
56 return ( _nFeatureId == LID_RECORD_LABEL )
57 || ( _nFeatureId == LID_RECORD_FILLER );
58 }
59
60 OUString getLabelString(TranslateId pResId)
61 {
62 OUString sLabel( " " + ResourceManager::loadString(pResId) + " " );
63 return sLabel;
64 }
65
66 OUString lcl_getCommandURL( const sal_Int16 _nFormFeature )
67 {
68 const char* pAsciiCommandName = nullptr;
69 switch ( _nFormFeature )
70 {
71 case FormFeature::MoveAbsolute : pAsciiCommandName = "AbsoluteRecord"; break;
72 case FormFeature::TotalRecords : pAsciiCommandName = "RecTotal"; break;
73 case FormFeature::MoveToFirst : pAsciiCommandName = "FirstRecord"; break;
74 case FormFeature::MoveToPrevious : pAsciiCommandName = "PrevRecord"; break;
75 case FormFeature::MoveToNext : pAsciiCommandName = "NextRecord"; break;
76 case FormFeature::MoveToLast : pAsciiCommandName = "LastRecord"; break;
77 case FormFeature::SaveRecordChanges : pAsciiCommandName = "RecSave"; break;
78 case FormFeature::UndoRecordChanges : pAsciiCommandName = "RecUndo"; break;
79 case FormFeature::MoveToInsertRow : pAsciiCommandName = "NewRecord"; break;
80 case FormFeature::DeleteRecord : pAsciiCommandName = "DeleteRecord"; break;
81 case FormFeature::ReloadForm : pAsciiCommandName = "Refresh"; break;
82 case FormFeature::RefreshCurrentControl : pAsciiCommandName = "RefreshFormControl"; break;
83 case FormFeature::SortAscending : pAsciiCommandName = "Sortup"; break;
84 case FormFeature::SortDescending : pAsciiCommandName = "SortDown"; break;
85 case FormFeature::InteractiveSort : pAsciiCommandName = "OrderCrit"; break;
86 case FormFeature::AutoFilter : pAsciiCommandName = "AutoFilter"; break;
87 case FormFeature::InteractiveFilter : pAsciiCommandName = "FilterCrit"; break;
88 case FormFeature::ToggleApplyFilter : pAsciiCommandName = "FormFiltered"; break;
89 case FormFeature::RemoveFilterAndSort : pAsciiCommandName = "RemoveFilterSort"; break;
90 }
91 if ( pAsciiCommandName != nullptr )
92 return ".uno:" + OUString::createFromAscii( pAsciiCommandName );
93
94 return OUString();
95 }
96 }
97
98 class ImplNavToolBar : public ToolBox
99 {
100 protected:
102
103 public:
104 explicit ImplNavToolBar( vcl::Window* _pParent )
105 :ToolBox( _pParent, WB_3DLOOK )
106 ,m_pDispatcher( nullptr )
107 {
108 }
109
110 void setDispatcher( const IFeatureDispatcher* _pDispatcher )
111 {
112 m_pDispatcher = _pDispatcher;
113 }
114
115 protected:
116 // ToolBox overridables
117 virtual void Select() override;
118
119 };
120
121
123 {
124 if ( m_pDispatcher )
125 {
126 sal_Int16 nFeatureId = sal_uInt16(GetCurItemId());
127 if ( !m_pDispatcher->isEnabled( nFeatureId ) )
128 // the toolbox is a little bit buggy: With ToolBoxItemBits::REPEAT, it sometimes
129 // happens that a select is reported, even though the respective
130 // item has just been disabled.
131 return;
132 m_pDispatcher->dispatch( nFeatureId );
133 }
134 }
135
137 PCommandImageProvider _pImageProvider,
138 OUString sModuleId )
139 :Window( _pParent, _nStyle )
140 ,m_pDispatcher( nullptr )
141 ,m_pImageProvider(std::move( _pImageProvider ))
142 ,m_eImageSize( eSmall )
143 ,m_pToolbar( nullptr )
144 ,m_sModuleId(std::move( sModuleId ))
145 {
146 implInit( );
147 }
148
150 {
151 disposeOnce();
152 }
153
155 {
156 for (auto & childWin : m_aChildWins)
157 childWin.disposeAndClear();
158 m_aChildWins.clear();
159 m_pToolbar.disposeAndClear();
161 }
162
164 {
165 m_pDispatcher = _pDispatcher;
166
167 m_pToolbar->setDispatcher( _pDispatcher );
168
169 RecordPositionInput* pPositionWindow = static_cast< RecordPositionInput* >( m_pToolbar->GetItemWindow( ToolBoxItemId(FormFeature::MoveAbsolute) ) );
170 OSL_ENSURE( pPositionWindow, "NavigationToolBar::setDispatcher: can't forward the dispatcher to the position window!" );
171 if ( pPositionWindow )
172 pPositionWindow->setDispatcher( _pDispatcher );
173
174 // update feature states
175 for ( ToolBox::ImplToolItems::size_type nPos = 0; nPos < m_pToolbar->GetItemCount(); ++nPos )
176 {
177 sal_uInt16 nItemId = sal_uInt16(m_pToolbar->GetItemId( nPos ));
178
179 if ( ( nItemId == LID_RECORD_LABEL ) || ( nItemId == LID_RECORD_FILLER ) )
180 continue;
181
182 // is this item enabled?
183 bool bEnabled = m_pDispatcher && m_pDispatcher->isEnabled( nItemId );
184 implEnableItem( nItemId, bEnabled );
185 }
186 }
187
188 void NavigationToolBar::implEnableItem( sal_uInt16 _nItemId, bool _bEnabled )
189 {
190 m_pToolbar->EnableItem( ToolBoxItemId(_nItemId), _bEnabled );
191
192 if ( _nItemId == FormFeature::MoveAbsolute )
193 m_pToolbar->EnableItem( ToolBoxItemId(LID_RECORD_LABEL), _bEnabled );
194
195 if ( _nItemId == FormFeature::TotalRecords )
196 m_pToolbar->EnableItem( ToolBoxItemId(LID_RECORD_FILLER), _bEnabled );
197 }
198
199 void NavigationToolBar::enableFeature( sal_Int16 _nFeatureId, bool _bEnabled )
200 {
201 DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
202 "NavigationToolBar::enableFeature: invalid id!" );
203
204 implEnableItem( static_cast<sal_uInt16>(_nFeatureId), _bEnabled );
205 }
206
207 void NavigationToolBar::checkFeature( sal_Int16 _nFeatureId, bool _bEnabled )
208 {
209 DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
210 "NavigationToolBar::checkFeature: invalid id!" );
211
212 m_pToolbar->CheckItem( ToolBoxItemId(_nFeatureId), _bEnabled );
213 }
214
215 void NavigationToolBar::setFeatureText( sal_Int16 _nFeatureId, const OUString& _rText )
216 {
217 DBG_ASSERT( m_pToolbar->GetItemPos( ToolBoxItemId(_nFeatureId) ) != ToolBox::ITEM_NOTFOUND,
218 "NavigationToolBar::checkFeature: invalid id!" );
219
220 vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( ToolBoxItemId(_nFeatureId) );
221 if ( pItemWindow )
222 {
223 if (_nFeatureId == FormFeature::TotalRecords)
224 static_cast<LabelItemWindow*>(pItemWindow)->set_label(_rText);
225 else if (_nFeatureId == FormFeature::MoveAbsolute)
226 static_cast<RecordPositionInput*>(pItemWindow)->set_text(_rText);
227 }
228 else
229 m_pToolbar->SetItemText( ToolBoxItemId(_nFeatureId), _rText );
230 }
231
233 {
235 m_pToolbar->Show();
236
237 // need the SfxApplication for retrieving information about our
238 // items. We could duplicate all the information here in our lib
239 // (such as the item text and the image), but why should we?
240
241 static struct FeatureDescription
242 {
243 sal_uInt16 nId;
244 bool bRepeat;
245 bool bItemWindow;
246 } const aSupportedFeatures[] =
247 {
248 { LID_RECORD_LABEL, false, true },
249 { FormFeature::MoveAbsolute, false, true },
250 { LID_RECORD_FILLER, false, true },
251 { FormFeature::TotalRecords, false, true },
252 { FormFeature::MoveToFirst, true, false },
253 { FormFeature::MoveToPrevious, true, false },
254 { FormFeature::MoveToNext, true, false },
255 { FormFeature::MoveToLast, true, false },
256 { FormFeature::MoveToInsertRow, false, false },
257 { 0, false, false },
258 { FormFeature::SaveRecordChanges, false, false },
259 { FormFeature::UndoRecordChanges, false, false },
260 { FormFeature::DeleteRecord, false, false },
261 { FormFeature::ReloadForm, false, false },
262 { FormFeature::RefreshCurrentControl, false, false },
263 { 0, false, false },
264 { FormFeature::SortAscending, false, false },
265 { FormFeature::SortDescending, false, false },
266 { FormFeature::InteractiveSort, false, false },
267 { FormFeature::AutoFilter, false, false },
268 { FormFeature::InteractiveFilter, false, false },
269 { FormFeature::ToggleApplyFilter, false, false },
270 { FormFeature::RemoveFilterAndSort, false, false },
271 };
272
273 FeatureDescription const * pSupportedFeatures = aSupportedFeatures;
274 FeatureDescription const * pSupportedFeaturesEnd = aSupportedFeatures + SAL_N_ELEMENTS( aSupportedFeatures );
275 for ( ; pSupportedFeatures < pSupportedFeaturesEnd; ++pSupportedFeatures )
276 {
277 if ( pSupportedFeatures->nId )
278 { // it's _not_ a separator
279
280 // insert the entry
281 OUString sCommandURL( lcl_getCommandURL( pSupportedFeatures->nId ) );
282 m_pToolbar->InsertItem( ToolBoxItemId(pSupportedFeatures->nId), OUString(), sCommandURL, pSupportedFeatures->bRepeat ? ToolBoxItemBits::REPEAT : ToolBoxItemBits::NONE );
283 m_pToolbar->SetQuickHelpText( ToolBoxItemId(pSupportedFeatures->nId), OUString() ); // TODO
284
285 if ( !isArtificialItem( pSupportedFeatures->nId ) )
286 {
288 m_pToolbar->SetQuickHelpText(ToolBoxItemId(pSupportedFeatures->nId),
290 }
291
292 if ( pSupportedFeatures->bItemWindow )
293 {
294 vcl::Window* pItemWindow = nullptr;
295 if ( FormFeature::MoveAbsolute == pSupportedFeatures->nId )
296 {
298 static_cast< RecordPositionInput* >( pItemWindow )->setDispatcher( m_pDispatcher );
299 }
300 else if (pSupportedFeatures->nId == LID_RECORD_FILLER)
301 pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, getLabelString(RID_STR_LABEL_OF));
302 else if (pSupportedFeatures->nId == LID_RECORD_LABEL)
303 pItemWindow = VclPtr<LabelItemWindow>::Create(m_pToolbar, getLabelString(RID_STR_LABEL_RECORD));
304 else if (pSupportedFeatures->nId == FormFeature::TotalRecords)
306
307 m_aChildWins.emplace_back(pItemWindow );
308 m_pToolbar->SetItemWindow( ToolBoxItemId(pSupportedFeatures->nId), pItemWindow );
309 }
310 }
311 else
312 { // a separator
313 m_pToolbar->InsertSeparator( );
314 }
315 }
316
318
320 }
321
322
324 {
325 OSL_ENSURE( m_pImageProvider, "NavigationToolBar::implUpdateImages: no image provider => no images!" );
326 if ( !m_pImageProvider )
327 return;
328
329 const ToolBox::ImplToolItems::size_type nItemCount = m_pToolbar->GetItemCount();
330
331 // collect the FormFeatures in the toolbar
332 std::vector<sal_Int16> aFormFeatures;
333 aFormFeatures.reserve( nItemCount );
334
335 for ( ToolBox::ImplToolItems::size_type i=0; i<nItemCount; ++i )
336 {
337 ToolBoxItemId nId = m_pToolbar->GetItemId( i );
338 if ( ( ToolBoxItemType::BUTTON == m_pToolbar->GetItemType( i ) ) && !isArtificialItem( sal_uInt16(nId) ) )
339 aFormFeatures.push_back( sal_uInt16(nId) );
340 }
341
342 // translate them into command URLs
343 css::uno::Sequence< OUString > aCommandURLs( aFormFeatures.size() );
344 auto aCommandURLsRange = asNonConstRange(aCommandURLs);
345 size_t i = 0;
346 for (auto const& formFeature : aFormFeatures)
347 {
348 aCommandURLsRange[i++] = lcl_getCommandURL(formFeature);
349 }
350
351 // retrieve the images for the command URLs
352 std::vector<Image> aCommandImages = m_pImageProvider->getCommandImages( aCommandURLs, m_eImageSize == eLarge );
353
354 // and set them at the toolbar
355 auto commandImage = aCommandImages.begin();
356 for (sal_Int16 formFeature : aFormFeatures)
357 {
358 m_pToolbar->SetItemImage( ToolBoxItemId(formFeature), *commandImage );
359 ++commandImage;
360 }
361
362 // parts of our layout is dependent on the size of our icons
363 Resize();
364 }
365
366
368 {
369 if ( _eSize != m_eImageSize )
370 {
371 m_eImageSize = _eSize;
373 }
374 }
375
376
378 {
379 implSetImageSize( _eSize );
380 }
381
382
384 {
385 const sal_uInt16* pGroupIds = nullptr;
386
387 switch ( _eGroup )
388 {
389 case ePosition:
390 {
391 static const sal_uInt16 aPositionIds[] = {
392 LID_RECORD_LABEL, FormFeature::MoveAbsolute, LID_RECORD_FILLER, FormFeature::TotalRecords, 0
393 };
394 pGroupIds = aPositionIds;
395 }
396 break;
397 case eNavigation:
398 {
399 static const sal_uInt16 aNavigationIds[] = {
400 FormFeature::MoveToFirst, FormFeature::MoveToPrevious, FormFeature::MoveToNext, FormFeature::MoveToLast, FormFeature::MoveToInsertRow, 0
401 };
402 pGroupIds = aNavigationIds;
403 }
404 break;
405 case eRecordActions:
406 {
407 static const sal_uInt16 aActionIds[] = {
408 FormFeature::SaveRecordChanges, FormFeature::UndoRecordChanges, FormFeature::DeleteRecord, FormFeature::ReloadForm, FormFeature::RefreshCurrentControl, 0
409 };
410 pGroupIds = aActionIds;
411 }
412 break;
413 case eFilterSort:
414 {
415 static const sal_uInt16 aFilterSortIds[] = {
416 FormFeature::SortAscending, FormFeature::SortDescending, FormFeature::InteractiveSort, FormFeature::AutoFilter, FormFeature::InteractiveFilter, FormFeature::ToggleApplyFilter, FormFeature::RemoveFilterAndSort, 0
417 };
418 pGroupIds = aFilterSortIds;
419 }
420 break;
421 default:
422 OSL_FAIL( "NavigationToolBar::ShowFunctionGroup: invalid group id!" );
423 }
424
425 if ( pGroupIds )
426 while ( *pGroupIds )
427 m_pToolbar->ShowItem( ToolBoxItemId(*pGroupIds++), _bShow );
428 }
429
430
432 {
433 sal_uInt16 nIndicatorItem = 0;
434 switch ( _eGroup )
435 {
436 case ePosition : nIndicatorItem = LID_RECORD_LABEL; break;
437 case eNavigation : nIndicatorItem = FormFeature::MoveToFirst; break;
438 case eRecordActions : nIndicatorItem = FormFeature::SaveRecordChanges; break;
439 case eFilterSort : nIndicatorItem = FormFeature::SortAscending; break;
440 default:
441 OSL_FAIL( "NavigationToolBar::IsFunctionGroupVisible: invalid group id!" );
442 }
443
444 return m_pToolbar->IsItemVisible( ToolBoxItemId(nIndicatorItem) );
445 }
446
447
449 {
450 Window::StateChanged( nType );
451
452 switch ( nType )
453 {
454 case StateChangedType::Zoom:
455// m_pToolbar->SetZoom( GetZoom() );
456// forEachItemWindow( setItemWindowZoom, NULL );
457 // the ToolBox class is not zoomable at the moment, so
458 // we better have no zoom at all instead of only half a zoom ...
459 break;
460
461 case StateChangedType::ControlFont:
464 break;
465
466 case StateChangedType::ControlForeground:
468 break;
469
470 case StateChangedType::Mirroring:
471 {
472 sal_Bool bIsRTLEnabled( IsRTLEnabled() );
473 m_pToolbar->EnableRTL( bIsRTLEnabled );
475 Resize();
476 }
477 break;
478 default:;
479 }
480 }
481
483 {
484 // resize/position the toolbox as a whole
485 sal_Int32 nToolbarHeight = m_pToolbar->CalcWindowSizePixel().Height();
486
487 sal_Int32 nMyHeight = GetOutputSizePixel().Height();
488 m_pToolbar->SetPosSizePixel( Point( 0, ( nMyHeight - nToolbarHeight ) / 2 ),
489 Size( GetSizePixel().Width(), nToolbarHeight ) );
490
491 Window::Resize();
492 }
493
495 {
496 Window::SetControlBackground();
497 m_pToolbar->SetControlBackground();
499
501 }
502
504 {
505 Window::SetControlBackground( _rColor );
506 m_pToolbar->SetControlBackground( _rColor );
508
510 }
511
513 {
514 Window::SetTextLineColor( );
515 m_pToolbar->SetTextLineColor( );
517 }
518
520 {
521 Window::SetTextLineColor( _rColor );
522 m_pToolbar->SetTextLineColor( _rColor );
524 }
525
526 void NavigationToolBar::forEachItemWindow( ItemWindowHandler _handler )
527 {
528 for ( ToolBox::ImplToolItems::size_type item = 0; item < m_pToolbar->GetItemCount(); ++item )
529 {
530 ToolBoxItemId nItemId = m_pToolbar->GetItemId( item );
531 vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( nItemId );
532 if ( pItemWindow )
533 (this->*_handler)( sal_uInt16(nItemId), pItemWindow );
534 }
535 }
536
537 void NavigationToolBar::forEachItemWindow( ItemWindowHandler2 _handler, const void* _pParam )
538 {
539 for ( ToolBox::ImplToolItems::size_type item = 0; item < m_pToolbar->GetItemCount(); ++item )
540 {
541 ToolBoxItemId nItemId = m_pToolbar->GetItemId( item );
542 vcl::Window* pItemWindow = m_pToolbar->GetItemWindow( nItemId );
543 if ( pItemWindow )
544 (*_handler)( sal_uInt16(nItemId), pItemWindow, _pParam );
545 }
546 }
547
548 void NavigationToolBar::setItemBackground( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow, const void* _pColor )
549 {
550 if ( _pColor )
551 _pItemWindow->SetControlBackground( *static_cast< const Color* >( _pColor ) );
552 else
553 _pItemWindow->SetControlBackground();
554 }
555
556 void NavigationToolBar::setTextLineColor( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow, const void* _pColor )
557 {
558 if ( _pColor )
559 _pItemWindow->SetTextLineColor( *static_cast< const Color* >( _pColor ) );
560 else
561 _pItemWindow->SetTextLineColor();
562 }
563
564 void NavigationToolBar::setItemControlFont( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow ) const
565 {
566 if ( IsControlFont() )
567 _pItemWindow->SetControlFont( GetControlFont() );
568 else
569 _pItemWindow->SetControlFont( );
570 }
571
572 void NavigationToolBar::setItemControlForeground( sal_uInt16 /* _nItemId */, vcl::Window* _pItemWindow ) const
573 {
574 if ( IsControlForeground() )
576 else
577 _pItemWindow->SetControlForeground( );
578 _pItemWindow->SetTextColor( GetTextColor() );
579 }
580
581 void NavigationToolBar::adjustItemWindowWidth( sal_uInt16 _nItemId, vcl::Window* _pItemWindow ) const
582 {
583 int nHeight = 0;
584
585 OUString sItemText;
586 switch ( _nItemId )
587 {
588 case LID_RECORD_LABEL:
589 sItemText = getLabelString( RID_STR_LABEL_RECORD );
590 break;
591
593 sItemText = getLabelString( RID_STR_LABEL_OF );
594 break;
595
596 case FormFeature::MoveAbsolute:
597 sItemText = "12345678";
598 nHeight = _pItemWindow->get_preferred_size().Height();
599 break;
600
601 case FormFeature::TotalRecords:
602 sItemText = "123456";
603 break;
604 }
605
606 if (nHeight == 0)
607 nHeight = _pItemWindow->GetTextHeight() + 4;
608
609 Size aSize(_pItemWindow->GetTextWidth(sItemText), nHeight);
610 aSize.AdjustWidth(6 );
611 _pItemWindow->SetSizePixel( aSize );
612
613 m_pToolbar->SetItemWindow( ToolBoxItemId(_nItemId), _pItemWindow );
614 }
615
616 void NavigationToolBar::enableItemRTL( sal_uInt16 /*_nItemId*/, vcl::Window* _pItemWindow, const void* _pIsRTLEnabled )
617 {
618 _pItemWindow->EnableRTL( *static_cast< const sal_Bool* >( _pIsRTLEnabled ) );
619 }
620
622 : RecordItemWindow(pParent)
623 , m_pDispatcher( nullptr )
624 {
625 }
626
628 {
629 m_pDispatcher = _pDispatcher;
630 }
631
633 {
634 if (!m_pDispatcher)
635 return;
636 m_pDispatcher->dispatchWithArgument( FormFeature::MoveAbsolute, "Position", Any( static_cast<sal_Int32>(nRecord) ) );
637 }
638
639} // namespace frm
640
641/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
PropertiesInfo aProperties
constexpr tools::Long Height() const
tools::Long AdjustWidth(tools::Long n)
ToolBoxItemId GetCurItemId() const
static constexpr auto ITEM_NOTFOUND
static VclPtr< reference_type > Create(Arg &&... arg)
virtual bool isEnabled(sal_Int16 _nFeatureId) const =0
checks whether a given feature is enabled
virtual void dispatch(sal_Int16 _nFeatureId) const =0
dispatches a feature
virtual void dispatchWithArgument(sal_Int16 _nFeatureId, const char *_pParamName, const css::uno::Any &_rParamValue) const =0
dispatches a feature, with an additional named parameter
const IFeatureDispatcher * m_pDispatcher
Definition: navtoolbar.cxx:101
void setDispatcher(const IFeatureDispatcher *_pDispatcher)
Definition: navtoolbar.cxx:110
virtual void Select() override
Definition: navtoolbar.cxx:122
ImplNavToolBar(vcl::Window *_pParent)
Definition: navtoolbar.cxx:104
static void setItemBackground(sal_uInt16, vcl::Window *_pItemWindow, const void *_pColor)
Definition: navtoolbar.cxx:548
virtual ~NavigationToolBar() override
Definition: navtoolbar.cxx:149
void implInit()
ctor implementation
Definition: navtoolbar.cxx:232
void setFeatureText(sal_Int16 _nFeatureId, const OUString &_rText)
sets the text of a given feature
Definition: navtoolbar.cxx:215
static void enableItemRTL(sal_uInt16, vcl::Window *_pItemWindow, const void *_pIsRTLEnabled)
Definition: navtoolbar.cxx:616
void adjustItemWindowWidth(sal_uInt16 _nItemId, vcl::Window *_pItemWindow) const
Definition: navtoolbar.cxx:581
void implSetImageSize(ImageSize _eSize)
impl version of SetImageSize
Definition: navtoolbar.cxx:367
void setDispatcher(const IFeatureDispatcher *_pDispatcher)
sets the dispatcher which is to be used for the features
Definition: navtoolbar.cxx:163
const std::shared_ptr< const DocumentCommandImageProvider > m_pImageProvider
Definition: navtoolbar.hxx:53
void enableFeature(sal_Int16 _nFeatureId, bool _bEnabled)
enables or disables a given feature
Definition: navtoolbar.cxx:199
void checkFeature(sal_Int16 _nFeatureId, bool _bEnabled)
checks or unchecks a given feature
Definition: navtoolbar.cxx:207
void ShowFunctionGroup(FunctionGroup _eGroup, bool _bShow)
shows or hides a function group
Definition: navtoolbar.cxx:383
void implUpdateImages()
updates the images of our items
Definition: navtoolbar.cxx:323
virtual void Resize() override
Definition: navtoolbar.cxx:482
void implEnableItem(sal_uInt16 _nItemId, bool _bEnabled)
enables or disables an item, plus possible dependent items
Definition: navtoolbar.cxx:188
virtual void dispose() override
Definition: navtoolbar.cxx:154
void setItemControlFont(sal_uInt16, vcl::Window *_pItemWindow) const
Definition: navtoolbar.cxx:564
VclPtr< ImplNavToolBar > m_pToolbar
Definition: navtoolbar.hxx:55
virtual void StateChanged(StateChangedType nType) override
Definition: navtoolbar.cxx:448
void forEachItemWindow(ItemWindowHandler _handler)
Definition: navtoolbar.cxx:526
static void setTextLineColor(sal_uInt16, vcl::Window *_pItemWindow, const void *_pColor)
Definition: navtoolbar.cxx:556
void setItemControlForeground(sal_uInt16, vcl::Window *_pItemWindow) const
Definition: navtoolbar.cxx:572
void SetImageSize(ImageSize _eSize)
sets the size of the images
Definition: navtoolbar.cxx:377
const IFeatureDispatcher * m_pDispatcher
Definition: navtoolbar.hxx:51
bool IsFunctionGroupVisible(FunctionGroup _eGroup)
determines whether or not a given function group is currently visible
Definition: navtoolbar.cxx:431
const OUString m_sModuleId
Definition: navtoolbar.hxx:57
::std::vector< VclPtr< vcl::Window > > m_aChildWins
Definition: navtoolbar.hxx:56
NavigationToolBar(vcl::Window *_pParent, WinBits _nStyle, PCommandImageProvider _pImageProvider, OUString sModuleId)
Definition: navtoolbar.cxx:136
const IFeatureDispatcher * m_pDispatcher
Definition: navtoolbar.hxx:149
RecordPositionInput(vcl::Window *_pParent)
Definition: navtoolbar.cxx:621
virtual void PositionFired(sal_Int64 nRecord) override
Definition: navtoolbar.cxx:632
void setDispatcher(const IFeatureDispatcher *_pDispatcher)
sets the dispatcher which is to be used for the features
Definition: navtoolbar.cxx:627
virtual void dispose() override
tools::Long GetTextWidth(const OUString &rStr, sal_Int32 nIndex=0, sal_Int32 nLen=-1, vcl::text::TextLayoutCache const *=nullptr, SalLayoutGlyphs const *const pLayoutCache=nullptr) const
void SetControlForeground()
bool IsControlFont() const
void SetControlFont()
virtual void SetSizePixel(const Size &rNewSize)
Size get_preferred_size() const
const Color & GetControlForeground() const
void SetControlBackground()
virtual void EnableRTL(bool bEnable=true)
tools::Long GetTextHeight() const
bool IsControlForeground() const
vcl::Font GetControlFont() const
const Color & GetTextColor() const
bool IsRTLEnabled() const
virtual Size GetSizePixel() const
Size GetOutputSizePixel() const
void SetTextLineColor()
void SetTextColor(const Color &rColor)
#define DBG_ASSERT(sCon, aError)
sal_uInt16 nPos
#define SAL_N_ELEMENTS(arr)
rEdit set_text(aStr)
OUString loadString(TranslateId aResId)
loads the string with the specified resource id from the FormLayer mo file
ListBox is a bit confusing / different from other form components, so here are a few notes:
Definition: BaseListBox.hxx:25
std::shared_ptr< const DocumentCommandImageProvider > PCommandImageProvider
int i
Sequence< beans::PropertyValue > GetCommandProperties(const OUString &rsCommandName, const OUString &rsModuleName)
OUString GetLabelForCommand(const css::uno::Sequence< css::beans::PropertyValue > &rProperties)
#define LID_RECORD_LABEL
Definition: navtoolbar.cxx:40
#define LID_RECORD_FILLER
Definition: navtoolbar.cxx:41
sal_Int16 nId
QPRO_FUNC_TYPE nType
unsigned char sal_Bool
StateChangedType
sal_Int64 WinBits
WinBits const WB_3DLOOK