LibreOffice Module dbaccess (master) 1
TableFieldDescWin.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 "TableFieldDescWin.hxx"
21#include <FieldDescriptions.hxx>
22#include <strings.hrc>
24#include <helpids.h>
25#include <core_resource.hxx>
26
27using namespace dbaui;
28
29OTableFieldDescWin::OTableFieldDescWin(weld::Container* pParent, OTableDesignView* pView)
30 : OChildWindow(pParent, "dbaccess/ui/fielddescpanel.ui", "FieldDescPanel")
31 , m_aHelpBar(m_xBuilder->weld_text_view("textview"))
32 , m_xBox(m_xBuilder->weld_container("box"))
33 , m_xFieldControl(new OTableFieldControl(m_xBox.get(), &m_aHelpBar, pView))
34 , m_xHeader(m_xBuilder->weld_label("header"))
35 , m_eChildFocus(NONE)
36{
37 // Header
38 m_xHeader->set_label(DBA_RES(STR_TAB_PROPERTIES));
39
41
43 m_xFieldControl->connect_focus_in(LINK(this, OTableFieldDescWin, FieldFocusIn));
44}
45
47{
48 return m_xFieldControl->HasChildPathFocus() || m_aHelpBar.HasFocus();
49}
50
52{
53}
54
56{
57 m_xFieldControl->Init();
58}
59
61{
62 m_xFieldControl->SetReadOnly( bRead );
63}
64
66{
67 m_xFieldControl->DisplayData( pFieldDescr );
68}
69
71{
72 m_xFieldControl->SaveData( pFieldDescr );
73}
74
76{
77 IClipboardTest* pTest = nullptr;
78 switch(m_eChildFocus)
79 {
80 case DESCRIPTION:
81 pTest = m_xFieldControl.get();
82 break;
83 default:
84 pTest = const_cast<OTableDesignHelpBar*>(&m_aHelpBar);
85 break;
86 }
87 return pTest;
88}
89
91{
93}
94
96{
98}
99
101{
103}
104
106{
107 if (getActiveChild())
108 getActiveChild()->cut();
109}
110
112{
113 if ( getActiveChild() )
114 getActiveChild()->copy();
115}
116
118{
119 if (getActiveChild())
121}
122
124{
125 m_xFieldControl->GrabFocus();
126}
127
128IMPL_LINK(OTableFieldDescWin, HelpFocusIn, weld::Widget&, rWidget, void)
129{
130 m_eChildFocus = HELP;
131 m_aFocusInHdl.Call(rWidget);
132}
133
134IMPL_LINK(OTableFieldDescWin, FieldFocusIn, weld::Widget&, rWidget, void)
135{
136 m_eChildFocus = DESCRIPTION;
137 m_aFocusInHdl.Call(rWidget);
138}
139
140/* vim:set shiftwidth=4 softtabstop=4 expandtab: */
virtual void copy()=0
virtual bool isCutAllowed()=0
virtual void cut()=0
virtual bool isPasteAllowed()=0
virtual void paste()=0
virtual bool isCopyAllowed()=0
void connect_focus_in(const Link< weld::Widget &, void > &rLink)
virtual ~OTableFieldDescWin() override
void SaveData(OFieldDescription *pFieldDescr)
virtual void cut() override
std::unique_ptr< weld::Label > m_xHeader
virtual bool isCutAllowed() override
IClipboardTest * getActiveChild() const
virtual bool HasChildPathFocus() const override
virtual void copy() override
std::unique_ptr< OTableFieldControl > m_xFieldControl
virtual void GrabFocus() override
void DisplayData(OFieldDescription *pFieldDescr)
OTableDesignHelpBar m_aHelpBar
virtual bool isCopyAllowed() override
virtual bool isPasteAllowed() override
virtual void paste() override
void SetReadOnly(bool bReadOnly)
#define DBA_RES(id)
constexpr OUStringLiteral HID_TAB_DESIGN_FIELDCONTROL
Definition: helpids.h:43
NONE
IMPL_LINK(OApplicationController, OnSelectContainer, void *, _pType, void)
css::uno::Reference< css::linguistic2::XProofreadingIterator > get(css::uno::Reference< css::uno::XComponentContext > const &context)