Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
12 : : * OpenOffice.org is free software: you can redistribute it and/or modify
13 : : * it under the terms of the GNU Lesser General Public License version 3
14 : : * only, as published by the Free Software Foundation.
15 : : *
16 : : * OpenOffice.org is distributed in the hope that it will be useful,
17 : : * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 : : * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 : : * GNU Lesser General Public License version 3 for more details
20 : : * (a copy is included in the LICENSE file that accompanied this code).
21 : : *
22 : : * You should have received a copy of the GNU Lesser General Public License
23 : : * version 3 along with OpenOffice.org. If not, see
24 : : * <http://www.openoffice.org/license.html>
25 : : * for a copy of the LGPLv3 License.
26 : : *
27 : : ************************************************************************/
28 : : #ifndef _ENVLOP_HXX
29 : : #define _ENVLOP_HXX
30 : :
31 : : #include <svtools/svmedit.hxx>
32 : : #include <sfx2/tabdlg.hxx>
33 : :
34 : : #include <vcl/fixed.hxx>
35 : :
36 : : #include <vcl/edit.hxx>
37 : :
38 : : #include <vcl/lstbox.hxx>
39 : :
40 : : #include <vcl/button.hxx>
41 : :
42 : : #include "envimg.hxx"
43 : :
44 : : #define GetFldVal(rField) (rField).Denormalize((rField).GetValue(FUNIT_TWIP))
45 : : #define SetFldVal(rField, lValue) (rField).SetValue((rField).Normalize(lValue), FUNIT_TWIP)
46 : :
47 : : class SwEnvPage;
48 : : class SwEnvFmtPage;
49 : : class SwWrtShell;
50 : : class Printer;
51 : :
52 : : // class SwEnvPreview ---------------------------------------------------------
53 : : class SwEnvPreview : public Window
54 : : {
55 : : void Paint(const Rectangle&);
56 : :
57 : : public:
58 : :
59 : : SwEnvPreview(SfxTabPage* pParent, const ResId& rResID);
60 : : ~SwEnvPreview();
61 : :
62 : : protected:
63 : : virtual void DataChanged( const DataChangedEvent& rDCEvt );
64 : : };
65 : :
66 : : // class SwEnvDlg -----------------------------------------------------------
67 : : class SwEnvDlg : public SfxTabDialog
68 : : {
69 : : friend class SwEnvPage;
70 : : friend class SwEnvFmtPage;
71 : : friend class SwEnvPrtPage;
72 : : friend class SwEnvPreview;
73 : :
74 : : String sInsert;
75 : : String sChange;
76 : : SwEnvItem aEnvItem;
77 : : SwWrtShell *pSh;
78 : : Printer *pPrinter;
79 : : SfxItemSet *pAddresseeSet;
80 : : SfxItemSet *pSenderSet;
81 : :
82 : : virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
83 : : virtual short Ok();
84 : :
85 : : public:
86 : : SwEnvDlg(Window* pParent, const SfxItemSet& rSet, SwWrtShell* pWrtSh, Printer* pPrt, sal_Bool bInsert);
87 : : ~SwEnvDlg();
88 : : };
89 : :
90 : : // class SwEnvPage ----------------------------------------------------------
91 : : class SwEnvPage : public SfxTabPage
92 : : {
93 : : FixedText aAddrText;
94 : : MultiLineEdit aAddrEdit;
95 : : FixedText aDatabaseFT;
96 : : ListBox aDatabaseLB;
97 : : FixedText aTableFT;
98 : : ListBox aTableLB;
99 : : ImageButton aInsertBT;
100 : : FixedText aDBFieldFT;
101 : : ListBox aDBFieldLB;
102 : : CheckBox aSenderBox;
103 : : MultiLineEdit aSenderEdit;
104 : : SwEnvPreview aPreview;
105 : :
106 : : SwWrtShell* pSh;
107 : : String sActDBName;
108 : :
109 : : SwEnvPage(Window* pParent, const SfxItemSet& rSet);
110 : : ~SwEnvPage();
111 : :
112 : : DECL_LINK( DatabaseHdl, ListBox * );
113 : : DECL_LINK(FieldHdl, void *);
114 : : DECL_LINK(SenderHdl, void *);
115 : :
116 : : void InitDatabaseBox();
117 : :
118 : : using Window::GetParent;
119 : 0 : SwEnvDlg* GetParent() {return (SwEnvDlg*) SfxTabPage::GetParent()->GetParent();}
120 : :
121 : : using SfxTabPage::ActivatePage;
122 : : using SfxTabPage::DeactivatePage;
123 : :
124 : : public:
125 : :
126 : : static SfxTabPage* Create(Window* pParent, const SfxItemSet& rSet);
127 : :
128 : : virtual void ActivatePage(const SfxItemSet& rSet);
129 : : virtual int DeactivatePage(SfxItemSet* pSet = 0);
130 : : void FillItem(SwEnvItem& rItem);
131 : : virtual sal_Bool FillItemSet(SfxItemSet& rSet);
132 : : virtual void Reset(const SfxItemSet& rSet);
133 : : };
134 : :
135 : : #endif
136 : :
137 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|