Tag: cws_dev300_dba30beta
User: oj      
Date: 2008-04-22 12:13:26+0000
Modified:
   dba/reportdesign/source/ui/inc/ReportController.hxx
   dba/reportdesign/source/ui/report/ReportController.cxx

Log:
 #i86908# new interface supported to allow a remote mode

File Changes:

Directory: /dba/reportdesign/source/ui/inc/
===========================================

File [changed]: ReportController.hxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/inc/ReportController.hxx?r1=1.7&r2=1.7.8.1
Delta lines:  +16 -5
--------------------
--- ReportController.hxx        2008-04-10 19:03:27+0000        1.7
+++ ReportController.hxx        2008-04-22 12:13:23+0000        1.7.8.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ReportController.hxx,v $
- * $Revision: 1.7 $
+ * $Revision: 1.7.8.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -33,10 +33,11 @@
 #ifndef rptui_SINGLEDOCCONTROLLER_HXX
 #include <dbaccess/singledoccontroller.hxx>
 #endif
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
 #include <com/sun/star/beans/PropertyValue.hpp>
 #include <com/sun/star/uno/Sequence.hxx>
 #include <com/sun/star/sdbc/XConnection.hpp>
+#include <com/sun/star/util/XModeSelector.hpp>
 #include <com/sun/star/report/XSection.hpp>
 #include <com/sun/star/beans/XPropertySet.hpp>
 #include <com/sun/star/util/XNumberFormatter.hpp>
@@ -73,8 +74,9 @@
     class OSectionView;
 
        typedef ::dbaui::OSingleDocumentController      OReportController_BASE;
-       typedef ::cppu::ImplHelper2     <       
::com::sun::star::container::XContainerListener,
-                                                                       
::com::sun::star::beans::XPropertyChangeListener
+       typedef ::cppu::ImplHelper3     <       
::com::sun::star::container::XContainerListener,
+                                                                       
::com::sun::star::beans::XPropertyChangeListener,
+                                                                       
::com::sun::star::util::XModeSelector
                                                                >       
OReportController_Listener;
 
        class OReportController :        public OReportController_BASE
@@ -102,6 +104,7 @@
                                 m_aReportModel;
                ::rtl::OUString                 m_sName;                        
    /// name for the report definition
         ::rtl::OUString         m_sLastActivePage;      /// last active 
property browser page
+        ::rtl::OUString         m_sMode;                       /// the current 
mode of the controller
                sal_Int32                               m_nSplitPos;            
    /// the position of the splitter
         sal_Int32               m_nPageNum;             /// the page number 
from the restoreView call
         //sal_Int32               m_nExecuteReportEvent;
@@ -344,6 +347,13 @@
         // XTitle
         virtual ::rtl::OUString SAL_CALL getTitle(  ) throw 
(::com::sun::star::uno::RuntimeException);
 
+               // XModeSelector
+        virtual void SAL_CALL setMode( const ::rtl::OUString& aMode ) throw 
(::com::sun::star::lang::NoSupportException, 
::com::sun::star::uno::RuntimeException) ;
+        virtual ::rtl::OUString SAL_CALL getMode(  ) throw 
(::com::sun::star::uno::RuntimeException) ;
+        virtual ::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 
getSupportedModes(  ) throw (::com::sun::star::uno::RuntimeException) ;
+        virtual ::sal_Bool SAL_CALL supportsMode( const ::rtl::OUString& aMode 
) throw (::com::sun::star::uno::RuntimeException) ;
+
+
                /** returns the current position of the splitter
                *
                * \return 
@@ -385,6 +395,7 @@
        private:
                virtual void onLoadedMenu( const 
::com::sun::star::uno::Reference< ::com::sun::star::frame::XLayoutManager >& 
_xLayoutManager );
                virtual void impl_initialize( );
+               bool isUiVisible() const;
        };
 }
 #endif // RPTUI_REPORTCONTROLLER_HXX

Directory: /dba/reportdesign/source/ui/report/
==============================================

File [changed]: ReportController.cxx
Url: 
http://dba.openoffice.org/source/browse/dba/reportdesign/source/ui/report/ReportController.cxx?r1=1.14&r2=1.14.6.1
Delta lines:  +51 -11
---------------------
--- ReportController.cxx        2008-04-10 19:14:22+0000        1.14
+++ ReportController.cxx        2008-04-22 12:13:23+0000        1.14.6.1
@@ -7,7 +7,7 @@
  * OpenOffice.org - a multi-platform office productivity suite
  *
  * $RCSfile: ReportController.cxx,v $
- * $Revision: 1.14 $
+ * $Revision: 1.14.6.1 $
  *
  * This file is part of OpenOffice.org.
  *
@@ -253,6 +253,7 @@
 ,m_bChartEnabled(false)
 ,m_bChartEnabledAsked(false)
 {
+       m_sMode =  ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal"));
     DBG_CTOR( rpt_OReportController,NULL);
 }
 // 
-----------------------------------------------------------------------------
@@ -1315,9 +1316,11 @@
             InvalidateAll();
             break;
         case SID_RPT_SHOWREPORTEXPLORER:
+                       if ( isUiVisible() )
             m_pMyOwnView->toggleReportExplorer();
             break;
                case SID_FM_ADD_FIELD:
+                       if ( isUiVisible() )
                        m_pMyOwnView->toggleAddField();
                        break;
                case SID_SHOW_PROPERTYBROWSER:
@@ -1326,11 +1329,14 @@
             else
                 m_pMyOwnView->setCurrentPage(m_sLastActivePage);
 
+                       if ( isUiVisible() )
+                       {
             m_bShowProperties = !m_bShowProperties;
             if ( aArgs.getLength() == 1 )
                 aArgs[0].Value >>= m_bShowProperties;
 
                        m_pMyOwnView->togglePropertyBrowser(m_bShowProperties);
+                       }
                        break;
         case SID_PROPERTYBROWSER_LAST_PAGE: // nothing to do
             m_sLastActivePage = m_pMyOwnView->getCurrentPage();
@@ -2122,7 +2128,7 @@
                     )
                        {
                 InvalidateFeature(SID_FM_ADD_FIELD);
-                if ( !m_pMyOwnView->isAddFieldVisible() )
+                if ( !m_pMyOwnView->isAddFieldVisible() && isUiVisible() )
                     m_pMyOwnView->toggleAddField();
             }
             /// TODO: check what we need to notify here TitleHelper
@@ -2518,7 +2524,7 @@
                m_pGroupsFloater = new 
OGroupsSortingDialog(getView(),!isEditable(),this);
                
m_pGroupsFloater->AddEventListener(LINK(this,OReportController,EventLstHdl));
        }
-       else
+       else if ( isUiVisible() )
                m_pGroupsFloater->Show(!m_pGroupsFloater->IsVisible());
 }
 // 
-----------------------------------------------------------------------------
@@ -2915,7 +2921,7 @@
 // 
-----------------------------------------------------------------------------
 void OReportController::displayDesignFloater(sal_Bool _bShow)
 {
-    if ( m_pGroupsFloater )
+    if ( m_pGroupsFloater && isUiVisible() )
     {
         m_pGroupsFloater->Show( m_bGroupFloaterWasVisible && _bShow);
     }
@@ -3834,5 +3840,39 @@
     return xTitle->getTitle ();
 }
 // 
-----------------------------------------------------------------------------
+void SAL_CALL OReportController::setMode( const ::rtl::OUString& aMode ) throw 
(::com::sun::star::lang::NoSupportException, 
::com::sun::star::uno::RuntimeException)
+{
+       ::osl::MutexGuard aGuard(m_aMutex);
+       m_sMode = aMode;
+}
+::rtl::OUString SAL_CALL OReportController::getMode(  ) throw 
(::com::sun::star::uno::RuntimeException)
+{
+       ::osl::MutexGuard aGuard(m_aMutex);
+       return m_sMode;
+}
+::com::sun::star::uno::Sequence< ::rtl::OUString > SAL_CALL 
OReportController::getSupportedModes(  ) throw 
(::com::sun::star::uno::RuntimeException)
+{
+       static ::rtl::OUString s_sModes[] = { 
::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("remote")),
+                                                                               
  ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal")) };
+       return uno::Sequence< ::rtl::OUString> 
(&s_sModes[0],sizeof(s_sModes)/sizeof(s_sModes[0]));
+}
+::sal_Bool SAL_CALL OReportController::supportsMode( const ::rtl::OUString& 
aMode ) throw (::com::sun::star::uno::RuntimeException)
+{
+       uno::Sequence< ::rtl::OUString> aModes = getSupportedModes();
+       const ::rtl::OUString* pIter = aModes.getConstArray();
+    const ::rtl::OUString* pEnd  = pIter + aModes.getLength();
+    for(;pIter != pEnd;++pIter)
+    {
+               if ( pIter->equals(aMode ) )
+                       break;
+       }
+       return pIter != pEnd;
+}
+// 
-----------------------------------------------------------------------------
+bool OReportController::isUiVisible() const
+{
+       return !m_sMode.equalsAscii("remote");
+}
+// 
-----------------------------------------------------------------------------
 // 
-----------------------------------------------------------------------------
 




---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]

Reply via email to