LibreOffice Module sfx2 (master) 1
mgetempl.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 <comphelper/string.hxx>
21#include <vcl/svapp.hxx>
22#include <vcl/weld.hxx>
23#include <svl/eitem.hxx>
24#include <svl/intitem.hxx>
25#include <svl/style.hxx>
26#include <osl/diagnose.h>
27
28#include <sfx2/styfitem.hxx>
29#include <sfx2/styledlg.hxx>
30#include <sfx2/tabdlg.hxx>
31#include <sfx2/app.hxx>
32#include <sfx2/objsh.hxx>
33#include <sfx2/sfxresid.hxx>
34#include <sfx2/module.hxx>
35#include <sfx2/sfxsids.hrc>
36
37#include <sfx2/strings.hrc>
38
39#include <svl/stritem.hxx>
40#include <sfx2/dispatch.hxx>
41
42#include "mgetempl.hxx"
43
44/* SfxManageStyleSheetPage Constructor
45 *
46 * initializes the list box with the templates
47 */
49 : SfxTabPage(pPage, pController, "sfx/ui/managestylepage.ui", "ManageStylePage", &rAttrSet)
50 , pStyle(&static_cast<SfxStyleDialogController*>(pController)->GetStyleSheet())
51 , pItem(nullptr)
52 , bModified(false)
53 , aName(pStyle->GetName())
54 , aFollow(pStyle->GetFollow())
55 , aParent(pStyle->GetParent())
56 , nFlags(pStyle->GetMask())
57 , m_xName(m_xBuilder->weld_entry("name"))
58 , m_xAutoCB(m_xBuilder->weld_check_button("autoupdate"))
59 , m_xFollowFt(m_xBuilder->weld_label("nextstyleft"))
60 , m_xFollowLb(m_xBuilder->weld_combo_box("nextstyle"))
61 , m_xEditStyleBtn(m_xBuilder->weld_button("editstyle"))
62 , m_xBaseFt(m_xBuilder->weld_label("linkedwithft"))
63 , m_xBaseLb(m_xBuilder->weld_combo_box("linkedwith"))
64 , m_xEditLinkStyleBtn(m_xBuilder->weld_button("editlinkstyle"))
65 , m_xFilterFt(m_xBuilder->weld_label("categoryft"))
66 , m_xFilterLb(m_xBuilder->weld_combo_box("category"))
67 , m_xDescFt(m_xBuilder->weld_label("desc"))
68{
69 m_xFollowLb->make_sorted();
70 // tdf#120188 like SwCharURLPage limit the width of the style combos
71 const int nMaxWidth(m_xFollowLb->get_approximate_digit_width() * 50);
72 m_xFollowLb->set_size_request(nMaxWidth , -1);
73 m_xBaseLb->make_sorted();
74 m_xBaseLb->set_size_request(nMaxWidth , -1);
75 //note that the code depends on categories not being lexically
76 //sorted, so if it's changed to sorted, the code needs to
77 //be adapted to be position unaware
78 m_xFilterLb->set_size_request(nMaxWidth , -1);
79
80 // this Page needs ExchangeSupport
82
83 if ( aFollow.isEmpty() || aFollow == aName )
84 m_xEditStyleBtn->set_sensitive(false);
85 else
86 m_xEditStyleBtn->set_sensitive(true);
87
88 int linkSelectPos = m_xBaseLb->get_active();
89 if ( linkSelectPos == 0 )
90 m_xEditLinkStyleBtn->set_sensitive(false);
91 else
92 m_xEditLinkStyleBtn->set_sensitive(true);
93
95
96 SfxStyleSheetBasePool* pPool = nullptr;
98
99 if ( pDocShell )
100 pPool = pDocShell->GetStyleSheetPool();
101 OSL_ENSURE( pPool, "no Pool or no DocShell" );
102
103 if ( pPool )
104 {
105 pPool->First(pStyle->GetFamily()); // for SW - update internal list
106 }
107
108 if ( pStyle->GetName().isEmpty() && pPool )
109 {
110 // NullString as Name -> generate Name
112 pStyle->SetName( aNoName );
113 aName = aNoName;
116 }
117 m_xName->set_text(pStyle->GetName());
118
119 // Set the field read-only if it is NOT an user-defined style
120 // but allow selecting and copying
121 if (pStyle->IsUserDefined())
122 {
123 m_xName->set_can_focus(true);
124 m_xName->set_editable(true);
125 m_xName->set_sensitive(true);
126 m_xName->grab_focus(); // tdf#142017 default to focus within the page, not in notebook tab
127 }
128 else
129 {
130 m_xName->set_sensitive(false);
131 }
132
133 if ( pStyle->HasFollowSupport() && pPool )
134 {
135 SfxStyleSheetBase* pPoolStyle = pPool->First(pStyle->GetFamily());
136
137 m_xFollowLb->freeze();
138
139 while ( pPoolStyle )
140 {
141 m_xFollowLb->append_text(pPoolStyle->GetName());
142 pPoolStyle = pPool->Next();
143 }
144
145 // A new Template is not yet in the Pool
146 if (m_xFollowLb->find_text(pStyle->GetName()) == -1)
147 m_xFollowLb->append_text(pStyle->GetName());
148
149 m_xFollowLb->thaw();
150 }
151 else
152 {
153 m_xFollowFt->set_sensitive(false);
154 m_xFollowFt->hide();
155 m_xFollowLb->set_sensitive(false);
156 m_xFollowLb->hide();
157 m_xEditStyleBtn->hide();
158 }
159
160 if ( pStyle->HasParentSupport() && pPool )
161 {
162 m_xBaseLb->freeze();
163
165 // the base template can be set to NULL
166 m_xBaseLb->append_text(SfxResId(STR_NONE));
167
168 SfxStyleSheetBase* pPoolStyle = pPool->First(pStyle->GetFamily());
169
170 while ( pPoolStyle )
171 {
172 const OUString aStr( pPoolStyle->GetName() );
173 // own name as base template
174 if ( aStr != aName )
175 m_xBaseLb->append_text(aStr);
176 pPoolStyle = pPool->Next();
177 }
178
179 m_xBaseLb->thaw();
180 }
181 else
182 {
183 m_xBaseFt->set_sensitive(false);
184 m_xBaseLb->set_sensitive(false);
185 }
186
187 size_t nCount = mxFamilies->size();
188 size_t i;
189 for ( i = 0; i < nCount; ++i )
190 {
191 pItem = &(mxFamilies->at(i));
192
193 if ( pItem->GetFamily() == pStyle->GetFamily() )
194 break;
195 }
196
197 if ( i < nCount )
198 {
199 sal_uInt16 nStyleFilterIdx = 0xffff;
200 // Filter flags
201 const SfxStyleFilter& rList = pItem->GetFilterList();
202 nCount = rList.size();
203 sal_uInt16 nIdx = 0;
204 SfxStyleSearchBits nMask = pStyle->GetMask() & ~SfxStyleSearchBits::UserDefined;
205
206 if ( nMask == SfxStyleSearchBits::Auto ) // User Template?
207 nMask = pStyle->GetMask();
208
209 for ( i = 0; i < nCount; ++i )
210 {
211 const SfxFilterTuple& rTupel = rList[ i ];
212
213 if ( rTupel.nFlags != SfxStyleSearchBits::Auto &&
214 rTupel.nFlags != SfxStyleSearchBits::Used &&
215 rTupel.nFlags != SfxStyleSearchBits::AllVisible &&
216 rTupel.nFlags != SfxStyleSearchBits::All )
217 {
218 OUString sId(OUString::number(i));
219 m_xFilterLb->insert(nIdx, rTupel.aName, &sId, nullptr, nullptr);
220 if ( ( rTupel.nFlags & nMask ) == nMask )
221 nStyleFilterIdx = nIdx;
222 ++nIdx;
223 }
224 }
225
226 if ( nStyleFilterIdx != 0xFFFF )
227 m_xFilterLb->set_active(nStyleFilterIdx);
228 }
229
230 if ( !m_xFilterLb->get_count() || !pStyle->IsUserDefined() )
231 {
232 pItem = nullptr;
233 m_xFilterFt->set_sensitive(false);
234 m_xFilterLb->set_sensitive(false);
235 }
236 else
237 m_xFilterLb->save_value();
239
240 if (m_xFollowLb->get_sensitive() || m_xBaseLb->get_sensitive())
241 {
242 m_xName->connect_focus_in(
243 LINK( this, SfxManageStyleSheetPage, GetFocusHdl ) );
244 m_xName->connect_focus_out(
245 LINK( this, SfxManageStyleSheetPage, LoseFocusHdl ) );
246 }
247 // It is a style with auto update? (SW only)
248 if(SfxItemState::SET == rAttrSet.GetItemState(SID_ATTR_AUTO_STYLE_UPDATE))
249 m_xAutoCB->show();
250 m_xFollowLb->connect_changed(LINK(this, SfxManageStyleSheetPage, EditStyleSelectHdl_Impl));
251 m_xBaseLb->connect_changed(LINK(this, SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl));
252 m_xEditStyleBtn->connect_clicked(LINK(this, SfxManageStyleSheetPage, EditStyleHdl_Impl));
253 m_xEditLinkStyleBtn->connect_clicked(LINK(this, SfxManageStyleSheetPage, EditLinkStyleHdl_Impl));
254}
255
257{
258 mxFamilies.reset();
259 pItem = nullptr;
260 pStyle = nullptr;
261}
262
264 const OUString& rNew )
265
266/* [Description]
267
268 After the change of a template name update the ListBox pBox
269
270 [Parameter]
271
272 ListBox* pBox ListBox, whose entries are to be updated
273 const String& rNew the new Name
274*/
275
276{
277 if (pBox->get_sensitive())
278 {
279 // it is the current entry, which name was modified
280 const bool bSelect = pBox->get_active_text() == aBuf;
281 int nOldIndex = pBox->find_text(aBuf);
282 if (nOldIndex != -1)
283 pBox->remove(nOldIndex);
284 pBox->append_text(rNew);
285
286 if (bSelect)
287 pBox->set_active_text(rNew);
288 }
289}
290
292
293/* [Description]
294
295 Set attribute description. Get the set metric for this.
296*/
297
298{
299 MapUnit eUnit = MapUnit::MapCM;
300 FieldUnit eFieldUnit( FieldUnit::CM );
302 if ( pModule )
303 {
304 const SfxPoolItem* pPoolItem = pModule->GetItem( SID_ATTR_METRIC );
305 if ( pPoolItem )
306 eFieldUnit = static_cast<FieldUnit>(static_cast<const SfxUInt16Item*>( pPoolItem )->GetValue());
307 }
308
309 switch ( eFieldUnit )
310 {
311 case FieldUnit::MM: eUnit = MapUnit::MapMM; break;
312 case FieldUnit::CM:
313 case FieldUnit::M:
314 case FieldUnit::KM: eUnit = MapUnit::MapCM; break;
315 case FieldUnit::POINT:
316 case FieldUnit::PICA: eUnit = MapUnit::MapPoint; break;
317 case FieldUnit::INCH:
318 case FieldUnit::FOOT:
319 case FieldUnit::MILE: eUnit = MapUnit::MapInch; break;
320
321 default:
322 OSL_FAIL( "non supported field unit" );
323 }
324 m_xDescFt->set_label(pStyle->GetDescription(eUnit));
325}
326
328{
329 OUString aTemplName(m_xFollowLb->get_active_text());
330 OUString aEditTemplName(m_xName->get_text());
331 m_xEditStyleBtn->set_sensitive(aTemplName != aEditTemplName);
332}
333
335{
336 OUString aTemplName(m_xFollowLb->get_active_text());
337 Execute_Impl(SID_STYLE_EDIT, aTemplName, static_cast<sal_uInt16>(pStyle->GetFamily()));
338}
339
340IMPL_LINK_NOARG(SfxManageStyleSheetPage, EditLinkStyleSelectHdl_Impl, weld::ComboBox&, void)
341{
342 int linkSelectPos = m_xBaseLb->get_active();
343 if ( linkSelectPos == 0 )
344 m_xEditLinkStyleBtn->set_sensitive(false);
345 else
346 m_xEditLinkStyleBtn->set_sensitive(true);
347}
348
350{
351 OUString aTemplName(m_xBaseLb->get_active_text());
352 if (aTemplName != SfxResId(STR_NONE))
353 Execute_Impl( SID_STYLE_EDIT, aTemplName, static_cast<sal_uInt16>(pStyle->GetFamily()) );
354}
355
356// Internal: Perform functions through the Dispatcher
358 sal_uInt16 nId, const OUString &rStr, sal_uInt16 nFamily)
359{
360
361 SfxDispatcher &rDispatcher = *SfxGetpApp()->GetDispatcher_Impl();
362 SfxStringItem aItem(nId, rStr);
363 SfxUInt16Item aFamily(SID_STYLE_FAMILY, nFamily);
364 const SfxPoolItem* pItems[ 6 ];
365 sal_uInt16 nCount = 0;
366 if( !rStr.isEmpty() )
367 pItems[ nCount++ ] = &aItem;
368 pItems[ nCount++ ] = &aFamily;
369
370 pItems[ nCount++ ] = nullptr;
371
372 const SfxPoolItem* pItem = rDispatcher.Execute(
374 pItems );
375
376 return pItem != nullptr;
377
378}
379
380IMPL_LINK(SfxManageStyleSheetPage, GetFocusHdl, weld::Widget&, rControl, void)
381
382/* [Description]
383
384 StarView Handler; GetFocus-Handler of the Edits with the template name.
385*/
386
387{
388 weld::Entry& rEdit = dynamic_cast<weld::Entry&>(rControl);
390}
391
392IMPL_LINK(SfxManageStyleSheetPage, LoseFocusHdl, weld::Widget&, rControl, void)
393
394/* [Description]
395
396 StarView Handler; lose-focus-handler of the edits of the template name.
397 This will update the listbox with the subsequent templates. The current
398 template itself is not returned in the listbox of the base templates.
399*/
400
401{
402 weld::Entry& rEdit = dynamic_cast<weld::Entry&>(rControl);
403 const OUString aStr(comphelper::string::stripStart(rEdit.get_text(), ' '));
405 // Update the Listbox of the base template if possible
406 if ( aStr != aBuf )
407 UpdateName_Impl(m_xFollowLb.get(), aStr);
408}
409
411
412/* [Description]
413
414 Handler for setting the (modified) data. I called from the OK of the
415 SfxTabDialog.
416
417 [Parameter]
418
419 SfxItemSet &rAttrSet The set, which receives the data.
420
421 [Return value]
422
423 sal_Bool sal_True: The data had been changed
424 sal_False: The data had not been changed
425
426 [Cross-reference]
427
428 <class SfxTabDialog>
429*/
430
431{
432 const int nFilterIdx = m_xFilterLb->get_active();
433
434 // Set Filter
435
436 if ( nFilterIdx != -1 &&
437 m_xFilterLb->get_value_changed_from_saved() &&
438 m_xFilterLb->get_sensitive() )
439 {
440 bModified = true;
441 OSL_ENSURE( pItem, "No Item" );
442 // is only possibly for user templates
443 SfxStyleSearchBits nMask = pItem->GetFilterList()[m_xFilterLb->get_id(nFilterIdx).toUInt32()].nFlags | SfxStyleSearchBits::UserDefined;
444 pStyle->SetMask( nMask );
445 }
446 if (m_xAutoCB->get_visible() && m_xAutoCB->get_state_changed_from_saved())
447 {
448 rSet->Put(SfxBoolItem(SID_ATTR_AUTO_STYLE_UPDATE, m_xAutoCB->get_active()));
449 }
450
451 return bModified;
452}
453
454
456
457/* [Description]
458
459 Handler to initialize the page with the initial data.
460
461 [Parameter]
462
463 const SfxItemSet &rAttrSet The data set
464
465 [Cross-reference]
466
467 <class SfxTabDialog>
468*/
469
470{
471 bModified = false;
472 OUString sCmp( pStyle->GetName() );
473
474 if ( sCmp != aName )
475 pStyle->SetName( aName );
476 m_xName->set_text( aName );
477 if (m_xName->get_editable())
478 m_xName->select_region(0, -1);
479
480 if ( m_xFollowLb->get_sensitive() )
481 {
482 sCmp = pStyle->GetFollow();
483
484 if ( sCmp != aFollow )
486
487 if ( aFollow.isEmpty() )
488 {
489 m_xFollowLb->set_active_text( aName );
490 m_xEditStyleBtn->set_sensitive( false );
491 }
492 else
493 m_xFollowLb->set_active_text( aFollow );
494 }
495
496 if (m_xBaseLb->get_sensitive())
497 {
498 sCmp = pStyle->GetParent();
499
500 if ( sCmp != aParent )
502
503 if ( aParent.isEmpty() )
504 {
505 m_xBaseLb->set_active_text( SfxResId(STR_NONE) );
506 m_xEditLinkStyleBtn->set_sensitive( false );
507 }
508 else
509 m_xBaseLb->set_active_text( aParent );
510
511 if ( SfxResId(STR_STANDARD) == aName )
512 {
513 // the default template can not be linked
514 m_xBaseFt->set_sensitive(false);
515 m_xBaseLb->set_sensitive(false);
516 }
517 }
518 else
519 m_xEditLinkStyleBtn->set_sensitive( false );
520
521 if (m_xFilterLb->get_sensitive())
522 {
524
525 if ( nCmp != nFlags )
527 m_xFilterLb->set_active_text(m_xFilterLb->get_saved_value());
528 }
529}
530
531std::unique_ptr<SfxTabPage> SfxManageStyleSheetPage::Create( weld::Container* pPage, weld::DialogController* pController,
532 const SfxItemSet *rAttrSet )
533{
534 return std::make_unique<SfxManageStyleSheetPage>(pPage, pController, *rAttrSet);
535}
536
538
539/* [Description]
540
541 ActivatePage handler of SfxTabDialog, is used for the update of the
542 descriptive text, since this might have changed through changes of data on
543 other pages.
544
545 [Parameter]
546
547 const SfxItemSet& the set for the exchange of data; is not used here.
548
549 [Cross-reference]
550
551 <SfxTabDialog::ActivatePage(const SfxItemSet &)>
552*/
553
554{
556
557 // It is a style with auto update? (SW only)
558 const SfxBoolItem* pPoolItem;
559
560 if ( (pPoolItem = rSet.GetItemIfSet( SID_ATTR_AUTO_STYLE_UPDATE, false )) )
561 m_xAutoCB->set_active(pPoolItem->GetValue());
562 m_xAutoCB->save_state();
563 m_xName->save_value();
564}
565
567
568/* [Description]
569
570 DeactivatePage-handler of SfxTabDialog; data is set on the template, so
571 that the correct inheritance on the other pages of the dialog is made.
572 If an error occurs, leaving the page is prevented.
573 [Parameter]
574
575 SfxItemSet* the set for the exchange of data; is not used here.
576
577 [Cross-reference]
578
579 <SfxTabDialog::DeactivatePage(SfxItemSet*)>
580*/
581
582{
584
585 if (m_xName->get_value_changed_from_saved())
586 {
587 // By pressing <Enter> LoseFocus() is not triggered through StarView
588 if (m_xName->has_focus())
589 LoseFocusHdl( *m_xName );
590
591 if (!pStyle->SetName(comphelper::string::stripStart(m_xName->get_text(), ' ')))
592 {
593 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
594 VclMessageType::Info, VclButtonsType::Ok,
595 SfxResId(STR_TABPAGE_INVALIDNAME)));
596 xBox->run();
597 m_xName->grab_focus();
598 m_xName->select_region(0, -1);
600 }
601 bModified = true;
602 }
603
604 if (pStyle->HasFollowSupport() && m_xFollowLb->get_sensitive())
605 {
606 const OUString aFollowEntry( m_xFollowLb->get_active_text() );
607
608 if ( pStyle->GetFollow() != aFollowEntry )
609 {
610 if ( !pStyle->SetFollow( aFollowEntry ) )
611 {
612 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
613 VclMessageType::Info, VclButtonsType::Ok,
614 SfxResId(STR_TABPAGE_INVALIDSTYLE)));
615 xBox->run();
616 m_xFollowLb->grab_focus();
618 }
619 bModified = true;
620 }
621 }
622
623 if (m_xBaseLb->get_sensitive())
624 {
625 OUString aParentEntry( m_xBaseLb->get_active_text() );
626
627 if ( SfxResId(STR_NONE) == aParentEntry || aParentEntry == pStyle->GetName() )
628 aParentEntry.clear();
629
630 if ( pStyle->GetParent() != aParentEntry )
631 {
632 if ( !pStyle->SetParent( aParentEntry ) )
633 {
634 std::unique_ptr<weld::MessageDialog> xBox(Application::CreateMessageDialog(GetFrameWeld(),
635 VclMessageType::Info, VclButtonsType::Ok,
636 SfxResId(STR_TABPAGE_INVALIDPARENT)));
637 xBox->run();
638 m_xBaseLb->grab_focus();
640 }
641 bModified = true;
642 nRet = nRet | DeactivateRC::RefreshSet;
643 }
644 }
645
646 if ( pItemSet )
647 FillItemSet( pItemSet );
648
649 return nRet;
650}
651
652/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
SfxApplication * SfxGetpApp()
Definition: app.hxx:231
IMPL_LINK(SfxEventAsyncer_Impl, IdleHdl, Timer *, pAsyncIdle, void)
Definition: appcfg.cxx:96
static weld::MessageDialog * CreateMessageDialog(weld::Widget *pParent, VclMessageType eMessageType, VclButtonsType eButtonType, const OUString &rPrimaryMessage, const ILibreOfficeKitNotifier *pNotifier=nullptr)
SAL_DLLPRIVATE SfxDispatcher * GetDispatcher_Impl()
Definition: app.cxx:228
static SAL_DLLPRIVATE SfxModule * GetModule_Impl()
Definition: appmisc.cxx:88
bool GetValue() const
const SfxPoolItem * Execute(sal_uInt16 nSlot, SfxCallMode nCall=SfxCallMode::SLOT, const SfxPoolItem **pArgs=nullptr, sal_uInt16 nModi=0, const SfxPoolItem **pInternalArgs=nullptr)
Method to execute a <SfxSlot>s over the Slot-Id.
Definition: dispatch.cxx:833
const T * GetItemIfSet(TypedWhichId< T > nWhich, bool bSrchInParent=true) const
SfxItemState GetItemState(sal_uInt16 nWhich, bool bSrchInParent=true, const SfxPoolItem **ppItem=nullptr) const
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxStyleFamilyItem * pItem
Definition: mgetempl.hxx:43
std::unique_ptr< weld::ComboBox > m_xFollowLb
Definition: mgetempl.hxx:56
std::unique_ptr< weld::Button > m_xEditStyleBtn
Definition: mgetempl.hxx:57
virtual bool FillItemSet(SfxItemSet *) override
Definition: mgetempl.cxx:410
std::unique_ptr< weld::Label > m_xDescFt
Definition: mgetempl.hxx:63
virtual void Reset(const SfxItemSet *) override
Definition: mgetempl.cxx:455
std::unique_ptr< weld::Button > m_xEditLinkStyleBtn
Definition: mgetempl.hxx:60
virtual DeactivateRC DeactivatePage(SfxItemSet *) override
Definition: mgetempl.cxx:566
std::unique_ptr< weld::Label > m_xFilterFt
Definition: mgetempl.hxx:61
SfxStyleSheetBase * pStyle
Definition: mgetempl.hxx:41
static bool Execute_Impl(sal_uInt16 nId, const OUString &rStr, sal_uInt16 nFamily)
Definition: mgetempl.cxx:357
std::optional< SfxStyleFamilies > mxFamilies
Definition: mgetempl.hxx:42
std::unique_ptr< weld::ComboBox > m_xBaseLb
Definition: mgetempl.hxx:59
std::unique_ptr< weld::Label > m_xFollowFt
Definition: mgetempl.hxx:55
std::unique_ptr< weld::Label > m_xBaseFt
Definition: mgetempl.hxx:58
SfxManageStyleSheetPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rAttrSet)
Definition: mgetempl.cxx:48
virtual ~SfxManageStyleSheetPage() override
Definition: mgetempl.cxx:256
void UpdateName_Impl(weld::ComboBox *, const OUString &rNew)
Definition: mgetempl.cxx:263
virtual void ActivatePage(const SfxItemSet &) override
Definition: mgetempl.cxx:537
SfxStyleSearchBits nFlags
Definition: mgetempl.hxx:51
std::unique_ptr< weld::ComboBox > m_xFilterLb
Definition: mgetempl.hxx:62
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *)
Definition: mgetempl.cxx:531
std::unique_ptr< weld::Entry > m_xName
Definition: mgetempl.hxx:53
std::unique_ptr< weld::CheckButton > m_xAutoCB
Definition: mgetempl.hxx:54
static SfxModule * GetActiveModule(SfxViewFrame *pFrame=nullptr)
Definition: module.cxx:208
virtual std::optional< SfxStyleFamilies > CreateStyleFamilies()
Definition: module.hxx:82
virtual SfxStyleSheetBasePool * GetStyleSheetPool()
Definition: objcont.cxx:346
static SAL_WARN_UNUSED_RESULT SfxObjectShell * Current()
Definition: objxtor.cxx:481
const SfxPoolItem * GetItem(sal_uInt16 nSlotId) const
With this method any objects of <SfxPoolItemu> subclasses can be accessed.
Definition: shell.cxx:144
static OUString GenerateUnusedName(SfxStyleSheetBasePool &rPool, SfxStyleFamily eFam)
Definition: styledlg.cxx:112
SfxStyleFamily GetFamily() const
Definition: styfitem.hxx:54
const SfxStyleFilter & GetFilterList() const
Definition: styfitem.hxx:55
SfxStyleSheetBase * First(SfxStyleFamily eFamily, SfxStyleSearchBits eMask=SfxStyleSearchBits::All)
SfxStyleSheetBase * Next()
SfxStyleSearchBits GetMask() const
virtual bool HasClearParentSupport() const
virtual bool SetName(const OUString &rNewName, bool bReindexNow=true)
virtual const OUString & GetParent() const
const OUString & GetName() const
virtual bool HasFollowSupport() const
SfxStyleFamily GetFamily() const
bool IsUserDefined() const
virtual bool HasParentSupport() const
virtual const OUString & GetFollow() const
virtual bool SetParent(const OUString &)
virtual bool SetFollow(const OUString &)
void SetMask(SfxStyleSearchBits mask)
virtual OUString GetDescription(MapUnit eMetric)
void SetExchangeSupport()
Definition: tabdlg.hxx:243
weld::Window * GetFrameWeld() const
Definition: tabdlg.cxx:296
virtual int find_text(const OUString &rStr) const=0
virtual OUString get_active_text() const=0
void append_text(const OUString &rStr)
virtual void remove(int pos)=0
void set_active_text(const OUString &rStr)
virtual void set_text(const OUString &rText)=0
virtual OUString get_text() const=0
virtual bool get_sensitive() const=0
int nCount
virtual OUString GetName() const override
FieldUnit
OUString aName
MapUnit
aStr
Definition: mgetempl.cxx:407
IMPL_LINK_NOARG(SfxManageStyleSheetPage, EditStyleSelectHdl_Impl, weld::ComboBox &, void)
Definition: mgetempl.cxx:327
aBuf
Definition: mgetempl.cxx:389
OString stripStart(const OString &rIn, char c)
int i
sal_Int16 nId
const char GetValue[]
OUString SfxResId(TranslateId aId)
Definition: sfxresid.cxx:22
static SfxItemSet & rSet
Definition: shell.cxx:534
OUString aName
Definition: styfitem.hxx:32
SfxStyleSearchBits nFlags
Definition: styfitem.hxx:33
std::vector< SfxFilterTuple > SfxStyleFilter
Definition: styfitem.hxx:41
SfxStyleSearchBits
DeactivateRC
Definition: tabdlg.hxx:173
OUString sId