Version 5.2.6.1, tag libreoffice-5.2.6.1
[LibreOffice.git] / dbaccess / source / ui / inc / TableDesignControl.hxx
bloba4845f45e13eb13de71ab3b1f7967ffcbb386117
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_TABLEDESIGNCONTROL_HXX
20 #define INCLUDED_DBACCESS_SOURCE_UI_INC_TABLEDESIGNCONTROL_HXX
22 #include <svtools/tabbar.hxx>
23 #include <svtools/editbrowsebox.hxx>
25 #include "IClipBoardTest.hxx"
26 #include "TypeInfo.hxx"
28 namespace dbaui
30 class OTableDesignView;
32 class OTableRowView : public ::svt::EditBrowseBox, public IClipboardTest
34 friend class OTableDesignUndoAct;
36 protected:
37 long m_nDataPos; ///< currently needed row
38 long m_nCurrentPos; ///< current position of selected column
40 private:
41 sal_uInt16 m_nCurUndoActId;
43 protected:
44 bool m_bClipboardFilled;
46 public:
47 OTableRowView(vcl::Window* pParent);
49 virtual void SetCellData( long nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0;
50 virtual void SetCellData( long nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) = 0;
51 virtual css::uno::Any GetCellData( long nRow, sal_uInt16 nColId ) = 0;
52 virtual void SetControlText( long nRow, sal_uInt16 nColId, const OUString& rText ) = 0;
54 virtual OTableDesignView* GetView() const = 0;
56 sal_uInt16 GetCurUndoActId(){ return m_nCurUndoActId; }
58 // IClipboardTest
59 virtual void cut() override;
60 virtual void copy() override;
61 virtual void paste() override;
63 protected:
64 void Paste( long nRow );
66 virtual void CopyRows() = 0;
67 virtual void DeleteRows() = 0;
68 virtual void InsertRows( long nRow ) = 0;
69 virtual void InsertNewRows( long nRow ) = 0;
71 virtual bool IsPrimaryKeyAllowed( long nRow ) = 0;
72 virtual bool IsInsertNewAllowed( long nRow ) = 0;
73 virtual bool IsDeleteAllowed( long nRow ) = 0;
75 virtual RowStatus GetRowStatus(long nRow) const override;
76 virtual void KeyInput(const KeyEvent& rEvt) override;
77 virtual void Command( const CommandEvent& rEvt ) override;
79 virtual void Init() override;
82 #endif
84 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */