Line data Source code
1 : /* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */
2 : /*
3 : * This file is part of the LibreOffice project.
4 : *
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/.
8 : *
9 : * This file incorporates work covered by the following license notice:
10 : *
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 .
18 : */
19 : #ifndef INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNCONTROL_HXX
20 : #define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNCONTROL_HXX
21 :
22 : #include <svtools/tabbar.hxx>
23 : #include <svtools/editbrowsebox.hxx>
24 :
25 : #include "IClipBoardTest.hxx"
26 : #include "TypeInfo.hxx"
27 :
28 : namespace dbaui
29 : {
30 : class OTableDesignView;
31 :
32 0 : class OTableRowView : public ::svt::EditBrowseBox, public IClipboardTest
33 : {
34 : friend class OTableDesignUndoAct;
35 :
36 : protected:
37 : long m_nDataPos; ///< currently needed row
38 : long m_nCurrentPos; ///< current position of selected column
39 :
40 : private:
41 : sal_uInt16 m_nCurUndoActId;
42 :
43 : protected:
44 : bool m_bCurrentModified;
45 : bool m_bClipboardFilled;
46 :
47 : public:
48 : OTableRowView(vcl::Window* pParent);
49 :
50 : virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0;
51 : virtual void SetCellData( long nRow, sal_uInt16 nColId, const ::com::sun::star::uno::Any& _rNewData ) = 0;
52 : virtual ::com::sun::star::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) = 0;
53 : virtual void SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ) = 0;
54 : virtual OUString GetControlText( long nRow, sal_uInt16 nColId ) = 0;
55 :
56 : virtual OTableDesignView* GetView() const = 0;
57 :
58 0 : sal_uInt16 GetCurUndoActId(){ return m_nCurUndoActId; }
59 :
60 : // IClipboardTest
61 : virtual void cut() SAL_OVERRIDE;
62 : virtual void copy() SAL_OVERRIDE;
63 : virtual void paste() SAL_OVERRIDE;
64 :
65 : protected:
66 : void Paste( long nRow );
67 :
68 : virtual void CopyRows() = 0;
69 : virtual void DeleteRows() = 0;
70 : virtual void InsertRows( long nRow ) = 0;
71 : virtual void InsertNewRows( long nRow ) = 0;
72 :
73 : virtual bool IsPrimaryKeyAllowed( long nRow ) = 0;
74 : virtual bool IsInsertNewAllowed( long nRow ) = 0;
75 : virtual bool IsDeleteAllowed( long nRow ) = 0;
76 :
77 : virtual RowStatus GetRowStatus(long nRow) const SAL_OVERRIDE;
78 : virtual void KeyInput(const KeyEvent& rEvt) SAL_OVERRIDE;
79 : virtual void Command( const CommandEvent& rEvt ) SAL_OVERRIDE;
80 :
81 : virtual void Init() SAL_OVERRIDE;
82 : };
83 : }
84 : #endif
85 :
86 : /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
|