LibreOffice Module dbaccess (master) 1
TableDesignHelpBar.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
21#include <helpids.h>
22
23using namespace dbaui;
24
25#define DETAILS_MIN_HELP_WIDTH 200
26
27OTableDesignHelpBar::OTableDesignHelpBar(std::unique_ptr<weld::TextView> xTextWin)
28 : m_xTextWin(std::move(xTextWin))
29{
30 m_xTextWin->set_size_request(DETAILS_MIN_HELP_WIDTH, -1);
32}
33
34void OTableDesignHelpBar::SetHelpText(const OUString& rText)
35{
36 if (!m_xTextWin)
37 return;
38 m_xTextWin->set_text(rText);
39}
40
42{
43 int mStartPos, nEndPos;
44 return m_xTextWin && m_xTextWin->get_selection_bounds(mStartPos, nEndPos);
45}
46
47bool OTableDesignHelpBar::isCutAllowed() { return false; }
48
50
52
54{
55 if (!m_xTextWin)
56 return;
57 m_xTextWin->copy_clipboard();
58}
59
61
62/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
#define DETAILS_MIN_HELP_WIDTH
virtual void copy() override
virtual void paste() override
virtual void cut() override
void SetHelpText(const OUString &rText)
virtual bool isCutAllowed() override
std::unique_ptr< weld::TextView > m_xTextWin
virtual bool isCopyAllowed() override
virtual bool isPasteAllowed() override
constexpr OUStringLiteral HID_TAB_DESIGN_HELP_TEXT_FRAME
Definition: helpids.h:50