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 INCLUDED_SW_SOURCE_UI_VBA_VBATABLEHELPER_HXX
20 #define INCLUDED_SW_SOURCE_UI_VBA_VBATABLEHELPER_HXX
22 #include <com/sun/star/text/XTextTable.hpp>
23 #include <swtable.hxx>
26 class SwVbaTableHelper
29 css::uno::Reference
< css::text::XTextTable
> mxTextTable
;
33 /// @throws css::uno::RuntimeException
34 SwTableBox
* GetTabBox( sal_Int32 nCol
, sal_Int32 nRow
);
35 void InitTabCols( SwTabCols
& rCols
, const SwTableBox
*pStart
);
36 static sal_Int32
GetRightSeparator( SwTabCols
const & rCols
, sal_Int32 nNum
);
37 static sal_Int32
GetColCount( SwTabCols
const & rCols
);
38 /// @throws css::uno::RuntimeException
39 static sal_Int32
GetColWidth( SwTabCols
& rCols
, sal_Int32 nNum
);
42 /// @throws css::uno::RuntimeException
43 explicit SwVbaTableHelper( css::uno::Reference
< css::text::XTextTable
> xTextTable
);
44 /// @throws css::uno::RuntimeException
45 sal_Int32
getTabColumnsCount( sal_Int32 nRowIndex
);
46 /// @throws css::uno::RuntimeException
47 sal_Int32
getTabColumnsMaxCount( );
48 /// @throws css::uno::RuntimeException
49 sal_Int32
getTabRowIndex( const OUString
& sCellName
);
50 /// @throws css::uno::RuntimeException
51 sal_Int32
getTabColIndex( const OUString
& sCellName
);
52 /// @throws css::uno::RuntimeException
53 sal_Int32
getTableWidth( ) const;
55 /// @throws css::uno::RuntimeException
56 sal_Int32
GetColWidth( sal_Int32 nCol
, sal_Int32 nRow
= 0 );
57 /// @throws css::uno::RuntimeException
58 void SetColWidth( sal_Int32 _width
, sal_Int32 nCol
, sal_Int32 nRow
= 0, bool bCurRowOnly
= false );
60 /// @throws css::uno::RuntimeException
61 static SwTable
* GetSwTable( const css::uno::Reference
< css::text::XTextTable
>& xTextTable
);
62 static OUString
getColumnStr( sal_Int32 nCol
);
67 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */