Update ooo320-m1
[ooovba.git] / basctl / source / inc / managelang.hxx
blob918ee043f605618045686490786c3fc5604ba0e7
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: managelang.hxx,v $
10 * $Revision: 1.4 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
31 #ifndef _BASCTL_MANAGELANG_HXX
32 #define _BASCTL_MANAGELANG_HXX
34 #include <vcl/dialog.hxx>
35 #ifndef _FIXED_HXX
36 #include <vcl/fixed.hxx>
37 #endif
38 #ifndef _LSTBOX_HXX
39 #include <vcl/lstbox.hxx>
40 #endif
41 #ifndef _BUTTON_HXX
42 #include <vcl/button.hxx>
43 #endif
44 #include <svx/langbox.hxx>
45 #include <svx/checklbx.hxx>
47 class LocalizationMgr;
49 struct LanguageEntry
51 String m_sLanguage;
52 ::com::sun::star::lang::Locale m_aLocale;
53 bool m_bIsDefault;
55 LanguageEntry( const String& _rLanguage,
56 const ::com::sun::star::lang::Locale& _rLocale,
57 bool _bIsDefault ) :
58 m_sLanguage( _rLanguage ),
59 m_aLocale( _rLocale ),
60 m_bIsDefault( _bIsDefault ) {}
63 extern bool localesAreEqual( const ::com::sun::star::lang::Locale& rLocaleLeft,
64 const ::com::sun::star::lang::Locale& rLocaleRight );
66 class ManageLanguageDialog : public ModalDialog
68 private:
69 FixedText m_aLanguageFT;
70 ListBox m_aLanguageLB;
71 PushButton m_aAddPB;
72 PushButton m_aDeletePB;
73 PushButton m_aMakeDefPB;
74 FixedText m_aInfoFT;
76 FixedLine m_aBtnLine;
77 HelpButton m_aHelpBtn;
78 OKButton m_aCloseBtn;
80 LocalizationMgr* m_pLocalizationMgr;
82 String m_sDefLangStr;
83 String m_sDeleteStr;
84 String m_sCreateLangStr;
86 void Init();
87 void CalcInfoSize();
88 void FillLanguageBox();
89 void ClearLanguageBox();
91 DECL_LINK( AddHdl, Button * );
92 DECL_LINK( DeleteHdl, Button * );
93 DECL_LINK( MakeDefHdl, Button * );
94 DECL_LINK( SelectHdl, ListBox * );
96 public:
97 ManageLanguageDialog( Window* pParent, LocalizationMgr* _pLMgr );
98 ~ManageLanguageDialog();
101 class SetDefaultLanguageDialog : public ModalDialog
103 private:
104 FixedText m_aLanguageFT;
105 SvxLanguageBox* m_pLanguageLB;
106 SvxCheckListBox* m_pCheckLangLB;
107 FixedText m_aInfoFT;
109 FixedLine m_aBtnLine;
110 OKButton m_aOKBtn;
111 CancelButton m_aCancelBtn;
112 HelpButton m_aHelpBtn;
114 bool m_bIsDefaultMode;
115 LocalizationMgr* m_pLocalizationMgr;
117 void FillLanguageBox();
118 void CalcInfoSize();
120 public:
121 SetDefaultLanguageDialog( Window* pParent, LocalizationMgr* _pLMgr );
122 ~SetDefaultLanguageDialog();
124 ::com::sun::star::uno::Sequence< ::com::sun::star::lang::Locale > GetLocales() const;
127 #endif //_BASCTL_MANAGELANG_HXX