Branch data Line data Source code
1 : : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : : /*************************************************************************
3 : : *
4 : : * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 : : *
6 : : * Copyright 2000, 2010 Oracle and/or its affiliates.
7 : : *
8 : : * OpenOffice.org - a multi-platform office productivity suite
9 : : *
10 : : * This file is part of OpenOffice.org.
11 : : *
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.
15 : : *
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).
21 : : *
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.
26 : : *
27 : : ************************************************************************/
28 : :
29 : : #include "internationaloptions.hxx"
30 : : #include "internationaloptions.hrc"
31 : : #include <svl/eitem.hxx>
32 : : #include <cuires.hrc>
33 : : #include "helpid.hrc"
34 : : #include <dialmgr.hxx>
35 : : #include <svx/dialogs.hrc>
36 : :
37 : : namespace offapp
38 : : {
39 : :
40 [ # # ][ # # ]: 0 : struct InternationalOptionsPage::IMPL
[ # # ][ # # ]
[ # # ]
41 : : {
42 : : FixedLine m_aFL_DefaultTextDirection;
43 : : RadioButton m_aRB_TxtDirLeft2Right;
44 : : RadioButton m_aRB_TxtDirRight2Left;
45 : : FixedLine m_aFL_SheetView;
46 : : CheckBox m_aCB_ShtVwRight2Left;
47 : : CheckBox m_aCB_ShtVwCurrentDocOnly;
48 : :
49 : : sal_Bool m_bEnable_SheetView_Opt : 1;
50 : :
51 : : inline IMPL( Window* _pParent );
52 : :
53 : : inline void EnableOption_SheetView( sal_Bool _bEnable = sal_True );
54 : : void ShowOption_SheetView( sal_Bool _bShow = sal_True );
55 : :
56 : : sal_Bool FillItemSet( SfxItemSet& _rSet );
57 : : void Reset( const SfxItemSet& _rSet );
58 : : };
59 : :
60 : 0 : inline InternationalOptionsPage::IMPL::IMPL( Window* _pParent ) :
61 : 0 : m_aFL_DefaultTextDirection ( _pParent, CUI_RES( FL_DEFTXTDIRECTION ) )
62 [ # # ]: 0 : ,m_aRB_TxtDirLeft2Right ( _pParent, CUI_RES( RB_TXTDIR_LEFT2RIGHT ) )
63 [ # # ]: 0 : ,m_aRB_TxtDirRight2Left ( _pParent, CUI_RES( RB_TXTDIR_RIGHT2LEFT ) )
64 [ # # ]: 0 : ,m_aFL_SheetView ( _pParent, CUI_RES( FL_SHEETVIEW ) )
65 [ # # ]: 0 : ,m_aCB_ShtVwRight2Left ( _pParent, CUI_RES( CB_SHTVW_RIGHT2LEFT ) )
66 [ # # ]: 0 : ,m_aCB_ShtVwCurrentDocOnly ( _pParent, CUI_RES( CB_SHTVW_CURRENTDOCONLY ) )
67 : :
68 [ # # ][ # # ]: 0 : ,m_bEnable_SheetView_Opt ( sal_False )
[ # # ][ # # ]
[ # # ][ # # ]
69 : : {
70 [ # # ]: 0 : ShowOption_SheetView( m_bEnable_SheetView_Opt );
71 : 0 : }
72 : :
73 : : inline void InternationalOptionsPage::IMPL::EnableOption_SheetView( sal_Bool _bEnable )
74 : : {
75 : : if( m_bEnable_SheetView_Opt != _bEnable )
76 : : {
77 : : ShowOption_SheetView( _bEnable );
78 : :
79 : : m_bEnable_SheetView_Opt = _bEnable;
80 : : }
81 : : }
82 : :
83 : 0 : void InternationalOptionsPage::IMPL::ShowOption_SheetView( sal_Bool _bShow )
84 : : {
85 : 0 : m_aFL_SheetView.Show( _bShow );
86 : 0 : m_aCB_ShtVwRight2Left.Show( _bShow );
87 : 0 : m_aCB_ShtVwCurrentDocOnly.Show( _bShow );
88 : 0 : }
89 : :
90 : 0 : sal_Bool InternationalOptionsPage::IMPL::FillItemSet( SfxItemSet& _rSet )
91 : : {
92 : : DBG_ASSERT( _rSet.GetPool(), "-InternationalOptionsPage::FillItemSet(): no pool gives rums!" );
93 : :
94 : : // handling of DefaultTextDirection stuff
95 : 0 : _rSet.Put( SfxBoolItem( _rSet.GetPool()->GetWhich( SID_ATTR_PARA_LEFT_TO_RIGHT ),
96 : 0 : m_aRB_TxtDirLeft2Right.IsChecked() ),
97 [ # # ]: 0 : SID_ATTR_PARA_LEFT_TO_RIGHT );
98 : :
99 : 0 : return sal_True;
100 : : }
101 : :
102 : 0 : void InternationalOptionsPage::IMPL::Reset( const SfxItemSet& _rSet )
103 : : {
104 : : // handling of DefaultTextDirection stuff
105 : 0 : const SfxBoolItem* pLeft2RightItem = static_cast< const SfxBoolItem* >( GetItem( _rSet, SID_ATTR_PARA_LEFT_TO_RIGHT ) );
106 : :
107 : : DBG_ASSERT( pLeft2RightItem, "+InternationalOptionsPage::Reset(): SID_ATTR_PARA_LEFT_TO_RIGHT not set!" );
108 : :
109 [ # # ]: 0 : sal_Bool bLeft2Right = pLeft2RightItem? pLeft2RightItem->GetValue() : sal_True;
110 : 0 : m_aRB_TxtDirLeft2Right.Check( bLeft2Right );
111 : :
112 : 0 : }
113 : :
114 : 0 : InternationalOptionsPage::InternationalOptionsPage( Window* _pParent, const SfxItemSet& _rAttrSet ) :
115 : 0 : SfxTabPage ( _pParent, CUI_RES( RID_OFA_TP_INTERNATIONAL ), _rAttrSet )
116 : :
117 [ # # ][ # # ]: 0 : ,m_pImpl ( new IMPL( this ) )
[ # # ]
118 : : {
119 [ # # ]: 0 : FreeResource();
120 : 0 : }
121 : :
122 : 0 : SfxTabPage* InternationalOptionsPage::CreateSd( Window* _pParent, const SfxItemSet& _rAttrSet )
123 : : {
124 [ # # ]: 0 : return new InternationalOptionsPage( _pParent, _rAttrSet );
125 : : }
126 : :
127 : 0 : SfxTabPage* InternationalOptionsPage::CreateSc( Window* _pParent, const SfxItemSet& _rAttrSet )
128 : : {
129 [ # # ]: 0 : InternationalOptionsPage* p = new InternationalOptionsPage( _pParent, _rAttrSet );
130 : 0 : return p;
131 : : }
132 : :
133 : 0 : InternationalOptionsPage::~InternationalOptionsPage()
134 : : {
135 [ # # ][ # # ]: 0 : DELETEZ( m_pImpl );
136 [ # # ]: 0 : }
137 : :
138 : 0 : sal_Bool InternationalOptionsPage::FillItemSet( SfxItemSet& _rSet )
139 : : {
140 : 0 : return m_pImpl->FillItemSet( _rSet );
141 : : }
142 : :
143 : 0 : void InternationalOptionsPage::Reset( const SfxItemSet& _rSet )
144 : : {
145 : 0 : m_pImpl->Reset( _rSet );
146 : 0 : }
147 : :
148 : : } // namespace offapp
149 : :
150 : : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|