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 
24 // MARKER(update_precomp.py): autogen include statement, do not remove
25 #include "precompiled_svx.hxx"
26 #include "fmtextcontroldialogs.hxx"
27 #include <svx/dialmgr.hxx>
28 #ifndef _SVX_DIALOGS_HRC
29 #include <svx/dialogs.hrc>
30 #endif
31 
32 #ifndef _SVX_CHARDLG_HXX
33 //#include "chardlg.hxx"
34 #endif
35 #ifndef _SVX_PARAGRPH_HXX
36 //#include "paragrph.hxx"
37 #endif
38 #include <editeng/eeitem.hxx>
39 #ifndef _SVX_TABSTPGE_HXX
40 //#include "tabstpge.hxx"
41 #endif
42 
43 #include "svx/flagsdef.hxx"
44 #include <svl/intitem.hxx>
45 
46 #include <com/sun/star/uno/Sequence.hxx>
47 #include <svl/cjkoptions.hxx>
48 
49 //........................................................................
50 namespace svx
51 {
52 //........................................................................
53 
54 	//====================================================================
55 	//= TextControlCharAttribDialog
56 	//====================================================================
57 	//--------------------------------------------------------------------
TextControlCharAttribDialog(Window * pParent,const SfxItemSet & _rCoreSet,const SvxFontListItem & _rFontList)58     TextControlCharAttribDialog::TextControlCharAttribDialog( Window* pParent, const SfxItemSet& _rCoreSet, const SvxFontListItem& _rFontList )
59         :SfxTabDialog( pParent, SVX_RES( RID_SVXDLG_TEXTCONTROL_CHARATTR ), &_rCoreSet )
60         ,m_aFontList( _rFontList )
61     {
62         FreeResource();
63 
64 	    AddTabPage( RID_SVXPAGE_CHAR_NAME);
65 	    AddTabPage( RID_SVXPAGE_CHAR_EFFECTS);
66 	    AddTabPage( RID_SVXPAGE_CHAR_POSITION);
67     }
68 
69 	//--------------------------------------------------------------------
~TextControlCharAttribDialog()70     TextControlCharAttribDialog::~TextControlCharAttribDialog()
71     {
72     }
73 
74 	//--------------------------------------------------------------------
PageCreated(sal_uInt16 _nId,SfxTabPage & _rPage)75     void TextControlCharAttribDialog::PageCreated( sal_uInt16 _nId, SfxTabPage& _rPage )
76     {
77 	    SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
78 
79 	    switch( _nId )
80 	    {
81             case RID_SVXPAGE_CHAR_NAME:
82 			    aSet.Put (m_aFontList);
83 			    _rPage.PageCreated(aSet);
84 		        break;
85 
86 		    case RID_SVXPAGE_CHAR_EFFECTS:
87 			    aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
88 			    _rPage.PageCreated(aSet);
89 			    break;
90 
91             case RID_SVXPAGE_CHAR_POSITION:
92                 aSet.Put( SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER) );
93                 _rPage.PageCreated(aSet);
94                 break;
95         }
96     }
97 
98 	//====================================================================
99 	//= TextControlParaAttribDialog
100 	//====================================================================
101 	//--------------------------------------------------------------------
TextControlParaAttribDialog(Window * _pParent,const SfxItemSet & _rCoreSet)102     TextControlParaAttribDialog::TextControlParaAttribDialog( Window* _pParent, const SfxItemSet& _rCoreSet )
103         :SfxTabDialog( _pParent, SVX_RES( RID_SVXDLG_TEXTCONTROL_PARAATTR ), &_rCoreSet )
104     {
105         FreeResource();
106 
107         AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
108         AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
109 
110         SvtCJKOptions aCJKOptions;
111         if( aCJKOptions.IsAsianTypographyEnabled() )
112             AddTabPage( RID_SVXPAGE_PARA_ASIAN );
113         else
114             RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
115 
116         AddTabPage( RID_SVXPAGE_TABULATOR );
117     }
118 
119 	//--------------------------------------------------------------------
~TextControlParaAttribDialog()120     TextControlParaAttribDialog::~TextControlParaAttribDialog()
121     {
122     }
123 
124 //........................................................................
125 }   // namespace svx
126 //........................................................................
127 
128