Version 4.0.0.1, tag libreoffice-4.0.0.1
[LibreOffice.git] / cui / source / options / optjava.hxx
blob7e7d9f5a8ec263ba9c4d22b2a46fe68284af1984
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #ifndef _SVX_OPTJAVA_HXX
20 #define _SVX_OPTJAVA_HXX
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"
33 // forward ---------------------------------------------------------------
35 typedef struct _JavaInfo JavaInfo;
37 class SvxJavaParameterDlg;
38 class SvxJavaClassPathDlg;
40 // class SvxJavaOptionsPage ----------------------------------------------
42 class SvxJavaOptionsPage : public SfxTabPage
44 private:
45 FixedLine m_aJavaLine;
46 CheckBox m_aJavaEnableCB;
47 FixedText m_aJavaFoundLabel;
48 SvxSimpleTableContainer m_aJavaListContainer;
49 svx::SvxRadioButtonListBox m_aJavaList;
50 FixedText m_aJavaPathText;
51 PushButton m_aAddBtn;
52 PushButton m_aParameterBtn;
53 PushButton m_aClassPathBtn;
55 SvxJavaParameterDlg* m_pParamDlg;
56 SvxJavaClassPathDlg* m_pPathDlg;
58 JavaInfo** m_parJavaInfo;
59 rtl_uString** m_parParameters;
60 rtl_uString* m_pClassPath;
61 sal_Int32 m_nInfoSize;
62 sal_Int32 m_nParamSize;
63 String m_sInstallText;
64 String m_sAccessibilityText;
65 String m_sAddDialogText;
66 Timer m_aResetTimer;
68 FixedLine m_aExperimental;
69 CheckBox m_aExperimentalCB;
70 CheckBox m_aMacroCB;
72 ::std::vector< JavaInfo* >
73 m_aAddedInfos;
75 ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
76 ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker2 > xFolderPicker;
78 DECL_LINK(EnableHdl_Impl, void *);
79 DECL_LINK( CheckHdl_Impl, SvxSimpleTable * );
80 DECL_LINK(SelectHdl_Impl, void *);
81 DECL_LINK(AddHdl_Impl, void *);
82 DECL_LINK(ParameterHdl_Impl, void *);
83 DECL_LINK(ClassPathHdl_Impl, void *);
84 DECL_LINK(ResetHdl_Impl, void *);
86 DECL_LINK( StartFolderPickerHdl, void * );
87 DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
89 void ClearJavaInfo();
90 void ClearJavaList();
91 void LoadJREs();
92 void AddJRE( JavaInfo* _pInfo );
93 void HandleCheckEntry( SvTreeListEntry* _pEntry );
94 void AddFolder( const ::rtl::OUString& _rFolder );
96 public:
97 SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet );
98 ~SvxJavaOptionsPage();
100 static SfxTabPage* Create( Window* pParent, const SfxItemSet& rSet );
102 virtual sal_Bool FillItemSet( SfxItemSet& rSet );
103 virtual void Reset( const SfxItemSet& rSet );
104 virtual void FillUserData();
107 // class SvxJavaParameterDlg ---------------------------------------------
109 class SvxJavaParameterDlg : public ModalDialog
111 private:
112 FixedText m_aParameterLabel;
113 Edit m_aParameterEdit;
114 PushButton m_aAssignBtn;
116 FixedText m_aAssignedLabel;
117 ListBox m_aAssignedList;
118 FixedText m_aExampleText;
119 PushButton m_aRemoveBtn;
121 FixedLine m_aButtonsLine;
122 OKButton m_aOKBtn;
123 CancelButton m_aCancelBtn;
124 HelpButton m_aHelpBtn;
126 DECL_LINK(ModifyHdl_Impl, void *);
127 DECL_LINK(AssignHdl_Impl, void *);
128 DECL_LINK(SelectHdl_Impl, void *);
129 DECL_LINK(DblClickHdl_Impl, void *);
130 DECL_LINK(RemoveHdl_Impl, void *);
132 inline void EnableRemoveButton()
133 { m_aRemoveBtn.Enable(
134 m_aAssignedList.GetSelectEntryPos()
135 != LISTBOX_ENTRY_NOTFOUND ); }
138 public:
139 SvxJavaParameterDlg( Window* pParent );
140 ~SvxJavaParameterDlg();
142 virtual short Execute();
144 ::com::sun::star::uno::Sequence< ::rtl::OUString > GetParameters() const;
145 void SetParameters( ::com::sun::star::uno::Sequence< ::rtl::OUString >& rParams );
148 // class SvxJavaClassPathDlg ---------------------------------------------
150 class SvxJavaClassPathDlg : public ModalDialog
152 private:
153 FixedText m_aPathLabel;
154 ListBox m_aPathList;
155 PushButton m_aAddArchiveBtn;
156 PushButton m_aAddPathBtn;
157 PushButton m_aRemoveBtn;
159 FixedLine m_aButtonsLine;
160 OKButton m_aOKBtn;
161 CancelButton m_aCancelBtn;
162 HelpButton m_aHelpBtn;
164 String m_sOldPath;
166 DECL_LINK(AddArchiveHdl_Impl, void *);
167 DECL_LINK(AddPathHdl_Impl, void *);
168 DECL_LINK(RemoveHdl_Impl, void *);
169 DECL_LINK(SelectHdl_Impl, void *);
171 bool IsPathDuplicate( const String& _rPath );
172 inline void EnableRemoveButton()
173 { m_aRemoveBtn.Enable(
174 m_aPathList.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); }
176 public:
177 SvxJavaClassPathDlg( Window* pParent );
178 ~SvxJavaClassPathDlg();
180 inline const String& GetOldPath() const { return m_sOldPath; }
181 inline void SetFocus() { m_aPathList.GrabFocus(); }
183 String GetClassPath() const;
184 void SetClassPath( const String& _rPath );
187 #endif // #ifndef _SVX_OPTJAVA_HXX
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */