1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * This file is part of OpenOffice.org.
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.
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).
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.
26 ************************************************************************/
28 // MARKER(update_precomp.py): autogen include statement, do not remove
29 #include "precompiled_cui.hxx"
31 #include "internationaloptions.hxx"
32 #include "internationaloptions.hrc"
33 #include <svl/eitem.hxx>
36 #include <dialmgr.hxx>
37 #include <svx/dialogs.hrc>
42 struct InternationalOptionsPage::IMPL
44 FixedLine m_aFL_DefaultTextDirection
;
45 RadioButton m_aRB_TxtDirLeft2Right
;
46 RadioButton m_aRB_TxtDirRight2Left
;
47 FixedLine m_aFL_SheetView
;
48 CheckBox m_aCB_ShtVwRight2Left
;
49 CheckBox m_aCB_ShtVwCurrentDocOnly
;
51 sal_Bool m_bEnable_SheetView_Opt
: 1;
53 inline IMPL( Window
* _pParent
);
55 inline void EnableOption_SheetView( sal_Bool _bEnable
= sal_True
);
56 void ShowOption_SheetView( sal_Bool _bShow
= sal_True
);
58 sal_Bool
FillItemSet( SfxItemSet
& _rSet
);
59 void Reset( const SfxItemSet
& _rSet
);
62 inline InternationalOptionsPage::IMPL::IMPL( Window
* _pParent
) :
63 m_aFL_DefaultTextDirection ( _pParent
, CUI_RES( FL_DEFTXTDIRECTION
) )
64 ,m_aRB_TxtDirLeft2Right ( _pParent
, CUI_RES( RB_TXTDIR_LEFT2RIGHT
) )
65 ,m_aRB_TxtDirRight2Left ( _pParent
, CUI_RES( RB_TXTDIR_RIGHT2LEFT
) )
66 ,m_aFL_SheetView ( _pParent
, CUI_RES( FL_SHEETVIEW
) )
67 ,m_aCB_ShtVwRight2Left ( _pParent
, CUI_RES( CB_SHTVW_RIGHT2LEFT
) )
68 ,m_aCB_ShtVwCurrentDocOnly ( _pParent
, CUI_RES( CB_SHTVW_CURRENTDOCONLY
) )
70 ,m_bEnable_SheetView_Opt ( sal_False
)
72 ShowOption_SheetView( m_bEnable_SheetView_Opt
);
75 inline void InternationalOptionsPage::IMPL::EnableOption_SheetView( sal_Bool _bEnable
)
77 if( m_bEnable_SheetView_Opt
!= _bEnable
)
79 ShowOption_SheetView( _bEnable
);
81 m_bEnable_SheetView_Opt
= _bEnable
;
85 void InternationalOptionsPage::IMPL::ShowOption_SheetView( sal_Bool _bShow
)
87 m_aFL_SheetView
.Show( _bShow
);
88 m_aCB_ShtVwRight2Left
.Show( _bShow
);
89 m_aCB_ShtVwCurrentDocOnly
.Show( _bShow
);
92 sal_Bool
InternationalOptionsPage::IMPL::FillItemSet( SfxItemSet
& _rSet
)
94 DBG_ASSERT( _rSet
.GetPool(), "-InternationalOptionsPage::FillItemSet(): no pool gives rums!" );
96 // handling of DefaultTextDirection stuff
97 _rSet
.Put( SfxBoolItem( _rSet
.GetPool()->GetWhich( SID_ATTR_PARA_LEFT_TO_RIGHT
),
98 m_aRB_TxtDirLeft2Right
.IsChecked() ),
99 SID_ATTR_PARA_LEFT_TO_RIGHT
);
101 // handling of SheetView stuff
102 // if( m_bEnable_SheetView_Opt )
109 void InternationalOptionsPage::IMPL::Reset( const SfxItemSet
& _rSet
)
111 // handling of DefaultTextDirection stuff
112 const SfxBoolItem
* pLeft2RightItem
= static_cast< const SfxBoolItem
* >( GetItem( _rSet
, SID_ATTR_PARA_LEFT_TO_RIGHT
) );
114 DBG_ASSERT( pLeft2RightItem
, "+InternationalOptionsPage::Reset(): SID_ATTR_PARA_LEFT_TO_RIGHT not set!" );
116 sal_Bool bLeft2Right
= pLeft2RightItem
? pLeft2RightItem
->GetValue() : sal_True
;
117 m_aRB_TxtDirLeft2Right
.Check( bLeft2Right
);
119 // handling of SheetView stuff
120 // if( m_bEnable_SheetView_Opt )
122 // m_aCB_ShtVwRight2Left.Check( sal_False );
124 // m_aCB_ShtVwCurrentDocOnly.Check( sal_False );
128 InternationalOptionsPage::InternationalOptionsPage( Window
* _pParent
, const SfxItemSet
& _rAttrSet
) :
129 SfxTabPage ( _pParent
, CUI_RES( RID_OFA_TP_INTERNATIONAL
), _rAttrSet
)
131 ,m_pImpl ( new IMPL( this ) )
136 SfxTabPage
* InternationalOptionsPage::CreateSd( Window
* _pParent
, const SfxItemSet
& _rAttrSet
)
138 return new InternationalOptionsPage( _pParent
, _rAttrSet
);
141 SfxTabPage
* InternationalOptionsPage::CreateSc( Window
* _pParent
, const SfxItemSet
& _rAttrSet
)
143 InternationalOptionsPage
* p
= new InternationalOptionsPage( _pParent
, _rAttrSet
);
144 // p->m_pImpl->EnableOption_SheetView();
148 InternationalOptionsPage::~InternationalOptionsPage()
153 sal_Bool
InternationalOptionsPage::FillItemSet( SfxItemSet
& _rSet
)
155 return m_pImpl
->FillItemSet( _rSet
);
158 void InternationalOptionsPage::Reset( const SfxItemSet
& _rSet
)
160 m_pImpl
->Reset( _rSet
);
163 } // /namespace offapp