xref: /trunk/main/cui/source/inc/cuitabline.hxx (revision 1ecadb572e7010ff3b3382ad9bf179dbc6efadbb)
1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 #ifndef _CUI_TAB_LINE_HXX
28 #define _CUI_TAB_LINE_HXX
29 
30 // include ---------------------------------------------------------------
31 #include <svx/tabline.hxx>
32 /*************************************************************************
33 |*
34 |* Transform-Tab-Dialog
35 |*
36 \************************************************************************/
37 
38 class SvxLineTabDialog : public SfxTabDialog
39 {
40 private:
41     SdrModel*           pDrawModel;
42     const SdrObject*    pObj;
43 
44     const SfxItemSet&   rOutAttrs;
45 
46     XColorTable*        pColorTab;
47     XColorTable*        mpNewColorTab;
48     XDashList*          pDashList;
49     XDashList*          pNewDashList;
50     XLineEndList*       pLineEndList;
51     XLineEndList*       pNewLineEndList;
52     sal_Bool                bObjSelected;
53 
54     ChangeType          nLineEndListState;
55     ChangeType          nDashListState;
56     ChangeType          mnColorTableState;
57 
58     sal_uInt16              nPageType;
59     sal_uInt16              nDlgType;
60     sal_uInt16              nPosDashLb;
61     sal_uInt16              nPosLineEndLb;
62     sal_uInt16              mnPos;
63     sal_Bool                mbAreaTP;
64     sal_Bool                mbDeleteColorTable;
65 
66     virtual void        PageCreated( sal_uInt16 nId, SfxTabPage &rPage );
67 
68 protected:
69     virtual short       Ok();
70 #ifdef _SVX_TABLINE_CXX
71     DECL_LINK( CancelHdlImpl, void * );
72     void                SavePalettes();
73 #endif
74 
75 public:
76     SvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr,
77                       SdrModel* pModel, const SdrObject* pObj = NULL,
78                       sal_Bool bHasObj = sal_True );
79     ~SvxLineTabDialog();
80 
81     void             SetNewDashList( XDashList* pInLst)
82                         { pNewDashList = pInLst; }
83     XDashList*       GetNewDashList() const { return pNewDashList; }
84     const XDashList* GetDashList() const { return pDashList; }
85 
86     void                SetNewLineEndList( XLineEndList* pInLst)
87                             { pNewLineEndList = pInLst; }
88     XLineEndList*       GetNewLineEndList() const { return pNewLineEndList; }
89     const XLineEndList* GetLineEndList() const { return pLineEndList; }
90 
91     void                SetNewColorTable( XColorTable* pColTab ) { mpNewColorTab = pColTab; }
92     XColorTable*        GetNewColorTable() const { return mpNewColorTab; }
93     const XColorTable*  GetColorTable() const { return pColorTab; }
94 };
95 
96 /*************************************************************************
97 |*
98 |* Linien-Tab-Page
99 |*
100 \************************************************************************/
101 
102 class SvxLineTabPage : public SvxTabPage
103 {
104     using TabPage::ActivatePage;
105     using TabPage::DeactivatePage;
106 private:
107     FixedLine           aFlLine;
108     FixedText           aFtLineStyle;
109     LineLB              aLbLineStyle;
110     FixedText           aFtColor;
111     ColorLB             aLbColor;
112     FixedText           aFtLineWidth;
113     MetricField         aMtrLineWidth;
114     FixedText           aFtTransparent;
115     MetricField         aMtrTransparent;
116     FixedLine           aFlLineEnds;
117     LineEndLB           aLbStartStyle;
118     MetricField         aMtrStartWidth;
119     TriStateBox         aTsbCenterStart;
120     FixedText           aFtLineEndsStyle;
121     LineEndLB           aLbEndStyle;
122     FixedText           aFtLineEndsWidth;
123     MetricField         aMtrEndWidth;
124     TriStateBox         aTsbCenterEnd;
125     CheckBox            aCbxSynchronize;
126     FixedLine           aFLSeparator;
127     SvxXLinePreview     aCtlPreview;
128 
129     // #116827#
130     FixedLine           maFLEdgeStyle;
131     FixedText           maFTEdgeStyle;
132     LineEndLB           maLBEdgeStyle;
133 
134     //#58425# Symbole auf einer Linie (z.B. StarChart) ->
135     SdrObjList*         pSymbolList; //a list of symbols to be shown in menu. Symbol at position SID_ATTR_SYMBOLTYPE is to be shown in preview. The list position is to be used cyclic.
136     bool                bNewSize;
137     Graphic             aAutoSymbolGraphic; //a graphic to be displayed in the preview in case that an automatic symbol is choosen
138     long                nNumMenuGalleryItems;
139     long                nSymbolType;
140     SfxItemSet*         pSymbolAttr; //attributes for the shown symbols; only necessary if not equal to line properties
141     FixedLine           aFlSymbol;
142     MenuButton          aSymbolMB;
143     FixedText           aSymbolWidthFT;
144     MetricField         aSymbolWidthMF;
145     FixedText           aSymbolHeightFT;
146     MetricField         aSymbolHeightMF;
147     CheckBox            aSymbolRatioCB;
148     List                aGrfNames;
149     List                aGrfBrushItems;
150     String              sNumCharFmtName;
151     sal_Bool                bLastWidthModified;
152     Size                aSymbolLastSize;
153     Graphic             aSymbolGraphic;
154     Size                aSymbolSize;
155     sal_Bool                bSymbols;
156 
157     const SfxItemSet&   rOutAttrs;
158     RECT_POINT          eRP;
159     sal_Bool                bObjSelected;
160 
161     XOutdevItemPool*    pXPool;
162     XLineStyleItem      aXLStyle;
163     XLineWidthItem      aXWidth;
164     XLineDashItem       aXDash;
165     XLineColorItem      aXColor;
166     XLineAttrSetItem    aXLineAttr;
167     SfxItemSet&         rXLSet;
168 
169     XColorTable*        pColorTab;
170     XDashList*          pDashList;
171     XLineEndList*       pLineEndList;
172 
173     ChangeType*         pnLineEndListState;
174     ChangeType*         pnDashListState;
175     ChangeType*         pnColorTableState;
176     sal_uInt16             nPageType; //add CHINA001
177     sal_uInt16             nDlgType; //add CHINA001
178     sal_uInt16*             pPosDashLb;
179     sal_uInt16*             pPosLineEndLb;
180 
181     SfxMapUnit          ePoolUnit;
182 
183     // #63083#
184     sal_Int32               nActLineWidth;
185 
186     //Handler f�r Gallery-Popup-Menue-Button + Size
187     DECL_LINK( GraphicHdl_Impl, MenuButton * );
188     DECL_LINK( MenuCreateHdl_Impl, MenuButton * );
189     DECL_STATIC_LINK( SvxLineTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* );
190     DECL_LINK( SizeHdl_Impl, MetricField * );
191     DECL_LINK( RatioHdl_Impl, CheckBox * );
192     // <- Symbole
193 
194 #ifdef _SVX_TPLINE_CXX
195     DECL_LINK( ClickInvisibleHdl_Impl, void * );
196     DECL_LINK( ChangeStartHdl_Impl, void * );
197     DECL_LINK( ChangeEndHdl_Impl, void * );
198     DECL_LINK( ChangePreviewHdl_Impl, void * );
199     DECL_LINK( ChangeTransparentHdl_Impl, void * );
200 
201     // #116827#
202     DECL_LINK( ChangeEdgeStyleHdl_Impl, void * );
203 
204     sal_Bool FillXLSet_Impl();
205 #endif
206 
207     void FillListboxes();
208 public:
209 
210     void ShowSymbolControls(sal_Bool bOn);
211 
212     SvxLineTabPage( Window* pParent, const SfxItemSet& rInAttrs );
213     virtual ~SvxLineTabPage();
214 
215     void    Construct();
216 
217 
218     static  SfxTabPage* Create( Window*, const SfxItemSet& );
219     static  sal_uInt16*    GetRanges();
220 
221     virtual sal_Bool FillItemSet( SfxItemSet& );
222     virtual void Reset( const SfxItemSet& );
223 
224     virtual void ActivatePage( const SfxItemSet& rSet );
225     virtual int  DeactivatePage( SfxItemSet* pSet );
226 
227     virtual void PointChanged( Window* pWindow, RECT_POINT eRP );
228 
229     virtual void FillUserData();
230 
231     void    SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; }
232     void    SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; }
233     void    SetLineEndList( XLineEndList* pLneEndLst) { pLineEndList = pLneEndLst; }
234     void    SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
235 
236     void    SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }//CHINA001 void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
237     void    SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; }    //CHINA001 void    SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
238     void    SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; }
239     void    SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; }
240 
241     void    SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
242     void    SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
243     void    SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; }
244 
245     virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001
246     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
247 };
248 
249 /*************************************************************************
250 |*
251 |* Linien-Definitions-Tab-Page
252 |*
253 \************************************************************************/
254 
255 class SvxLineDefTabPage : public SfxTabPage
256 {
257     using TabPage::ActivatePage;
258     using TabPage::DeactivatePage;
259 private:
260     FixedLine           aFlDefinition;
261     FixedText           aFTLinestyle;
262     LineLB              aLbLineStyles;
263     FixedText           aFtType;
264     ListBox             aLbType1;
265     ListBox             aLbType2;
266     FixedText           aFtNumber;
267     NumericField        aNumFldNumber1;
268     NumericField        aNumFldNumber2;
269     FixedText           aFtLength;
270     MetricField         aMtrLength1;
271     MetricField         aMtrLength2;
272     FixedText           aFtDistance;
273     MetricField         aMtrDistance;
274     CheckBox            aCbxSynchronize;
275     PushButton          aBtnAdd;
276     PushButton          aBtnModify;
277     PushButton          aBtnDelete;
278     ImageButton         aBtnLoad;
279     ImageButton         aBtnSave;
280     SvxXLinePreview     aCtlPreview;
281 
282     const SfxItemSet&   rOutAttrs;
283     XDash               aDash;
284     sal_Bool                bObjSelected;
285 
286     XOutdevItemPool*    pXPool;
287     XLineStyleItem      aXLStyle;
288     XLineWidthItem      aXWidth;
289     XLineDashItem       aXDash;
290     XLineColorItem      aXColor;
291     XLineAttrSetItem    aXLineAttr;
292     SfxItemSet&         rXLSet;
293 
294     XDashList*          pDashList;
295 
296     ChangeType*         pnDashListState;
297     sal_uInt16*             pPageType;
298     sal_uInt16*             pDlgType;
299     sal_uInt16*             pPosDashLb;
300 
301     SfxMapUnit          ePoolUnit;
302     FieldUnit           eFUnit;
303 
304 #ifdef _SVX_TPLNEDEF_CXX
305     void FillDash_Impl();
306     void FillDialog_Impl();
307 
308     DECL_LINK( ClickAddHdl_Impl, void * );
309     DECL_LINK( ClickModifyHdl_Impl, void * );
310     DECL_LINK( ClickDeleteHdl_Impl, void * );
311     DECL_LINK( SelectLinestyleHdl_Impl, void * );
312     DECL_LINK( ChangePreviewHdl_Impl, void * );
313     DECL_LINK( ChangeNumber1Hdl_Impl, void * );
314     DECL_LINK( ChangeNumber2Hdl_Impl, void * );
315     DECL_LINK( ClickLoadHdl_Impl, void * );
316     DECL_LINK( ClickSaveHdl_Impl, void * );
317     DECL_LINK( ChangeMetricHdl_Impl, void * );
318     DECL_LINK( SelectTypeHdl_Impl, void * );
319 
320     void CheckChanges_Impl();
321 #endif
322 
323 public:
324     SvxLineDefTabPage( Window* pParent, const SfxItemSet& rInAttrs  );
325 
326     void    Construct();
327 
328     static  SfxTabPage* Create( Window*, const SfxItemSet& );
329     virtual sal_Bool FillItemSet( SfxItemSet& );
330     virtual void Reset( const SfxItemSet & );
331 
332     virtual void ActivatePage( const SfxItemSet& rSet );
333     virtual int  DeactivatePage( SfxItemSet* pSet );
334 
335     void    SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; }
336     void    SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
337 
338     void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
339     void    SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
340     void    SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; }
341 
342     void    SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; }
343 
344     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
345 };
346 
347 /*************************************************************************
348 |*
349 |* Linienenden-Definitions-Tab-Page
350 |*
351 \************************************************************************/
352 
353 class SvxLineEndDefTabPage : public SfxTabPage
354 {
355     using TabPage::ActivatePage;
356     using TabPage::DeactivatePage;
357 
358 private:
359     FixedLine           aFlTip;
360     FixedText           aFTTitle;
361     Edit                aEdtName;
362     FixedText           aFTLineEndStyle;
363     LineEndLB           aLbLineEnds;
364     PushButton          aBtnAdd;
365     PushButton          aBtnModify;
366     PushButton          aBtnDelete;
367     ImageButton         aBtnLoad;
368     ImageButton         aBtnSave;
369     FixedInfo           aFiTip;
370     SvxXLinePreview     aCtlPreview;
371 
372     const SfxItemSet&   rOutAttrs;
373     const SdrObject*    pPolyObj;
374     sal_Bool                bObjSelected;
375 
376     XOutdevItemPool*    pXPool;
377     XLineStyleItem      aXLStyle;
378     XLineWidthItem      aXWidth;
379     XLineColorItem      aXColor;
380     XLineAttrSetItem    aXLineAttr;
381     SfxItemSet&         rXLSet;
382 
383     XLineEndList*       pLineEndList;
384 
385     ChangeType*         pnLineEndListState;
386     sal_uInt16*             pPageType;
387     sal_uInt16*             pDlgType;
388     sal_uInt16*             pPosLineEndLb;
389 
390 #ifdef _SVX_TPLNEEND_CXX
391     DECL_LINK( ClickAddHdl_Impl, void * );
392     DECL_LINK( ClickModifyHdl_Impl, void * );
393     DECL_LINK( ClickDeleteHdl_Impl, void * );
394     DECL_LINK( ClickLoadHdl_Impl, void * );
395     DECL_LINK( ClickSaveHdl_Impl, void * );
396     DECL_LINK( SelectLineEndHdl_Impl, void * );
397     long ChangePreviewHdl_Impl( void* p );
398 
399     void CheckChanges_Impl();
400 #endif
401 
402 public:
403     SvxLineEndDefTabPage( Window* pParent, const SfxItemSet& rInAttrs );
404     ~SvxLineEndDefTabPage();
405 
406     void    Construct();
407 
408     static  SfxTabPage* Create( Window*, const SfxItemSet& );
409     virtual sal_Bool FillItemSet( SfxItemSet& );
410     virtual void Reset( const SfxItemSet & );
411 
412     virtual void ActivatePage( const SfxItemSet& rSet );
413     virtual int  DeactivatePage( SfxItemSet* pSet );
414 
415     void    SetLineEndList( XLineEndList* pInList ) { pLineEndList = pInList; }
416     void    SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; }
417     void    SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; }
418 
419     void    SetPageType( sal_uInt16* pInType ) { pPageType = pInType; }
420     void    SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; }
421     void    SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; }
422 
423     void    SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; }
424 
425     virtual void    DataChanged( const DataChangedEvent& rDCEvt );
426 };
427 
428 
429 #endif // _CUI_TAB_LINE_HXX
430 
431