Tag: cws_src680_rptwizard01
User: oj      
Date: 2008-04-22 12:23:52+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.6&r2=1.6.2.1
Delta lines:  +17 -6
--------------------
--- ReportController.hxx        2008-04-04 15:10:34+0000        1.6
+++ ReportController.hxx        2008-04-22 12:23:49+0000        1.6.2.1
@@ -6,9 +6,9 @@
  *
  *  $RCSfile: ReportController.hxx,v $
  *
- *  $Revision: 1.6 $
+ *  $Revision: 1.6.2.1 $
  *
- *  last change: $Author: kz $ $Date: 2008/04/04 15:10:34 $
+ *  last change: $Author: oj $ $Date: 2008/04/22 12:23:49 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -39,7 +39,7 @@
 #include <dbaccess/singledoccontroller.hxx>
 #endif
 #ifndef _CPPUHELPER_IMPLBASE2_HXX_
-#include <cppuhelper/implbase2.hxx>
+#include <cppuhelper/implbase3.hxx>
 #endif
 #ifndef _COM_SUN_STAR_BEANS_PROPERTYVALUE_HPP_
 #include <com/sun/star/beans/PropertyValue.hpp>
@@ -108,6 +108,7 @@
 #include <functional>
 #include <boost/shared_ptr.hpp>
 #include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/util/XModeSelector.hpp>
 
 
 class TransferableHelper;
@@ -122,8 +123,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
@@ -151,6 +153,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;
@@ -393,6 +396,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 
@@ -434,6 +444,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.13&r2=1.13.2.1
Delta lines:  +52 -12
---------------------
--- ReportController.cxx        2008-04-04 15:11:51+0000        1.13
+++ ReportController.cxx        2008-04-22 12:23:49+0000        1.13.2.1
@@ -4,9 +4,9 @@
  *
  *  $RCSfile: ReportController.cxx,v $
  *
- *  $Revision: 1.13 $
+ *  $Revision: 1.13.2.1 $
  *
- *  last change: $Author: kz $ $Date: 2008/04/04 15:11:51 $
+ *  last change: $Author: oj $ $Date: 2008/04/22 12:23:49 $
  *
  *  The Contents of this file are made available subject to
  *  the terms of GNU Lesser General Public License Version 2.1.
@@ -394,6 +394,7 @@
 ,m_bChartEnabled(false)
 ,m_bChartEnabledAsked(false)
 {
+       m_sMode =  ::rtl::OUString(RTL_CONSTASCII_USTRINGPARAM("normal"));
     DBG_CTOR( rpt_OReportController,NULL);
 }
 // 
-----------------------------------------------------------------------------
@@ -1456,9 +1457,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:
@@ -1467,11 +1470,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();
@@ -2263,7 +2269,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
@@ -2659,7 +2665,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());
 }
 // 
-----------------------------------------------------------------------------
@@ -3056,7 +3062,7 @@
 // 
-----------------------------------------------------------------------------
 void OReportController::displayDesignFloater(sal_Bool _bShow)
 {
-    if ( m_pGroupsFloater )
+    if ( m_pGroupsFloater && isUiVisible() )
     {
         m_pGroupsFloater->Show( m_bGroupFloaterWasVisible && _bShow);
     }
@@ -3975,5 +3981,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