diff options
Diffstat (limited to 'offapi/com/sun/star/awt/grid')
22 files changed, 1833 insertions, 0 deletions
diff --git a/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl new file mode 100644 index 000000000..4f7a9a833 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/DefaultGridColumnModel.idl @@ -0,0 +1,38 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_DefaultGridColumnModel_idl__ +#define __com_sun_star_awt_grid_DefaultGridColumnModel_idl__ + +#include <com/sun/star/awt/grid/XGridColumnModel.idl> + + + module com { module sun { module star { module awt { module grid { + + +/** If you do not want to implement the XGridColumnModel yourself, use this service. + @since OOo 3.3 + */ +service DefaultGridColumnModel : com::sun::star::awt::grid::XGridColumnModel; + + +}; }; }; };}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl new file mode 100644 index 000000000..08c17b3ec --- /dev/null +++ b/offapi/com/sun/star/awt/grid/DefaultGridDataModel.idl @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_DefaultGridDataModel_idl__ +#define __com_sun_star_awt_grid_DefaultGridDataModel_idl__ + +#include <com/sun/star/awt/grid/XMutableGridDataModel.idl> + + + module com { module sun { module star { module awt { module grid { + + +/** If you do not want to implement the XGridDataModel yourself, use this service. + + <p>The <code>DefaultGridDataModel</code> implementation is a dumb container of tabular data. You can add + and remove rows, modify cell values, and the like.</p> + + <p>The implementation will implicitly increase its column count if you add a row which has more values than + the current column count.</p> + + @since OOo 3.3 + */ +published service DefaultGridDataModel : ::com::sun::star::awt::grid::XMutableGridDataModel; + + +}; }; }; };}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/GridColumn.idl b/offapi/com/sun/star/awt/grid/GridColumn.idl new file mode 100644 index 000000000..d34604781 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/GridColumn.idl @@ -0,0 +1,42 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_GridColumn_idl__ +#define __com_sun_star_awt_grid_GridColumn_idl__ + +#include <com/sun/star/awt/grid/XGridColumn.idl> + + + module com { module sun { module star { module awt { module grid { + + +/** Represents a column as used by the DefaultGridColumnModel + + @since OOo 3.3 + */ +service GridColumn +{ + interface com::sun::star::awt::grid::XGridColumn; +}; + + +}; }; }; };}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/GridColumnEvent.idl b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl new file mode 100644 index 000000000..2d8dd74e7 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/GridColumnEvent.idl @@ -0,0 +1,51 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_GridColumnEvent_idl__ +#define __com_sun_star_awt_grid_GridColumnEvent_idl__ + +#include <com/sun/star/lang/EventObject.idl> + + +module com { module sun { module star { module awt { module grid { + +/** An event used by a XGridColumn to notify changes in the column. + + @since OOo 3.3 + */ +published struct GridColumnEvent : ::com::sun::star::lang::EventObject +{ + /** Contains the name of the attributes whose value changed. **/ + string AttributeName; + + /** Contains the old value **/ + any OldValue; + + /** Contains the new value **/ + any NewValue; + + /** Contains the index of the changed column**/ + long ColumnIndex; +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/GridDataEvent.idl b/offapi/com/sun/star/awt/grid/GridDataEvent.idl new file mode 100644 index 000000000..922dd34fa --- /dev/null +++ b/offapi/com/sun/star/awt/grid/GridDataEvent.idl @@ -0,0 +1,68 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_GridDataEvent_idl__ +#define __com_sun_star_awt_grid_GridDataEvent_idl__ + +#include <com/sun/star/lang/EventObject.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** used to notify changes in the data represented by an XMutableGridDataModel. + + <p>Effectively, a <code>GridDataEvent</code> denotes a continuous two-dimensional cell range + within a grid's data model, which is affected by a certain change.</p> + + @see XMutableGridDataModel + @see XGridDataListener + + @since OOo 3.3 + */ +published struct GridDataEvent: com::sun::star::lang::EventObject +{ + /** denotes the first column affected by a change. + + <p>If <code>FirstColumn</code> is -1, the listener should assume that all rows of a grid's data model + are affected.</p> + */ + long FirstColumn; + + /** denotes the last column affected by a change + */ + long LastColumn; + + /** denotes the first row affected by a change. + + <p>If <code>FirstRow</code> is -1, the listener should assume that all rows of a grid's data model + are affected.</p> + */ + long FirstRow; + + /** denotes the last row affected by a change + */ + long LastRow; +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl new file mode 100644 index 000000000..6b12a5d82 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/GridInvalidDataException.idl @@ -0,0 +1,44 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_GridInvalidDataException_idl__ +#define __com_sun_star_awt_grid_GridInvalidDataException_idl__ + +#include <com/sun/star/uno/RuntimeException.idl> + + + +module com { module sun { module star { module awt { module grid { + + +/** Exception is thrown to indicate that set data is invalid, e.g. type of data is unknown + or data count doesn't match with column count. + + @since OOo 3.3 + */ +exception GridInvalidDataException : com::sun::star::uno::RuntimeException +{ + +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl new file mode 100644 index 000000000..ab5e03dea --- /dev/null +++ b/offapi/com/sun/star/awt/grid/GridInvalidModelException.idl @@ -0,0 +1,43 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_GridInvalidModelException_idl__ +#define __com_sun_star_awt_grid_GridInvalidModelException_idl__ + +#include <com/sun/star/uno/RuntimeException.idl> + + + +module com { module sun { module star { module awt { module grid { + + +/** Exception is thrown when data or column model isn't set. + + @since OOo 3.3 + */ +exception GridInvalidModelException : com::sun::star::uno::RuntimeException +{ + +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl new file mode 100644 index 000000000..dc441d83f --- /dev/null +++ b/offapi/com/sun/star/awt/grid/GridSelectionEvent.idl @@ -0,0 +1,49 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_GridSelectionEvent_idl__ +#define __com_sun_star_awt_grid_GridSelectionEvent_idl__ + +#include <com/sun/star/lang/EventObject.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** An event used by a XGridControl to notify changes in its row selection. + + @see XGridRowSelection + @see XGridSelectionListener + */ +published struct GridSelectionEvent: com::sun::star::lang::EventObject +{ + /** denotes the indexes of the rows being selected at the time the event was fired. + */ + sequence< long > SelectedRowIndexes; + + /** denotes the indexes of the columns being selected at the time the event was fired. + */ + sequence< long > SelectedColumnIndexes; +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/SortableGridDataModel.idl b/offapi/com/sun/star/awt/grid/SortableGridDataModel.idl new file mode 100644 index 000000000..ca92c1575 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/SortableGridDataModel.idl @@ -0,0 +1,93 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_awt_grid_SortableGridDataModel_idl__ +#define __com_sun_star_awt_grid_SortableGridDataModel_idl__ + +#include <com/sun/star/i18n/XCollator.idl> +#include <com/sun/star/lang/IllegalArgumentException.idl> + + +module com { module sun { module star { module awt { module grid { + +interface XSortableMutableGridDataModel; +interface XMutableGridDataModel; + + +/** provides a default implementation of a XSortableGridData. + + <p>This service must be created with a secondary grid data model, which all actual data requests are delegated to. + But before providing this data to the service's own clients, it is sorted, according to the sort order defined + via the <code>XSortableGridData</code> interface.</p> + + <p>The service implementation is able to compare the default scalar types, plus strings.</p> + + <p>For determining the data type of a column which the data should be sorted by, the first non-`VOID` data encountered + in this column is taken into account. Further read requests to this column will assume that all non-`VOID` data is of + the same type.</p> + + <p>Consequently, you cannot use this service with data sets containing heterogeneous data in a given column.</p> + + <p>All requests made via the XMutableGridDataModel are delegated to the <code>XMutableGridDataModel</code> + instance passed in the service constructor.</p> + + <p>Note that changing the data might result in the sort order being destroyed. If you want to ensure + that the data represented by the model is still sorted after your modifications, you should call + XSortableGridData::sortByColumn(), again.</p> + */ +service SortableGridDataModel : XSortableMutableGridDataModel +{ + /** creates a new instance of the <code>SortableGridDataModel</code> + + <p>For string comparison, a default ::com::sun::star::i18n::Collator, based on the system's + locale, will be used.</p> + + @param DelegatorModel + the data model to which read requests are delegated. + @throws ::com::sun::star::lang::IllegalArgumentException + if the given <code>DelegatorModel</code> is `NULL` + */ + create( + [in] XMutableGridDataModel DelegatorModel + ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); + + /** creates a new instance of the ScortableDefaultGridDataModel, passing a collator to be used for string comparison. + + @param DelegatorModel + is the data model to which read requests are delegated + @param Collator + is the collator to be used for string comparison + @throws ::com::sun::star::lang::IllegalArgumentException + if the given <code>DelegatorModel</code> is `NULL` + */ + createWithCollator( + [in] XMutableGridDataModel DelegatorModel, + [in] ::com::sun::star::i18n::XCollator Collator + ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/UnoControlGrid.idl b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl new file mode 100644 index 000000000..caa511256 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/UnoControlGrid.idl @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_UnoControlGrid_idl__ +#define __com_sun_star_awt_grid_UnoControlGrid_idl__ + +#include <com/sun/star/awt/UnoControl.idl> + +#include <com/sun/star/awt/grid/XGridControl.idl> + +#include <com/sun/star/awt/grid/XGridRowSelection.idl> + + + module com { module sun { module star { module awt { module grid { + + + +/** A control that displays a set of tabular data. + + <h4>The Column Model</h4> + + <p>The horizontal structure of the grid is defined by the XGridColumnModel implemented in DefaultGridColumnModel + The XGridColumn implemented in GridColumn describes the properties and behavior of a single column. Use the XGridColumnModel::addColumn() to add a column to the column model. + </p> + + <h4>The Data Model</h4> + <p> All row data are stored in the XGridDataModel. + Use the DefaultGridDataModel to add XGridDataModel::addRow() or remove XGridDataModel::removeRow() rows. + </p> + + <p>The column and data model must be set at the UnoControlGridModel::ColumnModel and UnoControlGridModel::GridDataModel properties.</p> + + <h4>Selection</h4> + <p>If you are interested in knowing when the selection changes implement a + XGridSelectionListener and add the instance with the method + XGridRowSelection::addSelectionListener(). + You than will be notified for any selection change.</p> + + @since OOo 3.3 + */ +service UnoControlGrid +{ + service com::sun::star::awt::UnoControl; + + interface ::com::sun::star::awt::grid::XGridControl; + + interface ::com::sun::star::awt::grid::XGridRowSelection; +}; + + +}; }; }; };}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl new file mode 100644 index 000000000..687a2bd50 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/UnoControlGridModel.idl @@ -0,0 +1,243 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_UnoControlGridModel_idl__ +#define __com_sun_star_awt_grid_UnoControlGridModel_idl__ + +#include <com/sun/star/awt/grid/XGridColumnModel.idl> +#include <com/sun/star/awt/grid/XGridDataModel.idl> +#include <com/sun/star/awt/UnoControlModel.idl> +#include <com/sun/star/view/SelectionType.idl> +#include <com/sun/star/awt/FontDescriptor.idl> +#include <com/sun/star/style/VerticalAlignment.idl> +#include <com/sun/star/util/Color.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** specifies the standard model of a UnoControlGrid control. + + @since OOo 3.3 + */ +published service UnoControlGridModel +{ + /** specifies the standard model of a com::sun::star::awt::UnoControl. */ + service com::sun::star::awt::UnoControlModel; + + /** Specifies whether the grid control should display a special header column. + + <p>The default value is `FALSE`</p> + */ + [property] boolean ShowRowHeader; + + /** specifies the width of the row header column, if applicable. + + <p>The width is specified in application font units - see com::sun::star::util::MeasureUnit.</p> + + <p>The value given here is ignored if #ShowRowHeader is `FALSE`.</p> + */ + [property] long RowHeaderWidth; + + /** Specifies whether the grid control should display a title row. + + <p>The default value is `TRUE`</p> + */ + [property] boolean ShowColumnHeader; + + /** specifies the height of the column header row, if applicable. + + <p>The height is specified in application font units - see com::sun::star::util::MeasureUnit.</p> + + <p>The value given here is ignored if #ShowColumnHeader is `FALSE`.</p> + + <p>If the property is `VOID`, the grid control shall automatically determine a height which conveniently allows, + according to the used font, to display one line of text.</p> + */ + [property, maybevoid] long ColumnHeaderHeight; + + /** Specifies the height of rows in the grid control. + + <p>The height is specified in application font units - see com::sun::star::util::MeasureUnit.</p> + */ + [property, maybevoid] long RowHeight; + + /** Specifies the XGridColumnModel that is providing the column structure. + + <p>You can implement your own instance of XGridColumnModel or use + the DefaultGridColumnModel. + + <p>The column model is in the ownership of the grid model: When you set a new column model, or dispose + the grid model, then the (old) column model is disposed, too.</p> + + <p>The default for this property is an empty instance of the DefaultGridColumnModel.</p> + */ + [property] XGridColumnModel ColumnModel; + + /** Specifies the XGridDataModel that is providing the hierarchical data. + + <p>You can implement your own instance of XGridDataModel or use + the DefaultGridDataModel. + + <p>The data model is in the ownership of the grid model: When you set a new data model, or dispose + the grid model, then the (old) data model is disposed, too.</p> + + <p>The default for this property is an empty instance of the DefaultGridDataModel.</p> + */ + [property] XGridDataModel GridDataModel; + + /** Specifies the vertical scrollbar mode. + <p>The default value is `FALSE`</p> + */ + [property] boolean HScroll; + + /** Specifies the horizontal scrollbar mode. + <p>The default value is `FALSE`</p> + */ + [property] boolean VScroll; + + /** Specifies that the control can be reached with the TAB key. + */ + [property] boolean Tabstop; + + /** Specifies the selection mode that is enabled for this grid control. + <p>The default value is com::sun::star::view::SelectionType::SINGLE</p> + */ + [property] ::com::sun::star::view::SelectionType SelectionModel; + + /** controls whether or not to paint horizontal and vertical lines between the grid cells. + + @see GridLineColor + */ + [property] boolean UseGridLines; + + /** specifies the color to be used when drawing lines between cells + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + + @see UseGridLines + */ + [property, maybevoid] ::com::sun::star::util::Color GridLineColor; + + /** specifies the color to be used when drawing the background of row or column headers + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + */ + [property, maybevoid] ::com::sun::star::util::Color HeaderBackgroundColor; + + /** specifies the color to be used when drawing the text within row or column headers + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + */ + [property, maybevoid] ::com::sun::star::util::Color HeaderTextColor; + + /** specifies the color to be used when drawing the background of selected cells, while the control has the focus. + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + */ + [property, maybevoid] ::com::sun::star::util::Color ActiveSelectionBackgroundColor; + + /** specifies the color to be used when drawing the background of selected cells, while the control does not have + the focus. + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + */ + [property, maybevoid] ::com::sun::star::util::Color InactiveSelectionBackgroundColor; + + /** specifies the color to be used when drawing the text of selected cells, while the control has the focus. + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + */ + [property, maybevoid] ::com::sun::star::util::Color ActiveSelectionTextColor; + + /** specifies the color to be used when drawing the text of selected cells, while the control does not have + the focus. + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + */ + [property, maybevoid] ::com::sun::star::util::Color InactiveSelectionTextColor; + + /** specifies the colors to be used as background for data rows. + + <p>If this sequence is non-empty, the data rows will be rendered with alternating background colors: Assuming + the sequence has <code>n</code> elements, each row will use the background color as specified by its number's + remainder modulo <code>n</code>.</p> + + <p>If this sequence is empty, all rows will use the same background color as the control as whole.</p> + + <p>If this property has a value of `VOID`, rows will be painted + in alternating background colors, every second row having a background color derived from the control's + selection color.</p> + */ + [property, maybevoid] sequence< ::com::sun::star::util::Color > RowBackgroundColors; + + /** specifies the vertical alignment of the content in the control. + */ + [property] com::sun::star::style::VerticalAlignment VerticalAlign; + + /** specifies the font attributes of the text in the control. + */ + [property] com::sun::star::awt::FontDescriptor FontDescriptor; + + /** specifies the color to be used when drawing cell texts + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + */ + [property, maybevoid] ::com::sun::star::util::Color TextColor; + + /** specifies the color to be used when drawing text lines (underlining and strikethrough) + + <p>If this property has a value of `VOID`, the grid control renderer will use some default color, + depending on the control's style settings.</p> + */ + [property, maybevoid] com::sun::star::util::Color TextLineColor; + + /** specifies the com::sun::star::text::FontEmphasis + value of the text in the control. + */ + [property] short FontEmphasisMark; + + /** specifies the com::sun::star::text::FontRelief + value of the text in the control. + */ + [property] short FontRelief; + + /** specifies the help text of the control. + */ + [property] string HelpText; + + /** specifies the help URL of the control. + */ + [property] string HelpURL; + +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XGridColumn.idl b/offapi/com/sun/star/awt/grid/XGridColumn.idl new file mode 100644 index 000000000..74cacb95d --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridColumn.idl @@ -0,0 +1,142 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_XGridColumn_idl__ +#define __com_sun_star_awt_grid_XGridColumn_idl__ + +#include <com/sun/star/lang/XComponent.idl> +#include <com/sun/star/style/HorizontalAlignment.idl> +#include <com/sun/star/lang/IllegalArgumentException.idl> +#include <com/sun/star/awt/grid/XGridColumnListener.idl> +#include <com/sun/star/util/XCloneable.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** The XGridColumn defines the properties and behavior of a column + in a grid control. + @since OOo 3.3 + */ +published interface XGridColumn +{ + /** implements life time control for the component + */ + interface ::com::sun::star::lang::XComponent; + + /** allows cloning the complete grid column + */ + interface ::com::sun::star::util::XCloneable; + + /** specifies an identifier of the column + + <p>This identifier will not be evaluated by the grid control, or its model. It is merely for clients + to identify particular columns.</p> + */ + [attribute] any Identifier; + + /** specifies the current width of the column. + */ + [attribute] long ColumnWidth; + + /** specifies the minimal width the column can have. + */ + [attribute] long MinWidth; + + /** specifies the maximal width the column can have. + */ + [attribute] long MaxWidth; + + /** controls whether or not the column's width is fixed or not. + + <p>If this is `TRUE`, the user can interactively change the column's width. Also, the column is subject to + auto-resizing, if its #Flexibility attribute is greater <code>0</code>.</p> + */ + [attribute] boolean Resizeable; + + /** specifies the flexibility of the column when it is automatically resized due to the grid control as a whole + being resized. + + <p>Specify <code>0</code> here if you do not want the column to be resized automatically.</p> + + <p>If a column has a flexibility greater than 0, it is set in relationship to the flexibility of all + other such columns, and the respective widths of the columns are changed in the same relationship.</p> + + <p>Note that a column's flexibility is ignored if its #Resizeable attribute is + `FALSE`.</p> + + <p>A column's flexibility cannot be negative, attempts to set a negative value will raise an exception.</p> + */ + [attribute] long Flexibility + { + set raises ( ::com::sun::star::lang::IllegalArgumentException ); + }; + + /** Specifies the horizontal alignment of the content in the control. + */ + [attribute] ::com::sun::star::style::HorizontalAlignment HorizontalAlign; + + /** A title is displayed in the column header row if UnoControlGridModel::ShowColumnHeader() is set to `TRUE`**/ + [attribute] string Title; + + /** is the help text associated with the column. + + <p>A grid control will usually display a column's help text as tooltip.</p> + */ + [attribute] string HelpText; + + /** denotes the index of the column within the grid column model it belongs to + + <p>If the column is not yet part of a column model, <code>Index</code> is -1.</p> + */ + [attribute, readonly] long Index; + + /** denotes the index of the data column which should be used to fetch this grid column's data + + <p>A grid control has a column model and a data model, both containing a possibly different number of columns. + The <code>DataColumnIndex</code> attribute defines the index of the column within the data model, which should + be used to retrieve actual data.</p> + + <p>Using this, you can do runtime changes to the column model, i.e. insertion and removal of columns, without + necessarily needing to adjust the data model, too.</p> + + <p>If <code>DataColumnIndex</code> is negative, the it will be ignored, then the column's index within its + column model, as determined by the #Index attribute, will be used.</p> + */ + [attribute] long DataColumnIndex; + + /** Adds a listener for the GridColumnEvent posted after the grid changes. + @param Listener + the listener to add. + */ + void addGridColumnListener( [in] XGridColumnListener Listener); + + + /** Removes a listener previously added with addColumnListener(). + @param Listener + the listener to remove. + */ + void removeGridColumnListener( [in] XGridColumnListener Listener); +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XGridColumnListener.idl b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl new file mode 100644 index 000000000..13a38229c --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridColumnListener.idl @@ -0,0 +1,45 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_XGridColumnListener_idl__ +#define __com_sun_star_awt_grid_XGridColumnListener_idl__ + +#include <com/sun/star/awt/grid/GridColumnEvent.idl> +#include <com/sun/star/lang/XEventListener.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** An instance of this interface is used by the XGridColumnModel to + get notifications about column model changes. + + @since OOo 3.3 + */ +published interface XGridColumnListener : ::com::sun::star::lang::XEventListener +{ + /** Invoked after a column was modified. + */ + void columnChanged( [in] GridColumnEvent event ); +}; + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XGridColumnModel.idl b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl new file mode 100644 index 000000000..3e96e8451 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridColumnModel.idl @@ -0,0 +1,135 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_XGridColumnModel_idl__ +#define __com_sun_star_awt_grid_XGridColumnModel_idl__ + +#include <com/sun/star/uno/XInterface.idl> +#include <com/sun/star/lang/XComponent.idl> +#include <com/sun/star/util/XCloneable.idl> +#include <com/sun/star/awt/grid/XGridColumn.idl> +#include <com/sun/star/container/XContainer.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> +#include <com/sun/star/lang/IllegalArgumentException.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** An instance of this interface is used by the UnoControlGrid to + retrieve the column structure that is displayed in the actual control. + + If you do not need your own model implementation, you can also use the DefaultGridColumnModel. + + @since OOo 3.3 +*/ +published interface XGridColumnModel +{ + /** implements life time control for the component + */ + interface ::com::sun::star::lang::XComponent; + + /** allows to register listeners to be notified when columns are inserted or removed + */ + interface ::com::sun::star::container::XContainer; + + /** allows cloning the complete column model + */ + interface ::com::sun::star::util::XCloneable; + + /** Returns the number of columns. + + @returns + the number of columns. + */ + long getColumnCount(); + + /** creates a new column for use with the column model. + + <p>The newly created column is not yet inserted into the column container, you need to call addColumn() + after you initialized the column object.</p> + */ + XGridColumn + createColumn(); + + /** Adds a column to the model. + + <p>You should use the createColumn() member to create a new column. This gives + implementations of the <code>XGridColumnModel</code> interface the possibility to provide own column + implementations which extend the basic GridColumn type.</p> + + <p>As soon as the column has been inserted into the model, the model takes ownership of it. This means when the + column is removed, or when the column model is disposed, the grid column is disposed as well.</p> + + @param column + the column to add to the model. + @returns + the index of new created column. + + @throws ::com::sun::star::lang::IllegalArgumentException + if the given column is not a valid element for the column container, or if it is `NULL`. + */ + long addColumn( [in] XGridColumn column ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); + + /** removes a column from the model + + <p>The column object will be disposed upon removal.</p> + + @param ColumnIndex + denotes the index of the column to remove + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if <code>ColumnIndex</code> does not denote a valid column index. + */ + void removeColumn( [in] long ColumnIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Returns all columns of the model. + @returns + all columns associated with the model in a sequence of XGridColumn. + */ + sequence<XGridColumn> getColumns(); + + /** Returns a specific column. + @param index + the position of the requested column. + @returns + the requested column. + */ + XGridColumn getColumn( [in] long index) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Fills the model with the given number of default columns + + <p>Existing columns will be removed before adding new columns. Listeners at the column model will + be notified one com::sun::star::container::XContainerListener::elementRemoved() event + for each removed column, and one com::sun::star::container::XContainerListener::elementInserted() + event for each insertion.</p> + + @param elements + the number of default columns that should be set. + */ + void setDefaultColumns([in] long elements); +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XGridControl.idl b/offapi/com/sun/star/awt/grid/XGridControl.idl new file mode 100644 index 000000000..6222216e5 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridControl.idl @@ -0,0 +1,98 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_XGridControl_idl__ +#define __com_sun_star_awt_grid_XGridControl_idl__ + +#include <com/sun/star/uno/XInterface.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> +#include <com/sun/star/util/VetoException.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** An interface to a control that displays a tabular data. + + @see UnoControlGrid + + @since OOo 3.3 + */ +published interface XGridControl +{ + /** retrieves the column which a given point belongs to + + @param X + the ordinate of the point, in pixel coordinates. + @param Y + the abscissa of the point, in pixel coordinates. + @return + the index of the column which the point lies in, or -1 if no column is under the given point. + */ + long getColumnAtPoint( [in] long X, [in] long Y ); + + /** retrieves the row which a given point belongs to + + @param X + the ordinate of the point, in pixel coordinates. + @param Y + the abscissa of the point, in pixel coordinates. + @return + the index of the row which the point lies in, or -1 if no row is under the given point. + */ + long getRowAtPoint( [in] long X, [in] long Y ); + + /** returns the column index of the currently active cell + + <p>If the grid control's does not contain any cells (which happens if the grid column model does not contain any + columns, or if grid data model does not contain any rows), then <code>-1</code> is returned.</p> + */ + long getCurrentColumn(); + + /** returns the row index of the currently active cell + + <p>If the grid control's does not contain any cells (which happens if the grid column model does not contain any + columns, or if grid data model does not contain any rows), then <code>-1</code> is returned.</p> + */ + long getCurrentRow(); + + /** moves the cursor to the given cell + @param ColumnIndex + the column index of the cell to activate. + @param RowIndex + the row index of the cell to activate. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if either <code>ColumnIndex</code> or <code>RowIndex</code> are out of range. + @throws ::com::sun::star::util::VetoException + if moving the cursor to another cell is vetoed. + */ + void goToCell( + [in] long ColumnIndex, + [in] long RowIndex + ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException + , ::com::sun::star::util::VetoException + ); +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XGridDataListener.idl b/offapi/com/sun/star/awt/grid/XGridDataListener.idl new file mode 100644 index 000000000..0c89a5abf --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridDataListener.idl @@ -0,0 +1,62 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_XGridDataListener_idl__ +#define __com_sun_star_awt_grid_XGridDataListener_idl__ + +#include <com/sun/star/awt/grid/GridDataEvent.idl> +#include <com/sun/star/lang/XEventListener.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** An instance of this interface is used by the XGridDataModel to + get notifications about data model changes. + + <p>Usually you must not implement this interface yourself, but you must notify it correctly if + you implement the XGridDataModel yourself</p>. + + @since OOo 3.3 + */ +published interface XGridDataListener: com::sun::star::lang::XEventListener +{ + + /** is called when one or more rows of data have been inserted into a grid control's data model. + */ + void rowsInserted( [in] GridDataEvent Event ); + + /** is called when one or more rows of data have been removed from a grid control's data model. + */ + void rowsRemoved( [in] GridDataEvent Event ); + + /** is called when existing data in a grid control's data model has been modified. + */ + void dataChanged( [in] GridDataEvent Event ); + + /** is called when the title of one or more rows changed. + */ + void rowHeadingChanged( [in] GridDataEvent Event ); +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XGridDataModel.idl b/offapi/com/sun/star/awt/grid/XGridDataModel.idl new file mode 100644 index 000000000..d80233174 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridDataModel.idl @@ -0,0 +1,110 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_XGridDataModel_idl__ +#define __com_sun_star_awt_grid_XGridDataModel_idl__ + + +#include <com/sun/star/lang/XComponent.idl> +#include <com/sun/star/util/XCloneable.idl> +#include <com/sun/star/awt/grid/XGridDataListener.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> + + +module com { module sun { module star { module awt { module grid { + +/** An instance of this interface is used by the UnoControlGrid to + retrieve the content data that is displayed in the actual control. + + If you do not need your own model implementation, you can also use the DefaultGridDataModel. + + @since OOo 3.3 +*/ +published interface XGridDataModel +{ + /** implements life time control for the component + */ + interface ::com::sun::star::lang::XComponent; + + /** allows cloning the complete data model + */ + interface ::com::sun::star::util::XCloneable; + + /** denotes the number of rows for which the model can provide data + */ + [attribute, readonly] long RowCount; + + /** denotes the number of columns for which the model can provide data + */ + [attribute, readonly] long ColumnCount; + + /** retrieves the data for a given cell + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if the column or row index do not denote a valid cell position. + */ + any getCellData( [in] long Column, [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** retrieves the tool tip to be displayed when the mouse hovers over a given cell + + <p>At the moment, only string tool tips are supported.</p> + + <p>If `VOID` is returned here, the cell's content will be displayed as tip, but only if it does + not fit into the cell.</p> + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if the column or row index do not denote a valid cell position. + */ + any getCellToolTip( [in] long Column, [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** retrieves the heading of a given row + + <p>A grid control will usually paint a row's title in the header column of the respective row.</p> + + <p>At the moment, only strings are supported as row headings.</p> + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if the given index does not denote a valid row. + */ + any + getRowHeading( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** retrieves the data for a complete row + + <p>This method is provided for performance and convenience reasons, it delivers the same result + as subsequent calls to getCellData() would.</p> + + @param RowIndex + the index of the row whose data should is to be retrieved. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + of the given row index does not denote a valid row. + */ + sequence< any > + getRowData( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); +}; + + +}; }; }; };}; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XGridRowSelection.idl b/offapi/com/sun/star/awt/grid/XGridRowSelection.idl new file mode 100644 index 000000000..838706d52 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridRowSelection.idl @@ -0,0 +1,103 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_XGridRowSelection_idl__ +#define __com_sun_star_awt_grid_XGridRowSelection_idl__ + +#include <com/sun/star/awt/grid/XGridSelectionListener.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** This interfaces provides access to the selection of row for UnoControlGrid. + + @since LibreOffice 3.4 + */ +published interface XGridRowSelection +{ + /** Selects all rows. + */ + void selectAllRows(); + + /** selects a given row + + @param RowIndex + denotes the index of the row to select + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if <code>RowIndex</code> does not denote a valid row index + */ + void selectRow( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Deselects all selected rows. + */ + void deselectAllRows(); + + /** removes the selection for a given row + + @param RowIndex + denotes the index of the row to deselect + */ + void deselectRow( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Returns the indices of all selected rows. + @returns + a sequence of indices. + */ + sequence< long > getSelectedRows(); + + /** Returns whether rows are selected. + @returns + `TRUE` if and only if at least one row is selected. + */ + boolean hasSelectedRows(); + + /** Returns whether a specific row is selected. + + @param RowIndex + the index of a row. If the value does not denote a valid row index, i.e. is smaller than <code>0</code> + or greater than the number of rows, this is silently ignored, and `FALSE` is returned. + + @returns + `TRUE` if and only if there is a row with the given index, and it is selected currently. + */ + boolean isRowSelected( [in] long RowIndex ); + + /** Adds a listener for the GridSelectionEvent posted after the grid changes. + @param listener + the listener to add. + */ + void addSelectionListener( [in] XGridSelectionListener listener); + + /** Removes a listener previously added with addSelectionListener(). + @param listener + the listener to remove. + */ + void removeSelectionListener( [in] XGridSelectionListener listener); +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl b/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl new file mode 100644 index 000000000..248da0a6b --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XGridSelectionListener.idl @@ -0,0 +1,46 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ +#ifndef __com_sun_star_awt_grid_XGridSelectionListener_idl__ +#define __com_sun_star_awt_grid_XGridSelectionListener_idl__ + +#include <com/sun/star/lang/XEventListener.idl> + +#include <com/sun/star/awt/grid/GridSelectionEvent.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** An instance of this interface is used by the XGridRowSelection to + get notifications about selection changes. + */ +published interface XGridSelectionListener: com::sun::star::lang::XEventListener +{ + /** Invoked after a selection was changed. + */ + void selectionChanged( [in] GridSelectionEvent gridSelectionEvent); + +}; + + +}; }; }; }; }; + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl new file mode 100644 index 000000000..d22321da0 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XMutableGridDataModel.idl @@ -0,0 +1,184 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_awt_grid_XMutableGridDataModel_idl__ +#define __com_sun_star_awt_grid_XMutableGridDataModel_idl__ + +#include <com/sun/star/awt/grid/XGridDataModel.idl> +#include <com/sun/star/lang/IllegalArgumentException.idl> +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** allows to modify the data represented by a XGridDataModel + */ +published interface XMutableGridDataModel : XGridDataModel +{ + /** appends a row to the model. + + @param Heading + denotes the heading of the row. + @param Data + specifies the content of the row. + */ + void addRow( [in] any Heading, [in] sequence< any > Data ); + + /** appends multiple rows of data to the model. + @param Headings + denotes the headings of the to-be-added rows. + @param Data + specifies the data of the rows to be added. + @throws ::com::sun::star::lang::IllegalArgumentException + if <code>Titles</code> and <code>Data</code> are of different length. + */ + void addRows( [in] sequence< any > Headings, [in] sequence< sequence< any > > Data ) + raises ( ::com::sun::star::lang::IllegalArgumentException ); + + /** inserts a row into the set of data rows + + @param Index + denotes the position at which the row is to be inserted + @param Heading + denotes the heading of the row. + @param Data + specifies the content of the row. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if <code>Index</code> is smaller than <code>0</code> or greater than the number of + rows in the model. + */ + void insertRow( [in] long Index, [in] any Heading, [in] sequence< any > Data ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** inserts multiple rows of data into the model. + @param Index + denotes the position at which the rows are to be inserted + @param Headings + denotes the headings of the to-be-added rows. + @param Data + specifies the data of the rows to be added. + @throws ::com::sun::star::lang::IllegalArgumentException + if <code>Titles</code> and <code>Data</code> are of different length. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if <code>Index</code> is smaller than <code>0</code> or greater than the number of + rows in the model. + */ + void insertRows( [in] long Index, [in] sequence< any > Headings, [in] sequence< sequence< any > > Data ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException + , ::com::sun::star::lang::IllegalArgumentException ); + + /** removes a row of data from the model + + @param RowIndex + the index of the row that should be removed. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if the given index is invalid + */ + void removeRow( [in] long RowIndex ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** Removes all rows from the model. + */ + void removeAllRows(); + + /** updates the content of the given cell + @param ColumnIndex + the column index of the to-be-updated cell + @param RowIndex + the row index of the to-be-updated cell + @param Value + the new value of the cell. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if the row or column index is invalid + */ + void updateCellData( [in] long ColumnIndex, [in] long RowIndex, [in] any Value ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** updates the content of a given row. + + <p>The change in the data model will be notified to registered listeners via + XGridDataListener::dataChanged(). The GridDataEvent::FirstColumn and + GridDataEvent::LastColumn will denote the smallest respectively largest column + index from ColumnIndexes.</p> + + @param ColumnIndexes + contains the column indexes of the cells, which should be updated + @param RowIndex + contains the index of the row whose data is to be updated + @param Values + specifies the new values of the cells. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if one of the row indexes or the column index is invalid + @throws ::com::sun::star::lang::IllegalArgumentException + if the lengths of the <code>ColumnIndexes</code> and <code>Values</code> sequences are not equal. + */ + void updateRowData( [in] sequence< long > ColumnIndexes, [in] long RowIndex, [in] sequence< any > Values ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException + , ::com::sun::star::lang::IllegalArgumentException); + + /** sets a new title for a given row. + + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if the given index does not denote a valid row. + */ + void + updateRowHeading( [in] long RowIndex, [in] any Heading ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** updates the tooltip to be displayed for a given cell + + @see XGridDataModel::getCellToolTip + */ + void updateCellToolTip( [in] long ColumnIndex, [in] long RowIndex, [in] any Value ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** updates the tooltip for all cells of a given row + + <p>Effectively this method is a shortcut for calling updateCellToolTip() multiple + times in a row, for all cells of a given row.</p> + + @see XGridDataModel::getCellToolTip + @see updateCellToolTip + */ + void updateRowToolTip( [in] long RowIndex, [in] any Value ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + + /** registers listener to be notified of data changes in the model + @param Listener + specifies the listener to register + */ + void addGridDataListener( [in] XGridDataListener Listener ); + + + /** revokes a listener which was previously registered via addGridDataListener() + @param Listener + specifies the listener to revoke. + */ + void removeGridDataListener( [in] XGridDataListener Listener ); +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XSortableGridData.idl b/offapi/com/sun/star/awt/grid/XSortableGridData.idl new file mode 100644 index 000000000..7a2e28373 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XSortableGridData.idl @@ -0,0 +1,70 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_awt_grid_XSortableGridData_idl__ +#define __com_sun_star_awt_grid_XSortableGridData_idl__ + +#include <com/sun/star/lang/IndexOutOfBoundsException.idl> +#include <com/sun/star/beans/Pair.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** allows to sort the data represented by a XGridDataModel + */ +interface XSortableGridData +{ + /** sorts the rows represented by the model by a given column's data. + + @param ColumnIndex + the index of the column whose data should be used as sort key + @param SortAscending + is `TRUE` if the data should be sorted ascending, `FALSE` otherwise. + @throws ::com::sun::star::lang::IndexOutOfBoundsException + if <code>ColumnIndex</code> does not denote a valid column. + */ + void sortByColumn( [in] long ColumnIndex, [in] boolean SortAscending ) + raises ( ::com::sun::star::lang::IndexOutOfBoundsException ); + + /** removes any possibly present sorting of the grid data + */ + void removeColumnSort(); + + /** returns the current sort order. + + @return + a structure describing the current sort order. + com::sun::star::beans::Pair::First + denotes the column by which the data is sorted, or -1 if + the data is currently unsorted. + com::sun::star::beans::Pair::Second + is `TRUE` if the data is sorted ascending, `FALSE` otherwise. + */ + ::com::sun::star::beans::Pair< long, boolean > + getCurrentSortOrder(); +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ diff --git a/offapi/com/sun/star/awt/grid/XSortableMutableGridDataModel.idl b/offapi/com/sun/star/awt/grid/XSortableMutableGridDataModel.idl new file mode 100644 index 000000000..7f5477cf2 --- /dev/null +++ b/offapi/com/sun/star/awt/grid/XSortableMutableGridDataModel.idl @@ -0,0 +1,52 @@ +/* -*- Mode: C++; tab-width: 4; indent-tabs-mode: nil; c-basic-offset: 4 -*- */ +/* + * This file is part of the LibreOffice project. + * + * This Source Code Form is subject to the terms of the Mozilla Public + * License, v. 2.0. If a copy of the MPL was not distributed with this + * file, You can obtain one at http://mozilla.org/MPL/2.0/. + * + * This file incorporates work covered by the following license notice: + * + * Licensed to the Apache Software Foundation (ASF) under one or more + * contributor license agreements. See the NOTICE file distributed + * with this work for additional information regarding copyright + * ownership. The ASF licenses this file to you under the Apache + * License, Version 2.0 (the "License"); you may not use this file + * except in compliance with the License. You may obtain a copy of + * the License at http://www.apache.org/licenses/LICENSE-2.0 . + */ + +#ifndef __com_sun_star_awt_grid_XSortableMutableGridDataModel_idl__ +#define __com_sun_star_awt_grid_XSortableMutableGridDataModel_idl__ + +#include <com/sun/star/awt/grid/XMutableGridDataModel.idl> +#include <com/sun/star/awt/grid/XSortableGridData.idl> + + +module com { module sun { module star { module awt { module grid { + + +/** describes a grid control data model whose data can be modified and sorted. + */ +interface XSortableMutableGridDataModel +{ + /** provides access to the basic functionality of a grid data model, plus functions to modify it. + */ + interface XMutableGridDataModel; + + /** provides means to sort the data represented by the model. + + <p>If you set a new column sort order, the implementation will notify the registered XGridDataListeners + via a call to its XGridDataListener::dataChanged() method.</p> + */ + interface XSortableGridData; +}; + + +}; }; }; }; }; + + +#endif + +/* vim:set shiftwidth=4 softtabstop=4 expandtab: */ |