Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
5 : * This Source Code Form is subject to the terms of the Mozilla Public
6 : * License, v. 2.0. If a copy of the MPL was not distributed with this
7 : * file, You can obtain one at http://mozilla.org/MPL/2.0/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
11 : * Licensed to the Apache Software Foundation (ASF) under one or more
12 : * contributor license agreements. See the NOTICE file distributed
13 : * with this work for additional information regarding copyright
14 : * ownership. The ASF licenses this file to you under the Apache
15 : * License, Version 2.0 (the "License"); you may not use this file
16 : * except in compliance with the License. You may obtain a copy of
17 : * the License at http://www.apache.org/licenses/LICENSE-2.0 .
18 : */
19 : #ifndef _SVX_OPTJAVA_HXX
20 : #define _SVX_OPTJAVA_HXX
21 :
22 : #include <vector>
23 : #include <ucbhelper/content.hxx>
24 : #include <vcl/button.hxx>
25 : #include <vcl/fixed.hxx>
26 : #include <vcl/timer.hxx>
27 : #include <sfx2/tabdlg.hxx>
28 : #include <svx/simptabl.hxx>
29 : #include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
30 : #include <svtools/dialogclosedlistener.hxx>
31 : #include "radiobtnbox.hxx"
32 :
33 : // forward ---------------------------------------------------------------
34 :
35 : #ifdef SOLAR_JAVA
36 : typedef struct _JavaInfo JavaInfo;
37 : #else
38 : typedef void* JavaInfo;
39 : #endif
40 :
41 : class SvxJavaParameterDlg;
42 : class SvxJavaClassPathDlg;
43 : class SvxJavaListBox;
44 :
45 : // class SvxJavaOptionsPage ----------------------------------------------
46 :
47 : class SvxJavaOptionsPage : public SfxTabPage
48 : {
49 : private:
50 : CheckBox* m_pJavaEnableCB;
51 : VclContainer* m_pJavaBox;
52 : SvxJavaListBox* m_pJavaList;
53 : FixedText* m_pJavaPathText;
54 : PushButton* m_pAddBtn;
55 : PushButton* m_pParameterBtn;
56 : PushButton* m_pClassPathBtn;
57 :
58 : SvxJavaParameterDlg* m_pParamDlg;
59 : SvxJavaClassPathDlg* m_pPathDlg;
60 :
61 : #ifdef SOLAR_JAVA
62 : JavaInfo** m_parJavaInfo;
63 : rtl_uString** m_parParameters;
64 : rtl_uString* m_pClassPath;
65 : sal_Int32 m_nInfoSize;
66 : sal_Int32 m_nParamSize;
67 : #endif
68 : String m_sInstallText;
69 : String m_sAccessibilityText;
70 : String m_sAddDialogText;
71 : Timer m_aResetTimer;
72 :
73 : CheckBox* m_pExperimentalCB;
74 : CheckBox* m_pExpSidebarCB;
75 : CheckBox* m_pMacroCB;
76 :
77 : ::std::vector< JavaInfo* >
78 : m_aAddedInfos;
79 :
80 : ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
81 : ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker2 > xFolderPicker;
82 :
83 : DECL_LINK(EnableHdl_Impl, void *);
84 : DECL_LINK( CheckHdl_Impl, SvxSimpleTable * );
85 : DECL_LINK(SelectHdl_Impl, void *);
86 : DECL_LINK(AddHdl_Impl, void *);
87 : DECL_LINK(ParameterHdl_Impl, void *);
88 : DECL_LINK(ClassPathHdl_Impl, void *);
89 : DECL_LINK(ResetHdl_Impl, void *);
90 :
91 : DECL_LINK( StartFolderPickerHdl, void * );
92 : DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
93 :
94 : void ClearJavaInfo();
95 : void ClearJavaList();
96 : void LoadJREs();
97 : void AddJRE( JavaInfo* _pInfo );
98 : void HandleCheckEntry( SvTreeListEntry* _pEntry );
99 : void AddFolder( const OUString& _rFolder );
100 :
101 : public:
102 : SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet );
103 : ~SvxJavaOptionsPage();
104 :
105 : static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
106 :
107 : virtual sal_Bool FillItemSet( SfxItemSet& rSet );
108 : virtual void Reset( const SfxItemSet& rSet );
109 : virtual void FillUserData();
110 : };
111 :
112 : // class SvxJavaParameterDlg ---------------------------------------------
113 :
114 : class SvxJavaParameterDlg : public ModalDialog
115 : {
116 : private:
117 : FixedText m_aParameterLabel;
118 : Edit m_aParameterEdit;
119 : PushButton m_aAssignBtn;
120 :
121 : FixedText m_aAssignedLabel;
122 : ListBox m_aAssignedList;
123 : FixedText m_aExampleText;
124 : PushButton m_aRemoveBtn;
125 :
126 : FixedLine m_aButtonsLine;
127 : OKButton m_aOKBtn;
128 : CancelButton m_aCancelBtn;
129 : HelpButton m_aHelpBtn;
130 :
131 : DECL_LINK(ModifyHdl_Impl, void *);
132 : DECL_LINK(AssignHdl_Impl, void *);
133 : DECL_LINK(SelectHdl_Impl, void *);
134 : DECL_LINK(DblClickHdl_Impl, void *);
135 : DECL_LINK(RemoveHdl_Impl, void *);
136 :
137 0 : inline void EnableRemoveButton()
138 : { m_aRemoveBtn.Enable(
139 0 : m_aAssignedList.GetSelectEntryPos()
140 0 : != LISTBOX_ENTRY_NOTFOUND ); }
141 :
142 :
143 : public:
144 : SvxJavaParameterDlg( Window* pParent );
145 : ~SvxJavaParameterDlg();
146 :
147 : virtual short Execute();
148 :
149 : ::com::sun::star::uno::Sequence< OUString > GetParameters() const;
150 : void SetParameters( ::com::sun::star::uno::Sequence< OUString >& rParams );
151 : };
152 :
153 : // class SvxJavaClassPathDlg ---------------------------------------------
154 :
155 : class SvxJavaClassPathDlg : public ModalDialog
156 : {
157 : private:
158 : FixedText m_aPathLabel;
159 : ListBox m_aPathList;
160 : PushButton m_aAddArchiveBtn;
161 : PushButton m_aAddPathBtn;
162 : PushButton m_aRemoveBtn;
163 :
164 : FixedLine m_aButtonsLine;
165 : OKButton m_aOKBtn;
166 : CancelButton m_aCancelBtn;
167 : HelpButton m_aHelpBtn;
168 :
169 : String m_sOldPath;
170 :
171 : DECL_LINK(AddArchiveHdl_Impl, void *);
172 : DECL_LINK(AddPathHdl_Impl, void *);
173 : DECL_LINK(RemoveHdl_Impl, void *);
174 : DECL_LINK(SelectHdl_Impl, void *);
175 :
176 : bool IsPathDuplicate( const String& _rPath );
177 0 : inline void EnableRemoveButton()
178 : { m_aRemoveBtn.Enable(
179 0 : m_aPathList.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); }
180 :
181 : public:
182 : SvxJavaClassPathDlg( Window* pParent );
183 : ~SvxJavaClassPathDlg();
184 :
185 0 : inline const String& GetOldPath() const { return m_sOldPath; }
186 0 : inline void SetFocus() { m_aPathList.GrabFocus(); }
187 :
188 : String GetClassPath() const;
189 : void SetClassPath( const String& _rPath );
190 : };
191 :
192 : #endif // #ifndef _SVX_OPTJAVA_HXX
193 :
194 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|