bump product version to 5.0.4.1
[LibreOffice.git] / cui / source / options / optjava.hxx
blobb73e2c308bb9ee669eb0fdf240702a9a9de858d5
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 INCLUDED_CUI_SOURCE_OPTIONS_OPTJAVA_HXX
20 #define INCLUDED_CUI_SOURCE_OPTIONS_OPTJAVA_HXX
22 #include <config_features.h>
24 #include <vector>
25 #include <ucbhelper/content.hxx>
26 #include <vcl/button.hxx>
27 #include <vcl/fixed.hxx>
28 #include <vcl/lstbox.hxx>
29 #include <vcl/timer.hxx>
30 #include <vcl/idle.hxx>
31 #include <sfx2/tabdlg.hxx>
32 #include <com/sun/star/ui/dialogs/XFolderPicker2.hpp>
33 #include <svtools/dialogclosedlistener.hxx>
34 #include <svtools/simptabl.hxx>
35 #include "radiobtnbox.hxx"
37 // forward ---------------------------------------------------------------
39 #if HAVE_FEATURE_JAVA
40 typedef struct _JavaInfo JavaInfo;
41 #else
42 typedef void* JavaInfo;
43 #endif
45 class SvxJavaParameterDlg;
46 class SvxJavaClassPathDlg;
47 class SvxJavaListBox;
49 // class SvxJavaOptionsPage ----------------------------------------------
51 class SvxJavaOptionsPage : public SfxTabPage
53 private:
54 VclPtr<CheckBox> m_pJavaEnableCB;
55 VclPtr<VclContainer> m_pJavaBox;
56 VclPtr<SvxJavaListBox> m_pJavaList;
57 VclPtr<FixedText> m_pJavaPathText;
58 VclPtr<PushButton> m_pAddBtn;
59 VclPtr<PushButton> m_pParameterBtn;
60 VclPtr<PushButton> m_pClassPathBtn;
61 VclPtr<PushButton> m_pExpertConfigBtn;
63 VclPtr<SvxJavaParameterDlg> m_pParamDlg;
64 VclPtr<SvxJavaClassPathDlg> m_pPathDlg;
66 #if HAVE_FEATURE_JAVA
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 #endif
73 OUString m_sInstallText;
74 OUString m_sAccessibilityText;
75 OUString m_sAddDialogText;
76 Idle m_aResetIdle;
78 VclPtr<CheckBox> m_pExperimentalCB;
79 VclPtr<CheckBox> m_pMacroCB;
81 ::std::vector< JavaInfo* >
82 m_aAddedInfos;
84 ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
85 ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker2 > xFolderPicker;
87 DECL_LINK(EnableHdl_Impl, void *);
88 DECL_LINK( CheckHdl_Impl, SvSimpleTable * );
89 DECL_LINK(SelectHdl_Impl, void *);
90 DECL_LINK(AddHdl_Impl, void *);
91 DECL_LINK(ParameterHdl_Impl, void *);
92 DECL_LINK(ClassPathHdl_Impl, void *);
93 DECL_LINK_TYPED(ResetHdl_Impl, Idle *, void);
95 DECL_LINK( StartFolderPickerHdl, void * );
96 DECL_LINK( DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
98 DECL_LINK(ExpertConfigHdl_Impl, void *);
100 void ClearJavaInfo();
101 void ClearJavaList();
102 void LoadJREs();
103 void AddJRE( JavaInfo* _pInfo );
104 void HandleCheckEntry( SvTreeListEntry* _pEntry );
105 void AddFolder( const OUString& _rFolder );
107 public:
108 SvxJavaOptionsPage( vcl::Window* pParent, const SfxItemSet& rSet );
109 virtual ~SvxJavaOptionsPage();
110 virtual void dispose() SAL_OVERRIDE;
112 static VclPtr<SfxTabPage> Create( vcl::Window* pParent, const SfxItemSet* rSet );
114 virtual bool FillItemSet( SfxItemSet* rSet ) SAL_OVERRIDE;
115 virtual void Reset( const SfxItemSet* rSet ) SAL_OVERRIDE;
116 virtual void FillUserData() SAL_OVERRIDE;
119 // class SvxJavaParameterDlg ---------------------------------------------
121 class SvxJavaParameterDlg : public ModalDialog
123 private:
124 VclPtr<Edit> m_pParameterEdit;
125 VclPtr<PushButton> m_pAssignBtn;
127 VclPtr<ListBox> m_pAssignedList;
128 VclPtr<PushButton> m_pRemoveBtn;
130 DECL_LINK(ModifyHdl_Impl, void *);
131 DECL_LINK(AssignHdl_Impl, void *);
132 DECL_LINK(SelectHdl_Impl, void *);
133 DECL_LINK(DblClickHdl_Impl, void *);
134 DECL_LINK(RemoveHdl_Impl, void *);
136 inline void EnableRemoveButton()
137 { m_pRemoveBtn->Enable(
138 m_pAssignedList->GetSelectEntryPos()
139 != LISTBOX_ENTRY_NOTFOUND ); }
142 public:
143 SvxJavaParameterDlg( vcl::Window* pParent );
144 virtual ~SvxJavaParameterDlg();
145 virtual void dispose() SAL_OVERRIDE;
147 virtual short Execute() SAL_OVERRIDE;
149 ::com::sun::star::uno::Sequence< OUString > GetParameters() const;
150 void SetParameters( ::com::sun::star::uno::Sequence< OUString >& rParams );
153 // class SvxJavaClassPathDlg ---------------------------------------------
155 class SvxJavaClassPathDlg : public ModalDialog
157 private:
158 VclPtr<ListBox> m_pPathList;
159 VclPtr<PushButton> m_pAddArchiveBtn;
160 VclPtr<PushButton> m_pAddPathBtn;
161 VclPtr<PushButton> m_pRemoveBtn;
163 OUString m_sOldPath;
165 DECL_LINK(AddArchiveHdl_Impl, void *);
166 DECL_LINK(AddPathHdl_Impl, void *);
167 DECL_LINK(RemoveHdl_Impl, void *);
168 DECL_LINK(SelectHdl_Impl, void *);
170 bool IsPathDuplicate( const OUString& _rPath );
171 inline void EnableRemoveButton()
172 { m_pRemoveBtn->Enable(
173 m_pPathList->GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); }
175 public:
176 SvxJavaClassPathDlg( vcl::Window* pParent );
177 virtual ~SvxJavaClassPathDlg();
178 virtual void dispose() SAL_OVERRIDE;
180 inline const OUString& GetOldPath() const { return m_sOldPath; }
181 inline void SetFocus() { m_pPathList->GrabFocus(); }
183 OUString GetClassPath() const;
184 void SetClassPath( const OUString& _rPath );
187 #endif // INCLUDED_CUI_SOURCE_OPTIONS_OPTJAVA_HXX
189 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */