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 ************************************************************************/
27 #ifndef _SVX_OPTJAVA_HXX
28 #define _SVX_OPTJAVA_HXX
30 // include ---------------------------------------------------------------
33 #include <ucbhelper/content.hxx>
34 #include <vcl/button.hxx>
35 #include <vcl/fixed.hxx>
36 #include <vcl/timer.hxx>
37 #include <sfx2/tabdlg.hxx>
38 #include <svx/simptabl.hxx>
39 #include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
40 #include <svtools/dialogclosedlistener.hxx>
41 #include "radiobtnbox.hxx"
43 // forward ---------------------------------------------------------------
45 typedef struct _JavaInfo JavaInfo
;
47 class SvxJavaParameterDlg
;
48 class SvxJavaClassPathDlg
;
50 // class SvxJavaOptionsPage ----------------------------------------------
52 class SvxJavaOptionsPage
: public SfxTabPage
55 FixedLine m_aJavaLine
;
56 CheckBox m_aJavaEnableCB
;
57 FixedText m_aJavaFoundLabel
;
58 svx::SvxRadioButtonListBox m_aJavaList
;
59 FixedText m_aJavaPathText
;
61 PushButton m_aParameterBtn
;
62 PushButton m_aClassPathBtn
;
64 SvxJavaParameterDlg
* m_pParamDlg
;
65 SvxJavaClassPathDlg
* m_pPathDlg
;
67 JavaInfo
** m_parJavaInfo
;
68 rtl_uString
** m_parParameters
;
69 rtl_uString
* m_pClassPath
;
70 sal_Int32 m_nInfoSize
;
71 sal_Int32 m_nParamSize
;
72 String m_sInstallText
;
73 String m_sAccessibilityText
;
74 String m_sAddDialogText
;
77 ::std::vector
< JavaInfo
* >
80 ::com::sun::star::uno::Reference
< ::svt::DialogClosedListener
> xDialogListener
;
81 ::com::sun::star::uno::Reference
< ::com::sun::star::ui::dialogs::XFolderPicker
> xFolderPicker
;
83 DECL_LINK( EnableHdl_Impl
, CheckBox
* );
84 DECL_LINK( CheckHdl_Impl
, SvxSimpleTable
* );
85 DECL_LINK( SelectHdl_Impl
, SvxSimpleTable
* );
86 DECL_LINK( AddHdl_Impl
, PushButton
* );
87 DECL_LINK( ParameterHdl_Impl
, PushButton
* );
88 DECL_LINK( ClassPathHdl_Impl
, PushButton
* );
89 DECL_LINK( ResetHdl_Impl
, Timer
* );
91 DECL_LINK( StartFolderPickerHdl
, void * );
92 DECL_LINK( DialogClosedHdl
, ::com::sun::star::ui::dialogs::DialogClosedEvent
* );
97 void AddJRE( JavaInfo
* _pInfo
);
98 void HandleCheckEntry( SvLBoxEntry
* _pEntry
);
99 void AddFolder( const ::rtl::OUString
& _rFolder
);
102 SvxJavaOptionsPage( Window
* pParent
, const SfxItemSet
& rSet
);
103 ~SvxJavaOptionsPage();
105 static SfxTabPage
* Create( Window
* pParent
, const SfxItemSet
& rSet
);
107 virtual sal_Bool
FillItemSet( SfxItemSet
& rSet
);
108 virtual void Reset( const SfxItemSet
& rSet
);
109 virtual void FillUserData();
112 // class SvxJavaParameterDlg ---------------------------------------------
114 class SvxJavaParameterDlg
: public ModalDialog
117 FixedText m_aParameterLabel
;
118 Edit m_aParameterEdit
;
119 PushButton m_aAssignBtn
;
121 FixedText m_aAssignedLabel
;
122 ListBox m_aAssignedList
;
123 FixedText m_aExampleText
;
124 PushButton m_aRemoveBtn
;
126 FixedLine m_aButtonsLine
;
128 CancelButton m_aCancelBtn
;
129 HelpButton m_aHelpBtn
;
131 DECL_LINK( ModifyHdl_Impl
, Edit
* );
132 DECL_LINK( AssignHdl_Impl
, PushButton
* );
133 DECL_LINK( SelectHdl_Impl
, ListBox
* );
134 DECL_LINK( DblClickHdl_Impl
, ListBox
* );
135 DECL_LINK( RemoveHdl_Impl
, PushButton
* );
137 inline void EnableRemoveButton()
138 { m_aRemoveBtn
.Enable(
139 m_aAssignedList
.GetSelectEntryPos()
140 != LISTBOX_ENTRY_NOTFOUND
); }
144 SvxJavaParameterDlg( Window
* pParent
);
145 ~SvxJavaParameterDlg();
147 virtual short Execute();
149 ::com::sun::star::uno::Sequence
< ::rtl::OUString
> GetParameters() const;
150 void SetParameters( ::com::sun::star::uno::Sequence
< ::rtl::OUString
>& rParams
);
153 // class SvxJavaClassPathDlg ---------------------------------------------
155 class SvxJavaClassPathDlg
: public ModalDialog
158 FixedText m_aPathLabel
;
160 PushButton m_aAddArchiveBtn
;
161 PushButton m_aAddPathBtn
;
162 PushButton m_aRemoveBtn
;
164 FixedLine m_aButtonsLine
;
166 CancelButton m_aCancelBtn
;
167 HelpButton m_aHelpBtn
;
171 DECL_LINK( AddArchiveHdl_Impl
, PushButton
* );
172 DECL_LINK( AddPathHdl_Impl
, PushButton
* );
173 DECL_LINK( RemoveHdl_Impl
, PushButton
* );
174 DECL_LINK( SelectHdl_Impl
, ListBox
* );
176 bool IsPathDuplicate( const String
& _rPath
);
177 inline void EnableRemoveButton()
178 { m_aRemoveBtn
.Enable(
179 m_aPathList
.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND
); }
182 SvxJavaClassPathDlg( Window
* pParent
);
183 ~SvxJavaClassPathDlg();
185 inline const String
& GetOldPath() const { return m_sOldPath
; }
186 inline void SetFocus() { m_aPathList
.GrabFocus(); }
188 String
GetClassPath() const;
189 void SetClassPath( const String
& _rPath
);
192 #endif // #ifndef _SVX_OPTJAVA_HXX