source/inc/xcalc.hxx

Go to the documentation of this file.
00001 /*************************************************************************
00002  *
00003  *  The Contents of this file are made available subject to
00004  *  the terms of GNU Lesser General Public License Version 2.1.
00005  *
00006  *
00007  *    GNU Lesser General Public License Version 2.1
00008  *    =============================================
00009  *    Copyright 2005 by Kohei Yoshida.
00010  *    1039 Kingsway Dr., Apex, NC 27502, USA
00011  *
00012  *    This library is free software; you can redistribute it and/or
00013  *    modify it under the terms of the GNU Lesser General Public
00014  *    License version 2.1, as published by the Free Software Foundation.
00015  *
00016  *    This library is distributed in the hope that it will be useful,
00017  *    but WITHOUT ANY WARRANTY; without even the implied warranty of
00018  *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00019  *    Lesser General Public License for more details.
00020  *
00021  *    You should have received a copy of the GNU Lesser General Public
00022  *    License along with this library; if not, write to the Free Software
00023  *    Foundation, Inc., 59 Temple Place, Suite 330, Boston,
00024  *    MA  02111-1307  USA
00025  *
00026  ************************************************************************/
00027 
00028 
00029 #ifndef _SHEET_HXX_
00030 #define _SHEET_HXX_
00031 
00032 #include "type.hxx"
00033 #include <com/sun/star/table/CellAddress.hpp>
00034 #include <com/sun/star/table/CellRangeAddress.hpp>
00035 
00036 using namespace com::sun::star;
00037 using com::sun::star::uno::Reference;
00038 
00039 namespace rtl { class OUString; }
00040 
00041 namespace com { namespace sun { namespace star {
00042 
00043         namespace uno
00044         {
00045                 class XComponentContext;
00046         }
00047 
00048         namespace lang
00049         {
00050                 class XComponent;
00051         }
00052         
00053         namespace sheet
00054         {
00055                 class XSpreadsheet;
00056                 class XSpreadsheets;
00057                 class XRangeSelection;
00058         }
00059         
00060         namespace table
00061         {
00062                 class XCellRange;
00063                 class XCell;
00064         }
00065         
00066 }}}
00067 
00068 
00069 namespace scsolver {
00070 
00076 class CalcInterface
00077 {
00078 public:
00079 
00080         CalcInterface( const Reference< uno::XComponentContext >& );
00081         ~CalcInterface();
00082 
00083         //------------------------------------------------------------------------------
00084         // Basic Component Methods
00085         
00086         Reference< uno::XComponentContext > getComponentContext() const { return m_xCC; }
00087         Reference< lang::XComponent > getCurrentComponent() const;
00088         void updateCurrentComponent() const;
00089         Reference< lang::XMultiComponentFactory > getServiceManager() const;
00090         
00091         void setDocumentProperty( const rtl::OUString&, uno::Any );
00092         uno::Any getDocumentProperty( const rtl::OUString& ) const;
00093 
00094         //------------------------------------------------------------------------------
00095         // Calc Component Methods
00096         
00097         Reference< sheet::XRangeSelection > getXRangeSelection() const;
00098 
00099         //------------------------------------------------------------------------------
00100         // Sheet-Related Methods
00101 
00102         Reference< sheet::XSpreadsheet > getActiveSheet() const;
00103         Reference< sheet::XSpreadsheet > getSheetByIndex( const sal_uInt16 ) const;
00104         Reference< sheet::XSpreadsheet > getSheetByName( const rtl::OUString& ) const;
00105         
00106         
00107         rtl::OUString getCellFormula( const rtl::OUString&, const rtl::OUString& );
00108 
00109 
00110         table::CellAddress getCellAddress( const rtl::OUString& );
00111         table::CellAddress getCellAddress( const rtl::OUString&, const rtl::OUString& );
00112 
00113         table::CellRangeAddress getCellRangeAddress( const rtl::OUString& );
00114         table::CellRangeAddress getCellRangeAddress( const rtl::OUString&, const rtl::OUString& );
00115         Reference< table::XCell > getCell( const table::CellAddress& ) const;
00116         rtl::OUString getCellFormula( const table::CellAddress& );
00117         double getCellValue( const table::CellAddress& );
00118 
00119         void setCellFormula( const table::CellAddress&, const rtl::OUString& ) const;
00120         void setCellValue( const table::CellAddress&, double ) const;
00121 
00122         void disableCellUpdates() const;
00123         void enableCellUpdates() const;
00124 
00125         void addMenuItem() const;
00126 
00127 private:
00128         Reference< uno::XComponentContext > m_xCC;
00129         mutable Reference< lang::XMultiComponentFactory > m_xSM;
00130         mutable Reference< lang::XComponent > m_xCurComp;
00131         mutable Reference< sheet::XRangeSelection > m_xRngSel;
00132 
00133         void splitCellRangeAddress( const rtl::OUString&, rtl::OUString&, rtl::OUString& );
00134 
00135 };      
00136         
00137         
00138         
00139 }
00140 
00141 #endif

Generated on Mon Jul 28 09:13:20 2008 for scsolver by  doxygen 1.5.3