source/inc/solver.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-2008 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 _SOLVER_HXX_
00030 #define _SOLVER_HXX_
00031 
00032 #include <cppuhelper/implbase6.hxx>
00033 #include <com/sun/star/lang/XInitialization.hpp>
00034 #include <com/sun/star/frame/XNotifyingDispatch.hpp>
00035 #include <com/sun/star/frame/XDispatchProvider.hpp>
00036 #include <com/sun/star/lang/XServiceInfo.hpp>
00037 #include <com/sun/star/lang/XLocalizable.hpp>
00038 
00039 #include <com/sun/star/ui/dialogs/XExecutableDialog.hpp>
00040 
00041 #include "tool/global.hxx"
00042 #include "type.hxx"
00043 #include <vector>
00044 #include <memory>
00045 
00046 #ifdef SCSOLVER_UNO_COMPONENT
00047 class ResMgr;
00048 #else
00049 #include <tools/resmgr.hxx>
00050 #endif
00051 
00052 #define SERVICE_NAME            "org.go-oo.CalcSolver"
00053 #define IMPLEMENTATION_NAME     "org.go-oo.comp.CalcSolver"
00054 
00055 namespace com { namespace sun { namespace star { 
00056         
00057         namespace frame
00058         {
00059                 class XDispatch;
00060                 class XDispatchDescriptor;
00061                 class XDispatchResultListener;
00062                 class XStatusListener;
00063         }
00064 
00065         namespace sheet 
00066         {       
00067                 class XSpreadsheet;
00068         }
00069 
00070 }}}
00071 
00072 namespace scsolver {
00073 
00074 
00075 class CalcInterface;
00076 class OptionData;
00077 class SolverDialog;
00078 class StringResMgr;
00079 
00080 //--------------------------------------------------------------------------
00081 // SolverImpl
00082 
00083 class SolverImpl : public ::cppu::WeakImplHelper6<
00084     ::com::sun::star::ui::dialogs::XExecutableDialog,
00085     ::com::sun::star::lang::XServiceInfo, 
00086     ::com::sun::star::lang::XInitialization,
00087     ::com::sun::star::frame::XDispatchProvider,
00088     ::com::sun::star::frame::XNotifyingDispatch,
00089     ::com::sun::star::lang::XLocalizable >
00090 {
00091 public:
00092 
00093     SolverImpl(const ::com::sun::star::uno::Reference< ::com::sun::star::uno::XComponentContext >& xContext);
00094     ~SolverImpl();
00095 
00096     //--------------------------------------------------------------------------
00097     // UNO Component Interface Methods
00098 
00099     // XInitialization
00100     virtual void SAL_CALL initialize( const ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Any >& aArgs )
00101         throw (::com::sun::star::uno::Exception);
00102 
00103     // XServiceInfo
00104     virtual rtl::OUString SAL_CALL getImplementationName()
00105         throw (::com::sun::star::uno::RuntimeException);
00106     virtual sal_Bool SAL_CALL supportsService( rtl::OUString const & )
00107         throw (::com::sun::star::uno::RuntimeException);
00108     virtual ::com::sun::star::uno::Sequence< rtl::OUString > SAL_CALL getSupportedServiceNames()
00109         throw (::com::sun::star::uno::RuntimeException);
00110 
00111     // XDispatchProvider
00112     virtual ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > SAL_CALL queryDispatch( 
00113         const ::com::sun::star::util::URL&, const ::rtl::OUString &, sal_Int32 )
00114         throw (::com::sun::star::uno::RuntimeException);
00115         
00116     virtual ::com::sun::star::uno::Sequence< ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatch > > SAL_CALL 
00117         queryDispatches(const ::com::sun::star::uno::Sequence< ::com::sun::star::frame::DispatchDescriptor >& )
00118         throw (::com::sun::star::uno::RuntimeException);
00119         
00120     // XDispatch
00121     virtual void SAL_CALL dispatch( const ::com::sun::star::util::URL&, 
00122                                     const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >& )
00123         throw(::com::sun::star::uno::RuntimeException);
00124         
00125     virtual void SAL_CALL addStatusListener( const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >&, 
00126                 const ::com::sun::star::util::URL& ) 
00127         throw (::com::sun::star::uno::RuntimeException);
00128         
00129     virtual void SAL_CALL removeStatusListener( 
00130                 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XStatusListener >&, const ::com::sun::star::util::URL& )
00131         throw (::com::sun::star::uno::RuntimeException);
00132 
00133     // XNotifyingDispatch
00134     virtual void SAL_CALL dispatchWithNotification( 
00135         const ::com::sun::star::util::URL&, const ::com::sun::star::uno::Sequence< ::com::sun::star::beans::PropertyValue >&, 
00136                 const ::com::sun::star::uno::Reference< ::com::sun::star::frame::XDispatchResultListener >& )
00137         throw (::com::sun::star::uno::RuntimeException);
00138 
00139     // XExecutableDialog
00140         virtual void SAL_CALL setTitle( const ::rtl::OUString& aTitle )
00141                         throw (::com::sun::star::uno::RuntimeException);
00142         virtual sal_Int16 SAL_CALL execute()
00143                         throw (::com::sun::star::uno::RuntimeException);
00144 
00145         // XLocalizable
00146     virtual void SAL_CALL setLocale( const com::sun::star::lang::Locale& eLocale )
00147                 throw(::com::sun::star::uno::RuntimeException);
00148     virtual com::sun::star::lang::Locale SAL_CALL getLocale()
00149                 throw(::com::sun::star::uno::RuntimeException);
00150 
00151         // The "get-pointer" methods
00152         CalcInterface* getCalcInterface() const;
00153         OptionData* getOptionData() const;
00154         SolverDialog* getMainDialog();
00155 
00156         sal_Bool solveModel();
00157     rtl::OUString getResStr( int resid );
00158 
00159 private:
00160 
00161 #ifndef SCSOLVER_UNO_COMPONENT
00162     ResMgr* getResMgr();
00163     ::std:::auto_ptr<ResMgr> m_pResMgr;
00164 #endif
00165 
00166     void initLocale();
00167 
00168     com::sun::star::lang::Locale    m_eLocale;
00169     ::std::auto_ptr<SolverDialog>   m_pDlg;
00170     ::std::auto_ptr<CalcInterface>  m_pCalc;
00171     ::std::auto_ptr<OptionData>     m_pOption;
00172     ::std::auto_ptr<StringResMgr>   m_pStringResMgr;
00173 };
00174 
00175 
00176 }
00177 
00178 
00179 
00180 #endif //_SOLVER_HXX_

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