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 XColorTable* pColorTab; 43 XColorTable* mpNewColorTab; 44 XDashList* pDashList; 45 XDashList* pNewDashList; 46 XLineEndList* pLineEndList; 47 XLineEndList* pNewLineEndList; 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 sal_Bool mbDeleteColorTable; 61 62 virtual void PageCreated( sal_uInt16 nId, SfxTabPage &rPage ); 63 64 protected: 65 virtual short Ok(); 66 #ifdef _SVX_TABLINE_CXX 67 DECL_LINK( CancelHdlImpl, void * ); 68 void SavePalettes(); 69 #endif 70 71 public: 72 SvxLineTabDialog( Window* pParent, const SfxItemSet* pAttr, 73 SdrModel* pModel, const SdrObject* pObj = NULL, 74 sal_Bool bHasObj = sal_True ); 75 ~SvxLineTabDialog(); 76 77 void SetNewDashList( XDashList* pInLst) 78 { pNewDashList = pInLst; } 79 XDashList* GetNewDashList() const { return pNewDashList; } 80 const XDashList* GetDashList() const { return pDashList; } 81 82 void SetNewLineEndList( XLineEndList* pInLst) 83 { pNewLineEndList = pInLst; } 84 XLineEndList* GetNewLineEndList() const { return pNewLineEndList; } 85 const XLineEndList* GetLineEndList() const { return pLineEndList; } 86 87 void SetNewColorTable( XColorTable* pColTab ) { mpNewColorTab = pColTab; } 88 XColorTable* GetNewColorTable() const { return mpNewColorTab; } 89 const XColorTable* GetColorTable() const { return pColorTab; } 90 }; 91 92 /************************************************************************* 93 |* 94 |* Linien-Tab-Page 95 |* 96 \************************************************************************/ 97 98 class SvxLineTabPage : public SvxTabPage 99 { 100 using TabPage::ActivatePage; 101 using TabPage::DeactivatePage; 102 private: 103 FixedLine aFlLine; 104 FixedText aFtLineStyle; 105 LineLB aLbLineStyle; 106 FixedText aFtColor; 107 ColorLB aLbColor; 108 FixedText aFtLineWidth; 109 MetricField aMtrLineWidth; 110 FixedText aFtTransparent; 111 MetricField aMtrTransparent; 112 FixedLine aFlLineEnds; 113 LineEndLB aLbStartStyle; 114 MetricField aMtrStartWidth; 115 TriStateBox aTsbCenterStart; 116 FixedText aFtLineEndsStyle; 117 LineEndLB aLbEndStyle; 118 FixedText aFtLineEndsWidth; 119 MetricField aMtrEndWidth; 120 TriStateBox aTsbCenterEnd; 121 CheckBox aCbxSynchronize; 122 FixedLine aFLSeparator; 123 SvxXLinePreview aCtlPreview; 124 125 // #116827# 126 FixedLine maFLEdgeStyle; 127 FixedText maFTEdgeStyle; 128 LineEndLB maLBEdgeStyle; 129 130 // LineCaps 131 FixedText maFTCapStyle; 132 LineEndLB maLBCapStyle; 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 // LineCaps 205 DECL_LINK ( ChangeCapStyleHdl_Impl, void * ); 206 207 sal_Bool FillXLSet_Impl(); 208 #endif 209 210 void FillListboxes(); 211 public: 212 213 void ShowSymbolControls(sal_Bool bOn); 214 215 SvxLineTabPage( Window* pParent, const SfxItemSet& rInAttrs ); 216 virtual ~SvxLineTabPage(); 217 218 void Construct(); 219 220 221 static SfxTabPage* Create( Window*, const SfxItemSet& ); 222 static sal_uInt16* GetRanges(); 223 224 virtual sal_Bool FillItemSet( SfxItemSet& ); 225 virtual void Reset( const SfxItemSet& ); 226 227 virtual void ActivatePage( const SfxItemSet& rSet ); 228 virtual int DeactivatePage( SfxItemSet* pSet ); 229 230 virtual void PointChanged( Window* pWindow, RECT_POINT eRP ); 231 232 virtual void FillUserData(); 233 234 void SetColorTable( XColorTable* pColTab ) { pColorTab = pColTab; } 235 void SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; } 236 void SetLineEndList( XLineEndList* pLneEndLst) { pLineEndList = pLneEndLst; } 237 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; } 238 239 void SetPageType( sal_uInt16 nInType ) { nPageType = nInType; }//CHINA001 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; } 240 void SetDlgType( sal_uInt16 nInType ) { nDlgType = nInType; } //CHINA001 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; } 241 void SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; } 242 void SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; } 243 244 void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; } 245 void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; } 246 void SetColorChgd( ChangeType* pIn ) { pnColorTableState = pIn; } 247 248 virtual void PageCreated (SfxAllItemSet aSet); //add CHINA001 249 virtual void DataChanged( const DataChangedEvent& rDCEvt ); 250 }; 251 252 /************************************************************************* 253 |* 254 |* Linien-Definitions-Tab-Page 255 |* 256 \************************************************************************/ 257 258 class SvxLineDefTabPage : public SfxTabPage 259 { 260 using TabPage::ActivatePage; 261 using TabPage::DeactivatePage; 262 private: 263 FixedLine aFlDefinition; 264 FixedText aFTLinestyle; 265 LineLB aLbLineStyles; 266 FixedText aFtType; 267 ListBox aLbType1; 268 ListBox aLbType2; 269 FixedText aFtNumber; 270 NumericField aNumFldNumber1; 271 NumericField aNumFldNumber2; 272 FixedText aFtLength; 273 MetricField aMtrLength1; 274 MetricField aMtrLength2; 275 FixedText aFtDistance; 276 MetricField aMtrDistance; 277 CheckBox aCbxSynchronize; 278 PushButton aBtnAdd; 279 PushButton aBtnModify; 280 PushButton aBtnDelete; 281 ImageButton aBtnLoad; 282 ImageButton aBtnSave; 283 SvxXLinePreview aCtlPreview; 284 285 const SfxItemSet& rOutAttrs; 286 XDash aDash; 287 sal_Bool bObjSelected; 288 289 XOutdevItemPool* pXPool; 290 XLineStyleItem aXLStyle; 291 XLineWidthItem aXWidth; 292 XLineDashItem aXDash; 293 XLineColorItem aXColor; 294 XLineAttrSetItem aXLineAttr; 295 SfxItemSet& rXLSet; 296 297 XDashList* pDashList; 298 299 ChangeType* pnDashListState; 300 sal_uInt16* pPageType; 301 sal_uInt16* pDlgType; 302 sal_uInt16* pPosDashLb; 303 304 SfxMapUnit ePoolUnit; 305 FieldUnit eFUnit; 306 307 #ifdef _SVX_TPLNEDEF_CXX 308 void FillDash_Impl(); 309 void FillDialog_Impl(); 310 311 DECL_LINK( ClickAddHdl_Impl, void * ); 312 DECL_LINK( ClickModifyHdl_Impl, void * ); 313 DECL_LINK( ClickDeleteHdl_Impl, void * ); 314 DECL_LINK( SelectLinestyleHdl_Impl, void * ); 315 DECL_LINK( ChangePreviewHdl_Impl, void * ); 316 DECL_LINK( ChangeNumber1Hdl_Impl, void * ); 317 DECL_LINK( ChangeNumber2Hdl_Impl, void * ); 318 DECL_LINK( ClickLoadHdl_Impl, void * ); 319 DECL_LINK( ClickSaveHdl_Impl, void * ); 320 DECL_LINK( ChangeMetricHdl_Impl, void * ); 321 DECL_LINK( SelectTypeHdl_Impl, void * ); 322 323 void CheckChanges_Impl(); 324 #endif 325 326 public: 327 SvxLineDefTabPage( Window* pParent, const SfxItemSet& rInAttrs ); 328 329 void Construct(); 330 331 static SfxTabPage* Create( Window*, const SfxItemSet& ); 332 virtual sal_Bool FillItemSet( SfxItemSet& ); 333 virtual void Reset( const SfxItemSet & ); 334 335 virtual void ActivatePage( const SfxItemSet& rSet ); 336 virtual int DeactivatePage( SfxItemSet* pSet ); 337 338 void SetDashList( XDashList* pDshLst ) { pDashList = pDshLst; } 339 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; } 340 341 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; } 342 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; } 343 void SetPosDashLb( sal_uInt16* pInPos ) { pPosDashLb = pInPos; } 344 345 void SetDashChgd( ChangeType* pIn ) { pnDashListState = pIn; } 346 347 virtual void DataChanged( const DataChangedEvent& rDCEvt ); 348 }; 349 350 /************************************************************************* 351 |* 352 |* Linienenden-Definitions-Tab-Page 353 |* 354 \************************************************************************/ 355 356 class SvxLineEndDefTabPage : public SfxTabPage 357 { 358 using TabPage::ActivatePage; 359 using TabPage::DeactivatePage; 360 361 private: 362 FixedLine aFlTip; 363 FixedText aFTTitle; 364 Edit aEdtName; 365 FixedText aFTLineEndStyle; 366 LineEndLB aLbLineEnds; 367 PushButton aBtnAdd; 368 PushButton aBtnModify; 369 PushButton aBtnDelete; 370 ImageButton aBtnLoad; 371 ImageButton aBtnSave; 372 FixedInfo aFiTip; 373 SvxXLinePreview aCtlPreview; 374 375 const SfxItemSet& rOutAttrs; 376 const SdrObject* pPolyObj; 377 sal_Bool bObjSelected; 378 379 XOutdevItemPool* pXPool; 380 XLineStyleItem aXLStyle; 381 XLineWidthItem aXWidth; 382 XLineColorItem aXColor; 383 XLineAttrSetItem aXLineAttr; 384 SfxItemSet& rXLSet; 385 386 XLineEndList* pLineEndList; 387 388 ChangeType* pnLineEndListState; 389 sal_uInt16* pPageType; 390 sal_uInt16* pDlgType; 391 sal_uInt16* pPosLineEndLb; 392 393 #ifdef _SVX_TPLNEEND_CXX 394 DECL_LINK( ClickAddHdl_Impl, void * ); 395 DECL_LINK( ClickModifyHdl_Impl, void * ); 396 DECL_LINK( ClickDeleteHdl_Impl, void * ); 397 DECL_LINK( ClickLoadHdl_Impl, void * ); 398 DECL_LINK( ClickSaveHdl_Impl, void * ); 399 DECL_LINK( SelectLineEndHdl_Impl, void * ); 400 long ChangePreviewHdl_Impl( void* p ); 401 402 void CheckChanges_Impl(); 403 #endif 404 405 public: 406 SvxLineEndDefTabPage( Window* pParent, const SfxItemSet& rInAttrs ); 407 ~SvxLineEndDefTabPage(); 408 409 void Construct(); 410 411 static SfxTabPage* Create( Window*, const SfxItemSet& ); 412 virtual sal_Bool FillItemSet( SfxItemSet& ); 413 virtual void Reset( const SfxItemSet & ); 414 415 virtual void ActivatePage( const SfxItemSet& rSet ); 416 virtual int DeactivatePage( SfxItemSet* pSet ); 417 418 void SetLineEndList( XLineEndList* pInList ) { pLineEndList = pInList; } 419 void SetPolyObj( const SdrObject* pObj ) { pPolyObj = pObj; } 420 void SetObjSelected( sal_Bool bHasObj ) { bObjSelected = bHasObj; } 421 422 void SetPageType( sal_uInt16* pInType ) { pPageType = pInType; } 423 void SetDlgType( sal_uInt16* pInType ) { pDlgType = pInType; } 424 void SetPosLineEndLb( sal_uInt16* pInPos ) { pPosLineEndLb = pInPos; } 425 426 void SetLineEndChgd( ChangeType* pIn ) { pnLineEndListState = pIn; } 427 428 virtual void DataChanged( const DataChangedEvent& rDCEvt ); 429 }; 430 431 432 #endif // _CUI_TAB_LINE_HXX 433 434