15b190011SAndrew Rist /************************************************************** 2cdf0e10cSrcweir * 35b190011SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one 45b190011SAndrew Rist * or more contributor license agreements. See the NOTICE file 55b190011SAndrew Rist * distributed with this work for additional information 65b190011SAndrew Rist * regarding copyright ownership. The ASF licenses this file 75b190011SAndrew Rist * to you under the Apache License, Version 2.0 (the 85b190011SAndrew Rist * "License"); you may not use this file except in compliance 95b190011SAndrew Rist * with the License. You may obtain a copy of the License at 10cdf0e10cSrcweir * 115b190011SAndrew Rist * http://www.apache.org/licenses/LICENSE-2.0 12cdf0e10cSrcweir * 135b190011SAndrew Rist * Unless required by applicable law or agreed to in writing, 145b190011SAndrew Rist * software distributed under the License is distributed on an 155b190011SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY 165b190011SAndrew Rist * KIND, either express or implied. See the License for the 175b190011SAndrew Rist * specific language governing permissions and limitations 185b190011SAndrew Rist * under the License. 19cdf0e10cSrcweir * 205b190011SAndrew Rist *************************************************************/ 215b190011SAndrew Rist 225b190011SAndrew Rist 23cdf0e10cSrcweir 24cdf0e10cSrcweir // MARKER(update_precomp.py): autogen include statement, do not remove 25cdf0e10cSrcweir #include "precompiled_sd.hxx" 26cdf0e10cSrcweir 27cdf0e10cSrcweir #ifdef SD_DLLIMPLEMENTATION 28cdf0e10cSrcweir #undef SD_DLLIMPLEMENTATION 29cdf0e10cSrcweir #endif 30cdf0e10cSrcweir 31cdf0e10cSrcweir #include <editeng/flstitem.hxx> 32cdf0e10cSrcweir 33cdf0e10cSrcweir #include <svx/svxids.hrc> 34cdf0e10cSrcweir 35cdf0e10cSrcweir #include <svx/drawitem.hxx> 36cdf0e10cSrcweir #include <svl/intitem.hxx> 37cdf0e10cSrcweir #include <svx/ofaitem.hxx> 38cdf0e10cSrcweir #include <svx/svxgrahicitem.hxx> 39cdf0e10cSrcweir #include <svx/svdmodel.hxx> 40cdf0e10cSrcweir #include <svl/cjkoptions.hxx> 41cdf0e10cSrcweir 42cdf0e10cSrcweir 43cdf0e10cSrcweir #include <svx/dialogs.hrc> 44cdf0e10cSrcweir 45cdf0e10cSrcweir #include <svx/svxdlg.hxx> 46cdf0e10cSrcweir #include <svx/tabline.hxx> 47cdf0e10cSrcweir #include <svl/style.hxx> 48cdf0e10cSrcweir #include <svx/xtable.hxx> 49cdf0e10cSrcweir 50cdf0e10cSrcweir #include "DrawDocShell.hxx" 51cdf0e10cSrcweir #include "tabtempl.hxx" 52cdf0e10cSrcweir #include "tabtempl.hrc" 53cdf0e10cSrcweir #include "sdresid.hxx" 54cdf0e10cSrcweir #include "dlg_char.hxx" 55cdf0e10cSrcweir #include "paragr.hxx" 56cdf0e10cSrcweir #include <svx/flagsdef.hxx> 57cdf0e10cSrcweir 58cdf0e10cSrcweir /************************************************************************* 59cdf0e10cSrcweir |* 60cdf0e10cSrcweir |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu 61cdf0e10cSrcweir |* 62cdf0e10cSrcweir \************************************************************************/ 63cdf0e10cSrcweir 64cdf0e10cSrcweir SdTabTemplateDlg::SdTabTemplateDlg( Window* pParent, 65cdf0e10cSrcweir const SfxObjectShell* pDocShell, 66cdf0e10cSrcweir SfxStyleSheetBase& rStyleBase, 67cdf0e10cSrcweir SdrModel* pModel, 68cdf0e10cSrcweir SdrView* pView ) : 69cdf0e10cSrcweir SfxStyleDialog ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, sal_False ), 70cdf0e10cSrcweir rDocShell ( *pDocShell ), 71cdf0e10cSrcweir pSdrView ( pView ), 72*c7be74b1SArmin Le Grand maColorTab ( pModel->GetColorTableFromSdrModel() ), 73*c7be74b1SArmin Le Grand maGradientList ( pModel->GetGradientListFromSdrModel() ), 74*c7be74b1SArmin Le Grand maHatchingList ( pModel->GetHatchListFromSdrModel() ), 75*c7be74b1SArmin Le Grand maBitmapList ( pModel->GetBitmapListFromSdrModel() ), 76*c7be74b1SArmin Le Grand maDashList ( pModel->GetDashListFromSdrModel() ), 77*c7be74b1SArmin Le Grand maLineEndList ( pModel->GetLineEndListFromSdrModel() ) 78cdf0e10cSrcweir { 79cdf0e10cSrcweir FreeResource(); 80cdf0e10cSrcweir 81cdf0e10cSrcweir // Listbox fuellen und Select-Handler ueberladen 82cdf0e10cSrcweir 83cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_LINE); 84cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_AREA); 85cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_SHADOW); 86cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_TRANSPARENCE); 87cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_CHAR_NAME ); 88cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_CHAR_EFFECTS ); 89cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_STD_PARAGRAPH ); 90cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_TEXTATTR ); 91cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_TEXTANIMATION ); 92cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_MEASURE); 93cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_CONNECTION); 94cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH ); 95cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_TABULATOR ); 96cdf0e10cSrcweir SvtCJKOptions aCJKOptions; 97cdf0e10cSrcweir if( aCJKOptions.IsAsianTypographyEnabled() ) 98cdf0e10cSrcweir AddTabPage( RID_SVXPAGE_PARA_ASIAN ); 99cdf0e10cSrcweir else 100cdf0e10cSrcweir RemoveTabPage( RID_SVXPAGE_PARA_ASIAN ); 101cdf0e10cSrcweir 102cdf0e10cSrcweir nDlgType = 1; 103cdf0e10cSrcweir nPageType = 0; 104cdf0e10cSrcweir nPos = 0; 105cdf0e10cSrcweir 106cdf0e10cSrcweir nColorTableState = CT_NONE; 107cdf0e10cSrcweir nBitmapListState = CT_NONE; 108cdf0e10cSrcweir nGradientListState = CT_NONE; 109cdf0e10cSrcweir nHatchingListState = CT_NONE; 110cdf0e10cSrcweir } 111cdf0e10cSrcweir 112cdf0e10cSrcweir // ----------------------------------------------------------------------- 113cdf0e10cSrcweir 114cdf0e10cSrcweir SdTabTemplateDlg::~SdTabTemplateDlg() 115cdf0e10cSrcweir { 116cdf0e10cSrcweir } 117cdf0e10cSrcweir 118cdf0e10cSrcweir // ----------------------------------------------------------------------- 119cdf0e10cSrcweir 120cdf0e10cSrcweir void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage ) 121cdf0e10cSrcweir { 122cdf0e10cSrcweir SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool())); 123cdf0e10cSrcweir switch( nId ) 124cdf0e10cSrcweir { 125cdf0e10cSrcweir case RID_SVXPAGE_LINE: 126*c7be74b1SArmin Le Grand aSet.Put (SvxColorTableItem(maColorTab,SID_COLOR_TABLE)); 127*c7be74b1SArmin Le Grand aSet.Put (SvxDashListItem(maDashList,SID_DASH_LIST)); 128*c7be74b1SArmin Le Grand aSet.Put (SvxLineEndListItem(maLineEndList,SID_LINEEND_LIST)); 129cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType)); 130cdf0e10cSrcweir rPage.PageCreated(aSet); 131cdf0e10cSrcweir break; 132cdf0e10cSrcweir 133cdf0e10cSrcweir case RID_SVXPAGE_AREA: 134*c7be74b1SArmin Le Grand aSet.Put (SvxColorTableItem(maColorTab,SID_COLOR_TABLE)); 135*c7be74b1SArmin Le Grand aSet.Put (SvxGradientListItem(maGradientList,SID_GRADIENT_LIST)); 136*c7be74b1SArmin Le Grand aSet.Put (SvxHatchListItem(maHatchingList,SID_HATCH_LIST)); 137*c7be74b1SArmin Le Grand aSet.Put (SvxBitmapListItem(maBitmapList,SID_BITMAP_LIST)); 138cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType)); 139cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType)); 140cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,nPos)); 141cdf0e10cSrcweir rPage.PageCreated(aSet); 142cdf0e10cSrcweir 143cdf0e10cSrcweir 144cdf0e10cSrcweir break; 145cdf0e10cSrcweir 146cdf0e10cSrcweir case RID_SVXPAGE_SHADOW: 147*c7be74b1SArmin Le Grand aSet.Put (SvxColorTableItem(maColorTab,SID_COLOR_TABLE)); //add CHINA001 148cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType)); 149cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType)); 150cdf0e10cSrcweir rPage.PageCreated(aSet); 151cdf0e10cSrcweir break; 152cdf0e10cSrcweir 153cdf0e10cSrcweir case RID_SVXPAGE_TRANSPARENCE: 154cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType)); 155cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType)); 156cdf0e10cSrcweir rPage.PageCreated(aSet); 157cdf0e10cSrcweir break; 158cdf0e10cSrcweir 159cdf0e10cSrcweir case RID_SVXPAGE_CHAR_NAME: 160cdf0e10cSrcweir { 161cdf0e10cSrcweir SvxFontListItem aItem(*( (const SvxFontListItem*) 162cdf0e10cSrcweir ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) ); 163cdf0e10cSrcweir 164cdf0e10cSrcweir aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST)); 165cdf0e10cSrcweir rPage.PageCreated(aSet); 166cdf0e10cSrcweir } 167cdf0e10cSrcweir break; 168cdf0e10cSrcweir 169cdf0e10cSrcweir case RID_SVXPAGE_CHAR_EFFECTS: 170cdf0e10cSrcweir aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP)); 171cdf0e10cSrcweir rPage.PageCreated(aSet); 172cdf0e10cSrcweir break; 173cdf0e10cSrcweir 174cdf0e10cSrcweir case RID_SVXPAGE_STD_PARAGRAPH: 175cdf0e10cSrcweir break; 176cdf0e10cSrcweir 177cdf0e10cSrcweir case RID_SVXPAGE_TEXTATTR: 178cdf0e10cSrcweir { 179cdf0e10cSrcweir aSet.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW,pSdrView)); 180cdf0e10cSrcweir rPage.PageCreated(aSet); 181cdf0e10cSrcweir } 182cdf0e10cSrcweir break; 183cdf0e10cSrcweir 184cdf0e10cSrcweir case RID_SVXPAGE_TEXTANIMATION: 185cdf0e10cSrcweir break; 186cdf0e10cSrcweir 187cdf0e10cSrcweir case RID_SVXPAGE_MEASURE: 188cdf0e10cSrcweir aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView)); 189cdf0e10cSrcweir rPage.PageCreated(aSet); 190cdf0e10cSrcweir break; 191cdf0e10cSrcweir 192cdf0e10cSrcweir case RID_SVXPAGE_CONNECTION: 193cdf0e10cSrcweir { 194cdf0e10cSrcweir aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView)); 195cdf0e10cSrcweir rPage.PageCreated(aSet); 196cdf0e10cSrcweir } 197cdf0e10cSrcweir break; 198cdf0e10cSrcweir } 199cdf0e10cSrcweir } 200cdf0e10cSrcweir 201cdf0e10cSrcweir // ----------------------------------------------------------------------- 202cdf0e10cSrcweir 203cdf0e10cSrcweir const SfxItemSet* SdTabTemplateDlg::GetRefreshedSet() 204cdf0e10cSrcweir { 205cdf0e10cSrcweir SfxItemSet* pRet = GetInputSetImpl(); 206cdf0e10cSrcweir 207cdf0e10cSrcweir if( pRet ) 208cdf0e10cSrcweir { 209cdf0e10cSrcweir pRet->ClearItem(); 210cdf0e10cSrcweir pRet->SetParent( GetStyleSheet().GetItemSet().GetParent() ); 211cdf0e10cSrcweir } 212cdf0e10cSrcweir else 213cdf0e10cSrcweir pRet = new SfxItemSet( GetStyleSheet().GetItemSet() ); 214cdf0e10cSrcweir 215cdf0e10cSrcweir return pRet; 216cdf0e10cSrcweir } 217cdf0e10cSrcweir 218cdf0e10cSrcweir 219cdf0e10cSrcweir 220