fix baseline build (old cairo) - 'cairo_rectangle_int_t' does not name a type
[LibreOffice.git] / dbaccess / source / ui / inc / TableDesignView.hxx
blob7a1016f6753fa0fd97b5d8b455e467c569ced8b1
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( bool bFont, bool bForeground, bool bBackground );
40 void ArrangeChildren( long nSplitPos ,Rectangle& rRect);
41 DECL_LINK( SplitHdl, Splitter* );
42 protected:
43 virtual void DataChanged(const DataChangedEvent& rDCEvt) SAL_OVERRIDE;
44 public:
45 OTableBorderWindow(vcl::Window* pParent);
46 virtual ~OTableBorderWindow();
47 // Window overrides
48 virtual void dispose() SAL_OVERRIDE;
49 virtual void Resize() SAL_OVERRIDE;
50 virtual void GetFocus() SAL_OVERRIDE;
52 OTableEditorCtrl* GetEditorCtrl() const { return m_pEditorCtrl; }
53 OTableFieldDescWin* GetDescWin() const { return m_pFieldDescWin; }
55 class OTableDesignView : public ODataView
56 ,public IClipboardTest
58 enum ChildFocusState
60 DESCRIPTION,
61 EDITOR,
62 NONE
64 private:
65 ::com::sun::star::lang::Locale m_aLocale;
66 VclPtr<OTableBorderWindow> m_pWin;
67 OTableController& m_rController;
68 ChildFocusState m_eChildFocus;
70 IClipboardTest* getActiveChild() const;
71 protected:
73 // return the Rectangle where I can paint myself
74 virtual void resizeDocumentView(Rectangle& rRect) SAL_OVERRIDE;
76 public:
77 OTableDesignView( vcl::Window* pParent,
78 const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >&,
79 OTableController& _rController);
80 virtual ~OTableDesignView();
81 virtual void dispose() SAL_OVERRIDE;
83 // Window overrides
84 virtual bool PreNotify( NotifyEvent& rNEvt ) SAL_OVERRIDE;
85 virtual void GetFocus() SAL_OVERRIDE;
87 OTableEditorCtrl* GetEditorCtrl() const { return m_pWin ? m_pWin->GetEditorCtrl() : NULL; }
88 OTableFieldDescWin* GetDescWin() const { return m_pWin ? m_pWin->GetDescWin() : NULL; }
89 OTableController& getController() const { return m_rController; }
91 ::com::sun::star::lang::Locale getLocale() const { return m_aLocale;}
93 // IClipboardTest
94 virtual bool isCutAllowed() SAL_OVERRIDE;
95 virtual bool isCopyAllowed() SAL_OVERRIDE;
96 virtual bool isPasteAllowed() SAL_OVERRIDE;
97 virtual bool hasChildPathFocus() SAL_OVERRIDE { return HasChildPathFocus(); }
98 virtual void copy() SAL_OVERRIDE;
99 virtual void cut() SAL_OVERRIDE;
100 virtual void paste() SAL_OVERRIDE;
102 // set the view readonly or not
103 void setReadOnly(bool _bReadOnly);
105 virtual void initialize() SAL_OVERRIDE;
106 void reSync(); // resync window data with realdata
109 #endif // INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNVIEW_HXX
111 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */