bump product version to 4.1.6.2
[LibreOffice.git] / sw / source / ui / inc / envlop.hxx
blob2025d3dcab526c41c99d20d30ddc171af48a01fd
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
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 .
19 #ifndef _ENVLOP_HXX
20 #define _ENVLOP_HXX
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>
33 #include "envimg.hxx"
35 #define GetFldVal(rField) (rField).Denormalize((rField).GetValue(FUNIT_TWIP))
36 #define SetFldVal(rField, lValue) (rField).SetValue((rField).Normalize(lValue), FUNIT_TWIP)
38 class SwEnvPage;
39 class SwEnvFmtPage;
40 class SwWrtShell;
41 class Printer;
43 // class SwEnvPreview ---------------------------------------------------------
44 class SwEnvPreview : public Window
46 void Paint(const Rectangle&);
48 public:
50 SwEnvPreview(SfxTabPage* pParent, const ResId& rResID);
51 ~SwEnvPreview();
53 protected:
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;
65 String sInsert;
66 String sChange;
67 SwEnvItem aEnvItem;
68 SwWrtShell *pSh;
69 Printer *pPrinter;
70 SfxItemSet *pAddresseeSet;
71 SfxItemSet *pSenderSet;
73 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
74 virtual short Ok();
76 public:
77 SwEnvDlg(Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert);
78 ~SwEnvDlg();
81 // class SwEnvPage ----------------------------------------------------------
82 class SwEnvPage : public SfxTabPage
84 FixedText aAddrText;
85 MultiLineEdit aAddrEdit;
86 FixedText aDatabaseFT;
87 ListBox aDatabaseLB;
88 FixedText aTableFT;
89 ListBox aTableLB;
90 ImageButton aInsertBT;
91 FixedText aDBFieldFT;
92 ListBox aDBFieldLB;
93 CheckBox aSenderBox;
94 MultiLineEdit aSenderEdit;
95 SwEnvPreview aPreview;
97 SwWrtShell* pSh;
98 String sActDBName;
100 SwEnvPage(Window* pParent, const SfxItemSet& rSet);
101 ~SwEnvPage();
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;
114 public:
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);
125 #endif
127 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */