xref: /trunk/main/sw/source/ui/inc/envlop.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*1d2dbeb0SAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*1d2dbeb0SAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*1d2dbeb0SAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*1d2dbeb0SAndrew Rist  * distributed with this work for additional information
6*1d2dbeb0SAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*1d2dbeb0SAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*1d2dbeb0SAndrew Rist  * "License"); you may not use this file except in compliance
9*1d2dbeb0SAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*1d2dbeb0SAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*1d2dbeb0SAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*1d2dbeb0SAndrew Rist  * software distributed under the License is distributed on an
15*1d2dbeb0SAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*1d2dbeb0SAndrew Rist  * KIND, either express or implied.  See the License for the
17*1d2dbeb0SAndrew Rist  * specific language governing permissions and limitations
18*1d2dbeb0SAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*1d2dbeb0SAndrew Rist  *************************************************************/
21*1d2dbeb0SAndrew Rist 
22*1d2dbeb0SAndrew Rist 
23cdf0e10cSrcweir #ifndef _ENVLOP_HXX
24cdf0e10cSrcweir #define _ENVLOP_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir #ifndef _SV_MEDIT_HXX
27cdf0e10cSrcweir #include <svtools/svmedit.hxx>
28cdf0e10cSrcweir #endif
29cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
30cdf0e10cSrcweir 
31cdf0e10cSrcweir #ifndef _FIXED_HXX //autogen
32cdf0e10cSrcweir #include <vcl/fixed.hxx>
33cdf0e10cSrcweir #endif
34cdf0e10cSrcweir 
35cdf0e10cSrcweir #ifndef _EDIT_HXX //autogen
36cdf0e10cSrcweir #include <vcl/edit.hxx>
37cdf0e10cSrcweir #endif
38cdf0e10cSrcweir 
39cdf0e10cSrcweir #ifndef _LSTBOX_HXX //autogen
40cdf0e10cSrcweir #include <vcl/lstbox.hxx>
41cdf0e10cSrcweir #endif
42cdf0e10cSrcweir 
43cdf0e10cSrcweir #ifndef _IMAGEBTN_HXX //autogen
44cdf0e10cSrcweir #include <vcl/button.hxx>
45cdf0e10cSrcweir #endif
46cdf0e10cSrcweir 
47cdf0e10cSrcweir #include "envimg.hxx"
48cdf0e10cSrcweir 
49cdf0e10cSrcweir #define GetFldVal(rField)         (rField).Denormalize((rField).GetValue(FUNIT_TWIP))
50cdf0e10cSrcweir #define SetFldVal(rField, lValue) (rField).SetValue((rField).Normalize(lValue), FUNIT_TWIP)
51cdf0e10cSrcweir 
52cdf0e10cSrcweir class SwEnvPage;
53cdf0e10cSrcweir class SwEnvFmtPage;
54cdf0e10cSrcweir class SwWrtShell;
55cdf0e10cSrcweir class Printer;
56cdf0e10cSrcweir 
57cdf0e10cSrcweir // class SwEnvPreview ---------------------------------------------------------
58cdf0e10cSrcweir 
59cdf0e10cSrcweir class SwEnvPreview : public Window
60cdf0e10cSrcweir {
61cdf0e10cSrcweir     void Paint(const Rectangle&);
62cdf0e10cSrcweir 
63cdf0e10cSrcweir public:
64cdf0e10cSrcweir 
65cdf0e10cSrcweir      SwEnvPreview(SfxTabPage* pParent, const ResId& rResID);
66cdf0e10cSrcweir     ~SwEnvPreview();
67cdf0e10cSrcweir 
68cdf0e10cSrcweir protected:
69cdf0e10cSrcweir     virtual void DataChanged( const DataChangedEvent& rDCEvt );
70cdf0e10cSrcweir };
71cdf0e10cSrcweir 
72cdf0e10cSrcweir // class SwEnvDlg -----------------------------------------------------------
73cdf0e10cSrcweir 
74cdf0e10cSrcweir class SwEnvDlg : public SfxTabDialog
75cdf0e10cSrcweir {
76cdf0e10cSrcweir friend class SwEnvPage;
77cdf0e10cSrcweir friend class SwEnvFmtPage;
78cdf0e10cSrcweir friend class SwEnvPrtPage;
79cdf0e10cSrcweir friend class SwEnvPreview;
80cdf0e10cSrcweir 
81cdf0e10cSrcweir     String          sInsert;
82cdf0e10cSrcweir     String          sChange;
83cdf0e10cSrcweir     SwEnvItem       aEnvItem;
84cdf0e10cSrcweir     SwWrtShell      *pSh;
85cdf0e10cSrcweir     Printer         *pPrinter;
86cdf0e10cSrcweir     SfxItemSet      *pAddresseeSet;
87cdf0e10cSrcweir     SfxItemSet      *pSenderSet;
88cdf0e10cSrcweir 
89cdf0e10cSrcweir     virtual void    PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
90cdf0e10cSrcweir     virtual short   Ok();
91cdf0e10cSrcweir 
92cdf0e10cSrcweir public:
93cdf0e10cSrcweir      SwEnvDlg(Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert);
94cdf0e10cSrcweir     ~SwEnvDlg();
95cdf0e10cSrcweir };
96cdf0e10cSrcweir 
97cdf0e10cSrcweir // class SwEnvPage ----------------------------------------------------------
98cdf0e10cSrcweir 
99cdf0e10cSrcweir class SwEnvPage : public SfxTabPage
100cdf0e10cSrcweir {
101cdf0e10cSrcweir     FixedText     aAddrText;
102cdf0e10cSrcweir     MultiLineEdit aAddrEdit;
103cdf0e10cSrcweir     FixedText     aDatabaseFT;
104cdf0e10cSrcweir     ListBox       aDatabaseLB;
105cdf0e10cSrcweir     FixedText     aTableFT;
106cdf0e10cSrcweir     ListBox       aTableLB;
107cdf0e10cSrcweir     ImageButton   aInsertBT;
108cdf0e10cSrcweir     FixedText     aDBFieldFT;
109cdf0e10cSrcweir     ListBox       aDBFieldLB;
110cdf0e10cSrcweir     CheckBox      aSenderBox;
111cdf0e10cSrcweir     MultiLineEdit aSenderEdit;
112cdf0e10cSrcweir     SwEnvPreview  aPreview;
113cdf0e10cSrcweir 
114cdf0e10cSrcweir     SwWrtShell*   pSh;
115cdf0e10cSrcweir     String        sActDBName;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir      SwEnvPage(Window* pParent, const SfxItemSet& rSet);
118cdf0e10cSrcweir     ~SwEnvPage();
119cdf0e10cSrcweir 
120cdf0e10cSrcweir     DECL_LINK( DatabaseHdl, ListBox * );
121cdf0e10cSrcweir     DECL_LINK( FieldHdl, Button * );
122cdf0e10cSrcweir     DECL_LINK( SenderHdl, Button * );
123cdf0e10cSrcweir 
124cdf0e10cSrcweir     void InitDatabaseBox();
125cdf0e10cSrcweir 
126cdf0e10cSrcweir     using Window::GetParent;
GetParent()127cdf0e10cSrcweir     SwEnvDlg* GetParent() {return (SwEnvDlg*) SfxTabPage::GetParent()->GetParent();}
128cdf0e10cSrcweir 
129cdf0e10cSrcweir     using SfxTabPage::ActivatePage;
130cdf0e10cSrcweir     using SfxTabPage::DeactivatePage;
131cdf0e10cSrcweir 
132cdf0e10cSrcweir public:
133cdf0e10cSrcweir 
134cdf0e10cSrcweir     static SfxTabPage* Create(Window* pParent, const SfxItemSet& rSet);
135cdf0e10cSrcweir 
136cdf0e10cSrcweir     virtual void ActivatePage(const SfxItemSet& rSet);
137cdf0e10cSrcweir     virtual int  DeactivatePage(SfxItemSet* pSet = 0);
138cdf0e10cSrcweir             void FillItem(SwEnvItem& rItem);
139cdf0e10cSrcweir     virtual sal_Bool FillItemSet(SfxItemSet& rSet);
140cdf0e10cSrcweir     virtual void Reset(const SfxItemSet& rSet);
141cdf0e10cSrcweir };
142cdf0e10cSrcweir 
143cdf0e10cSrcweir #endif
144