1*cdf0e10cSrcweir /************************************************************************* 2*cdf0e10cSrcweir * 3*cdf0e10cSrcweir * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER. 4*cdf0e10cSrcweir * 5*cdf0e10cSrcweir * Copyright 2000, 2010 Oracle and/or its affiliates. 6*cdf0e10cSrcweir * 7*cdf0e10cSrcweir * OpenOffice.org - a multi-platform office productivity suite 8*cdf0e10cSrcweir * 9*cdf0e10cSrcweir * This file is part of OpenOffice.org. 10*cdf0e10cSrcweir * 11*cdf0e10cSrcweir * OpenOffice.org is free software: you can redistribute it and/or modify 12*cdf0e10cSrcweir * it under the terms of the GNU Lesser General Public License version 3 13*cdf0e10cSrcweir * only, as published by the Free Software Foundation. 14*cdf0e10cSrcweir * 15*cdf0e10cSrcweir * OpenOffice.org is distributed in the hope that it will be useful, 16*cdf0e10cSrcweir * but WITHOUT ANY WARRANTY; without even the implied warranty of 17*cdf0e10cSrcweir * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the 18*cdf0e10cSrcweir * GNU Lesser General Public License version 3 for more details 19*cdf0e10cSrcweir * (a copy is included in the LICENSE file that accompanied this code). 20*cdf0e10cSrcweir * 21*cdf0e10cSrcweir * You should have received a copy of the GNU Lesser General Public License 22*cdf0e10cSrcweir * version 3 along with OpenOffice.org. If not, see 23*cdf0e10cSrcweir * <http://www.openoffice.org/license.html> 24*cdf0e10cSrcweir * for a copy of the LGPLv3 License. 25*cdf0e10cSrcweir * 26*cdf0e10cSrcweir ************************************************************************/ 27*cdf0e10cSrcweir #ifndef _SVX_OPTJAVA_HXX 28*cdf0e10cSrcweir #define _SVX_OPTJAVA_HXX 29*cdf0e10cSrcweir 30*cdf0e10cSrcweir // include --------------------------------------------------------------- 31*cdf0e10cSrcweir 32*cdf0e10cSrcweir #include <vector> 33*cdf0e10cSrcweir #include <ucbhelper/content.hxx> 34*cdf0e10cSrcweir #include <vcl/button.hxx> 35*cdf0e10cSrcweir #include <vcl/fixed.hxx> 36*cdf0e10cSrcweir #include <vcl/timer.hxx> 37*cdf0e10cSrcweir #include <sfx2/tabdlg.hxx> 38*cdf0e10cSrcweir #include <svx/simptabl.hxx> 39*cdf0e10cSrcweir #include <com/sun/star/ui/dialogs/XFolderPicker.hpp> 40*cdf0e10cSrcweir #include <svtools/dialogclosedlistener.hxx> 41*cdf0e10cSrcweir #include "radiobtnbox.hxx" 42*cdf0e10cSrcweir 43*cdf0e10cSrcweir // forward --------------------------------------------------------------- 44*cdf0e10cSrcweir 45*cdf0e10cSrcweir typedef struct _JavaInfo JavaInfo; 46*cdf0e10cSrcweir 47*cdf0e10cSrcweir class SvxJavaParameterDlg; 48*cdf0e10cSrcweir class SvxJavaClassPathDlg; 49*cdf0e10cSrcweir 50*cdf0e10cSrcweir // class SvxJavaOptionsPage ---------------------------------------------- 51*cdf0e10cSrcweir 52*cdf0e10cSrcweir class SvxJavaOptionsPage : public SfxTabPage 53*cdf0e10cSrcweir { 54*cdf0e10cSrcweir private: 55*cdf0e10cSrcweir FixedLine m_aJavaLine; 56*cdf0e10cSrcweir CheckBox m_aJavaEnableCB; 57*cdf0e10cSrcweir FixedText m_aJavaFoundLabel; 58*cdf0e10cSrcweir svx::SvxRadioButtonListBox m_aJavaList; 59*cdf0e10cSrcweir FixedText m_aJavaPathText; 60*cdf0e10cSrcweir PushButton m_aAddBtn; 61*cdf0e10cSrcweir PushButton m_aParameterBtn; 62*cdf0e10cSrcweir PushButton m_aClassPathBtn; 63*cdf0e10cSrcweir 64*cdf0e10cSrcweir SvxJavaParameterDlg* m_pParamDlg; 65*cdf0e10cSrcweir SvxJavaClassPathDlg* m_pPathDlg; 66*cdf0e10cSrcweir 67*cdf0e10cSrcweir JavaInfo** m_parJavaInfo; 68*cdf0e10cSrcweir rtl_uString** m_parParameters; 69*cdf0e10cSrcweir rtl_uString* m_pClassPath; 70*cdf0e10cSrcweir sal_Int32 m_nInfoSize; 71*cdf0e10cSrcweir sal_Int32 m_nParamSize; 72*cdf0e10cSrcweir String m_sInstallText; 73*cdf0e10cSrcweir String m_sAccessibilityText; 74*cdf0e10cSrcweir String m_sAddDialogText; 75*cdf0e10cSrcweir Timer m_aResetTimer; 76*cdf0e10cSrcweir 77*cdf0e10cSrcweir ::std::vector< JavaInfo* > 78*cdf0e10cSrcweir m_aAddedInfos; 79*cdf0e10cSrcweir 80*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener; 81*cdf0e10cSrcweir ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker > xFolderPicker; 82*cdf0e10cSrcweir 83*cdf0e10cSrcweir DECL_LINK( EnableHdl_Impl, CheckBox * ); 84*cdf0e10cSrcweir DECL_LINK( CheckHdl_Impl, SvxSimpleTable * ); 85*cdf0e10cSrcweir DECL_LINK( SelectHdl_Impl, SvxSimpleTable * ); 86*cdf0e10cSrcweir DECL_LINK( AddHdl_Impl, PushButton * ); 87*cdf0e10cSrcweir DECL_LINK( ParameterHdl_Impl, PushButton * ); 88*cdf0e10cSrcweir DECL_LINK( ClassPathHdl_Impl, PushButton * ); 89*cdf0e10cSrcweir DECL_LINK( ResetHdl_Impl, Timer * ); 90*cdf0e10cSrcweir 91*cdf0e10cSrcweir DECL_LINK( StartFolderPickerHdl, void * ); 92*cdf0e10cSrcweir DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* ); 93*cdf0e10cSrcweir 94*cdf0e10cSrcweir void ClearJavaInfo(); 95*cdf0e10cSrcweir void ClearJavaList(); 96*cdf0e10cSrcweir void LoadJREs(); 97*cdf0e10cSrcweir void AddJRE( JavaInfo* _pInfo ); 98*cdf0e10cSrcweir void HandleCheckEntry( SvLBoxEntry* _pEntry ); 99*cdf0e10cSrcweir void AddFolder( const ::rtl::OUString& _rFolder ); 100*cdf0e10cSrcweir 101*cdf0e10cSrcweir public: 102*cdf0e10cSrcweir SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet ); 103*cdf0e10cSrcweir ~SvxJavaOptionsPage(); 104*cdf0e10cSrcweir 105*cdf0e10cSrcweir static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet ); 106*cdf0e10cSrcweir 107*cdf0e10cSrcweir virtual sal_Bool FillItemSet( SfxItemSet& rSet ); 108*cdf0e10cSrcweir virtual void Reset( const SfxItemSet& rSet ); 109*cdf0e10cSrcweir virtual void FillUserData(); 110*cdf0e10cSrcweir }; 111*cdf0e10cSrcweir 112*cdf0e10cSrcweir // class SvxJavaParameterDlg --------------------------------------------- 113*cdf0e10cSrcweir 114*cdf0e10cSrcweir class SvxJavaParameterDlg : public ModalDialog 115*cdf0e10cSrcweir { 116*cdf0e10cSrcweir private: 117*cdf0e10cSrcweir FixedText m_aParameterLabel; 118*cdf0e10cSrcweir Edit m_aParameterEdit; 119*cdf0e10cSrcweir PushButton m_aAssignBtn; 120*cdf0e10cSrcweir 121*cdf0e10cSrcweir FixedText m_aAssignedLabel; 122*cdf0e10cSrcweir ListBox m_aAssignedList; 123*cdf0e10cSrcweir FixedText m_aExampleText; 124*cdf0e10cSrcweir PushButton m_aRemoveBtn; 125*cdf0e10cSrcweir 126*cdf0e10cSrcweir FixedLine m_aButtonsLine; 127*cdf0e10cSrcweir OKButton m_aOKBtn; 128*cdf0e10cSrcweir CancelButton m_aCancelBtn; 129*cdf0e10cSrcweir HelpButton m_aHelpBtn; 130*cdf0e10cSrcweir 131*cdf0e10cSrcweir DECL_LINK( ModifyHdl_Impl, Edit * ); 132*cdf0e10cSrcweir DECL_LINK( AssignHdl_Impl, PushButton * ); 133*cdf0e10cSrcweir DECL_LINK( SelectHdl_Impl, ListBox * ); 134*cdf0e10cSrcweir DECL_LINK( DblClickHdl_Impl, ListBox * ); 135*cdf0e10cSrcweir DECL_LINK( RemoveHdl_Impl, PushButton * ); 136*cdf0e10cSrcweir 137*cdf0e10cSrcweir inline void EnableRemoveButton() 138*cdf0e10cSrcweir { m_aRemoveBtn.Enable( 139*cdf0e10cSrcweir m_aAssignedList.GetSelectEntryPos() 140*cdf0e10cSrcweir != LISTBOX_ENTRY_NOTFOUND ); } 141*cdf0e10cSrcweir 142*cdf0e10cSrcweir 143*cdf0e10cSrcweir public: 144*cdf0e10cSrcweir SvxJavaParameterDlg( Window* pParent ); 145*cdf0e10cSrcweir ~SvxJavaParameterDlg(); 146*cdf0e10cSrcweir 147*cdf0e10cSrcweir virtual short Execute(); 148*cdf0e10cSrcweir 149*cdf0e10cSrcweir ::com::sun::star::uno::Sequence< ::rtl::OUString > GetParameters() const; 150*cdf0e10cSrcweir void SetParameters( ::com::sun::star::uno::Sequence< ::rtl::OUString >& rParams ); 151*cdf0e10cSrcweir }; 152*cdf0e10cSrcweir 153*cdf0e10cSrcweir // class SvxJavaClassPathDlg --------------------------------------------- 154*cdf0e10cSrcweir 155*cdf0e10cSrcweir class SvxJavaClassPathDlg : public ModalDialog 156*cdf0e10cSrcweir { 157*cdf0e10cSrcweir private: 158*cdf0e10cSrcweir FixedText m_aPathLabel; 159*cdf0e10cSrcweir ListBox m_aPathList; 160*cdf0e10cSrcweir PushButton m_aAddArchiveBtn; 161*cdf0e10cSrcweir PushButton m_aAddPathBtn; 162*cdf0e10cSrcweir PushButton m_aRemoveBtn; 163*cdf0e10cSrcweir 164*cdf0e10cSrcweir FixedLine m_aButtonsLine; 165*cdf0e10cSrcweir OKButton m_aOKBtn; 166*cdf0e10cSrcweir CancelButton m_aCancelBtn; 167*cdf0e10cSrcweir HelpButton m_aHelpBtn; 168*cdf0e10cSrcweir 169*cdf0e10cSrcweir String m_sOldPath; 170*cdf0e10cSrcweir 171*cdf0e10cSrcweir DECL_LINK( AddArchiveHdl_Impl, PushButton * ); 172*cdf0e10cSrcweir DECL_LINK( AddPathHdl_Impl, PushButton * ); 173*cdf0e10cSrcweir DECL_LINK( RemoveHdl_Impl, PushButton * ); 174*cdf0e10cSrcweir DECL_LINK( SelectHdl_Impl, ListBox * ); 175*cdf0e10cSrcweir 176*cdf0e10cSrcweir bool IsPathDuplicate( const String& _rPath ); 177*cdf0e10cSrcweir inline void EnableRemoveButton() 178*cdf0e10cSrcweir { m_aRemoveBtn.Enable( 179*cdf0e10cSrcweir m_aPathList.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); } 180*cdf0e10cSrcweir 181*cdf0e10cSrcweir public: 182*cdf0e10cSrcweir SvxJavaClassPathDlg( Window* pParent ); 183*cdf0e10cSrcweir ~SvxJavaClassPathDlg(); 184*cdf0e10cSrcweir 185*cdf0e10cSrcweir inline const String& GetOldPath() const { return m_sOldPath; } 186*cdf0e10cSrcweir inline void SetFocus() { m_aPathList.GrabFocus(); } 187*cdf0e10cSrcweir 188*cdf0e10cSrcweir String GetClassPath() const; 189*cdf0e10cSrcweir void SetClassPath( const String& _rPath ); 190*cdf0e10cSrcweir }; 191*cdf0e10cSrcweir 192*cdf0e10cSrcweir #endif // #ifndef _SVX_OPTJAVA_HXX 193*cdf0e10cSrcweir 194