LibreOffice Module basctl (master) 1
macrodlg.hxx
Go to the documentation of this file.
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
20#pragma once
21
22#include <basobj.hxx>
23#include <bastype2.hxx>
24#include <sfx2/basedlgs.hxx>
25#include <com/sun/star/frame/XFrame.hpp>
26#include <vcl/weld.hxx>
27
28namespace basctl
29{
30
34 Macro_New = 112,
36};
37
39{
40public:
41 enum Mode {
42 All = 1,
45 };
46
47private:
49
50 // For forwarding to Assign dialog
51 ::css::uno::Reference< ::css::frame::XFrame > m_xDocumentFrame;
52
54
56
57 DECL_LINK(MacroSelectHdl, weld::TreeView&, void);
58 DECL_LINK(MacroDoubleClickHdl, weld::TreeView&, bool);
59 DECL_LINK(BasicSelectHdl, weld::TreeView&, void);
60 DECL_LINK(EditModifyHdl, weld::Entry&, void);
61 DECL_LINK(ContextMenuHdl, const CommandEvent&, bool);
62 DECL_LINK(ButtonHdl, weld::Button&, void);
63
64 void CheckButtons();
65 void SaveSetCurEntry(weld::TreeView& rBox, const weld::TreeIter& rEntry);
66 void UpdateFields();
67
68 void EnableButton(weld::Button& rButton, bool bEnable);
69
70 static OUString GetInfo( SbxVariable* pVar );
71
74
75 std::unique_ptr<weld::Entry> m_xMacroNameEdit;
76 std::unique_ptr<weld::Label> m_xMacroFromTxT;
77 std::unique_ptr<weld::Label> m_xMacrosSaveInTxt;
78 std::unique_ptr<SbTreeListBox> m_xBasicBox;
79 std::unique_ptr<weld::TreeIter> m_xBasicBoxIter;
80 std::unique_ptr<weld::Label> m_xMacrosInTxt;
81 std::unique_ptr<weld::TreeView> m_xMacroBox;
82 std::unique_ptr<weld::TreeIter> m_xMacroBoxIter;
83 std::unique_ptr<weld::Button> m_xRunButton;
84 std::unique_ptr<weld::Button> m_xCloseButton;
85 std::unique_ptr<weld::Button> m_xAssignButton;
86 std::unique_ptr<weld::Button> m_xEditButton;
87 std::unique_ptr<weld::Button> m_xDelButton;
88 std::unique_ptr<weld::Button> m_xNewButton;
89 std::unique_ptr<weld::Button> m_xOrganizeButton;
90 std::unique_ptr<weld::Button> m_xNewLibButton;
91 std::unique_ptr<weld::Button> m_xNewModButton;
92public:
93 MacroChooser(weld::Window *pParent, const ::css::uno::Reference< ::css::frame::XFrame >& xDocFrame);
94 virtual ~MacroChooser() override;
95
97 void DeleteMacro();
99
100 virtual short run() override;
101
102 void SetMode (Mode);
103 Mode GetMode () const { return nMode; }
104};
105
106} // namespace basctl
107
108/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
OUString m_aMacrosInTxtBaseStr
Definition: macrodlg.hxx:48
SbMethod * CreateMacro()
Definition: macrodlg.cxx:295
std::unique_ptr< weld::TreeIter > m_xBasicBoxIter
Definition: macrodlg.hxx:79
virtual ~MacroChooser() override
Definition: macrodlg.cxx:114
DECL_LINK(BasicSelectHdl, weld::TreeView &, void)
::css::uno::Reference< ::css::frame::XFrame > m_xDocumentFrame
Definition: macrodlg.hxx:51
SbMethod * GetMacro()
Definition: macrodlg.cxx:239
void EnableButton(weld::Button &rButton, bool bEnable)
Definition: macrodlg.cxx:226
void SaveSetCurEntry(weld::TreeView &rBox, const weld::TreeIter &rEntry)
Definition: macrodlg.cxx:358
std::unique_ptr< weld::Button > m_xAssignButton
Definition: macrodlg.hxx:85
DECL_LINK(MacroDoubleClickHdl, weld::TreeView &, bool)
std::unique_ptr< weld::Button > m_xRunButton
Definition: macrodlg.hxx:83
std::unique_ptr< weld::Label > m_xMacrosInTxt
Definition: macrodlg.hxx:80
Mode GetMode() const
Definition: macrodlg.hxx:103
void StoreMacroDescription()
Definition: macrodlg.cxx:123
std::unique_ptr< weld::Button > m_xDelButton
Definition: macrodlg.hxx:87
std::unique_ptr< weld::TreeView > m_xMacroBox
Definition: macrodlg.hxx:81
std::unique_ptr< SbTreeListBox > m_xBasicBox
Definition: macrodlg.hxx:78
virtual short run() override
Definition: macrodlg.cxx:178
std::unique_ptr< weld::Entry > m_xMacroNameEdit
Definition: macrodlg.hxx:75
std::unique_ptr< weld::Button > m_xCloseButton
Definition: macrodlg.hxx:84
void RestoreMacroDescription()
Definition: macrodlg.cxx:143
std::unique_ptr< weld::TreeIter > m_xMacroBoxIter
Definition: macrodlg.hxx:82
DECL_LINK(MacroSelectHdl, weld::TreeView &, void)
std::unique_ptr< weld::Label > m_xMacroFromTxT
Definition: macrodlg.hxx:76
std::unique_ptr< weld::Button > m_xEditButton
Definition: macrodlg.hxx:86
std::unique_ptr< weld::Button > m_xNewModButton
Definition: macrodlg.hxx:91
void SetMode(Mode)
Definition: macrodlg.cxx:820
DECL_LINK(ButtonHdl, weld::Button &, void)
std::unique_ptr< weld::Button > m_xNewLibButton
Definition: macrodlg.hxx:90
DECL_LINK(ContextMenuHdl, const CommandEvent &, bool)
static OUString GetInfo(SbxVariable *pVar)
Definition: macrodlg.cxx:867
DECL_LINK(EditModifyHdl, weld::Entry &, void)
std::unique_ptr< weld::Button > m_xOrganizeButton
Definition: macrodlg.hxx:89
std::unique_ptr< weld::Button > m_xNewButton
Definition: macrodlg.hxx:88
MacroChooser(weld::Window *pParent, const ::css::uno::Reference< ::css::frame::XFrame > &xDocFrame)
Definition: macrodlg.cxx:53
std::unique_ptr< weld::Label > m_xMacrosSaveInTxt
Definition: macrodlg.hxx:77
MacroExitCode
Definition: macrodlg.hxx:31
@ Macro_New
Definition: macrodlg.hxx:34
@ Macro_Close
Definition: macrodlg.hxx:32
@ Macro_OkRun
Definition: macrodlg.hxx:33
@ Macro_Edit
Definition: macrodlg.hxx:35