xref: /trunk/main/sw/source/ui/inc/wrap.hxx (revision 515f4036a64467de788f5756d8ebf472d92f9466)
1 /**************************************************************
2  *
3  * Licensed to the Apache Software Foundation (ASF) under one
4  * or more contributor license agreements.  See the NOTICE file
5  * distributed with this work for additional information
6  * regarding copyright ownership.  The ASF licenses this file
7  * to you under the Apache License, Version 2.0 (the
8  * "License"); you may not use this file except in compliance
9  * with the License.  You may obtain a copy of the License at
10  *
11  *   http://www.apache.org/licenses/LICENSE-2.0
12  *
13  * Unless required by applicable law or agreed to in writing,
14  * software distributed under the License is distributed on an
15  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16  * KIND, either express or implied.  See the License for the
17  * specific language governing permissions and limitations
18  * under the License.
19  *
20  *************************************************************/
21 
22 #ifndef _WRAP_HXX
23 #define _WRAP_HXX
24 
25 #include <sfx2/tabdlg.hxx>
26 #include <sfx2/basedlgs.hxx>
27 
28 #ifndef _IMAGEBTN_HXX //autogen
29 #include <vcl/button.hxx>
30 #endif
31 
32 #ifndef _BUTTON_HXX //autogen
33 #include <vcl/button.hxx>
34 #endif
35 
36 #ifndef _FIXED_HXX //autogen
37 #include <vcl/fixed.hxx>
38 #endif
39 
40 #ifndef _FIELD_HXX //autogen
41 #include <vcl/field.hxx>
42 #endif
43 
44 class Window;
45 class SfxItemSet;
46 class SwWrtShell;
47 
48 class SwWrapDlg : public SfxSingleTabDialog
49 {
50     SwWrtShell*         pWrtShell;
51 
52 public:
53      SwWrapDlg(Window* pParent, SfxItemSet& rSet, SwWrtShell* pSh, sal_Bool bDrawMode);
54     ~SwWrapDlg();
55 
56     inline SwWrtShell*  GetWrtShell()   { return pWrtShell; }
57 };
58 
59 
60 /*--------------------------------------------------------------------
61     Beschreibung:   Umlauf-TabPage
62  --------------------------------------------------------------------*/
63 
64 class SwWrapTabPage: public SfxTabPage
65 {
66     // WRAPPING
67     FixedLine           aWrapFLC;
68     ImageRadioButton    aNoWrapRB;
69     ImageRadioButton    aWrapLeftRB;
70     ImageRadioButton    aWrapRightRB;
71     ImageRadioButton    aWrapParallelRB;
72     ImageRadioButton    aWrapThroughRB;
73     ImageRadioButton    aIdealWrapRB;
74 
75     // MARGIN
76     FixedLine           aMarginFL;
77     FixedText           aLeftMarginFT;
78     MetricField         aLeftMarginED;
79     FixedText           aRightMarginFT;
80     MetricField         aRightMarginED;
81     FixedText           aTopMarginFT;
82     MetricField         aTopMarginED;
83     FixedText           aBottomMarginFT;
84     MetricField         aBottomMarginED;
85 
86     // OPTIONS
87     FixedLine           aOptionsSepFL;
88     FixedLine           aOptionsFL;
89     CheckBox            aWrapAnchorOnlyCB;
90     CheckBox            aWrapTransparentCB;
91     CheckBox            aWrapOutlineCB;
92     CheckBox            aWrapOutsideCB;
93 
94     ImageList           aWrapIL;
95     ImageList           aWrapILH;
96 
97     sal_uInt16              nOldLeftMargin;
98     sal_uInt16              nOldRightMargin;
99     sal_uInt16              nOldUpperMargin;
100     sal_uInt16              nOldLowerMargin;
101 
102     RndStdIds           nAnchorId;
103     sal_uInt16              nHtmlMode;
104 
105     Size aFrmSize;
106     SwWrtShell*         pWrtSh;
107 
108     sal_Bool bFormat;
109     sal_Bool bNew;
110     sal_Bool bHtmlMode;
111     sal_Bool bDrawMode;
112     sal_Bool bContourImage;
113 
114     SwWrapTabPage(Window *pParent, const SfxItemSet &rSet);
115     ~SwWrapTabPage();
116 
117     void            ApplyImageList();
118     void            EnableModes(const SfxItemSet& rSet);
119     virtual void    ActivatePage(const SfxItemSet& rSet);
120     virtual int     DeactivatePage(SfxItemSet *pSet);
121     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
122 
123     DECL_LINK( RangeModifyHdl, MetricField * );
124     DECL_LINK( WrapTypeHdl, ImageRadioButton * );
125     DECL_LINK( ContourHdl, CheckBox * );
126 
127     using SfxTabPage::ActivatePage;
128     using SfxTabPage::DeactivatePage;
129 
130 public:
131 
132     static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
133 
134     virtual sal_Bool    FillItemSet(SfxItemSet &rSet);
135     virtual void    Reset(const SfxItemSet &rSet);
136 
137     static sal_uInt16*  GetRanges();
138     inline void     SetNewFrame(sal_Bool bNewFrame) { bNew = bNewFrame; }
139     inline void     SetFormatUsed(sal_Bool bFmt, sal_Bool bDrw) { bFormat = bFmt;
140                                                             bDrawMode = bDrw; }
141     inline void     SetShell(SwWrtShell* pSh) { pWrtSh = pSh; }
142 };
143 
144 #endif
145 
146 /* vim: set noet sw=4 ts=4: */
147