00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
00022
00023
00024
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
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
00098
00099
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
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
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
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
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
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
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
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_