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 23 #ifndef _CUI_TAB_LINE_HXX 24 #define _CUI_TAB_LINE_HXX 25 26 // include --------------------------------------------------------------- 27 #include <svx/tabline.hxx> 28 /************************************************************************* 29 |* 30 |* Transform-Tab-Dialog 31 |* 32 \************************************************************************/ 33 34 class SvxLineTabDialog : public SfxTabDialog 35 { 36 private: 37 SdrModel* pDrawModel; 38 const SdrObject* pObj; 39 40 const SfxItemSet& rOutAttrs; 41 42 XColorListSharedPtr maColorTab; 43 XColorListSharedPtr maNewColorTab; 44 XDashListSharedPtr maDashList; 45 XDashListSharedPtr maNewDashList; 46 XLineEndListSharedPtr maLineEndList; 47 XLineEndListSharedPtr maNewLineEndList; 48 sal_Bool bObjSelected; 49 50 ChangeType nLineEndListState; 51 ChangeType nDashListState; 52 ChangeType mnColorTableState; 53 54 sal_uInt16 nPageType; 55 sal_uInt16 nDlgType; 56 sal_uInt16 nPosDashLb; 57 sal_uInt16 nPosLineEndLb; 58 sal_uInt16 mnPos; 59 sal_Bool mbAreaTP; 60 61 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); 62 63 protected: 64 virtual short Ok(); 65 #ifdef _SVX_TABLINE_CXX 66 DECL_LINK( CancelHdlImpl, void * ); 67 void SavePalettes(); 68 #endif 69 70 public: 71 SvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr, 72 SdrModel* pModel, const SdrObject* pObj = NULL, 73 sal_Bool bHasObj = sal_True ); 74 ~SvxLineTabDialog(); 75 SetNewDashList(XDashListSharedPtr aInLst)76 void SetNewDashList( XDashListSharedPtr aInLst) { maNewDashList = aInLst; } GetNewDashList() const77 XDashListSharedPtr GetNewDashList() const { return maNewDashList; } GetDashList() const78 const XDashListSharedPtr GetDashList() const { return maDashList; } 79 SetNewLineEndList(XLineEndListSharedPtr aInLst)80 void SetNewLineEndList( XLineEndListSharedPtr aInLst) { maNewLineEndList = aInLst; } GetNewLineEndList() const81 XLineEndListSharedPtr GetNewLineEndList() const { return maNewLineEndList; } GetLineEndList() const82 const XLineEndListSharedPtr GetLineEndList() const { return maLineEndList; } 83 SetNewColorTable(XColorListSharedPtr aColTab)84 void SetNewColorTable( XColorListSharedPtr aColTab ) { maNewColorTab = aColTab; } GetNewColorTable() const85 XColorListSharedPtr GetNewColorTable() const { return maNewColorTab; } GetColorTable() const86 const XColorListSharedPtr GetColorTable() const { return maColorTab; } 87 }; 88 89 /************************************************************************* 90 |* 91 |* Linien-Tab-Page 92 |* 93 \************************************************************************/ 94 95 class SvxLineTabPage : public SvxTabPage 96 { 97 using TabPage::ActivatePage; 98 using TabPage::DeactivatePage; 99 private: 100 FixedLine aFlLine; 101 FixedText aFtLineStyle; 102 LineLB aLbLineStyle; 103 FixedText aFtColor; 104 ColorLB aLbColor; 105 FixedText aFtLineWidth; 106 MetricField aMtrLineWidth; 107 FixedText aFtTransparent; 108 MetricField aMtrTransparent; 109 FixedLine aFlLineEnds; 110 LineEndLB aLbStartStyle; 111 MetricField aMtrStartWidth; 112 TriStateBox aTsbCenterStart; 113 FixedText aFtLineEndsStyle; 114 LineEndLB aLbEndStyle; 115 FixedText aFtLineEndsWidth; 116 MetricField aMtrEndWidth; 117 TriStateBox aTsbCenterEnd; 118 CheckBox aCbxSynchronize; 119 FixedLine aFLSeparator; 120 SvxXLinePreview aCtlPreview; 121 122 // #116827# 123 FixedLine maFLEdgeStyle; 124 FixedText maFTEdgeStyle; 125 LineEndLB maLBEdgeStyle; 126 127 // LineCaps 128 FixedText maFTCapStyle; 129 LineEndLB maLBCapStyle; 130 131 //#58425# Symbole auf einer Linie (z.B. StarChart) -> 132 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. 133 bool bNewSize; 134 Graphic aAutoSymbolGraphic; //a graphic to be displayed in the preview in case that an automatic symbol is choosen 135 long nNumMenuGalleryItems; 136 long nSymbolType; 137 SfxItemSet* pSymbolAttr; //attributes for the shown symbols; only necessary if not equal to line properties 138 FixedLine aFlSymbol; 139 MenuButton aSymbolMB; 140 FixedText aSymbolWidthFT; 141 MetricField aSymbolWidthMF; 142 FixedText aSymbolHeightFT; 143 MetricField aSymbolHeightMF; 144 CheckBox aSymbolRatioCB; 145 List aGrfNames; 146 List aGrfBrushItems; 147 String sNumCharFmtName; 148 sal_Bool bLastWidthModified; 149 Size aSymbolLastSize; 150 Graphic aSymbolGraphic; 151 Size aSymbolSize; 152 sal_Bool bSymbols; 153 154 const SfxItemSet& rOutAttrs; 155 RECT_POINT eRP; 156 sal_Bool bObjSelected; 157 158 XOutdevItemPool* pXPool; 159 XLineStyleItem aXLStyle; 160 XLineWidthItem aXWidth; 161 XLineDashItem aXDash; 162 XLineColorItem aXColor; 163 XLineAttrSetItem aXLineAttr; 164 SfxItemSet& rXLSet; 165 166 XColorListSharedPtr maColorTab; 167 XDashListSharedPtr maDashList; 168 XLineEndListSharedPtr maLineEndList; 169 170 ChangeType* pnLineEndListState; 171 ChangeType* pnDashListState; 172 ChangeType* pnColorTableState; 173 sal_uInt16 nPageType; //add CHINA001 174 sal_uInt16 nDlgType; //add CHINA001 175 sal_uInt16* pPosDashLb; 176 sal_uInt16* pPosLineEndLb; 177 178 SfxMapUnit ePoolUnit; 179 180 // #63083# 181 sal_Int32 nActLineWidth; 182 183 //Handler f�r Gallery-Popup-Menue-Button + Size 184 DECL_LINK( GraphicHdl_Impl, MenuButton * ); 185 DECL_LINK( MenuCreateHdl_Impl, MenuButton * ); 186 DECL_STATIC_LINK( SvxLineTabPage, GraphicArrivedHdl_Impl, SvxBrushItem* ); 187 DECL_LINK( SizeHdl_Impl, MetricField * ); 188 DECL_LINK( RatioHdl_Impl, CheckBox * ); 189 // <- Symbole 190 191 #ifdef _SVX_TPLINE_CXX 192 DECL_LINK( ClickInvisibleHdl_Impl, void * ); 193 DECL_LINK( ChangeStartHdl_Impl, void * ); 194 DECL_LINK( ChangeEndHdl_Impl, void * ); 195 DECL_LINK( ChangePreviewHdl_Impl, void * ); 196 DECL_LINK( ChangeTransparentHdl_Impl, void * ); 197 198 // #116827# 199 DECL_LINK( ChangeEdgeStyleHdl_Impl, void * ); 200 201 // LineCaps 202 DECL_LINK ( ChangeCapStyleHdl_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 SetColorTable(XColorListSharedPtr aColTab)231 void SetColorTable( XColorListSharedPtr aColTab ) { maColorTab = aColTab; } SetDashList(XDashListSharedPtr aDshLst)232 void SetDashList( XDashListSharedPtr aDshLst ) { maDashList = aDshLst; } SetLineEndList(XLineEndListSharedPtr aLneEndLst)233 void SetLineEndList( XLineEndListSharedPtr aLneEndLst) { maLineEndList = aLneEndLst; } SetObjSelected(sal_Bool bHasObj)234 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; } 235 SetPageType(sal_uInt16 nInType)236 void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }//CHINA001 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; } SetDlgType(sal_uInt16 nInType)237 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; } //CHINA001 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; } SetPosDashLb(sal_uInt16 * pInPos)238 void SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; } SetPosLineEndLb(sal_uInt16 * pInPos)239 void SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; } 240 SetLineEndChgd(ChangeType * pIn)241 void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; } SetDashChgd(ChangeType * pIn)242 void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; } SetColorChgd(ChangeType * 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 XDashListSharedPtr maDashList; 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 SetDashList(XDashListSharedPtr aDshLst)335 void SetDashList( XDashListSharedPtr aDshLst ) { maDashList = aDshLst; } SetObjSelected(sal_Bool bHasObj)336 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; } 337 SetPageType(sal_uInt16 * pInType)338 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; } SetDlgType(sal_uInt16 * pInType)339 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; } SetPosDashLb(sal_uInt16 * pInPos)340 void SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; } 341 SetDashChgd(ChangeType * pIn)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 XLineEndListSharedPtr maLineEndList; 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 SetLineEndList(XLineEndListSharedPtr aInList)415 void SetLineEndList( XLineEndListSharedPtr aInList ) { maLineEndList = aInList; } SetPolyObj(const SdrObject * pObj)416 void SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; } SetObjSelected(sal_Bool bHasObj)417 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; } 418 SetPageType(sal_uInt16 * pInType)419 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; } SetDlgType(sal_uInt16 * pInType)420 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; } SetPosLineEndLb(sal_uInt16 * pInPos)421 void SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; } 422 SetLineEndChgd(ChangeType * pIn)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