LibreOffice Module basctl (master) 1
ObjectCatalog.cxx
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#include <strings.hrc>
21#include <iderid.hxx>
22
23#include <ObjectCatalog.hxx>
24#include <helpids.h>
25
26#include <vcl/taskpanelist.hxx>
27
28namespace basctl
29{
31 : DockingWindow(pParent, "modules/BasicIDE/ui/dockingorganizer.ui", "DockingOrganizer")
32{
33 m_xTitle = m_xBuilder->weld_label("title");
34 m_xTree.reset(new SbTreeListBox(m_xBuilder->weld_tree_view("libraries"), GetFrameWeld()));
35
36 SetHelpId("basctl:FloatingWindow:RID_BASICIDE_OBJCAT");
37 SetText(IDEResId(RID_BASICIDE_OBJCAT));
38
39 // title
40 m_xTitle->set_label(IDEResId(RID_BASICIDE_OBJCAT));
41
42 // tree list
43 weld::TreeView& rWidget = m_xTree->get_widget();
44
46 m_xTree->ScanAllEntries();
47 rWidget.grab_focus();
48
49 // make object catalog keyboard accessible
51}
52
54
56{
58 m_xTitle.reset();
59 m_xTree.reset();
61}
62
63// ToggleFloatingMode() -- called by DockingWindow when IsFloatingMode() changes
65{
66 // base class version
68
69 bool const bFloating = IsFloatingMode();
70 // tdf#152154: m_xTitle will be null during disposing
71 if (m_xTitle)
72 m_xTitle->set_visible(!bFloating);
73}
74
76{
77 EntryDescriptor aDescriptor;
78 if (pCurWin)
79 aDescriptor = pCurWin->CreateEntryDescriptor();
80 m_xTree->SetCurrentEntry(aDescriptor);
81}
82
83} // namespace basctl
84
85/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
bool IsFloatingMode() const
virtual void SetText(const OUString &rStr) override
TaskPaneList * GetTaskPaneList()
void AddWindow(vcl::Window *pWindow)
void RemoveWindow(vcl::Window *pWindow)
virtual EntryDescriptor CreateEntryDescriptor()=0
virtual void ToggleFloatingMode() override
Definition: bastypes.cxx:422
std::unique_ptr< weld::Builder > m_xBuilder
Definition: bastypes.hxx:105
virtual void dispose() override
Definition: bastypes.cxx:336
virtual void ToggleFloatingMode() override
std::unique_ptr< weld::Label > m_xTitle
Title of the Object Catalog window.
std::unique_ptr< SbTreeListBox > m_xTree
The Treelist of the objects in window.
virtual void dispose() override
virtual ~ObjectCatalog() override
void SetCurrentEntry(BaseWindow *pCurWin)
ObjectCatalog(vcl::Window *pParent)
vcl::Window * GetParent() const
SystemWindow * GetSystemWindow() const
weld::Window * GetFrameWeld() const
void SetHelpId(const OUString &)
virtual void grab_focus()=0
virtual void set_help_id(const OUString &rName)=0
constexpr OUStringLiteral HID_BASICIDE_OBJECTCAT
Definition: helpids.h:23
OUString IDEResId(TranslateId aId)
Definition: iderdll.cxx:108