Gtk-WARNING gtktreestore.c:1047: Invalid column number 1 added to iter
[LibreOffice.git] / dbaccess / source / ui / inc / TableDesignControl.hxx
blob89debc9e1125a74a8ee16b105d427adc4109bbd0
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 #pragma once
21 #include <svtools/editbrowsebox.hxx>
23 #include "IClipBoardTest.hxx"
24 #include "TypeInfo.hxx"
26 namespace dbaui
28 class OTableDesignView;
30 class OTableRowView : public ::svt::EditBrowseBox, public IClipboardTest
32 friend class OTableDesignUndoAct;
34 protected:
35 tools::Long m_nDataPos; ///< currently needed row
36 tools::Long m_nCurrentPos; ///< current position of selected column
38 private:
39 sal_uInt16 m_nCurUndoActId;
41 public:
42 OTableRowView(vcl::Window* pParent);
44 virtual void SetCellData( sal_Int32 nRow, sal_uInt16 nColId, const TOTypeInfoSP& _pTypeInfo ) = 0;
45 virtual void SetCellData( sal_Int32 nRow, sal_uInt16 nColId, const css::uno::Any& _rNewData ) = 0;
46 virtual css::uno::Any GetCellData( sal_Int32 nRow, sal_uInt16 nColId ) = 0;
47 virtual void SetControlText( sal_Int32 nRow, sal_uInt16 nColId, const OUString& rText ) = 0;
49 virtual OTableDesignView* GetView() const = 0;
51 sal_uInt16 GetCurUndoActId() const { return m_nCurUndoActId; }
53 // IClipboardTest
54 virtual void cut() override;
55 virtual void copy() override;
56 virtual void paste() override;
58 protected:
59 void Paste( sal_Int32 nRow );
61 virtual void CopyRows() = 0;
62 virtual void DeleteRows() = 0;
63 virtual void InsertRows( sal_Int32 nRow ) = 0;
64 virtual void InsertNewRows( sal_Int32 nRow ) = 0;
66 virtual bool IsPrimaryKeyAllowed() = 0;
67 virtual bool IsInsertNewAllowed( sal_Int32 nRow ) = 0;
68 virtual bool IsDeleteAllowed() = 0;
70 virtual RowStatus GetRowStatus(sal_Int32 nRow) const override;
71 virtual void KeyInput(const KeyEvent& rEvt) override;
72 virtual void Command( const CommandEvent& rEvt ) override;
74 virtual void Init() override;
78 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */