update dev300-m58
[ooovba.git] / sw / source / ui / inc / envlop.hxx
blobc0780063ec7296f960fab62cbe7bd284e68314f0
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: envlop.hxx,v $
10 * $Revision: 1.8 $
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 ************************************************************************/
30 #ifndef _ENVLOP_HXX
31 #define _ENVLOP_HXX
33 #ifndef _SV_MEDIT_HXX
34 #include <svtools/svmedit.hxx>
35 #endif
36 #include <sfx2/tabdlg.hxx>
38 #ifndef _FIXED_HXX //autogen
39 #include <vcl/fixed.hxx>
40 #endif
42 #ifndef _EDIT_HXX //autogen
43 #include <vcl/edit.hxx>
44 #endif
46 #ifndef _LSTBOX_HXX //autogen
47 #include <vcl/lstbox.hxx>
48 #endif
50 #ifndef _IMAGEBTN_HXX //autogen
51 #include <vcl/imagebtn.hxx>
52 #endif
54 #include "envimg.hxx"
56 #define GetFldVal(rField) (rField).Denormalize((rField).GetValue(FUNIT_TWIP))
57 #define SetFldVal(rField, lValue) (rField).SetValue((rField).Normalize(lValue), FUNIT_TWIP)
59 class SwEnvPage;
60 class SwEnvFmtPage;
61 class SwWrtShell;
62 class Printer;
64 // class SwEnvPreview ---------------------------------------------------------
66 class SwEnvPreview : public Window
68 void Paint(const Rectangle&);
70 public:
72 SwEnvPreview(SfxTabPage* pParent, const ResId& rResID);
73 ~SwEnvPreview();
75 protected:
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;
88 String sInsert;
89 String sChange;
90 SwEnvItem aEnvItem;
91 SwWrtShell *pSh;
92 Printer *pPrinter;
93 SfxItemSet *pAddresseeSet;
94 SfxItemSet *pSenderSet;
96 virtual void PageCreated( USHORT nId, SfxTabPage &rPage );
97 virtual short Ok();
99 public:
100 SwEnvDlg(Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, BOOL bInsert);
101 ~SwEnvDlg();
104 // class SwEnvPage ----------------------------------------------------------
106 class SwEnvPage : public SfxTabPage
108 FixedText aAddrText;
109 MultiLineEdit aAddrEdit;
110 FixedText aDatabaseFT;
111 ListBox aDatabaseLB;
112 FixedText aTableFT;
113 ListBox aTableLB;
114 ImageButton aInsertBT;
115 FixedText aDBFieldFT;
116 ListBox aDBFieldLB;
117 CheckBox aSenderBox;
118 MultiLineEdit aSenderEdit;
119 SwEnvPreview aPreview;
121 SwWrtShell* pSh;
122 String sActDBName;
124 SwEnvPage(Window* pParent, const SfxItemSet& rSet);
125 ~SwEnvPage();
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;
139 public:
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);
150 #endif