Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 :
20 : #ifndef INCLUDED_SW_SOURCE_UI_INC_FRMPAGE_HXX
21 : #define INCLUDED_SW_SOURCE_UI_INC_FRMPAGE_HXX
22 :
23 : #include <vcl/fixed.hxx>
24 : #include <vcl/button.hxx>
25 : #include <vcl/lstbox.hxx>
26 : #include <vcl/field.hxx>
27 : #include <sfx2/tabdlg.hxx>
28 : #include <svx/swframeposstrings.hxx>
29 : #include <swtypes.hxx>
30 : #include <bmpwin.hxx>
31 : #include <svx/swframeexample.hxx>
32 : #include <prcntfld.hxx>
33 : #include <globals.hrc>
34 :
35 : namespace sfx2{class FileDialogHelper;}
36 : class SwWrtShell;
37 : struct FrmMap;
38 : // OD 12.11.2003 #i22341#
39 : struct SwPosition;
40 :
41 : /*--------------------------------------------------------------------
42 : Description: frame dialog
43 : --------------------------------------------------------------------*/
44 : class SwFrmPage: public SfxTabPage
45 : {
46 : // size
47 : FixedText* m_pWidthFT;
48 : FixedText* m_pWidthAutoFT;
49 : PercentField m_aWidthED;
50 : CheckBox* m_pRelWidthCB;
51 : ListBox* m_pRelWidthRelationLB;
52 : CheckBox* m_pAutoWidthCB;
53 :
54 : FixedText* m_pHeightFT;
55 : FixedText* m_pHeightAutoFT;
56 : PercentField m_aHeightED;
57 : CheckBox* m_pRelHeightCB;
58 : ListBox* m_pRelHeightRelationLB;
59 : CheckBox* m_pAutoHeightCB;
60 :
61 : CheckBox* m_pFixedRatioCB;
62 : PushButton* m_pRealSizeBT;
63 :
64 : // anchor
65 : VclContainer* m_pAnchorFrame;
66 : RadioButton* m_pAnchorAtPageRB;
67 : RadioButton* m_pAnchorAtParaRB;
68 : RadioButton* m_pAnchorAtCharRB;
69 : RadioButton* m_pAnchorAsCharRB;
70 : RadioButton* m_pAnchorAtFrameRB;
71 :
72 : // position
73 : FixedText* m_pHorizontalFT;
74 : ListBox* m_pHorizontalDLB;
75 : FixedText* m_pAtHorzPosFT;
76 : MetricField* m_pAtHorzPosED;
77 : FixedText* m_pHoriRelationFT;
78 : ListBox* m_pHoriRelationLB;
79 :
80 : CheckBox* m_pMirrorPagesCB;
81 :
82 : FixedText* m_pVerticalFT;
83 : ListBox* m_pVerticalDLB;
84 : FixedText* m_pAtVertPosFT;
85 : MetricField* m_pAtVertPosED;
86 : FixedText* m_pVertRelationFT;
87 : ListBox* m_pVertRelationLB;
88 : // #i18732# - check box for new option 'FollowTextFlow'
89 : CheckBox* m_pFollowTextFlowCB;
90 :
91 : // example
92 : SvxSwFrameExample* m_pExampleWN;
93 :
94 : //'string provider'
95 : SvxSwFramePosString aFramePosString;
96 :
97 : sal_Bool bAtHorzPosModified;
98 : sal_Bool bAtVertPosModified;
99 :
100 : sal_Bool bFormat;
101 : sal_Bool bNew;
102 : sal_Bool bNoModifyHdl;
103 : bool bIsVerticalFrame; //current frame is in vertical environment - strings are exchanged
104 : // --> OD 2009-08-31 #mongolianlayou#
105 : sal_Bool bIsVerticalL2R;
106 : sal_Bool bIsInRightToLeft; // current frame is in right-to-left environment - strings are exchanged
107 : sal_Bool bHtmlMode;
108 : sal_uInt16 nHtmlMode;
109 : OString sDlgType;
110 : Size aGrfSize;
111 : Size aWrap;
112 : SwTwips nUpperBorder;
113 : SwTwips nLowerBorder;
114 : double fWidthHeightRatio; //width-to-height ratio to support the KeepRatio button
115 :
116 : // OD 12.11.2003 #i22341# - keep content position of character for
117 : // to character anchored objects.
118 : const SwPosition* mpToCharCntntPos;
119 :
120 : // old alignment
121 : sal_Int16 nOldH;
122 : sal_Int16 nOldHRel;
123 : sal_Int16 nOldV;
124 : sal_Int16 nOldVRel;
125 :
126 : FrmMap* pVMap;
127 : FrmMap* pHMap;
128 :
129 : bool m_bAllowVertPositioning;
130 : bool m_bIsMathOLE;
131 : bool m_bIsMathBaselineAlignment;
132 :
133 : virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
134 : virtual int DeactivatePage(SfxItemSet *pSet) SAL_OVERRIDE;
135 :
136 : DECL_LINK(RangeModifyHdl, void *);
137 : DECL_LINK(AnchorTypeHdl, void *);
138 : DECL_LINK( PosHdl, ListBox * );
139 : DECL_LINK( RelHdl, ListBox * );
140 : void InitPos(RndStdIds eId, sal_Int16 nH, sal_Int16 nHRel,
141 : sal_Int16 nV, sal_Int16 nVRel,
142 : long nX, long nY);
143 :
144 : DECL_LINK(RealSizeHdl, void *);
145 : DECL_LINK( RelSizeClickHdl, CheckBox * );
146 : DECL_LINK(MirrorHdl, void *);
147 :
148 : DECL_LINK( AutoWidthClickHdl, void* );
149 : DECL_LINK( AutoHeightClickHdl, void* );
150 :
151 : // update example
152 : void UpdateExample();
153 : DECL_LINK( ModifyHdl, Edit * );
154 :
155 : void Init(const SfxItemSet& rSet, sal_Bool bReset = sal_False);
156 : // OD 12.11.2003 #i22341# - adjustment to handle maps, that are ambigous
157 : // in the alignment.
158 : sal_Int32 FillPosLB( const FrmMap* _pMap,
159 : const sal_Int16 _nAlign,
160 : const sal_Int16 _nRel,
161 : ListBox& _rLB );
162 : // OD 14.11.2003 #i22341# - adjustment to handle maps, that are ambigous
163 : // in their string entries.
164 : sal_uLong FillRelLB( const FrmMap* _pMap,
165 : const sal_uInt16 _nLBSelPos,
166 : const sal_Int16 _nAlign,
167 : const sal_Int16 _nRel,
168 : ListBox& _rLB,
169 : FixedText& _rFT );
170 : sal_Int32 GetMapPos( const FrmMap *pMap, ListBox &rAlignLB );
171 : sal_Int16 GetAlignment(FrmMap *pMap, sal_Int32 nMapPos, ListBox &rAlignLB, ListBox &rRelationLB);
172 : sal_Int16 GetRelation(FrmMap *pMap, ListBox &rRelationLB);
173 : RndStdIds GetAnchor();
174 :
175 : void setOptimalFrmWidth();
176 : void setOptimalRelWidth();
177 :
178 : void EnableGraficMode( void ); // hides auto check boxes and re-org controls for "Real Size" button
179 :
180 : SwFrmPage(Window *pParent, const SfxItemSet &rSet);
181 : virtual ~SwFrmPage();
182 :
183 : SwWrtShell *getFrmDlgParentShell();
184 :
185 : using SfxTabPage::ActivatePage;
186 : using SfxTabPage::DeactivatePage;
187 :
188 : public:
189 :
190 : static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
191 : static sal_uInt16* GetRanges();
192 :
193 : virtual bool FillItemSet(SfxItemSet &rSet) SAL_OVERRIDE;
194 : virtual void Reset(const SfxItemSet &rSet) SAL_OVERRIDE;
195 :
196 0 : void SetNewFrame(sal_Bool bNewFrame) { bNew = bNewFrame; }
197 : void SetFormatUsed(sal_Bool bFmt);
198 0 : void SetFrmType(const OString &rType) { sDlgType = rType; }
199 0 : inline sal_Bool IsInGraficMode( void ) { return sDlgType == "PictureDialog" || sDlgType == "ObjectDialog"; }
200 : void EnableVerticalPositioning( bool bEnable );
201 : };
202 :
203 : class SwGrfExtPage: public SfxTabPage
204 : {
205 : // mirror
206 : VclContainer* m_pMirror;
207 : CheckBox* m_pMirrorVertBox;
208 : CheckBox* m_pMirrorHorzBox;
209 : RadioButton* m_pAllPagesRB;
210 : RadioButton* m_pLeftPagesRB;
211 : RadioButton* m_pRightPagesRB;
212 : BmpWindow* m_pBmpWin;
213 :
214 : Edit* m_pConnectED;
215 : PushButton* m_pBrowseBT;
216 :
217 : OUString aFilterName;
218 : OUString aGrfName, aNewGrfName;
219 :
220 : ::sfx2::FileDialogHelper* pGrfDlg;
221 :
222 : sal_Bool bHtmlMode;
223 :
224 : // handler for mirroring
225 : DECL_LINK(MirrorHdl, void *);
226 : DECL_LINK(BrowseHdl, void *);
227 :
228 : virtual void ActivatePage(const SfxItemSet& rSet) SAL_OVERRIDE;
229 : SwGrfExtPage(Window *pParent, const SfxItemSet &rSet);
230 : virtual ~SwGrfExtPage();
231 :
232 : using SfxTabPage::ActivatePage;
233 : using SfxTabPage::DeactivatePage;
234 :
235 : public:
236 :
237 : static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
238 :
239 : virtual bool FillItemSet(SfxItemSet &rSet) SAL_OVERRIDE;
240 : virtual void Reset(const SfxItemSet &rSet) SAL_OVERRIDE;
241 : virtual int DeactivatePage(SfxItemSet *pSet) SAL_OVERRIDE;
242 : };
243 :
244 : class SwFrmURLPage : public SfxTabPage
245 : {
246 : // hyperlink
247 : Edit* pURLED;
248 : PushButton* pSearchPB;
249 : Edit* pNameED;
250 : ComboBox* pFrameCB;
251 :
252 : // image map
253 : CheckBox* pServerCB;
254 : CheckBox* pClientCB;
255 :
256 : DECL_LINK(InsertFileHdl, void *);
257 :
258 : SwFrmURLPage(Window *pParent, const SfxItemSet &rSet);
259 : virtual ~SwFrmURLPage();
260 :
261 : using SfxTabPage::ActivatePage;
262 : using SfxTabPage::DeactivatePage;
263 :
264 : public:
265 :
266 : static SfxTabPage *Create(Window *pParent, const SfxItemSet &rSet);
267 :
268 : virtual bool FillItemSet(SfxItemSet &rSet) SAL_OVERRIDE;
269 : virtual void Reset(const SfxItemSet &rSet) SAL_OVERRIDE;
270 : };
271 :
272 : class SwFrmAddPage : public SfxTabPage
273 : {
274 : VclContainer* pNameFrame;
275 : FixedText* pNameFT;
276 : Edit* pNameED;
277 : FixedText* pAltNameFT;
278 : Edit* pAltNameED;
279 : FixedText* pPrevFT;
280 : ListBox* pPrevLB;
281 : FixedText* pNextFT;
282 : ListBox* pNextLB;
283 :
284 : VclContainer* pProtectFrame;
285 : CheckBox* pProtectContentCB;
286 : CheckBox* pProtectFrameCB;
287 : CheckBox* pProtectSizeCB;
288 :
289 : VclContainer* m_pContentAlignFrame;
290 : ListBox* m_pVertAlignLB;
291 :
292 : VclContainer* pPropertiesFrame;
293 : CheckBox* pEditInReadonlyCB;
294 : CheckBox* pPrintFrameCB;
295 : FixedText* pTextFlowFT;
296 : ListBox* pTextFlowLB;
297 :
298 : SwWrtShell* pWrtSh;
299 :
300 : OString sDlgType;
301 : sal_Bool bHtmlMode;
302 : sal_Bool bFormat;
303 : sal_Bool bNew;
304 :
305 : DECL_LINK(EditModifyHdl, void *);
306 : DECL_LINK(ChainModifyHdl, ListBox*);
307 :
308 : SwFrmAddPage(Window *pParent, const SfxItemSet &rSet);
309 : virtual ~SwFrmAddPage();
310 :
311 : public:
312 :
313 : static SfxTabPage* Create(Window *pParent, const SfxItemSet &rSet);
314 : static sal_uInt16* GetRanges();
315 :
316 : virtual bool FillItemSet(SfxItemSet &rSet) SAL_OVERRIDE;
317 : virtual void Reset(const SfxItemSet &rSet) SAL_OVERRIDE;
318 :
319 : void SetFormatUsed(sal_Bool bFmt);
320 0 : void SetFrmType(const OString &rType) { sDlgType = rType; }
321 0 : void SetNewFrame(sal_Bool bNewFrame) { bNew = bNewFrame; }
322 0 : void SetShell(SwWrtShell* pSh) { pWrtSh = pSh; }
323 :
324 : };
325 :
326 : #endif // INCLUDED_SW_SOURCE_UI_INC_FRMPAGE_HXX
327 :
328 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|