1 /*************************************************************************
2  *
3  * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4  *
5  * Copyright 2000, 2010 Oracle and/or its affiliates.
6  *
7  * OpenOffice.org - a multi-platform office productivity suite
8  *
9  * This file is part of OpenOffice.org.
10  *
11  * OpenOffice.org is free software: you can redistribute it and/or modify
12  * it under the terms of the GNU Lesser General Public License version 3
13  * only, as published by the Free Software Foundation.
14  *
15  * OpenOffice.org is distributed in the hope that it will be useful,
16  * but WITHOUT ANY WARRANTY; without even the implied warranty of
17  * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18  * GNU Lesser General Public License version 3 for more details
19  * (a copy is included in the LICENSE file that accompanied this code).
20  *
21  * You should have received a copy of the GNU Lesser General Public License
22  * version 3 along with OpenOffice.org.  If not, see
23  * <http://www.openoffice.org/license.html>
24  * for a copy of the LGPLv3 License.
25  *
26  ************************************************************************/
27 
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_svx.hxx"
30 #include "fmtextcontroldialogs.hxx"
31 #include <svx/dialmgr.hxx>
32 #ifndef _SVX_DIALOGS_HRC
33 #include <svx/dialogs.hrc>
34 #endif
35 
36 #ifndef _SVX_CHARDLG_HXX
37 //#include "chardlg.hxx"
38 #endif
39 #ifndef _SVX_PARAGRPH_HXX
40 //#include "paragrph.hxx"
41 #endif
42 #include <editeng/eeitem.hxx>
43 #ifndef _SVX_TABSTPGE_HXX
44 //#include "tabstpge.hxx"
45 #endif
46 
47 #include "svx/flagsdef.hxx"
48 #include <svl/intitem.hxx>
49 
50 #include <com/sun/star/uno/Sequence.hxx>
51 #include <svl/cjkoptions.hxx>
52 
53 //........................................................................
54 namespace svx
55 {
56 //........................................................................
57 
58 	//====================================================================
59 	//= TextControlCharAttribDialog
60 	//====================================================================
61 	//--------------------------------------------------------------------
62     TextControlCharAttribDialog::TextControlCharAttribDialog( Window* pParent, const SfxItemSet& _rCoreSet, const SvxFontListItem& _rFontList )
63         :SfxTabDialog( pParent, SVX_RES( RID_SVXDLG_TEXTCONTROL_CHARATTR ), &_rCoreSet )
64         ,m_aFontList( _rFontList )
65     {
66         FreeResource();
67 
68 	    AddTabPage( RID_SVXPAGE_CHAR_NAME);
69 	    AddTabPage( RID_SVXPAGE_CHAR_EFFECTS);
70 	    AddTabPage( RID_SVXPAGE_CHAR_POSITION);
71     }
72 
73 	//--------------------------------------------------------------------
74     TextControlCharAttribDialog::~TextControlCharAttribDialog()
75     {
76     }
77 
78 	//--------------------------------------------------------------------
79     void TextControlCharAttribDialog::PageCreated( sal_uInt16 _nId, SfxTabPage& _rPage )
80     {
81 	    SfxAllItemSet aSet(*(GetInputSetImpl()->GetPool()));
82 
83 	    switch( _nId )
84 	    {
85             case RID_SVXPAGE_CHAR_NAME:
86 			    aSet.Put (m_aFontList);
87 			    _rPage.PageCreated(aSet);
88 		        break;
89 
90 		    case RID_SVXPAGE_CHAR_EFFECTS:
91 			    aSet.Put (SfxUInt16Item(SID_DISABLE_CTL,DISABLE_CASEMAP));
92 			    _rPage.PageCreated(aSet);
93 			    break;
94 
95             case RID_SVXPAGE_CHAR_POSITION:
96                 aSet.Put( SfxUInt32Item(SID_FLAG_TYPE, SVX_PREVIEW_CHARACTER) );
97                 _rPage.PageCreated(aSet);
98                 break;
99         }
100     }
101 
102 	//====================================================================
103 	//= TextControlParaAttribDialog
104 	//====================================================================
105 	//--------------------------------------------------------------------
106     TextControlParaAttribDialog::TextControlParaAttribDialog( Window* _pParent, const SfxItemSet& _rCoreSet )
107         :SfxTabDialog( _pParent, SVX_RES( RID_SVXDLG_TEXTCONTROL_PARAATTR ), &_rCoreSet )
108     {
109         FreeResource();
110 
111         AddTabPage( RID_SVXPAGE_STD_PARAGRAPH );
112         AddTabPage( RID_SVXPAGE_ALIGN_PARAGRAPH );
113 
114         SvtCJKOptions aCJKOptions;
115         if( aCJKOptions.IsAsianTypographyEnabled() )
116             AddTabPage( RID_SVXPAGE_PARA_ASIAN );
117         else
118             RemoveTabPage( RID_SVXPAGE_PARA_ASIAN );
119 
120         AddTabPage( RID_SVXPAGE_TABULATOR );
121     }
122 
123 	//--------------------------------------------------------------------
124     TextControlParaAttribDialog::~TextControlParaAttribDialog()
125     {
126     }
127 
128 //........................................................................
129 }   // namespace svx
130 //........................................................................
131 
132