fdo#74697 Add Bluez 5 support for impress remote.
[LibreOffice.git] / sd / source / ui / dlg / tabtempl.cxx
blob33b34cda31f4316e61ba357153d1fe062806d259
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
5 * This Source Code Form is subject to the terms of the Mozilla Public
6 * License, v. 2.0. If a copy of the MPL was not distributed with this
7 * file, You can obtain one at http://mozilla.org/MPL/2.0/.
9 * This file incorporates work covered by the following license notice:
11 * Licensed to the Apache Software Foundation (ASF) under one or more
12 * contributor license agreements. See the NOTICE file distributed
13 * with this work for additional information regarding copyright
14 * ownership. The ASF licenses this file to you under the Apache
15 * License, Version 2.0 (the "License"); you may not use this file
16 * except in compliance with the License. You may obtain a copy of
17 * the License at http://www.apache.org/licenses/LICENSE-2.0 .
20 #include <editeng/flstitem.hxx>
22 #include <svx/svxids.hrc>
24 #include <svx/drawitem.hxx>
25 #include <svl/intitem.hxx>
26 #include <svx/ofaitem.hxx>
27 #include <svx/svxgrahicitem.hxx>
28 #include <svx/svdmodel.hxx>
29 #include <svl/cjkoptions.hxx>
32 #include <svx/dialogs.hrc>
34 #include <svx/svxdlg.hxx>
35 #include <svx/tabline.hxx>
36 #include <svl/style.hxx>
37 #include <svx/xtable.hxx>
39 #include "DrawDocShell.hxx"
40 #include "tabtempl.hxx"
41 #include "tabtempl.hrc"
42 #include "sdresid.hxx"
43 #include "dlg_char.hxx"
44 #include "paragr.hxx"
45 #include <svx/flagsdef.hxx>
47 /**
48 * Constructor of the Tab dialog: appends pages to the dialog
50 SdTabTemplateDlg::SdTabTemplateDlg( Window* pParent,
51 const SfxObjectShell* pDocShell,
52 SfxStyleSheetBase& rStyleBase,
53 SdrModel* pModel,
54 SdrView* pView ) :
55 SfxStyleDialog ( pParent, SdResId( TAB_TEMPLATE ), rStyleBase, sal_False ),
56 rDocShell ( *pDocShell ),
57 pSdrView ( pView ),
58 pColorList ( pModel->GetColorList() ),
59 pGradientList ( pModel->GetGradientList() ),
60 pHatchingList ( pModel->GetHatchList() ),
61 pBitmapList ( pModel->GetBitmapList() ),
62 pDashList ( pModel->GetDashList() ),
63 pLineEndList ( pModel->GetLineEndList() )
65 FreeResource();
67 // fill Listbox and overload Select-Handler
69 AddTabPage( RID_SVXPAGE_LINE);
70 AddTabPage( RID_SVXPAGE_AREA);
71 AddTabPage( RID_SVXPAGE_SHADOW);
72 AddTabPage( RID_SVXPAGE_TRANSPARENCE);
73 AddTabPage( RID_SVXPAGE_CHAR_NAME );
74 AddTabPage( RID_SVXPAGE_CHAR_EFFECTS );
75 AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
76 AddTabPage( RID_SVXPAGE_TEXTATTR );
77 AddTabPage( RID_SVXPAGE_TEXTANIMATION );
78 AddTabPage( RID_SVXPAGE_MEASURE);
79 AddTabPage( RID_SVXPAGE_CONNECTION);
80 AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
81 AddTabPage( RID_SVXPAGE_TABULATOR );
82 SvtCJKOptions aCJKOptions;
83 if( aCJKOptions.IsAsianTypographyEnabled() )
84 AddTabPage( RID_SVXPAGE_PARA_ASIAN );
85 else
86 RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
88 nDlgType = 1;
89 nPageType = 0;
90 nPos = 0;
92 nColorTableState = CT_NONE;
93 nBitmapListState = CT_NONE;
94 nGradientListState = CT_NONE;
95 nHatchingListState = CT_NONE;
98 // -----------------------------------------------------------------------
100 SdTabTemplateDlg::~SdTabTemplateDlg()
104 // -----------------------------------------------------------------------
106 void SdTabTemplateDlg::PageCreated( sal_uInt16 nId, SfxTabPage &rPage )
108 SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
109 switch( nId )
111 case RID_SVXPAGE_LINE:
112 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
113 aSet.Put (SvxDashListItem(pDashList,SID_DASH_LIST));
114 aSet.Put (SvxLineEndListItem(pLineEndList,SID_LINEEND_LIST));
115 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
116 rPage.PageCreated(aSet);
117 break;
119 case RID_SVXPAGE_AREA:
120 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
121 aSet.Put (SvxGradientListItem(pGradientList,SID_GRADIENT_LIST));
122 aSet.Put (SvxHatchListItem(pHatchingList,SID_HATCH_LIST));
123 aSet.Put (SvxBitmapListItem(pBitmapList,SID_BITMAP_LIST));
124 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
125 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
126 aSet.Put (SfxUInt16Item(SID_TABPAGE_POS,nPos));
127 rPage.PageCreated(aSet);
130 break;
132 case RID_SVXPAGE_SHADOW:
133 aSet.Put (SvxColorListItem(pColorList,SID_COLOR_TABLE));
134 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
135 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
136 rPage.PageCreated(aSet);
137 break;
139 case RID_SVXPAGE_TRANSPARENCE:
140 aSet.Put (SfxUInt16Item(SID_PAGE_TYPE,nPageType));
141 aSet.Put (SfxUInt16Item(SID_DLG_TYPE,nDlgType));
142 rPage.PageCreated(aSet);
143 break;
145 case RID_SVXPAGE_CHAR_NAME:
147 SvxFontListItem aItem(*( (const SvxFontListItem*)
148 ( rDocShell.GetItem( SID_ATTR_CHAR_FONTLIST) ) ) );
150 aSet.Put (SvxFontListItem( aItem.GetFontList(), SID_ATTR_CHAR_FONTLIST));
151 rPage.PageCreated(aSet);
153 break;
155 case RID_SVXPAGE_CHAR_EFFECTS:
156 aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
157 rPage.PageCreated(aSet);
158 break;
160 case RID_SVXPAGE_STD_PARAGRAPH:
161 break;
163 case RID_SVXPAGE_TEXTATTR:
165 aSet.Put(OfaPtrItem(SID_SVXTEXTATTRPAGE_VIEW,pSdrView));
166 rPage.PageCreated(aSet);
168 break;
170 case RID_SVXPAGE_TEXTANIMATION:
171 break;
173 case RID_SVXPAGE_MEASURE:
174 aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
175 rPage.PageCreated(aSet);
176 break;
178 case RID_SVXPAGE_CONNECTION:
180 aSet.Put (OfaPtrItem(SID_OBJECT_LIST,pSdrView));
181 rPage.PageCreated(aSet);
183 break;
187 // -----------------------------------------------------------------------
189 const SfxItemSet* SdTabTemplateDlg::GetRefreshedSet()
191 SfxItemSet* pRet = GetInputSetImpl();
193 if( pRet )
195 pRet->ClearItem();
196 pRet->SetParent( GetStyleSheet().GetItemSet().GetParent() );
198 else
199 pRet = new SfxItemSet( GetStyleSheet().GetItemSet() );
201 return pRet;
206 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */