1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: optjava.hxx,v $
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 ************************************************************************/
30 #ifndef _SVX_OPTJAVA_HXX
31 #define _SVX_OPTJAVA_HXX
33 // include ---------------------------------------------------------------
36 #include <ucbhelper/content.hxx>
37 #ifndef _SV_BUTTON_HXX
38 #include <vcl/button.hxx>
40 #include <vcl/fixed.hxx>
41 #include <vcl/timer.hxx>
42 #include <sfx2/tabdlg.hxx>
43 #include <svx/simptabl.hxx>
44 #ifndef _COM_SUN_STAR_UI_XFOLDERPICKER_HPP_
45 #include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
47 #include <svtools/dialogclosedlistener.hxx>
48 #include "radiobtnbox.hxx"
50 // forward ---------------------------------------------------------------
52 typedef struct _JavaInfo JavaInfo
;
54 class SvxJavaParameterDlg
;
55 class SvxJavaClassPathDlg
;
57 // class SvxJavaTable ----------------------------------------------------
59 class SvxJavaTable
: public SvxSimpleTable
61 using SvxSimpleTable::SetTabs
;
63 Point m_aCurMousePoint
;
66 virtual void SetTabs();
67 virtual void MouseButtonUp( const MouseEvent
& _rMEvt
);
68 virtual void KeyInput( const KeyEvent
& rKEvt
);
71 SvxJavaTable( Window
* _pParent
, const ResId
& _rId
);
75 inline Point
GetCurMousePoint() { return m_aCurMousePoint
; }
78 // class SvxJavaOptionsPage ----------------------------------------------
80 class SvxJavaOptionsPage
: public SfxTabPage
83 FixedLine m_aJavaLine
;
84 CheckBox m_aJavaEnableCB
;
85 FixedText m_aJavaFoundLabel
;
86 svx::SvxRadioButtonListBox m_aJavaList
;
87 FixedText m_aJavaPathText
;
89 PushButton m_aParameterBtn
;
90 PushButton m_aClassPathBtn
;
92 SvxJavaParameterDlg
* m_pParamDlg
;
93 SvxJavaClassPathDlg
* m_pPathDlg
;
95 JavaInfo
** m_parJavaInfo
;
96 rtl_uString
** m_parParameters
;
97 rtl_uString
* m_pClassPath
;
98 sal_Int32 m_nInfoSize
;
99 sal_Int32 m_nParamSize
;
100 String m_sInstallText
;
101 String m_sAccessibilityText
;
102 String m_sAddDialogText
;
105 ::std::vector
< JavaInfo
* >
108 ::com::sun::star::uno::Reference
< ::svt::DialogClosedListener
> xDialogListener
;
109 ::com::sun::star::uno::Reference
< ::com::sun::star::ui::dialogs::XFolderPicker
> xFolderPicker
;
111 DECL_LINK( EnableHdl_Impl
, CheckBox
* );
112 DECL_LINK( CheckHdl_Impl
, SvxSimpleTable
* );
113 DECL_LINK( SelectHdl_Impl
, SvxSimpleTable
* );
114 DECL_LINK( AddHdl_Impl
, PushButton
* );
115 DECL_LINK( ParameterHdl_Impl
, PushButton
* );
116 DECL_LINK( ClassPathHdl_Impl
, PushButton
* );
117 DECL_LINK( ResetHdl_Impl
, Timer
* );
119 DECL_LINK( StartFolderPickerHdl
, void * );
120 DECL_LINK( DialogClosedHdl
, ::com::sun::star::ui::dialogs::DialogClosedEvent
* );
122 void ClearJavaInfo();
123 void ClearJavaList();
125 void AddJRE( JavaInfo
* _pInfo
);
126 void HandleCheckEntry( SvLBoxEntry
* _pEntry
);
127 void AddFolder( const ::rtl::OUString
& _rFolder
);
130 SvxJavaOptionsPage( Window
* pParent
, const SfxItemSet
& rSet
);
131 ~SvxJavaOptionsPage();
133 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rSet
);
135 virtual BOOL
FillItemSet( SfxItemSet
& rSet
);
136 virtual void Reset( const SfxItemSet
& rSet
);
137 virtual void FillUserData();
140 // class SvxJavaParameterDlg ---------------------------------------------
142 class SvxJavaParameterDlg
: public ModalDialog
145 FixedText m_aParameterLabel
;
146 Edit m_aParameterEdit
;
147 PushButton m_aAssignBtn
;
149 FixedText m_aAssignedLabel
;
150 ListBox m_aAssignedList
;
151 FixedText m_aExampleText
;
152 PushButton m_aRemoveBtn
;
154 FixedLine m_aButtonsLine
;
156 CancelButton m_aCancelBtn
;
157 HelpButton m_aHelpBtn
;
159 DECL_LINK( ModifyHdl_Impl
, Edit
* );
160 DECL_LINK( AssignHdl_Impl
, PushButton
* );
161 DECL_LINK( SelectHdl_Impl
, ListBox
* );
162 DECL_LINK( DblClickHdl_Impl
, ListBox
* );
163 DECL_LINK( RemoveHdl_Impl
, PushButton
* );
165 inline void EnableRemoveButton()
166 { m_aRemoveBtn
.Enable(
167 m_aAssignedList
.GetSelectEntryPos()
168 != LISTBOX_ENTRY_NOTFOUND
); }
172 SvxJavaParameterDlg( Window
* pParent
);
173 ~SvxJavaParameterDlg();
175 virtual short Execute();
177 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> GetParameters() const;
178 void SetParameters( ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& rParams
);
181 // class SvxJavaClassPathDlg ---------------------------------------------
183 class SvxJavaClassPathDlg
: public ModalDialog
186 FixedText m_aPathLabel
;
188 PushButton m_aAddArchiveBtn
;
189 PushButton m_aAddPathBtn
;
190 PushButton m_aRemoveBtn
;
192 FixedLine m_aButtonsLine
;
194 CancelButton m_aCancelBtn
;
195 HelpButton m_aHelpBtn
;
199 DECL_LINK( AddArchiveHdl_Impl
, PushButton
* );
200 DECL_LINK( AddPathHdl_Impl
, PushButton
* );
201 DECL_LINK( RemoveHdl_Impl
, PushButton
* );
202 DECL_LINK( SelectHdl_Impl
, ListBox
* );
204 bool IsPathDuplicate( const String
& _rPath
);
205 inline void EnableRemoveButton()
206 { m_aRemoveBtn
.Enable(
207 m_aPathList
.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND
); }
210 SvxJavaClassPathDlg( Window
* pParent
);
211 ~SvxJavaClassPathDlg();
213 inline const String
& GetOldPath() const { return m_sOldPath
; }
214 inline void SetFocus() { m_aPathList
.GrabFocus(); }
216 String
GetClassPath() const;
217 void SetClassPath( const String
& _rPath
);
220 #endif // #ifndef _SVX_OPTJAVA_HXX