xref: /trunk/main/cui/source/options/optjava.hxx (revision 914d351e5f5b84e4342a86d6ab8d4aca7308b9bd)
1*c4eee24dSAndrew Rist /**************************************************************
2cdf0e10cSrcweir  *
3*c4eee24dSAndrew Rist  * Licensed to the Apache Software Foundation (ASF) under one
4*c4eee24dSAndrew Rist  * or more contributor license agreements.  See the NOTICE file
5*c4eee24dSAndrew Rist  * distributed with this work for additional information
6*c4eee24dSAndrew Rist  * regarding copyright ownership.  The ASF licenses this file
7*c4eee24dSAndrew Rist  * to you under the Apache License, Version 2.0 (the
8*c4eee24dSAndrew Rist  * "License"); you may not use this file except in compliance
9*c4eee24dSAndrew Rist  * with the License.  You may obtain a copy of the License at
10cdf0e10cSrcweir  *
11*c4eee24dSAndrew Rist  *   http://www.apache.org/licenses/LICENSE-2.0
12cdf0e10cSrcweir  *
13*c4eee24dSAndrew Rist  * Unless required by applicable law or agreed to in writing,
14*c4eee24dSAndrew Rist  * software distributed under the License is distributed on an
15*c4eee24dSAndrew Rist  * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*c4eee24dSAndrew Rist  * KIND, either express or implied.  See the License for the
17*c4eee24dSAndrew Rist  * specific language governing permissions and limitations
18*c4eee24dSAndrew Rist  * under the License.
19cdf0e10cSrcweir  *
20*c4eee24dSAndrew Rist  *************************************************************/
21*c4eee24dSAndrew Rist 
22*c4eee24dSAndrew Rist 
23cdf0e10cSrcweir #ifndef _SVX_OPTJAVA_HXX
24cdf0e10cSrcweir #define _SVX_OPTJAVA_HXX
25cdf0e10cSrcweir 
26cdf0e10cSrcweir // include ---------------------------------------------------------------
27cdf0e10cSrcweir 
28cdf0e10cSrcweir #include <vector>
29cdf0e10cSrcweir #include <ucbhelper/content.hxx>
30cdf0e10cSrcweir #include <vcl/button.hxx>
31cdf0e10cSrcweir #include <vcl/fixed.hxx>
32cdf0e10cSrcweir #include <vcl/timer.hxx>
33cdf0e10cSrcweir #include <sfx2/tabdlg.hxx>
34cdf0e10cSrcweir #include <svx/simptabl.hxx>
35cdf0e10cSrcweir #include <com/sun/star/ui/dialogs/XFolderPicker.hpp>
36cdf0e10cSrcweir #include <svtools/dialogclosedlistener.hxx>
37cdf0e10cSrcweir #include "radiobtnbox.hxx"
38cdf0e10cSrcweir 
39cdf0e10cSrcweir // forward ---------------------------------------------------------------
40cdf0e10cSrcweir 
41cdf0e10cSrcweir typedef struct _JavaInfo JavaInfo;
42cdf0e10cSrcweir 
43cdf0e10cSrcweir class   SvxJavaParameterDlg;
44cdf0e10cSrcweir class   SvxJavaClassPathDlg;
45cdf0e10cSrcweir 
46cdf0e10cSrcweir // class SvxJavaOptionsPage ----------------------------------------------
47cdf0e10cSrcweir 
48cdf0e10cSrcweir class SvxJavaOptionsPage : public SfxTabPage
49cdf0e10cSrcweir {
50cdf0e10cSrcweir private:
51cdf0e10cSrcweir     FixedLine                   m_aJavaLine;
52cdf0e10cSrcweir     CheckBox                    m_aJavaEnableCB;
53cdf0e10cSrcweir     FixedText                   m_aJavaFoundLabel;
54cdf0e10cSrcweir     svx::SvxRadioButtonListBox  m_aJavaList;
55cdf0e10cSrcweir     FixedText                   m_aJavaPathText;
56cdf0e10cSrcweir     PushButton                  m_aAddBtn;
57cdf0e10cSrcweir     PushButton                  m_aParameterBtn;
58cdf0e10cSrcweir     PushButton                  m_aClassPathBtn;
59cdf0e10cSrcweir 
60cdf0e10cSrcweir     SvxJavaParameterDlg*    m_pParamDlg;
61cdf0e10cSrcweir     SvxJavaClassPathDlg*    m_pPathDlg;
62cdf0e10cSrcweir 
63cdf0e10cSrcweir     JavaInfo**              m_parJavaInfo;
64cdf0e10cSrcweir     rtl_uString**           m_parParameters;
65cdf0e10cSrcweir     rtl_uString*            m_pClassPath;
66cdf0e10cSrcweir     sal_Int32               m_nInfoSize;
67cdf0e10cSrcweir     sal_Int32               m_nParamSize;
68cdf0e10cSrcweir     String                  m_sInstallText;
69cdf0e10cSrcweir     String                  m_sAccessibilityText;
70cdf0e10cSrcweir     String                  m_sAddDialogText;
71cdf0e10cSrcweir     Timer                   m_aResetTimer;
72cdf0e10cSrcweir 
73cdf0e10cSrcweir     ::std::vector< JavaInfo* >
74cdf0e10cSrcweir                             m_aAddedInfos;
75cdf0e10cSrcweir 
76cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::svt::DialogClosedListener > xDialogListener;
77cdf0e10cSrcweir     ::com::sun::star::uno::Reference< ::com::sun::star::ui::dialogs::XFolderPicker > xFolderPicker;
78cdf0e10cSrcweir 
79cdf0e10cSrcweir     DECL_LINK(              EnableHdl_Impl, CheckBox * );
80cdf0e10cSrcweir     DECL_LINK(              CheckHdl_Impl, SvxSimpleTable * );
81cdf0e10cSrcweir     DECL_LINK(              SelectHdl_Impl, SvxSimpleTable * );
82cdf0e10cSrcweir     DECL_LINK(              AddHdl_Impl, PushButton * );
83cdf0e10cSrcweir     DECL_LINK(              ParameterHdl_Impl, PushButton * );
84cdf0e10cSrcweir     DECL_LINK(              ClassPathHdl_Impl, PushButton * );
85cdf0e10cSrcweir     DECL_LINK(              ResetHdl_Impl, Timer * );
86cdf0e10cSrcweir 
87cdf0e10cSrcweir     DECL_LINK(              StartFolderPickerHdl, void * );
88cdf0e10cSrcweir     DECL_LINK(              DialogClosedHdl, ::com::sun::star::ui::dialogs::DialogClosedEvent* );
89cdf0e10cSrcweir 
90cdf0e10cSrcweir     void                    ClearJavaInfo();
91cdf0e10cSrcweir     void                    ClearJavaList();
92cdf0e10cSrcweir     void                    LoadJREs();
93cdf0e10cSrcweir     void                    AddJRE( JavaInfo* _pInfo );
94cdf0e10cSrcweir     void                    HandleCheckEntry( SvLBoxEntry* _pEntry );
95cdf0e10cSrcweir     void                    AddFolder( const ::rtl::OUString& _rFolder );
96cdf0e10cSrcweir 
97cdf0e10cSrcweir public:
98cdf0e10cSrcweir     SvxJavaOptionsPage( Window* pParent, const SfxItemSet& rSet );
99cdf0e10cSrcweir     ~SvxJavaOptionsPage();
100cdf0e10cSrcweir 
101cdf0e10cSrcweir     static SfxTabPage*      Create( Window* pParent, const SfxItemSet& rSet );
102cdf0e10cSrcweir 
103cdf0e10cSrcweir     virtual sal_Bool            FillItemSet( SfxItemSet& rSet );
104cdf0e10cSrcweir     virtual void            Reset( const SfxItemSet& rSet );
105cdf0e10cSrcweir     virtual void            FillUserData();
106cdf0e10cSrcweir };
107cdf0e10cSrcweir 
108cdf0e10cSrcweir // class SvxJavaParameterDlg ---------------------------------------------
109cdf0e10cSrcweir 
110cdf0e10cSrcweir class SvxJavaParameterDlg : public ModalDialog
111cdf0e10cSrcweir {
112cdf0e10cSrcweir private:
113cdf0e10cSrcweir     FixedText               m_aParameterLabel;
114cdf0e10cSrcweir     Edit                    m_aParameterEdit;
115cdf0e10cSrcweir     PushButton              m_aAssignBtn;
116cdf0e10cSrcweir 
117cdf0e10cSrcweir     FixedText               m_aAssignedLabel;
118cdf0e10cSrcweir     ListBox                 m_aAssignedList;
119cdf0e10cSrcweir     FixedText               m_aExampleText;
120cdf0e10cSrcweir     PushButton              m_aRemoveBtn;
121cdf0e10cSrcweir 
122cdf0e10cSrcweir     FixedLine               m_aButtonsLine;
123cdf0e10cSrcweir     OKButton                m_aOKBtn;
124cdf0e10cSrcweir     CancelButton            m_aCancelBtn;
125cdf0e10cSrcweir     HelpButton              m_aHelpBtn;
126cdf0e10cSrcweir 
127cdf0e10cSrcweir     DECL_LINK(              ModifyHdl_Impl, Edit * );
128cdf0e10cSrcweir     DECL_LINK(              AssignHdl_Impl, PushButton * );
129cdf0e10cSrcweir     DECL_LINK(              SelectHdl_Impl, ListBox * );
130cdf0e10cSrcweir     DECL_LINK(              DblClickHdl_Impl, ListBox * );
131cdf0e10cSrcweir     DECL_LINK(              RemoveHdl_Impl, PushButton * );
132cdf0e10cSrcweir 
EnableRemoveButton()133cdf0e10cSrcweir     inline void             EnableRemoveButton()
134cdf0e10cSrcweir                                 { m_aRemoveBtn.Enable(
135cdf0e10cSrcweir                                     m_aAssignedList.GetSelectEntryPos()
136cdf0e10cSrcweir                                     != LISTBOX_ENTRY_NOTFOUND ); }
137cdf0e10cSrcweir 
138cdf0e10cSrcweir 
139cdf0e10cSrcweir public:
140cdf0e10cSrcweir     SvxJavaParameterDlg( Window* pParent );
141cdf0e10cSrcweir     ~SvxJavaParameterDlg();
142cdf0e10cSrcweir 
143cdf0e10cSrcweir     virtual short           Execute();
144cdf0e10cSrcweir 
145cdf0e10cSrcweir     ::com::sun::star::uno::Sequence< ::rtl::OUString > GetParameters() const;
146cdf0e10cSrcweir     void SetParameters( ::com::sun::star::uno::Sequence< ::rtl::OUString >& rParams );
147cdf0e10cSrcweir };
148cdf0e10cSrcweir 
149cdf0e10cSrcweir // class SvxJavaClassPathDlg ---------------------------------------------
150cdf0e10cSrcweir 
151cdf0e10cSrcweir class SvxJavaClassPathDlg : public ModalDialog
152cdf0e10cSrcweir {
153cdf0e10cSrcweir private:
154cdf0e10cSrcweir     FixedText               m_aPathLabel;
155cdf0e10cSrcweir     ListBox                 m_aPathList;
156cdf0e10cSrcweir     PushButton              m_aAddArchiveBtn;
157cdf0e10cSrcweir     PushButton              m_aAddPathBtn;
158cdf0e10cSrcweir     PushButton              m_aRemoveBtn;
159cdf0e10cSrcweir 
160cdf0e10cSrcweir     FixedLine               m_aButtonsLine;
161cdf0e10cSrcweir     OKButton                m_aOKBtn;
162cdf0e10cSrcweir     CancelButton            m_aCancelBtn;
163cdf0e10cSrcweir     HelpButton              m_aHelpBtn;
164cdf0e10cSrcweir 
165cdf0e10cSrcweir     String                  m_sOldPath;
166cdf0e10cSrcweir 
167cdf0e10cSrcweir     DECL_LINK(              AddArchiveHdl_Impl, PushButton * );
168cdf0e10cSrcweir     DECL_LINK(              AddPathHdl_Impl, PushButton * );
169cdf0e10cSrcweir     DECL_LINK(              RemoveHdl_Impl, PushButton * );
170cdf0e10cSrcweir     DECL_LINK(              SelectHdl_Impl, ListBox * );
171cdf0e10cSrcweir 
172cdf0e10cSrcweir     bool                    IsPathDuplicate( const String& _rPath );
EnableRemoveButton()173cdf0e10cSrcweir     inline void             EnableRemoveButton()
174cdf0e10cSrcweir                                 { m_aRemoveBtn.Enable(
175cdf0e10cSrcweir                                     m_aPathList.GetSelectEntryPos() != LISTBOX_ENTRY_NOTFOUND ); }
176cdf0e10cSrcweir 
177cdf0e10cSrcweir public:
178cdf0e10cSrcweir     SvxJavaClassPathDlg( Window* pParent );
179cdf0e10cSrcweir     ~SvxJavaClassPathDlg();
180cdf0e10cSrcweir 
GetOldPath() const181cdf0e10cSrcweir     inline const String&    GetOldPath() const { return m_sOldPath; }
SetFocus()182cdf0e10cSrcweir     inline void             SetFocus() { m_aPathList.GrabFocus(); }
183cdf0e10cSrcweir 
184cdf0e10cSrcweir     String                  GetClassPath() const;
185cdf0e10cSrcweir     void                    SetClassPath( const String& _rPath );
186cdf0e10cSrcweir };
187cdf0e10cSrcweir 
188cdf0e10cSrcweir #endif // #ifndef _SVX_OPTJAVA_HXX
189