summaryrefslogtreecommitdiff
path: root/framework
diff options
context:
space:
mode:
authorNoel Grandin <noel@peralex.com>2013-03-22 09:24:15 +0200
committerNoel Grandin <noel@peralex.com>2013-04-08 13:53:04 +0200
commitb248624126c271c88381d3dad6e04fc954f65779 (patch)
tree989f9131b865ea470ced1317834b91de06efd9e4 /framework
parentc68b934cd03e60ab6e0579108089b0e834ac47ad (diff)
fdo#46808, Convert frame::Frame to new style
Change-Id: I74427d1e0059808f04960c648b93245b06c20f7f
Diffstat (limited to 'framework')
-rw-r--r--framework/inc/macros/xtypeprovider.hxx28
-rw-r--r--framework/inc/services.h2
-rw-r--r--framework/inc/services/frame.hxx54
-rw-r--r--framework/inc/services/taskcreatorsrv.hxx10
-rw-r--r--framework/source/services/frame.cxx69
-rw-r--r--framework/source/services/taskcreatorsrv.cxx16
6 files changed, 125 insertions, 54 deletions
diff --git a/framework/inc/macros/xtypeprovider.hxx b/framework/inc/macros/xtypeprovider.hxx
index 3de533fc552e..85648a75bb99 100644
--- a/framework/inc/macros/xtypeprovider.hxx
+++ b/framework/inc/macros/xtypeprovider.hxx
@@ -638,6 +638,34 @@ ________________________________________________________________________________
)) \
)
+// implementation of XTypeProvider with 20 additional interfaces for getTypes()
+#define DEFINE_XTYPEPROVIDER_21( CLASS, TYPE1, TYPE2, TYPE3, TYPE4, TYPE5, TYPE6, TYPE7, TYPE8, TYPE9, TYPE10, TYPE11, TYPE12, TYPE13, TYPE14, TYPE15, TYPE16, TYPE17, TYPE18, TYPE19, TYPE20, TYPE21 ) \
+ PRIVATE_DEFINE_XTYPEPROVIDER_LARGE ( CLASS, \
+ (PRIVATE_DEFINE_TYPE_12 ( TYPE1 , \
+ TYPE2 , \
+ TYPE3 , \
+ TYPE4 , \
+ TYPE5 , \
+ TYPE6 , \
+ TYPE7 , \
+ TYPE8 , \
+ TYPE9 , \
+ TYPE10 , \
+ TYPE11 , \
+ TYPE12 \
+ )), \
+ (PRIVATE_DEFINE_TYPE_9 ( TYPE13 , \
+ TYPE14 , \
+ TYPE15 , \
+ TYPE16 , \
+ TYPE17 , \
+ TYPE18 , \
+ TYPE19 , \
+ TYPE20 , \
+ TYPE21 \
+ )) \
+ )
+
// implementation of XTypeProvider with 1 additional interface for getTypes() AND using 1 baseclass
#define DEFINE_XTYPEPROVIDER_1_WITH_BASECLASS( CLASS, BASECLASS, TYPE1 ) \
PRIVATE_DEFINE_XTYPEPROVIDER_BASECLASS ( CLASS, \
diff --git a/framework/inc/services.h b/framework/inc/services.h
index 956568db3721..bf1502632bea 100644
--- a/framework/inc/services.h
+++ b/framework/inc/services.h
@@ -28,7 +28,6 @@ namespace framework{
// used servicenames by framework
//_________________________________________________________________________________________________________________
-#define SERVICENAME_FRAME DECLARE_ASCII("com.sun.star.frame.Frame" )
#define SERVICENAME_FRAMELOADERFACTORY DECLARE_ASCII("com.sun.star.frame.FrameLoaderFactory" )
#define SERVICENAME_FILTERFACTORY DECLARE_ASCII("com.sun.star.document.FilterFactory" )
#define SERVICENAME_TYPEDETECTION DECLARE_ASCII("com.sun.star.document.TypeDetection" )
@@ -62,7 +61,6 @@ namespace framework{
// used implementationnames by framework
//_________________________________________________________________________________________________________________
-#define IMPLEMENTATIONNAME_FRAME DECLARE_ASCII("com.sun.star.comp.framework.Frame" )
#define IMPLEMENTATIONNAME_DESKTOP DECLARE_ASCII("com.sun.star.comp.framework.Desktop" )
#define IMPLEMENTATIONNAME_URLTRANSFORMER DECLARE_ASCII("com.sun.star.comp.framework.URLTransformer" )
#define IMPLEMENTATIONNAME_GENERICFRAMELOADER DECLARE_ASCII("com.sun.star.comp.office.FrameLoader" )
diff --git a/framework/inc/services/frame.hxx b/framework/inc/services/frame.hxx
index cc050cff67c1..492c3989c064 100644
--- a/framework/inc/services/frame.hxx
+++ b/framework/inc/services/frame.hxx
@@ -35,23 +35,6 @@
#include <macros/xserviceinfo.hxx>
#include <general.h>
-#include <com/sun/star/frame/XDispatchInformationProvider.hpp>
-#include <com/sun/star/frame/XComponentLoader.hpp>
-#include <com/sun/star/frame/XController.hpp>
-#include <com/sun/star/frame/XDispatch.hpp>
-#include <com/sun/star/frame/XDispatchProvider.hpp>
-#include <com/sun/star/frame/XDispatchRecorderSupplier.hpp>
-#include <com/sun/star/frame/XDispatchProviderInterception.hpp>
-#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
-#include <com/sun/star/lang/XEventListener.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
-#include <com/sun/star/frame/XFrameActionListener.hpp>
-#include <com/sun/star/frame/XFrames.hpp>
-#include <com/sun/star/frame/XFramesSupplier.hpp>
-#include <com/sun/star/frame/XTitle.hpp>
-#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
-#include <com/sun/star/task/XStatusIndicator.hpp>
-#include <com/sun/star/task/XStatusIndicatorFactory.hpp>
#include <com/sun/star/awt/XTopWindowListener.hpp>
#include <com/sun/star/awt/XWindow.hpp>
#include <com/sun/star/awt/XTopWindow.hpp>
@@ -60,8 +43,18 @@
#include <com/sun/star/awt/FocusEvent.hpp>
#include <com/sun/star/datatransfer/dnd/XDropTargetListener.hpp>
#include <com/sun/star/document/XActionLockable.hpp>
-#include <com/sun/star/util/XCloseable.hpp>
+#include <com/sun/star/lang/XEventListener.hpp>
+#include <com/sun/star/frame/XComponentLoader.hpp>
+#include <com/sun/star/frame/XController.hpp>
+#include <com/sun/star/frame/XDispatch.hpp>
+#include <com/sun/star/frame/XDispatchProviderInterceptor.hpp>
+#include <com/sun/star/frame/XFrame2.hpp>
+#include <com/sun/star/frame/XFrameActionListener.hpp>
#include <com/sun/star/frame/XLayoutManager.hpp>
+#include <com/sun/star/frame/XTitle.hpp>
+#include <com/sun/star/frame/XTitleChangeBroadcaster.hpp>
+#include <com/sun/star/task/XStatusIndicator.hpp>
+#include <com/sun/star/util/XCloseable.hpp>
#include <unotools/cmdoptions.hxx>
#include <cppuhelper/interfacecontainer.hxx>
@@ -111,11 +104,7 @@ class WindowCommandDispatch;
class Frame : // interfaces
public css::lang::XTypeProvider ,
public css::lang::XServiceInfo ,
- public css::frame::XFramesSupplier , // => XFrame => XComponent
- public css::frame::XDispatchProvider ,
- public css::frame::XDispatchProviderInterception ,
- public css::frame::XDispatchInformationProvider ,
- public css::task::XStatusIndicatorFactory ,
+ public css::frame::XFrame2 ,
public css::awt::XWindowListener , // => XEventListener
public css::awt::XTopWindowListener ,
public css::awt::XFocusListener ,
@@ -290,6 +279,19 @@ class Frame : // interfaces
virtual void SAL_CALL addTitleChangeListener ( const css::uno::Reference< css::frame::XTitleChangeListener >& xListener) throw (css::uno::RuntimeException);
virtual void SAL_CALL removeTitleChangeListener( const css::uno::Reference< css::frame::XTitleChangeListener >& xListenr ) throw (css::uno::RuntimeException);
+
+ //---------------------------------------------------------------------------------------------------------
+ // XFrame2 attributes
+ //---------------------------------------------------------------------------------------------------------
+ virtual css::uno::Reference<css::container::XNameContainer> SAL_CALL getUserDefinedAttributes() throw (css::uno::RuntimeException);
+
+ virtual css::uno::Reference<css::frame::XDispatchRecorderSupplier> SAL_CALL getDispatchRecorderSupplier() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setDispatchRecorderSupplier(const css::uno::Reference<css::frame::XDispatchRecorderSupplier>&) throw (css::uno::RuntimeException);
+
+ virtual css::uno::Reference<css::uno::XInterface> SAL_CALL getLayoutManager() throw (css::uno::RuntimeException);
+ virtual void SAL_CALL setLayoutManager(const css::uno::Reference<css::uno::XInterface>&) throw (css::uno::RuntimeException);
+
+
//---------------------------------------------------------------------------------------------------------
// PropertySetHelper => XPropertySet, XPropertySetInfo
//---------------------------------------------------------------------------------------------------------
@@ -331,7 +333,7 @@ class Frame : // interfaces
// non threadsafe
void impl_checkMenuCloser ( );
- void impl_setCloser ( const css::uno::Reference< css::frame::XFrame >& xFrame ,
+ void impl_setCloser ( const css::uno::Reference< css::frame::XFrame2 >& xFrame ,
sal_Bool bState );
void impl_disposeContainerWindow ( css::uno::Reference< css::awt::XWindow >& xWindow );
static const css::uno::Sequence< css::beans::Property > impl_getStaticPropertyDescriptor( );
@@ -403,8 +405,8 @@ class Frame : // interfaces
SvtCommandOptions m_aCommandOptions ; /// ref counted class to support disabling commands defined by configuration file
sal_Bool m_bSelfClose ; /// in case of CloseVetoException on method close() wqs thrown by ourself - we must close ourself later if no internal processes are running
sal_Bool m_bIsHidden ; /// indicates, if this frame is used in hidden mode or not
- static css::uno::WeakReference< css::frame::XFrame > m_xCloserFrame ; /// holds the only frame, which must show the special closer menu item (can be NULL!)
- css::uno::Reference< ::com::sun::star::frame::XLayoutManager > m_xLayoutManager ; /// is used to layout the child windows of the frame.
+ static css::uno::WeakReference< css::frame::XFrame2 > m_xCloserFrame ; /// holds the only frame, which must show the special closer menu item (can be NULL!)
+ css::uno::Reference< ::css::frame::XLayoutManager > m_xLayoutManager ; /// is used to layout the child windows of the frame.
css::uno::Reference< css::frame::XDispatchInformationProvider > m_xDispatchInfoHelper ;
css::uno::Reference< css::frame::XTitle > m_xTitleHelper ;
diff --git a/framework/inc/services/taskcreatorsrv.hxx b/framework/inc/services/taskcreatorsrv.hxx
index 2d80f43163dd..68654e0c89e7 100644
--- a/framework/inc/services/taskcreatorsrv.hxx
+++ b/framework/inc/services/taskcreatorsrv.hxx
@@ -28,7 +28,7 @@
#include <stdtypes.h>
#include <com/sun/star/uno/XInterface.hpp>
-#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/XFrame2.hpp>
#include <com/sun/star/lang/XTypeProvider.hpp>
#include <com/sun/star/lang/XServiceInfo.hpp>
#include <com/sun/star/lang/XMultiServiceFactory.hpp>
@@ -132,14 +132,14 @@ class TaskCreatorService : public css::lang::XTypeProvider
void implts_applyDocStyleToWindow(const css::uno::Reference< css::awt::XWindow >& xWindow) const;
- css::uno::Reference< css::frame::XFrame > implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame ,
+ css::uno::Reference< css::frame::XFrame2 > implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame ,
const css::uno::Reference< css::awt::XWindow >& xContainerWindow ,
const OUString& sName );
- void implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame >& xFrame );
- void implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame >& xFrame );
+ void implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame );
+ void implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame2 >& xFrame );
- void implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame >& xFrame );
+ void implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame );
OUString impl_filterNames( const OUString& sName );
};
diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx
index 6c6a32aeec67..44d30d03d4de 100644
--- a/framework/source/services/frame.cxx
+++ b/framework/source/services/frame.cxx
@@ -91,22 +91,23 @@
namespace framework{
-css::uno::WeakReference< css::frame::XFrame > Frame::m_xCloserFrame = css::uno::WeakReference< css::frame::XFrame >();
+css::uno::WeakReference< css::frame::XFrame2 > Frame::m_xCloserFrame = css::uno::WeakReference< css::frame::XFrame2 >();
//*****************************************************************************************************************
// XInterface, XTypeProvider, XServiceInfo
//*****************************************************************************************************************
-DEFINE_XINTERFACE_21 ( Frame ,
+DEFINE_XINTERFACE_22 ( Frame ,
OWeakObject ,
DIRECT_INTERFACE(css::lang::XTypeProvider ),
DIRECT_INTERFACE(css::lang::XServiceInfo ),
+ DIRECT_INTERFACE(css::frame::XFrame2 ),
DIRECT_INTERFACE(css::frame::XFramesSupplier ),
DIRECT_INTERFACE(css::frame::XFrame ),
- DIRECT_INTERFACE(css::lang::XComponent ),
DIRECT_INTERFACE(css::task::XStatusIndicatorFactory ),
DIRECT_INTERFACE(css::frame::XDispatchProvider ),
DIRECT_INTERFACE(css::frame::XDispatchInformationProvider ),
DIRECT_INTERFACE(css::frame::XDispatchProviderInterception ),
+ DIRECT_INTERFACE(css::lang::XComponent ),
DIRECT_INTERFACE(css::beans::XPropertySet ),
DIRECT_INTERFACE(css::beans::XPropertySetInfo ),
DIRECT_INTERFACE(css::awt::XWindowListener ),
@@ -121,18 +122,19 @@ DEFINE_XINTERFACE_21 ( Frame
DIRECT_INTERFACE(css::frame::XTitleChangeBroadcaster )
)
-DEFINE_XTYPEPROVIDER_20 ( Frame ,
+DEFINE_XTYPEPROVIDER_21 ( Frame ,
css::lang::XTypeProvider ,
css::lang::XServiceInfo ,
+ css::frame::XFrame2 ,
css::frame::XFramesSupplier ,
css::frame::XFrame ,
- css::lang::XComponent ,
css::task::XStatusIndicatorFactory ,
- css::beans::XPropertySet ,
- css::beans::XPropertySetInfo ,
css::frame::XDispatchProvider ,
css::frame::XDispatchInformationProvider ,
css::frame::XDispatchProviderInterception ,
+ css::lang::XComponent ,
+ css::beans::XPropertySet ,
+ css::beans::XPropertySetInfo ,
css::awt::XWindowListener ,
css::awt::XTopWindowListener ,
css::awt::XFocusListener ,
@@ -146,8 +148,8 @@ DEFINE_XTYPEPROVIDER_20 ( Frame
DEFINE_XSERVICEINFO_MULTISERVICE ( Frame ,
::cppu::OWeakObject ,
- SERVICENAME_FRAME ,
- IMPLEMENTATIONNAME_FRAME
+ "com.sun.star.frame.Frame" ,
+ OUString("com.sun.star.comp.framework.Frame")
)
DEFINE_INIT_SERVICE ( Frame,
@@ -1735,6 +1737,47 @@ void SAL_CALL Frame::removeTitleChangeListener( const css::uno::Reference< css::
xTitle->removeTitleChangeListener(xListener);
}
+css::uno::Reference<css::container::XNameContainer> SAL_CALL Frame::getUserDefinedAttributes() throw (css::uno::RuntimeException)
+{
+ // optional attribute
+ return 0;
+}
+
+css::uno::Reference<css::frame::XDispatchRecorderSupplier> SAL_CALL Frame::getDispatchRecorderSupplier() throw (css::uno::RuntimeException)
+{
+ ReadGuard aReadLock( m_aLock );
+ return m_xDispatchRecorderSupplier;
+}
+
+void SAL_CALL Frame::setDispatchRecorderSupplier(const css::uno::Reference<css::frame::XDispatchRecorderSupplier>& p) throw (css::uno::RuntimeException)
+{
+ TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
+
+ /* SAFE { */
+ WriteGuard aWriteLock( m_aLock );
+ m_xDispatchRecorderSupplier.set(p);
+ aWriteLock.unlock();
+ /* } SAFE */
+}
+
+css::uno::Reference<css::uno::XInterface> SAL_CALL Frame::getLayoutManager() throw (css::uno::RuntimeException)
+{
+ ReadGuard aReadLock( m_aLock );
+ return m_xLayoutManager;
+}
+
+void SAL_CALL Frame::setLayoutManager(const css::uno::Reference<css::uno::XInterface>& p1) throw (css::uno::RuntimeException)
+{
+ TransactionGuard aTransaction( m_aTransactionManager, E_HARDEXCEPTIONS );
+
+ /* SAFE { */
+ WriteGuard aWriteLock( m_aLock );
+ m_xLayoutManager.set(p1, css::uno::UNO_QUERY_THROW);
+ aWriteLock.unlock();
+ /* } SAFE */
+}
+
+
/*-****************************************************************************************************/
void Frame::implts_forgetSubFrames()
{
@@ -3011,7 +3054,7 @@ void Frame::implts_checkSuicide()
<TRUE/> enable; <FALSE/> disable this state
*/
-void Frame::impl_setCloser( /*IN*/ const css::uno::Reference< css::frame::XFrame >& xFrame ,
+void Frame::impl_setCloser( /*IN*/ const css::uno::Reference< css::frame::XFrame2 >& xFrame ,
/*IN*/ sal_Bool bState )
{
// Note: If start module isnt installed - no closer has to be shown!
@@ -3068,7 +3111,7 @@ void Frame::impl_checkMenuCloser()
FrameListAnalyzer::E_HIDDEN | FrameListAnalyzer::E_HELP | FrameListAnalyzer::E_BACKINGCOMPONENT);
// specify the new frame, which must have this special state ...
- css::uno::Reference< css::frame::XFrame > xNewCloserFrame;
+ css::uno::Reference< css::frame::XFrame2 > xNewCloserFrame;
// -----------------------------
// a)
@@ -3088,7 +3131,7 @@ void Frame::impl_checkMenuCloser()
{
// others[0] can't be the backing component!
// Because it's set at the special member aAnalyzer.m_xBackingComponent ... :-)
- xNewCloserFrame = aAnalyzer.m_lOtherVisibleFrames[0];
+ xNewCloserFrame.set( aAnalyzer.m_lOtherVisibleFrames[0], css::uno::UNO_QUERY_THROW );
}
// -----------------------------
// b)
@@ -3109,7 +3152,7 @@ void Frame::impl_checkMenuCloser()
// or must be enabled/disabled at all.
/* STATIC SAFE { */
WriteGuard aStaticWriteLock(LockHelper::getGlobalLock());
- css::uno::Reference< css::frame::XFrame > xCloserFrame (m_xCloserFrame.get(), css::uno::UNO_QUERY);
+ css::uno::Reference< css::frame::XFrame2 > xCloserFrame (m_xCloserFrame.get(), css::uno::UNO_QUERY);
if (xCloserFrame!=xNewCloserFrame)
{
if (xCloserFrame.is())
diff --git a/framework/source/services/taskcreatorsrv.cxx b/framework/source/services/taskcreatorsrv.cxx
index b90ef2cef4ab..52f5ebe60a7d 100644
--- a/framework/source/services/taskcreatorsrv.cxx
+++ b/framework/source/services/taskcreatorsrv.cxx
@@ -27,7 +27,7 @@
#include <loadenv/targethelper.hxx>
#include <services.h>
-#include <com/sun/star/frame/XFrame.hpp>
+#include <com/sun/star/frame/Frame.hpp>
#include <com/sun/star/frame/XController.hpp>
#include <com/sun/star/frame/XModel.hpp>
#include <com/sun/star/frame/XDesktop.hpp>
@@ -160,7 +160,7 @@ css::uno::Reference< css::uno::XInterface > SAL_CALL TaskCreatorService::createI
//------------------->
// create the new frame
- css::uno::Reference< css::frame::XFrame > xFrame = implts_createFrame(xParentFrame, xContainerWindow, sRightName);
+ css::uno::Reference< css::frame::XFrame2 > xFrame = implts_createFrame(xParentFrame, xContainerWindow, sRightName);
// special freature:
// A special listener will restore pos/size states in case
@@ -264,7 +264,7 @@ css::uno::Reference< css::awt::XWindow > TaskCreatorService::implts_createContai
}
//-----------------------------------------------
-css::uno::Reference< css::frame::XFrame > TaskCreatorService::implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame ,
+css::uno::Reference< css::frame::XFrame2 > TaskCreatorService::implts_createFrame( const css::uno::Reference< css::frame::XFrame >& xParentFrame ,
const css::uno::Reference< css::awt::XWindow >& xContainerWindow,
const OUString& sName )
{
@@ -275,7 +275,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreatorService::implts_createFrame
// <- SAFE
// create new frame.
- css::uno::Reference< css::frame::XFrame > xNewFrame( xSMGR->createInstance( SERVICENAME_FRAME ), css::uno::UNO_QUERY_THROW );
+ css::uno::Reference< css::frame::XFrame2 > xNewFrame = css::frame::Frame::create( comphelper::getComponentContext(xSMGR) );
// Set window on frame.
// Do it before calling any other interface methods ...
@@ -288,7 +288,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreatorService::implts_createFrame
{
css::uno::Reference< css::frame::XFramesSupplier > xSupplier (xParentFrame, css::uno::UNO_QUERY_THROW);
css::uno::Reference< css::frame::XFrames > xContainer = xSupplier->getFrames();
- xContainer->append( xNewFrame );
+ xContainer->append( css::uno::Reference<css::frame::XFrame>(xNewFrame, css::uno::UNO_QUERY_THROW) );
}
// Set it's API name (if there is one from outside)
@@ -299,7 +299,7 @@ css::uno::Reference< css::frame::XFrame > TaskCreatorService::implts_createFrame
}
//-----------------------------------------------
-void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame >& xFrame )
+void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame )
{
// SAFE ->
ReadGuard aReadLock( m_aLock );
@@ -320,7 +320,7 @@ void TaskCreatorService::implts_establishWindowStateListener( const css::uno::Re
}
//-----------------------------------------------
-void TaskCreatorService::implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame >& xFrame )
+void TaskCreatorService::implts_establishDocModifyListener( const css::uno::Reference< css::frame::XFrame2 >& xFrame )
{
// SAFE ->
ReadGuard aReadLock( m_aLock );
@@ -340,7 +340,7 @@ void TaskCreatorService::implts_establishDocModifyListener( const css::uno::Refe
}
//-----------------------------------------------
-void TaskCreatorService::implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame >& xFrame )
+void TaskCreatorService::implts_establishTitleBarUpdate( const css::uno::Reference< css::frame::XFrame2 >& xFrame )
{
// SAFE ->
ReadGuard aReadLock( m_aLock );