1 /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
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 DBAUI_TABLEDESIGNVIEW_HXX
20 #define DBAUI_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"
30 class OTableController
;
31 class OTableFieldDescWin
;
32 class OTableEditorCtrl
;
33 //==================================================================
34 class OTableBorderWindow
: public Window
36 Splitter m_aHorzSplitter
;
37 OTableFieldDescWin
* m_pFieldDescWin
;
38 OTableEditorCtrl
* m_pEditorCtrl
;
40 void ImplInitSettings( sal_Bool bFont
, sal_Bool bForeground
, sal_Bool bBackground
);
41 void ArrangeChildren( long nSplitPos
,Rectangle
& rRect
);
42 DECL_LINK( SplitHdl
, Splitter
* );
44 virtual void DataChanged(const DataChangedEvent
& rDCEvt
);
46 OTableBorderWindow(Window
* pParent
);
47 ~OTableBorderWindow();
49 virtual void Resize();
50 virtual void GetFocus();
52 OTableEditorCtrl
* GetEditorCtrl() const { return m_pEditorCtrl
; }
53 OTableFieldDescWin
* GetDescWin() const { return m_pFieldDescWin
; }
55 //==================================================================
56 class OTableDesignView
: public ODataView
57 ,public IClipboardTest
66 ::com::sun::star::lang::Locale m_aLocale
;
67 OTableBorderWindow
* m_pWin
;
68 OTableController
& m_rController
;
69 ChildFocusState m_eChildFocus
;
71 IClipboardTest
* getActiveChild() const;
75 // return the Rectangle where I can paint myself
76 virtual void resizeDocumentView(Rectangle
& rRect
);
79 OTableDesignView( Window
* pParent
,
80 const ::com::sun::star::uno::Reference
< ::com::sun::star::uno::XComponentContext
>&,
81 OTableController
& _rController
);
82 virtual ~OTableDesignView();
85 virtual long PreNotify( NotifyEvent
& rNEvt
);
86 virtual void GetFocus();
88 OTableEditorCtrl
* GetEditorCtrl() const { return m_pWin
? m_pWin
->GetEditorCtrl() : NULL
; }
89 OTableFieldDescWin
* GetDescWin() const { return m_pWin
? m_pWin
->GetDescWin() : NULL
; }
90 OTableController
& getController() const { return m_rController
; }
92 ::com::sun::star::lang::Locale
getLocale() const { return m_aLocale
;}
95 virtual sal_Bool
isCutAllowed();
96 virtual sal_Bool
isCopyAllowed();
97 virtual sal_Bool
isPasteAllowed();
98 virtual sal_Bool
hasChildPathFocus() { return HasChildPathFocus(); }
101 virtual void paste();
103 // set the view readonly or not
104 virtual void setReadOnly(sal_Bool _bReadOnly
);
106 virtual void initialize();
107 void reSync(); // resync window data with realdata
110 #endif // DBAUI_TABLEDESIGNVIEW_HXX
112 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */