Line data Source code
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 : #ifndef INCLUDED_BASCTL_SOURCE_BASICIDE_MACRODLG_HXX
21 : #define INCLUDED_BASCTL_SOURCE_BASICIDE_MACRODLG_HXX
22 :
23 : #include <bastype2.hxx>
24 : #include <sfx2/basedlgs.hxx>
25 :
26 : #include <vcl/button.hxx>
27 :
28 : namespace basctl
29 : {
30 :
31 : enum MacroExitCode {
32 : Macro_Close = 10,
33 : Macro_OkRun = 11,
34 : Macro_New = 12,
35 : Macro_Edit = 14,
36 : };
37 :
38 : class MacroChooser : public SfxModalDialog
39 : {
40 : public:
41 : enum Mode {
42 : All = 1,
43 : ChooseOnly = 2,
44 : Recording = 3,
45 : };
46 :
47 : private:
48 : VclPtr<Edit> m_pMacroNameEdit;
49 : VclPtr<FixedText> m_pMacroFromTxT;
50 : VclPtr<FixedText> m_pMacrosSaveInTxt;
51 : VclPtr<TreeListBox> m_pBasicBox;
52 : VclPtr<FixedText> m_pMacrosInTxt;
53 : OUString m_aMacrosInTxtBaseStr;
54 : VclPtr<SvTreeListBox> m_pMacroBox;
55 :
56 : VclPtr<PushButton> m_pRunButton;
57 : VclPtr<CloseButton> m_pCloseButton;
58 : VclPtr<PushButton> m_pAssignButton;
59 : VclPtr<PushButton> m_pEditButton;
60 : VclPtr<PushButton> m_pDelButton;
61 : VclPtr<PushButton> m_pOrganizeButton;
62 : VclPtr<PushButton> m_pNewLibButton;
63 : VclPtr<PushButton> m_pNewModButton;
64 :
65 : bool bNewDelIsDel;
66 : bool bForceStoreBasic;
67 :
68 : Mode nMode;
69 :
70 : DECL_LINK( MacroSelectHdl, SvTreeListBox * );
71 : DECL_LINK(MacroDoubleClickHdl, void *);
72 : DECL_LINK( BasicSelectHdl, SvTreeListBox * );
73 : DECL_LINK( EditModifyHdl, Edit * );
74 : DECL_LINK( ButtonHdl, Button * );
75 :
76 : void CheckButtons();
77 : void SaveSetCurEntry( SvTreeListBox& rBox, SvTreeListEntry* pEntry );
78 : void UpdateFields();
79 :
80 : void EnableButton( Button& rButton, bool bEnable );
81 :
82 : static OUString GetInfo( SbxVariable* pVar );
83 :
84 : void StoreMacroDescription();
85 : void RestoreMacroDescription();
86 :
87 : public:
88 : MacroChooser( vcl::Window* pParent, bool bCreateEntries = true );
89 : virtual ~MacroChooser();
90 : virtual void dispose() SAL_OVERRIDE;
91 :
92 : SbMethod* GetMacro();
93 : void DeleteMacro();
94 : SbMethod* CreateMacro();
95 :
96 : virtual short Execute() SAL_OVERRIDE;
97 :
98 : void SetMode (Mode);
99 0 : Mode GetMode () const { return nMode; }
100 : };
101 :
102 : } // namespace basctl
103 :
104 : #endif // INCLUDED_BASCTL_SOURCE_BASICIDE_MACRODLG_HXX
105 :
106 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|