xref: /trunk/main/offapi/com/sun/star/sheet/XSolver.idl (revision cdf0e10c)
1/*************************************************************************
2 *
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
4 *
5 * Copyright 2000, 2010 Oracle and/or its affiliates.
6 *
7 * OpenOffice.org - a multi-platform office productivity suite
8 *
9 * This file is part of OpenOffice.org.
10 *
11 * OpenOffice.org is free software: you can redistribute it and/or modify
12 * it under the terms of the GNU Lesser General Public License version 3
13 * only, as published by the Free Software Foundation.
14 *
15 * OpenOffice.org is distributed in the hope that it will be useful,
16 * but WITHOUT ANY WARRANTY; without even the implied warranty of
17 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the
18 * GNU Lesser General Public License version 3 for more details
19 * (a copy is included in the LICENSE file that accompanied this code).
20 *
21 * You should have received a copy of the GNU Lesser General Public License
22 * version 3 along with OpenOffice.org.  If not, see
23 * <http://www.openoffice.org/license.html>
24 * for a copy of the LGPLv3 License.
25 *
26 ************************************************************************/
27
28#ifndef __com_sun_star_sheet_XSolver_idl__
29#define __com_sun_star_sheet_XSolver_idl__
30
31#ifndef __com_sun_star_sheet_XSpreadsheetDocument_idl__
32#include <com/sun/star/sheet/XSpreadsheetDocument.idl>
33#endif
34
35#ifndef __com_sun_star_sheet_SolverConstraint_idl__
36#include <com/sun/star/sheet/SolverConstraint.idl>
37#endif
38
39//=============================================================================
40
41module com {  module sun {  module star {  module sheet {
42
43//=============================================================================
44
45/** allows to call a solver for a model that is defined by spreadsheet cells.
46 */
47interface XSolver: com::sun::star::uno::XInterface
48{
49    /// The spreadsheet document that contains the cells.
50    [attribute] XSpreadsheetDocument Document;
51
52    /// The address of the cell that contains the objective value.
53    [attribute] com::sun::star::table::CellAddress Objective;
54
55    /// The addresses of the cells that contain the variables.
56    [attribute] sequence< com::sun::star::table::CellAddress > Variables;
57
58    /// The constraints of the model.
59    [attribute] sequence< SolverConstraint > Constraints;
60
61    /// selects if the objective value is maximized or minimized.
62    [attribute] boolean Maximize;
63
64    /// executes the calculation and tries to find a solution.
65    void solve();
66
67    /// contains <TRUE/> if a solution was found.
68    [attribute, readonly] boolean Success;
69
70    /// contains the objective value for the solution, if a solution was found.
71    [attribute, readonly] double ResultValue;
72
73    /** contains the solution's value for each of the variables,
74        if a solution was found.
75     */
76    [attribute, readonly] sequence< double > Solution;
77};
78
79//=============================================================================
80
81}; }; }; };
82
83#endif
84
85