1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: tabtempl.cxx,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 // MARKER(update_precomp.py): autogen include statement, do not remove
32 #include "precompiled_sd.hxx"
34 #ifdef SD_DLLIMPLEMENTATION
35 #undef SD_DLLIMPLEMENTATION
38 #include <svx/flstitem.hxx>
40 #include <svx/svxids.hrc>
42 #include <svx/drawitem.hxx>
43 #include <svtools/intitem.hxx>
44 #include <svx/ofaitem.hxx>
45 #include <svx/svxgrahicitem.hxx>
46 #include <svx/svdmodel.hxx>
47 #include <svtools/cjkoptions.hxx>
50 #include <svx/dialogs.hrc>
52 #include <svx/svxdlg.hxx>
53 #include <svx/tabline.hxx>
54 #include <svtools/style.hxx>
55 #include <svx/xtable.hxx>
57 #include "DrawDocShell.hxx"
58 #include "tabtempl.hxx"
59 #include "tabtempl.hrc"
60 #include "sdresid.hxx"
61 #include "dlg_char.hxx"
63 #include <svx/flagsdef.hxx>
65 /*************************************************************************
67 |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
69 \************************************************************************/
71 SdTabTemplateDlg::SdTabTemplateDlg( Window
* pParent
,
72 const SfxObjectShell
* pDocShell
,
73 SfxStyleSheetBase
& rStyleBase
,
76 SfxStyleDialog ( pParent
, SdResId( TAB_TEMPLATE
), rStyleBase
, FALSE
),
77 rDocShell ( *pDocShell
),
79 pColorTab ( pModel
->GetColorTable() ),
80 pGradientList ( pModel
->GetGradientList() ),
81 pHatchingList ( pModel
->GetHatchList() ),
82 pBitmapList ( pModel
->GetBitmapList() ),
83 pDashList ( pModel
->GetDashList() ),
84 pLineEndList ( pModel
->GetLineEndList() )
88 // Listbox fuellen und Select-Handler ueberladen
90 AddTabPage( RID_SVXPAGE_LINE
);
91 AddTabPage( RID_SVXPAGE_AREA
);
92 AddTabPage( RID_SVXPAGE_SHADOW
);
93 AddTabPage( RID_SVXPAGE_TRANSPARENCE
);
94 AddTabPage( RID_SVXPAGE_CHAR_NAME
);
95 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS
);
96 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH
);
97 AddTabPage( RID_SVXPAGE_TEXTATTR
);
98 AddTabPage( RID_SVXPAGE_TEXTANIMATION
);
99 AddTabPage( RID_SVXPAGE_MEASURE
);
100 AddTabPage( RID_SVXPAGE_CONNECTION
);
101 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH
);
102 AddTabPage( RID_SVXPAGE_TABULATOR
);
103 SvtCJKOptions aCJKOptions
;
104 if( aCJKOptions
.IsAsianTypographyEnabled() )
105 AddTabPage( RID_SVXPAGE_PARA_ASIAN
);
107 RemoveTabPage( RID_SVXPAGE_PARA_ASIAN
);
113 nColorTableState
= CT_NONE
;
114 nBitmapListState
= CT_NONE
;
115 nGradientListState
= CT_NONE
;
116 nHatchingListState
= CT_NONE
;
119 // -----------------------------------------------------------------------
121 SdTabTemplateDlg::~SdTabTemplateDlg()
125 // -----------------------------------------------------------------------
127 void SdTabTemplateDlg::PageCreated( USHORT nId
, SfxTabPage
&rPage
)
129 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
132 case RID_SVXPAGE_LINE
:
133 aSet
.Put (SvxColorTableItem(pColorTab
,SID_COLOR_TABLE
));
134 aSet
.Put (SvxDashListItem(pDashList
,SID_DASH_LIST
));
135 aSet
.Put (SvxLineEndListItem(pLineEndList
,SID_LINEEND_LIST
));
136 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,nDlgType
));
137 rPage
.PageCreated(aSet
);
140 case RID_SVXPAGE_AREA
:
141 aSet
.Put (SvxColorTableItem(pColorTab
,SID_COLOR_TABLE
));
142 aSet
.Put (SvxGradientListItem(pGradientList
,SID_GRADIENT_LIST
));
143 aSet
.Put (SvxHatchListItem(pHatchingList
,SID_HATCH_LIST
));
144 aSet
.Put (SvxBitmapListItem(pBitmapList
,SID_BITMAP_LIST
));
145 aSet
.Put (SfxUInt16Item(SID_PAGE_TYPE
,nPageType
));
146 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,nDlgType
));
147 aSet
.Put (SfxUInt16Item(SID_TABPAGE_POS
,nPos
));
148 rPage
.PageCreated(aSet
);
153 case RID_SVXPAGE_SHADOW
:
154 aSet
.Put (SvxColorTableItem(pColorTab
,SID_COLOR_TABLE
)); //add CHINA001
155 aSet
.Put (SfxUInt16Item(SID_PAGE_TYPE
,nPageType
));
156 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,nDlgType
));
157 rPage
.PageCreated(aSet
);
160 case RID_SVXPAGE_TRANSPARENCE
:
161 aSet
.Put (SfxUInt16Item(SID_PAGE_TYPE
,nPageType
));
162 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,nDlgType
));
163 rPage
.PageCreated(aSet
);
166 case RID_SVXPAGE_CHAR_NAME
:
168 SvxFontListItem
aItem(*( (const SvxFontListItem
*)
169 ( rDocShell
.GetItem( SID_ATTR_CHAR_FONTLIST
) ) ) );
171 aSet
.Put (SvxFontListItem( aItem
.GetFontList(), SID_ATTR_CHAR_FONTLIST
));
172 rPage
.PageCreated(aSet
);
176 case RID_SVXPAGE_CHAR_EFFECTS
:
177 aSet
.Put (SfxUInt16Item(SID_DISABLE_CTL
,DISABLE_CASEMAP
));
178 rPage
.PageCreated(aSet
);
181 case RID_SVXPAGE_STD_PARAGRAPH
:
184 case RID_SVXPAGE_TEXTATTR
:
186 aSet
.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW
,pSdrView
));
187 rPage
.PageCreated(aSet
);
191 case RID_SVXPAGE_TEXTANIMATION
:
194 case RID_SVXPAGE_MEASURE
:
195 aSet
.Put (OfaPtrItem(SID_OBJECT_LIST
,pSdrView
));
196 rPage
.PageCreated(aSet
);
199 case RID_SVXPAGE_CONNECTION
:
201 aSet
.Put (OfaPtrItem(SID_OBJECT_LIST
,pSdrView
));
202 rPage
.PageCreated(aSet
);
208 // -----------------------------------------------------------------------
210 const SfxItemSet
* SdTabTemplateDlg::GetRefreshedSet()
212 SfxItemSet
* pRet
= GetInputSetImpl();
217 pRet
->SetParent( GetStyleSheet().GetItemSet().GetParent() );
220 pRet
= new SfxItemSet( GetStyleSheet().GetItemSet() );