Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / inc / TableDesignView.hxx
blob3ad829b4eac9127963083f5339969efe8fc97ca5
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 #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNVIEW_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNVIEW_HXX
22 #include <dbaccess/dataview.hxx>
23 #include <com/sun/star/beans/XPropertySet.hpp>
24 #include <com/sun/star/frame/XController.hpp>
25 #include <vcl/split.hxx>
26 #include "IClipBoardTest.hxx"
28 namespace dbaui
30 class OTableController;
31 class OTableFieldDescWin;
32 class OTableEditorCtrl;
33 class OTableBorderWindow : public vcl::Window
35 VclPtr<Splitter> m_aHorzSplitter;
36 VclPtr<OTableFieldDescWin> m_pFieldDescWin;
37 VclPtr<OTableEditorCtrl> m_pEditorCtrl;
39 void ImplInitSettings();
40 DECL_LINK_TYPED( SplitHdl, Splitter*, void );
41 protected:
42 virtual void DataChanged(const DataChangedEvent& rDCEvt) override;
43 public:
44 OTableBorderWindow(vcl::Window* pParent);
45 virtual ~OTableBorderWindow();
46 // Window overrides
47 virtual void dispose() override;
48 virtual void Resize() override;
49 virtual void GetFocus() override;
51 OTableEditorCtrl* GetEditorCtrl() const { return m_pEditorCtrl; }
52 OTableFieldDescWin* GetDescWin() const { return m_pFieldDescWin; }
54 class OTableDesignView : public ODataView
55 ,public IClipboardTest
57 enum ChildFocusState
59 DESCRIPTION,
60 EDITOR,
61 NONE
63 private:
64 css::lang::Locale m_aLocale;
65 VclPtr<OTableBorderWindow> m_pWin;
66 OTableController& m_rController;
67 ChildFocusState m_eChildFocus;
69 IClipboardTest* getActiveChild() const;
70 protected:
72 // return the Rectangle where I can paint myself
73 virtual void resizeDocumentView(Rectangle& rRect) override;
75 public:
76 OTableDesignView( vcl::Window* pParent,
77 const css::uno::Reference< css::uno::XComponentContext >&,
78 OTableController& _rController);
79 virtual ~OTableDesignView();
80 virtual void dispose() override;
82 // Window overrides
83 virtual bool PreNotify( NotifyEvent& rNEvt ) override;
84 virtual void GetFocus() override;
86 OTableEditorCtrl* GetEditorCtrl() const { return m_pWin ? m_pWin->GetEditorCtrl() : nullptr; }
87 OTableFieldDescWin* GetDescWin() const { return m_pWin ? m_pWin->GetDescWin() : nullptr; }
88 OTableController& getController() const { return m_rController; }
90 const css::lang::Locale& getLocale() const { return m_aLocale;}
92 // IClipboardTest
93 virtual bool isCutAllowed() override;
94 virtual bool isCopyAllowed() override;
95 virtual bool isPasteAllowed() override;
96 virtual void copy() override;
97 virtual void cut() override;
98 virtual void paste() override;
100 // set the view readonly or not
101 void setReadOnly(bool _bReadOnly);
103 virtual void initialize() override;
104 void reSync(); // resync window data with realdata
107 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNVIEW_HXX
109 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */