1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*************************************************************************
4 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
6 * Copyright 2000, 2010 Oracle and/or its affiliates.
8 * OpenOffice.org - a multi-platform office productivity suite
10 * This file is part of OpenOffice.org.
12 * OpenOffice.org is free software: you can redistribute it and/or modify
13 * it under the terms of the GNU Lesser General Public License version 3
14 * only, as published by the Free Software Foundation.
16 * OpenOffice.org is distributed in the hope that it will be useful,
17 * but WITHOUT ANY WARRANTY; without even the implied warranty of
18 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
19 * GNU Lesser General Public License version 3 for more details
20 * (a copy is included in the LICENSE file that accompanied this code).
22 * You should have received a copy of the GNU Lesser General Public License
23 * version 3 along with OpenOffice.org. If not, see
24 * <http://www.openoffice.org/license.html>
25 * for a copy of the LGPLv3 License.
27 ************************************************************************/
29 // MARKER(update_precomp.py): autogen include statement, do not remove
30 #include "precompiled_sd.hxx"
32 #ifdef SD_DLLIMPLEMENTATION
33 #undef SD_DLLIMPLEMENTATION
36 #include <editeng/flstitem.hxx>
38 #include <svx/svxids.hrc>
40 #include <svx/drawitem.hxx>
41 #include <svl/intitem.hxx>
42 #include <svx/ofaitem.hxx>
43 #include <svx/svxgrahicitem.hxx>
44 #include <svx/svdmodel.hxx>
45 #include <svl/cjkoptions.hxx>
48 #include <svx/dialogs.hrc>
50 #include <svx/svxdlg.hxx>
51 #include <svx/tabline.hxx>
52 #include <svl/style.hxx>
53 #include <svx/xtable.hxx>
55 #include "DrawDocShell.hxx"
56 #include "tabtempl.hxx"
57 #include "tabtempl.hrc"
58 #include "sdresid.hxx"
59 #include "dlg_char.hxx"
61 #include <svx/flagsdef.hxx>
63 /*************************************************************************
65 |* Konstruktor des Tab-Dialogs: Fuegt die Seiten zum Dialog hinzu
67 \************************************************************************/
69 SdTabTemplateDlg::SdTabTemplateDlg( Window
* pParent
,
70 const SfxObjectShell
* pDocShell
,
71 SfxStyleSheetBase
& rStyleBase
,
74 SfxStyleDialog ( pParent
, SdResId( TAB_TEMPLATE
), rStyleBase
, FALSE
),
75 rDocShell ( *pDocShell
),
77 pColorTab ( pModel
->GetColorTable() ),
78 pGradientList ( pModel
->GetGradientList() ),
79 pHatchingList ( pModel
->GetHatchList() ),
80 pBitmapList ( pModel
->GetBitmapList() ),
81 pDashList ( pModel
->GetDashList() ),
82 pLineEndList ( pModel
->GetLineEndList() )
86 // Listbox fuellen und Select-Handler ueberladen
88 AddTabPage( RID_SVXPAGE_LINE
);
89 AddTabPage( RID_SVXPAGE_AREA
);
90 AddTabPage( RID_SVXPAGE_SHADOW
);
91 AddTabPage( RID_SVXPAGE_TRANSPARENCE
);
92 AddTabPage( RID_SVXPAGE_CHAR_NAME
);
93 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS
);
94 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH
);
95 AddTabPage( RID_SVXPAGE_TEXTATTR
);
96 AddTabPage( RID_SVXPAGE_TEXTANIMATION
);
97 AddTabPage( RID_SVXPAGE_MEASURE
);
98 AddTabPage( RID_SVXPAGE_CONNECTION
);
99 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH
);
100 AddTabPage( RID_SVXPAGE_TABULATOR
);
101 SvtCJKOptions aCJKOptions
;
102 if( aCJKOptions
.IsAsianTypographyEnabled() )
103 AddTabPage( RID_SVXPAGE_PARA_ASIAN
);
105 RemoveTabPage( RID_SVXPAGE_PARA_ASIAN
);
111 nColorTableState
= CT_NONE
;
112 nBitmapListState
= CT_NONE
;
113 nGradientListState
= CT_NONE
;
114 nHatchingListState
= CT_NONE
;
117 // -----------------------------------------------------------------------
119 SdTabTemplateDlg::~SdTabTemplateDlg()
123 // -----------------------------------------------------------------------
125 void SdTabTemplateDlg::PageCreated( USHORT nId
, SfxTabPage
&rPage
)
127 SfxAllItemSet
aSet(*(GetInputSetImpl()->GetPool()));
130 case RID_SVXPAGE_LINE
:
131 aSet
.Put (SvxColorTableItem(pColorTab
,SID_COLOR_TABLE
));
132 aSet
.Put (SvxDashListItem(pDashList
,SID_DASH_LIST
));
133 aSet
.Put (SvxLineEndListItem(pLineEndList
,SID_LINEEND_LIST
));
134 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,nDlgType
));
135 rPage
.PageCreated(aSet
);
138 case RID_SVXPAGE_AREA
:
139 aSet
.Put (SvxColorTableItem(pColorTab
,SID_COLOR_TABLE
));
140 aSet
.Put (SvxGradientListItem(pGradientList
,SID_GRADIENT_LIST
));
141 aSet
.Put (SvxHatchListItem(pHatchingList
,SID_HATCH_LIST
));
142 aSet
.Put (SvxBitmapListItem(pBitmapList
,SID_BITMAP_LIST
));
143 aSet
.Put (SfxUInt16Item(SID_PAGE_TYPE
,nPageType
));
144 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,nDlgType
));
145 aSet
.Put (SfxUInt16Item(SID_TABPAGE_POS
,nPos
));
146 rPage
.PageCreated(aSet
);
151 case RID_SVXPAGE_SHADOW
:
152 aSet
.Put (SvxColorTableItem(pColorTab
,SID_COLOR_TABLE
));
153 aSet
.Put (SfxUInt16Item(SID_PAGE_TYPE
,nPageType
));
154 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,nDlgType
));
155 rPage
.PageCreated(aSet
);
158 case RID_SVXPAGE_TRANSPARENCE
:
159 aSet
.Put (SfxUInt16Item(SID_PAGE_TYPE
,nPageType
));
160 aSet
.Put (SfxUInt16Item(SID_DLG_TYPE
,nDlgType
));
161 rPage
.PageCreated(aSet
);
164 case RID_SVXPAGE_CHAR_NAME
:
166 SvxFontListItem
aItem(*( (const SvxFontListItem
*)
167 ( rDocShell
.GetItem( SID_ATTR_CHAR_FONTLIST
) ) ) );
169 aSet
.Put (SvxFontListItem( aItem
.GetFontList(), SID_ATTR_CHAR_FONTLIST
));
170 rPage
.PageCreated(aSet
);
174 case RID_SVXPAGE_CHAR_EFFECTS
:
175 aSet
.Put (SfxUInt16Item(SID_DISABLE_CTL
,DISABLE_CASEMAP
));
176 rPage
.PageCreated(aSet
);
179 case RID_SVXPAGE_STD_PARAGRAPH
:
182 case RID_SVXPAGE_TEXTATTR
:
184 aSet
.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW
,pSdrView
));
185 rPage
.PageCreated(aSet
);
189 case RID_SVXPAGE_TEXTANIMATION
:
192 case RID_SVXPAGE_MEASURE
:
193 aSet
.Put (OfaPtrItem(SID_OBJECT_LIST
,pSdrView
));
194 rPage
.PageCreated(aSet
);
197 case RID_SVXPAGE_CONNECTION
:
199 aSet
.Put (OfaPtrItem(SID_OBJECT_LIST
,pSdrView
));
200 rPage
.PageCreated(aSet
);
206 // -----------------------------------------------------------------------
208 const SfxItemSet
* SdTabTemplateDlg::GetRefreshedSet()
210 SfxItemSet
* pRet
= GetInputSetImpl();
215 pRet
->SetParent( GetStyleSheet().GetItemSet().GetParent() );
218 pRet
= new SfxItemSet( GetStyleSheet().GetItemSet() );
225 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */