LibreOffice Module sw (master)  1
vbatablehelper.hxx
Go to the documentation of this file.
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_SW_SOURCE_UI_VBA_VBATABLEHELPER_HXX
20 #define INCLUDED_SW_SOURCE_UI_VBA_VBATABLEHELPER_HXX
21 
22 #include <com/sun/star/text/XTextTable.hpp>
23 #include "wordvbahelper.hxx"
24 #include <swtable.hxx>
25 #include <tabcol.hxx>
26 
28 {
29 private:
30  css::uno::Reference< css::text::XTextTable > mxTextTable;
32 
33 private:
35  SwTableBox* GetTabBox( sal_Int32 nCol, sal_Int32 nRow );
36  void InitTabCols( SwTabCols& rCols, const SwTableBox *pStart );
37  static sal_Int32 GetRightSeparator( SwTabCols const & rCols, sal_Int32 nNum);
38  static sal_Int32 GetColCount( SwTabCols const & rCols );
40  static sal_Int32 GetColWidth( SwTabCols& rCols, sal_Int32 nNum );
41 
42 public:
44  explicit SwVbaTableHelper( const css::uno::Reference< css::text::XTextTable >& xTextTable );
46  sal_Int32 getTabColumnsCount( sal_Int32 nRowIndex );
48  sal_Int32 getTabColumnsMaxCount( );
50  sal_Int32 getTabRowIndex( const OUString& sCellName );
52  sal_Int32 getTabColIndex( const OUString& sCellName );
54  sal_Int32 getTableWidth( );
55 
57  sal_Int32 GetColWidth( sal_Int32 nCol, sal_Int32 nRow = 0 );
59  void SetColWidth( sal_Int32 _width, sal_Int32 nCol, sal_Int32 nRow = 0, bool bCurRowOnly = false );
60 
62  static SwTable* GetSwTable( const css::uno::Reference< css::text::XTextTable >& xTextTable );
63  static OUString getColumnStr( sal_Int32 nCol );
64 };
65 
66 #endif
67 
68 /* vim:set shiftwidth=4 softtabstop=4 expandtab: */
sal_Int32 getTableWidth()
static sal_Int32 GetColWidth(SwTabCols &rCols, sal_Int32 nNum)
SwTableBox * GetTabBox(sal_Int32 nCol, sal_Int32 nRow)
void InitTabCols(SwTabCols &rCols, const SwTableBox *pStart)
sal_Int32 getTabColIndex(const OUString &sCellName)
void SetColWidth(sal_Int32 _width, sal_Int32 nCol, sal_Int32 nRow=0, bool bCurRowOnly=false)
static sal_Int32 GetRightSeparator(SwTabCols const &rCols, sal_Int32 nNum)
sal_Int32 getTabColumnsCount(sal_Int32 nRowIndex)
css::uno::Reference< css::text::XTextTable > mxTextTable
static OUString getColumnStr(sal_Int32 nCol)
sal_Int32 getTabColumnsMaxCount()
SwTable is one table in the document model, containing rows (which contain cells).
Definition: swtable.hxx:110
SwVbaTableHelper(const css::uno::Reference< css::text::XTextTable > &xTextTable)
SwTableBox is one table cell in the document model.
Definition: swtable.hxx:386
static sal_Int32 GetColCount(SwTabCols const &rCols)
static SwTable * GetSwTable(const css::uno::Reference< css::text::XTextTable > &xTextTable)
sal_Int32 getTabRowIndex(const OUString &sCellName)