51 CustomWidgetController::SetDrawingArea(pDrawingArea);
60 rRenderContext.
Erase();
70 double(aSize.
Width()) /
double(nPageW),
71 double(aSize.
Height()) /
double(nPageH));
125 , m_xModify(m_xBuilder->weld_button(
"modify"))
145 if (rId ==
"printer")
149 else if (rId ==
"envelope")
153 else if (rId ==
"format")
181 :
SfxTabPage(pPage, pController,
"modules/swriter/ui/envaddresspage.ui",
"EnvAddressPage", &
rSet)
184 , m_xAddrEdit(m_xBuilder->weld_text_view(
"addredit"))
185 , m_xDatabaseLB(m_xBuilder->weld_combo_box(
"database"))
186 , m_xTableLB(m_xBuilder->weld_combo_box(
"table"))
187 , m_xDBFieldLB(m_xBuilder->weld_combo_box(
"field"))
188 , m_xInsertBT(m_xBuilder->weld_button(
"insert"))
189 , m_xSenderBox(m_xBuilder->weld_check_button(
"sender"))
190 , m_xSenderEdit(m_xBuilder->weld_text_view(
"senderedit"))
191 , m_xPreview(new
weld::CustomWeld(*m_xBuilder,
"preview", m_aPreview))
193 auto nTextBoxHeight(
m_xAddrEdit->get_height_rows(10));
194 auto nTextBoxWidth(
m_xAddrEdit->get_approximate_digit_width() * 25);
196 m_xAddrEdit->set_size_request(nTextBoxWidth, nTextBoxHeight);
197 m_xSenderEdit->set_size_request(nTextBoxWidth, nTextBoxHeight);
199 auto nListBoxWidth =
m_xTableLB->get_approximate_digit_width() * 25;
200 m_xTableLB->set_size_request(nListBoxWidth, -1);
230 SwWait aWait( *m_pSh->GetView().GetDocShell(),
true );
232 if (&rListBox == m_xDatabaseLB.get())
234 m_sActDBName = rListBox.get_active_text();
235 m_pSh->GetDBManager()->GetTableNames(*m_xTableLB, m_sActDBName);
236 m_sActDBName += OUStringChar(
DB_DELIM);
242 m_pSh->GetDBManager()->GetColumnNames(*m_xDBFieldLB, m_xDatabaseLB->get_active_text(),
243 m_xTableLB->get_active_text());
248 OUString
aStr(
"<" + m_xDatabaseLB->get_active_text() +
"." +
249 m_xTableLB->get_active_text() +
"." +
250 m_xTableLB->get_active_id() +
"." +
251 m_xDBFieldLB->get_active_text() +
">");
252 m_xAddrEdit->replace_selection(
aStr);
253 int nStartPos, nEndPos;
254 m_xAddrEdit->get_selection_bounds(nStartPos, nEndPos);
255 m_xAddrEdit->grab_focus();
256 m_xAddrEdit->select_region(nStartPos, nEndPos);
261 const bool bEnable = m_xSenderBox->get_active();
262 GetParentSwEnvDlg()->m_aEnvItem.m_bSend = bEnable;
263 m_xSenderEdit->set_sensitive(bEnable);
266 m_xSenderEdit->grab_focus();
267 if (m_xSenderEdit->get_text().isEmpty())
270 m_xPreview->queue_draw();
281 for (
const OUString& rDataName : aDataNames)
299 return std::make_unique<SwEnvPage>(pPage, pController, *
rSet);
314 return DeactivateRC::LeavePage;
const StyleSettings & GetStyleSettings() const
sal_uInt8 GetBlue() const
sal_uInt8 GetGreen() const
void DrawRect(const tools::Rectangle &rRect)
const AllSettings & GetSettings() const
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)
weld::Button * GetUserButton() const
void SetExchangeSupport()
constexpr tools::Long Height() const
constexpr tools::Long Width() const
const Color & GetWindowColor() const
const Color & GetDialogColor() const
static css::uno::Sequence< OUString > GetExistingDatabaseNames()
bool GetTableNames(weld::ComboBox &rBox, const OUString &rDBName)
Fill listbox with all table names of a database.
void GetColumnNames(weld::ComboBox &rBox, const OUString &rDBName, const OUString &rTableName)
Fill listbox with all column names of a database table.
SwDBManager * GetDBManager() const
For evaluation of DB fields (new DB-manager).
SwTextFormatColl * GetTextCollFromPool(sal_uInt16 nId)
SwDBData const & GetDBData() const
Database information.
std::unique_ptr< SfxItemSet > m_pSenderSet
virtual void PageCreated(const OUString &rId, SfxTabPage &rPage) override
virtual ~SwEnvDlg() override
std::unique_ptr< weld::Button > m_xModify
VclPtr< Printer > m_pPrinter
virtual short Ok() override
SwEnvDlg(weld::Window *pParent, const SfxItemSet &rSet, SwWrtShell *pWrtSh, Printer *pPrt, bool bInsert)
std::unique_ptr< SfxItemSet > m_pAddresseeSet
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
sal_Int32 m_nSendFromLeft
sal_Int32 m_nAddrFromLeft
std::unique_ptr< weld::ComboBox > m_xDBFieldLB
virtual void ActivatePage(const SfxItemSet &rSet) override
SwEnvDlg * GetParentSwEnvDlg()
virtual bool FillItemSet(SfxItemSet *rSet) override
SwEnvPage(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet &rSet)
std::unique_ptr< weld::CheckButton > m_xSenderBox
std::unique_ptr< weld::ComboBox > m_xTableLB
std::unique_ptr< weld::TextView > m_xAddrEdit
virtual DeactivateRC DeactivatePage(SfxItemSet *pSet) override
std::unique_ptr< weld::TextView > m_xSenderEdit
std::unique_ptr< weld::ComboBox > m_xDatabaseLB
std::unique_ptr< weld::Button > m_xInsertBT
virtual ~SwEnvPage() override
void FillItem(SwEnvItem &rItem)
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
void Init(SwEnvDlg *pDialog)
virtual void Reset(const SfxItemSet *rSet) override
void SetDialog(SwEnvDlg *pDialog)
virtual void Paint(vcl::RenderContext &rRenderContext, const tools::Rectangle &rRect) override
virtual void SetDrawingArea(weld::DrawingArea *pDrawingArea) override
static std::unique_ptr< SfxTabPage > Create(weld::Container *pPage, weld::DialogController *pController, const SfxItemSet *rSet)
Represents the style of a paragraph.
virtual bool SetFormatAttr(const SfxPoolItem &rAttr) override
Override to recognize changes on the <SwNumRuleItem> and register/unregister the paragragh style at t...
const Color & GetFontColor() const
static const SwViewOption & GetCurrentViewOptions()
Used by the UI to modify the document model.
IMPL_LINK_NOARG(SwEnvPage, FieldHdl, weld::Button &, void)
IMPL_LINK(SwEnvPage, DatabaseHdl, weld::ComboBox &, rListBox, void)
LineEnd GetSystemLineEnd()
TOOLS_DLLPUBLIC OString convertLineEnd(const OString &rIn, LineEnd eLineEnd)
#define LINK(Instance, Class, Member)
SVXCORE_DLLPUBLIC MSO_SPT Get(const OUString &)
constexpr OUStringLiteral aData
OUString setToken(const OUString &rIn, sal_Int32 nToken, sal_Unicode cTok, std::u16string_view rNewToken)
SwNodeOffset min(const SwNodeOffset &a, const SwNodeOffset &b)
@ RES_POOLCOLL_ENVELOPE_ADDRESS
Addressee.
@ RES_POOLCOLL_SEND_ADDRESS
Sender.