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 INCLUDED_SW_SOURCE_UIBASE_INC_JAVAEDIT_HXX
20 #define INCLUDED_SW_SOURCE_UIBASE_INC_JAVAEDIT_HXX
21 
22 #include <vcl/weld.hxx>
23 
24 class SwWrtShell;
25 class SwFieldMgr;
26 class SwScriptField;
27 
28 namespace sfx2 { class FileDialogHelper; }
29 
30 class SwJavaEditDialog : public weld::GenericDialogController
31 {
32 private:
33     OUString       m_aText;
34     OUString       m_aType;
35 
36     bool           m_bNew;
37     bool           m_bIsUrl;
38 
39     SwScriptField*          m_pField;
40     std::unique_ptr<SwFieldMgr>             m_pMgr;
41     SwWrtShell*             m_pSh;
42     std::unique_ptr<sfx2::FileDialogHelper> m_pFileDlg;
43 
44     std::unique_ptr<weld::Entry>        m_xTypeED;
45     std::unique_ptr<weld::RadioButton>  m_xUrlRB;
46     std::unique_ptr<weld::RadioButton>  m_xEditRB;
47     std::unique_ptr<weld::Button>       m_xUrlPB;
48     std::unique_ptr<weld::Entry>        m_xUrlED;
49     std::unique_ptr<weld::TextView>     m_xEditED;
50     std::unique_ptr<weld::Button>       m_xOKBtn;
51     std::unique_ptr<weld::Button>       m_xPrevBtn;
52     std::unique_ptr<weld::Button>       m_xNextBtn;
53 
54     DECL_LINK(OKHdl, weld::Button&, void);
55     DECL_LINK(PrevHdl, weld::Button&, void);
56     DECL_LINK(NextHdl, weld::Button&, void);
57     DECL_LINK(RadioButtonHdl, weld::Button&, void);
58     DECL_LINK(InsertFileHdl, weld::Button&, void);
59     DECL_LINK(DlgClosedHdl, sfx2::FileDialogHelper *, void);
60 
61     void            CheckTravel();
62     void            SetField();
63 
64 public:
65     SwJavaEditDialog(weld::Window* pParent, SwWrtShell* pWrtSh);
66     virtual ~SwJavaEditDialog() override;
67 
GetScriptText() const68     const OUString& GetScriptText() const { return m_aText; }
69 
GetScriptType() const70     const OUString& GetScriptType() const { return m_aType; }
71 
IsUrl() const72     bool IsUrl() const { return m_bIsUrl; }
IsNew() const73     bool IsNew() const { return m_bNew; }
74     bool IsUpdate() const;
75 };
76 
77 #endif
78 
79 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
80