merge the formfield patch from ooo-build
[ooovba.git] / dbaccess / source / ui / inc / TableDesignView.hxx
blobba9ddcd8981b8c8f46f97ec8618c9befcedcc675
1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: TableDesignView.hxx,v $
10 * $Revision: 1.13 $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef DBAUI_TABLEDESIGNVIEW_HXX
31 #define DBAUI_TABLEDESIGNVIEW_HXX
33 #ifndef DBAUI_DATAVIEW_HXX
34 #include "dataview.hxx"
35 #endif
36 #ifndef _COM_SUN_STAR_BEANS_XPROPERTYSET_HPP_
37 #include <com/sun/star/beans/XPropertySet.hpp>
38 #endif
39 #ifndef _COM_SUN_STAR_FRAME_XCONTROLLER_HPP_
40 #include <com/sun/star/frame/XController.hpp>
41 #endif
42 #ifndef _SV_SPLIT_HXX
43 #include <vcl/split.hxx>
44 #endif
45 #ifndef DBACCESS_TABLEDESIGN_ICLIPBOARDTEST_HXX
46 #include "IClipBoardTest.hxx"
47 #endif
49 namespace dbaui
51 class OTableController;
52 class OTableFieldDescWin;
53 class OTableEditorCtrl;
54 //==================================================================
55 class OTableBorderWindow : public Window
57 Splitter m_aHorzSplitter;
58 OTableFieldDescWin* m_pFieldDescWin;
59 OTableEditorCtrl* m_pEditorCtrl;
61 void ImplInitSettings( BOOL bFont, BOOL bForeground, BOOL bBackground );
62 void ArrangeChilds( long nSplitPos ,Rectangle& rRect);
63 DECL_LINK( SplitHdl, Splitter* );
64 protected:
65 virtual void DataChanged(const DataChangedEvent& rDCEvt);
66 public:
67 OTableBorderWindow(Window* pParent);
68 ~OTableBorderWindow();
69 // window overloads
70 virtual void Resize();
71 virtual void GetFocus();
73 OTableEditorCtrl* GetEditorCtrl() const { return m_pEditorCtrl; }
74 OTableFieldDescWin* GetDescWin() const { return m_pFieldDescWin; }
76 //==================================================================
77 class OTableDesignView : public ODataView
78 ,public IClipboardTest
80 enum ChildFocusState
82 DESCRIPTION,
83 EDITOR,
84 NONE
86 private:
87 ::com::sun::star::lang::Locale m_aLocale;
88 OTableBorderWindow* m_pWin;
89 OTableController& m_rController;
90 ChildFocusState m_eChildFocus;
92 IClipboardTest* getActiveChild() const;
93 protected:
96 // return the Rectangle where I can paint myself
97 virtual void resizeDocumentView(Rectangle& rRect);
99 public:
100 OTableDesignView( Window* pParent,
101 const ::com::sun::star::uno::Reference< ::com::sun::star::lang::XMultiServiceFactory >&,
102 OTableController& _rController);
103 virtual ~OTableDesignView();
105 // window overloads
106 virtual long PreNotify( NotifyEvent& rNEvt );
107 virtual void GetFocus();
109 OTableEditorCtrl* GetEditorCtrl() const { return m_pWin ? m_pWin->GetEditorCtrl() : NULL; }
110 OTableFieldDescWin* GetDescWin() const { return m_pWin ? m_pWin->GetDescWin() : NULL; }
111 OTableController& getController() const { return m_rController; }
113 ::com::sun::star::lang::Locale getLocale() const { return m_aLocale;}
115 // IClipboardTest
116 virtual sal_Bool isCutAllowed();
117 virtual sal_Bool isCopyAllowed();
118 virtual sal_Bool isPasteAllowed();
119 virtual sal_Bool hasChildPathFocus() { return HasChildPathFocus(); }
120 virtual void copy();
121 virtual void cut();
122 virtual void paste();
124 // set the view readonly or not
125 virtual void setReadOnly(sal_Bool _bReadOnly);
127 virtual void initialize();
128 void reSync(); // resync window data with realdata
130 DECL_LINK( SwitchHdl, Accelerator* );
133 #endif // DBAUI_TABLEDESIGNVIEW_HXX