22#include <rtl/ustring.hxx>
25#include <com/sun/star/uno/Sequence.h>
80 static_cast<SwLabPage*
>(&rPage)->InitDatabaseBox();
82 static_cast<SwLabPage*
>(&rPage)->SetToBusinessCard();
84 else if (rId ==
"options")
91 , m_pDBManager(pDBManager_)
101 std::unique_ptr<SwLabRec> pRec(
new SwLabRec);
102 pRec->m_aMake = pRec->m_aType =
SwResId(STR_CUSTOM_LABEL);
103 pRec->SetFromItem( aItem );
105 bool bDouble =
false;
107 for (
const std::unique_ptr<SwLabRec> &
i : *
m_pRecs)
109 if (pRec->m_aMake ==
i->m_aMake &&
110 pRec->m_aType ==
i->m_aType)
120 size_t nLstGroup = 0;
122 for(
size_t nMan = 0; nMan < rMan.size(); ++nMan)
163 if (rActItem != rOldItem)
183 const OUString sCustom(
SwResId(STR_CUSTOM_LABEL));
188 pRec =
Recs()[
i].get();
189 if (pRec->
m_aType != sCustom &&
197 pRec =
Recs()[0].get();
211 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/cardmediumpage.ui",
"CardMediumPage", &
rSet)
212 , m_pDBManager(nullptr)
214 , m_xAddressFrame(m_xBuilder->weld_widget(
"addressframe"))
215 , m_xAddrBox(m_xBuilder->weld_check_button(
"address"))
216 , m_xWritingEdit(m_xBuilder->weld_text_view(
"textview"))
217 , m_xDatabaseLB(m_xBuilder->weld_combo_box(
"database"))
218 , m_xTableLB(m_xBuilder->weld_combo_box(
"table"))
219 , m_xInsertBT(m_xBuilder->weld_button(
"insert"))
220 , m_xDBFieldLB(m_xBuilder->weld_combo_box(
"field"))
221 , m_xContButton(m_xBuilder->weld_radio_button(
"continuous"))
222 , m_xSheetButton(m_xBuilder->weld_radio_button(
"sheet"))
223 , m_xMakeBox(m_xBuilder->weld_combo_box(
"brand"))
224 , m_xTypeBox(m_xBuilder->weld_combo_box(
"type"))
225 , m_xHiddenSortTypeBox(m_xBuilder->weld_combo_box(
"hiddentype"))
226 , m_xFormatInfo(m_xBuilder->weld_label(
"formatinfo"))
235 m_xTableLB->set_size_request(nListBoxWidth, -1);
252 auto nMaxWidth =
m_xMakeBox->get_approximate_digit_width() * 32;
278 if (m_xAddrBox->get_active())
281 m_xWritingEdit->set_text(aWriting);
282 m_xWritingEdit->grab_focus();
287 m_sActDBName = m_xDatabaseLB->get_active_text();
291 if (&rListBox == m_xDatabaseLB.get())
292 GetDBManager()->GetTableNames(*m_xTableLB, m_sActDBName);
294 if (&rListBox == m_xDatabaseLB.get() || &rListBox == m_xTableLB.get())
295 GetDBManager()->GetColumnNames(*m_xDBFieldLB, m_sActDBName, m_xTableLB->get_active_text());
297 if (!m_xDatabaseLB->get_active_text().isEmpty() && !m_xTableLB->get_active_text().isEmpty()
298 && !m_xDBFieldLB->get_active_text().isEmpty())
299 m_xInsertBT->set_sensitive(
true);
301 m_xInsertBT->set_sensitive(
false);
306 OUString
aStr(
"<" + m_xDatabaseLB->get_active_text() +
"." +
307 m_xTableLB->get_active_text() +
"." +
308 m_xTableLB->get_active_id() +
"." +
309 m_xDBFieldLB->get_active_text() +
">");
310 m_xWritingEdit->replace_selection(
aStr);
311 int nStartPos, nEndPos;
312 m_xWritingEdit->get_selection_bounds(nStartPos, nEndPos);
313 m_xWritingEdit->grab_focus();
314 m_xWritingEdit->select_region(nStartPos, nEndPos);
319 MakeHdl(*m_xMakeBox);
327 m_xHiddenSortTypeBox->clear();
328 GetParentSwLabDlg()->TypeIds().clear();
330 const OUString aMake = m_xMakeBox->get_active_text();
331 GetParentSwLabDlg()->ReplaceGroup( aMake );
332 m_aItem.m_aLstMake = aMake;
334 const bool bCont = m_xContButton->get_active();
335 const size_t nCount = GetParentSwLabDlg()->Recs().size();
338 const OUString sCustom(
SwResId(STR_CUSTOM_LABEL));
342 const OUString aType(GetParentSwLabDlg()->Recs()[
i]->
m_aType);
343 bool bInsert =
false;
344 if (GetParentSwLabDlg()->Recs()[
i]->
m_aType == sCustom)
347 m_xTypeBox->append_text(aType );
349 else if (GetParentSwLabDlg()->Recs()[
i]->m_bCont == bCont)
351 if (m_xHiddenSortTypeBox->find_text(aType) == -1)
354 m_xHiddenSortTypeBox->append_text( aType );
359 GetParentSwLabDlg()->TypeIds().push_back(
i);
360 if ( !nLstType && aType == m_aItem.m_aLstType )
361 nLstType = GetParentSwLabDlg()->TypeIds().size();
364 for (
int nEntry = 0; nEntry < m_xHiddenSortTypeBox->get_count(); ++nEntry)
366 m_xTypeBox->append_text(m_xHiddenSortTypeBox->get_text(nEntry));
369 m_xTypeBox->set_active_text(m_aItem.m_aLstType);
371 m_xTypeBox->set_active(0);
372 TypeHdl(*m_xTypeBox);
378 m_aItem.m_aType = m_xTypeBox->get_active_text();
384 std::unique_ptr<weld::Dialog> xTopLevel(xBuilder->weld_dialog(
"SpinDialog"));
385 std::unique_ptr<weld::MetricSpinButton> xField(xBuilder->weld_metric_spin_button(
"spin", FieldUnit::CM));
387 xField->set_digits(2);
388 xField->set_range(0, INT_MAX - 1, FieldUnit::NONE);
394 const OUString aWString = xField->get_text();
399 OUString aText = pRec->
m_aType +
": " + aWString +
400 " x " + xField->get_text() +
401 " (" + OUString::number( pRec->
m_nCols ) +
402 " x " + OUString::number( pRec->
m_nRows ) +
")";
408 OUString sSelEntry(
m_xTypeBox->get_active_text());
420 for (
const OUString& rDataName : aDataNames)
437 return std::make_unique<SwLabPage>(pPage, pController, *
rSet);
450 return DeactivateRC::LeavePage;
481 size_t nLstGroup = 0;
536 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/privateuserpage.ui",
"PrivateUserPage", &
rSet)
537 , m_xFirstNameED(m_xBuilder->weld_entry(
"firstname"))
538 , m_xNameED(m_xBuilder->weld_entry(
"lastname"))
539 , m_xShortCutED(m_xBuilder->weld_entry(
"shortname"))
540 , m_xFirstName2ED(m_xBuilder->weld_entry(
"firstname2"))
541 , m_xName2ED(m_xBuilder->weld_entry(
"lastname2"))
542 , m_xShortCut2ED(m_xBuilder->weld_entry(
"shortname2"))
543 , m_xStreetED(m_xBuilder->weld_entry(
"street"))
544 , m_xZipED(m_xBuilder->weld_entry(
"izip"))
545 , m_xCityED(m_xBuilder->weld_entry(
"icity"))
546 , m_xCountryED(m_xBuilder->weld_entry(
"country"))
547 , m_xStateED(m_xBuilder->weld_entry(
"state"))
548 , m_xTitleED(m_xBuilder->weld_entry(
"title"))
549 , m_xProfessionED(m_xBuilder->weld_entry(
"job"))
550 , m_xPhoneED(m_xBuilder->weld_entry(
"phone"))
551 , m_xMobilePhoneED(m_xBuilder->weld_entry(
"mobile"))
552 , m_xFaxED(m_xBuilder->weld_entry(
"fax"))
553 , m_xHomePageED(m_xBuilder->weld_entry(
"url"))
554 , m_xMailED(m_xBuilder->weld_entry(
"email"))
565 return std::make_unique<SwPrivateDataPage>(pPage, pController, *
rSet);
577 return DeactivateRC::LeavePage;
633 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/businessdatapage.ui",
"BusinessDataPage", &
rSet)
634 , m_xCompanyED(m_xBuilder->weld_entry(
"company"))
635 , m_xCompanyExtED(m_xBuilder->weld_entry(
"company2"))
636 , m_xSloganED(m_xBuilder->weld_entry(
"slogan"))
637 , m_xStreetED(m_xBuilder->weld_entry(
"street"))
638 , m_xZipED(m_xBuilder->weld_entry(
"izip"))
639 , m_xCityED(m_xBuilder->weld_entry(
"icity"))
640 , m_xCountryED(m_xBuilder->weld_entry(
"country"))
641 , m_xStateED(m_xBuilder->weld_entry(
"state"))
642 , m_xPositionED(m_xBuilder->weld_entry(
"position"))
643 , m_xPhoneED(m_xBuilder->weld_entry(
"phone"))
644 , m_xMobilePhoneED(m_xBuilder->weld_entry(
"mobile"))
645 , m_xFaxED(m_xBuilder->weld_entry(
"fax"))
646 , m_xHomePageED(m_xBuilder->weld_entry(
"url"))
647 , m_xMailED(m_xBuilder->weld_entry(
"email"))
658 return std::make_unique<SwBusinessDataPage>(pPage, pController, *
rSet);
670 return DeactivateRC::LeavePage;
Reference< XExecutableDialog > m_xDialog
static std::unique_ptr< weld::Builder > CreateBuilder(weld::Widget *pParent, const OUString &rUIFile, bool bMobile=false, sal_uInt64 nLOKWindowId=0)
const SfxPoolItem * Put(const SfxPoolItem &rItem, sal_uInt16 nWhich)
const SfxPoolItem & Get(sal_uInt16 nWhich, bool bSrchInParent=true) const
void AddTabPage(const OUString &rName, CreateTabPage pCreateFunc, GetTabPageRanges pRangesFunc)
virtual const SfxItemSet * GetExampleSet() const override
void RemoveTabPage(const OUString &rName)
std::unique_ptr< SfxItemSet > m_xExampleSet
SfxItemSet * GetInputSetImpl()
void SetExchangeSupport()
const SfxItemSet * GetDialogExampleSet() const
weld::Window * GetFrameWeld() const
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::Entry > m_xStateED
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::Entry > m_xFaxED
std::unique_ptr< weld::Entry > m_xCountryED
SwBusinessDataPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::Entry > m_xMailED
std::unique_ptr< weld::Entry > m_xPositionED
std::unique_ptr< weld::Entry > m_xCompanyExtED
std::unique_ptr< weld::Entry > m_xCityED
std::unique_ptr< weld::Entry > m_xZipED
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
virtual ~SwBusinessDataPage() override
std::unique_ptr< weld::Entry > m_xPhoneED
std::unique_ptr< weld::Entry > m_xSloganED
std::unique_ptr< weld::Entry > m_xMobilePhoneED
std::unique_ptr< weld::Entry > m_xHomePageED
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
std::unique_ptr< weld::Entry > m_xStreetED
std::unique_ptr< weld::Entry > m_xCompanyED
virtual void Reset(const SfxItemSet *rSet) override
static css::uno::Sequence< OUString > GetExistingDatabaseNames()
void GetColumnNames(weld::ComboBox &rBox, const OUString &rDBName, const OUString &rTableName)
Fill listbox with all column names of a database table.
std::vector< OUString > m_aMakes
SwLabRec * GetRecord(std::u16string_view rRecName, bool bCont)
virtual ~SwLabDlg() override
OUString m_sBusinessCardDlg
SwLabDlg(weld::Window *pParent, const SfxItemSet &rSet, SwDBManager *pDBManager, bool bLabel)
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
SwLabelConfig m_aLabelsCfg
SwLabPrtPage * m_pPrtPage
void ReplaceGroup_(const OUString &rMake)
void UpdateGroup(const OUString &rMake)
void GetLabItem(SwLabItem &rItem)
std::unique_ptr< SwLabRecs > m_pRecs
SwDBManager * m_pDBManager
std::vector< OUString > & Makes()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
OUString m_aCompCompanyExt
OUString m_aPrivFirstName2
OUString m_aPrivShortCut2
OUString m_aPrivProfession
OUString m_aPrivFirstName
std::unique_ptr< weld::ComboBox > m_xTypeBox
std::unique_ptr< weld::ComboBox > m_xHiddenSortTypeBox
SwLabDlg * GetParentSwLabDlg()
virtual bool FillItemSet(SfxItemSet *rSet) override
SwLabPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::RadioButton > m_xContButton
std::unique_ptr< weld::ComboBox > m_xMakeBox
std::unique_ptr< weld::Label > m_xFormatInfo
SwLabRec * GetSelectedEntryPos()
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
std::unique_ptr< weld::RadioButton > m_xSheetButton
std::unique_ptr< weld::TextView > m_xWritingEdit
std::unique_ptr< weld::ComboBox > m_xTableLB
virtual ~SwLabPage() override
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
SwDBManager * GetDBManager() const
std::unique_ptr< weld::CheckButton > m_xAddrBox
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::ComboBox > m_xDatabaseLB
void FillItem(SwLabItem &rItem)
virtual void Reset(const SfxItemSet *rSet) override
std::unique_ptr< weld::ComboBox > m_xDBFieldLB
std::unique_ptr< weld::Button > m_xInsertBT
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
void SetFromItem(const SwLabItem &rItem)
void FillItem(SwLabItem &rItem) const
const std::vector< OUString > & GetManufacturers() const
void FillLabels(const OUString &rManufacturer, SwLabRecs &rLabArr)
std::unique_ptr< weld::Entry > m_xStreetED
std::unique_ptr< weld::Entry > m_xMailED
std::unique_ptr< weld::Entry > m_xMobilePhoneED
virtual void Reset(const SfxItemSet *rSet) override
virtual void ActivatePage(const SfxItemSet &rSet) override
std::unique_ptr< weld::Entry > m_xZipED
SwPrivateDataPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::Entry > m_xCityED
std::unique_ptr< weld::Entry > m_xNameED
std::unique_ptr< weld::Entry > m_xPhoneED
std::unique_ptr< weld::Entry > m_xShortCutED
virtual bool FillItemSet(SfxItemSet *rSet) override
std::unique_ptr< weld::Entry > m_xStateED
std::unique_ptr< weld::Entry > m_xProfessionED
std::unique_ptr< weld::Entry > m_xHomePageED
std::unique_ptr< weld::Entry > m_xFirstNameED
std::unique_ptr< weld::Entry > m_xName2ED
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::Entry > m_xFirstName2ED
virtual ~SwPrivateDataPage() override
std::unique_ptr< weld::Entry > m_xShortCut2ED
std::unique_ptr< weld::Entry > m_xFaxED
std::unique_ptr< weld::Entry > m_xTitleED
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
std::unique_ptr< weld::Entry > m_xCountryED
constexpr OUStringLiteral HID_BUSINESS_FMT_PAGE_TYPE
constexpr OUStringLiteral HID_BUSINESS_FMT_PAGE_SHEET
constexpr OUStringLiteral HID_BUSINESS_FMT_PAGE_CONT
constexpr OUStringLiteral HID_BUSINESS_FMT_PAGE
constexpr OUStringLiteral HID_BUSINESS_FMT_PAGE_BRAND
IMPL_LINK_NOARG(SwLabPage, AddrHdl, weld::Toggleable &, void)
IMPL_LINK(SwLabPage, DatabaseHdl, weld::ComboBox &, rListBox, void)
void setfldval(weld::MetricSpinButton &rField, int lValue)
std::vector< std::unique_ptr< SwLabRec > > SwLabRecs
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
#define LINK(Instance, Class, Member)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
Reference< XNameAccess > m_xContainer
OUString SwResId(TranslateId aId)
SVT_DLLPUBLIC void SetFieldUnit(weld::MetricSpinButton &rCtrl, FieldUnit eUnit, bool bAll=false)