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_INC_OBJDLG_HXX
21 #define INCLUDED_BASCTL_SOURCE_INC_OBJDLG_HXX
22 
23 #include "bastype2.hxx"
24 #include "bastypes.hxx"
25 
26 #include <vcl/fixed.hxx>
27 
28 namespace basctl
29 {
30 /*!
31  *  @brief A docking window that contains a tree of the currently loaded macros
32  *
33  *  The class creates Object Catalog window with the currently loaded macros
34  *  in a tree structure which allows user to quickly select the necessary
35  *  macro in BasicIDE.
36  */
37 class ObjectCatalog : public DockingWindow
38 {
39 public:
40     explicit ObjectCatalog(vcl::Window* pParent);
41     virtual ~ObjectCatalog() override;
42     virtual void dispose() override;
43 
44     ///  Update the entries of Object Catalog Treelist
UpdateEntries()45     void UpdateEntries() { aTree->UpdateEntries(); }
46     void SetCurrentEntry(BaseWindow* pCurWin);
47 
48 private:
49     VclPtr<FixedText> aTitle; ///< Title of the Object Catalog window
50     VclPtr<TreeListBox> aTree; ///< The Treelist of the objects in window
51 
52     /// Function is called by Window. Use only for arranging the controls.
53     virtual void Resize() override;
54     /*!
55      *  Function for resize by DockingWindow.
56      *  It is called by DockingWindow when IsFloatingMode() changes.
57      */
58     virtual void ToggleFloatingMode() override;
59 
60     /// Uses by Resize() and ToggleFloatingMode() functions for resizing
61     void ArrangeWindows();
62 };
63 
64 } // namespace basctl
65 
66 #endif // INCLUDED_BASCTL_SOURCE_INC_OBJDLG_HXX
67 
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
69