1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
22 #include <svtools/svmedit.hxx>
23 #include <sfx2/tabdlg.hxx>
25 #include <vcl/fixed.hxx>
27 #include <vcl/edit.hxx>
29 #include <vcl/lstbox.hxx>
31 #include <vcl/button.hxx>
35 #define GetFldVal(rField) (rField).Denormalize((rField).GetValue(FUNIT_TWIP))
36 #define SetFldVal(rField, lValue) (rField).SetValue((rField).Normalize(lValue), FUNIT_TWIP)
43 // class SwEnvPreview ---------------------------------------------------------
44 class SwEnvPreview
: public Window
46 void Paint(const Rectangle
&);
50 SwEnvPreview(SfxTabPage
* pParent
, const ResId
& rResID
);
54 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
57 // class SwEnvDlg -----------------------------------------------------------
58 class SwEnvDlg
: public SfxTabDialog
60 friend class SwEnvPage
;
61 friend class SwEnvFmtPage
;
62 friend class SwEnvPrtPage
;
63 friend class SwEnvPreview
;
70 SfxItemSet
*pAddresseeSet
;
71 SfxItemSet
*pSenderSet
;
73 virtual void PageCreated( sal_uInt16 nId
, SfxTabPage
&rPage
);
77 SwEnvDlg(Window
* pParent
, const SfxItemSet
& rSet
, SwWrtShell
* pWrtSh
, Printer
* pPrt
, sal_Bool bInsert
);
81 // class SwEnvPage ----------------------------------------------------------
82 class SwEnvPage
: public SfxTabPage
85 MultiLineEdit aAddrEdit
;
86 FixedText aDatabaseFT
;
90 ImageButton aInsertBT
;
94 MultiLineEdit aSenderEdit
;
95 SwEnvPreview aPreview
;
100 SwEnvPage(Window
* pParent
, const SfxItemSet
& rSet
);
103 DECL_LINK( DatabaseHdl
, ListBox
* );
104 DECL_LINK(FieldHdl
, void *);
105 DECL_LINK(SenderHdl
, void *);
107 void InitDatabaseBox();
109 SwEnvDlg
* GetParentSwEnvDlg() {return (SwEnvDlg
*)GetParentDialog();}
111 using SfxTabPage::ActivatePage
;
112 using SfxTabPage::DeactivatePage
;
116 static SfxTabPage
* Create(Window
* pParent
, const SfxItemSet
& rSet
);
118 virtual void ActivatePage(const SfxItemSet
& rSet
);
119 virtual int DeactivatePage(SfxItemSet
* pSet
= 0);
120 void FillItem(SwEnvItem
& rItem
);
121 virtual sal_Bool
FillItemSet(SfxItemSet
& rSet
);
122 virtual void Reset(const SfxItemSet
& rSet
);
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */