Update git submodules
[LibreOffice.git] / dbaccess / source / ui / tabledesign / TableFieldDescWin.hxx
blobf14e468c561e28e39ae754445cf70d27da8b11b6
1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 /*
3 * This file is part of the LibreOffice project.
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/.
9 * This file incorporates work covered by the following license notice:
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 .
19 #pragma once
21 #include <IClipBoardTest.hxx>
22 #include <ChildWindow.hxx>
23 #include "TableFieldControl.hxx"
24 #include <TableDesignHelpBar.hxx>
26 namespace dbaui
28 class OTableDesignView;
29 class OFieldDescription;
31 class OTableFieldDescWin final : public OChildWindow
32 , public IClipboardTest
34 enum ChildFocusState
36 DESCRIPTION,
37 HELP,
38 NONE
40 private:
41 OTableDesignHelpBar m_aHelpBar;
42 std::unique_ptr<weld::Container> m_xBox;
43 std::unique_ptr<OTableFieldControl> m_xFieldControl;
44 std::unique_ptr<weld::Label> m_xHeader;
45 Link<weld::Widget&, void> m_aFocusInHdl;
47 ChildFocusState m_eChildFocus;
49 IClipboardTest* getActiveChild() const;
51 DECL_LINK(HelpFocusIn, weld::Widget&, void);
52 DECL_LINK(FieldFocusIn, weld::Widget&, void);
54 public:
55 explicit OTableFieldDescWin(weld::Container* pParent, OTableDesignView* pView);
56 virtual ~OTableFieldDescWin() override;
58 void Init();
60 void DisplayData( OFieldDescription* pFieldDescr );
61 void SaveData( OFieldDescription* pFieldDescr );
62 void SetReadOnly( bool bReadOnly );
64 void SetControlText( sal_uInt16 nControlId, const OUString& rText )
65 { m_xFieldControl->SetControlText(nControlId,rText); }
67 OUString BoolStringPersistent(std::u16string_view rUIString) const { return m_xFieldControl->BoolStringPersistent(rUIString); }
68 OUString BoolStringUI(const OUString& rPersistentString) const { return m_xFieldControl->BoolStringUI(rPersistentString); }
70 virtual bool HasChildPathFocus() const override;
71 virtual void GrabFocus() override;
73 // IClipboardTest
74 virtual bool isCutAllowed() override;
75 virtual bool isCopyAllowed() override;
76 virtual bool isPasteAllowed() override;
78 virtual void copy() override;
79 virtual void cut() override;
80 virtual void paste() override;
82 void connect_focus_in(const Link<weld::Widget&, void>& rLink)
84 m_aFocusInHdl = rLink;
87 OTableFieldControl* getGenPage() const { return m_xFieldControl.get(); }
91 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */