1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: envlop.hxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
34 #include <svtools/svmedit.hxx>
36 #include <sfx2/tabdlg.hxx>
38 #ifndef _FIXED_HXX //autogen
39 #include <vcl/fixed.hxx>
42 #ifndef _EDIT_HXX //autogen
43 #include <vcl/edit.hxx>
46 #ifndef _LSTBOX_HXX //autogen
47 #include <vcl/lstbox.hxx>
50 #ifndef _IMAGEBTN_HXX //autogen
51 #include <vcl/imagebtn.hxx>
56 #define GetFldVal(rField) (rField).Denormalize((rField).GetValue(FUNIT_TWIP))
57 #define SetFldVal(rField, lValue) (rField).SetValue((rField).Normalize(lValue), FUNIT_TWIP)
64 // class SwEnvPreview ---------------------------------------------------------
66 class SwEnvPreview
: public Window
68 void Paint(const Rectangle
&);
72 SwEnvPreview(SfxTabPage
* pParent
, const ResId
& rResID
);
76 virtual void DataChanged( const DataChangedEvent
& rDCEvt
);
79 // class SwEnvDlg -----------------------------------------------------------
81 class SwEnvDlg
: public SfxTabDialog
83 friend class SwEnvPage
;
84 friend class SwEnvFmtPage
;
85 friend class SwEnvPrtPage
;
86 friend class SwEnvPreview
;
93 SfxItemSet
*pAddresseeSet
;
94 SfxItemSet
*pSenderSet
;
96 virtual void PageCreated( USHORT nId
, SfxTabPage
&rPage
);
100 SwEnvDlg(Window
* pParent
, const SfxItemSet
& rSet
, SwWrtShell
* pWrtSh
, Printer
* pPrt
, BOOL bInsert
);
104 // class SwEnvPage ----------------------------------------------------------
106 class SwEnvPage
: public SfxTabPage
109 MultiLineEdit aAddrEdit
;
110 FixedText aDatabaseFT
;
114 ImageButton aInsertBT
;
115 FixedText aDBFieldFT
;
118 MultiLineEdit aSenderEdit
;
119 SwEnvPreview aPreview
;
124 SwEnvPage(Window
* pParent
, const SfxItemSet
& rSet
);
127 DECL_LINK( DatabaseHdl
, ListBox
* );
128 DECL_LINK( FieldHdl
, Button
* );
129 DECL_LINK( SenderHdl
, Button
* );
131 void InitDatabaseBox();
133 using Window::GetParent
;
134 SwEnvDlg
* GetParent() {return (SwEnvDlg
*) SfxTabPage::GetParent()->GetParent();}
136 using SfxTabPage::ActivatePage
;
137 using SfxTabPage::DeactivatePage
;
141 static SfxTabPage
* Create(Window
* pParent
, const SfxItemSet
& rSet
);
143 virtual void ActivatePage(const SfxItemSet
& rSet
);
144 virtual int DeactivatePage(SfxItemSet
* pSet
= 0);
145 void FillItem(SwEnvItem
& rItem
);
146 virtual BOOL
FillItemSet(SfxItemSet
& rSet
);
147 virtual void Reset(const SfxItemSet
& rSet
);