diff options
author | Andreas Schlüns <as@openoffice.org> | 2001-07-02 12:40:19 +0000 |
---|---|---|
committer | Andreas Schlüns <as@openoffice.org> | 2001-07-02 12:40:19 +0000 |
commit | b143c62f550f3e6cfa2a84c372d3f8b3fd9a9ca3 (patch) | |
tree | 79aa06240683ce8e521e84f20cb030c2aa8fd653 | |
parent | 19c01d03312f3d2b69d156972f57f2325d200b44 (diff) |
#79955# use new DispatchProviderinc/services/frame.hxx
-rw-r--r-- | framework/inc/services/frame.hxx | 4 | ||||
-rw-r--r-- | framework/prj/build.lst | 14 | ||||
-rw-r--r-- | framework/source/classes/targetfinder.cxx | 563 | ||||
-rw-r--r-- | framework/source/helper/makefile.mk | 12 | ||||
-rw-r--r-- | framework/source/register/registerservices.cxx | 12 | ||||
-rw-r--r-- | framework/source/register/registertemp.cxx | 12 | ||||
-rw-r--r-- | framework/source/services/desktop.cxx | 118 | ||||
-rw-r--r-- | framework/source/services/frame.cxx | 44 | ||||
-rw-r--r-- | framework/source/services/makefile.mk | 9 | ||||
-rw-r--r-- | framework/test/typecfg/cfgview.cxx | 226 | ||||
-rw-r--r-- | framework/test/typecfg/xml2xcd.cxx | 221 | ||||
-rw-r--r-- | framework/util/makefile.mk | 22 |
12 files changed, 861 insertions, 396 deletions
diff --git a/framework/inc/services/frame.hxx b/framework/inc/services/frame.hxx index 900d0dc599aa..f5e029a8320b 100644 --- a/framework/inc/services/frame.hxx +++ b/framework/inc/services/frame.hxx @@ -2,9 +2,9 @@ * * $RCSfile: frame.hxx,v $ * - * $Revision: 1.12 $ + * $Revision: 1.13 $ * - * last change: $Author: as $ $Date: 2001-06-19 10:37:04 $ + * last change: $Author: as $ $Date: 2001-07-02 13:39:33 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses diff --git a/framework/prj/build.lst b/framework/prj/build.lst index e2e5f30e23a3..9fcb382fe76d 100644 --- a/framework/prj/build.lst +++ b/framework/prj/build.lst @@ -1,10 +1,10 @@ fr framework : svtools NULL fr framework usr1 - all fr_mkout NULL -fr framework\source\unotypes nmake - all fr_unotypes NULL fr framework\source\threadhelp nmake - all fr_threadhelp NULL -fr framework\source\classes nmake - all fr_classes fr_unotypes fr_threadhelp NULL -fr framework\source\helper nmake - all fr_helper fr_unotypes fr_threadhelp NULL -fr framework\source\services nmake - all fr_services fr_unotypes fr_threadhelp NULL -fr framework\source\register nmake - all fr_register fr_unotypes fr_threadhelp NULL -fr framework\source\application nmake - all fr_application fr_unotypes fr_threadhelp NULL -fr framework\util nmake - all fr_util fr_classes fr_helper fr_services fr_register fr_application NULL +fr framework\source\classes nmake - all fr_classes fr_threadhelp NULL +fr framework\source\helper nmake - all fr_helper fr_threadhelp NULL +fr framework\source\dispatch nmake - all fr_dispatch fr_threadhelp NULL +fr framework\source\services nmake - all fr_services fr_threadhelp NULL +fr framework\source\register nmake - all fr_register fr_threadhelp NULL +fr framework\source\application nmake - all fr_application fr_threadhelp NULL +fr framework\util nmake - all fr_util fr_classes fr_helper fr_dispatch fr_services fr_register fr_application NULL diff --git a/framework/source/classes/targetfinder.cxx b/framework/source/classes/targetfinder.cxx index 6a523ea31bb8..85363910537f 100644 --- a/framework/source/classes/targetfinder.cxx +++ b/framework/source/classes/targetfinder.cxx @@ -2,9 +2,9 @@ * * $RCSfile: targetfinder.cxx,v $ * - * $Revision: 1.3 $ + * $Revision: 1.4 $ * - * last change: $Author: as $ $Date: 2001-03-29 13:17:13 $ + * last change: $Author: as $ $Date: 2001-07-02 13:40:02 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -75,6 +75,22 @@ #include <com/sun/star/frame/FrameSearchFlag.hpp> #endif +#ifndef _COM_SUN_STAR_FRAME_XDESKTOP_HPP_ +#include <com/sun/star/frame/XDesktop.hpp> +#endif + +#ifndef _COM_SUN_STAR_MOZILLA_XPLUGININSTANCE_HPP_ +#include <com/sun/star/mozilla/XPluginInstance.hpp> +#endif + +#ifndef _COM_SUN_STAR_FRAME_XTASK_HPP_ +#include <com/sun/star/frame/XTask.hpp> +#endif + +#ifndef _COM_SUN_STAR_FRAME_XFRAME_HPP_ +#include <com/sun/star/frame/XFrame.hpp> +#endif + //_________________________________________________________________________________________________________________ // other includes //_________________________________________________________________________________________________________________ @@ -89,10 +105,6 @@ namespace framework{ -using namespace ::rtl ; -using namespace ::com::sun::star::uno ; -using namespace ::com::sun::star::frame ; - //_________________________________________________________________________________________________________________ // non exported const //_________________________________________________________________________________________________________________ @@ -105,75 +117,361 @@ using namespace ::com::sun::star::frame ; // definitions //_________________________________________________________________________________________________________________ -//***************************************************************************************************************** -// constructor -//***************************************************************************************************************** -TargetFinder::TargetFinder() +/*-************************************************************************************************************//** + @short create new target info with valid values + @descr If you wish to call TargetFinder::classify...() methods you must give him + a lot of informations about currently set environment of a frame. + But ... sometimes you have all informations ... and sometimes you need a helper + to get it. These ctor implementations do both things for you. + You should call it with ALL or with NOTHING. + He use your values (at ALL) or try to get this informations by himself (at NOTHING). + After that you can use this filled target info to call you classify...(). + + @seealso method TargetFinder::classify...() + + @param "xFrame" , reference to frame which should be detected [MUST ] + @param "sTarget" , name of searched target [MUST ] + @param "nFlags" , search flags [MUST ] + @param "eType" , type of frame [OPTIONAL] + @param "bChildrens", Is children search possible? [OPTIONAL] + @param "bParent" , Is parent search possible? [OPTIONAL] + @param "sFrame" , name of frame for self-search [OPTIONAL] + @param "sParent" , parent name for parent-search [OPTIONAL] + @return - + + @onerror No error should occure ... if incoming parameters are correct :-) + @threadsafe No +*//*-*************************************************************************************************************/ +TargetInfo::TargetInfo( const ::rtl::OUString& sTarget , + sal_Int32 nFlags , + EFrameType eType , + sal_Bool bChildrens , + sal_Bool bParent , + const ::rtl::OUString& sFrame , + const ::rtl::OUString& sParent ) { + // Check incoming parameter. + LOG_ASSERT2( implcp_ctor( sTarget, nFlags, eType, bChildrens, bParent, sFrame, sParent ), "TargetInfo::TargetInfo( 2 )", "Invalid parameter detected!" ) + + // Set given values on internal member. + sTargetName = sTarget ; + nSearchFlags = nFlags ; + eFrameType = eType ; + bChildrenExist = bChildrens ; + bParentExist = bParent ; + sFrameName = sFrame ; + sParentName = sParent ; + bCreationAllowed = impl_getCreateFlag( nSearchFlags ) ; } //***************************************************************************************************************** -// destructor -//***************************************************************************************************************** -TargetFinder::~TargetFinder() +TargetInfo::TargetInfo( const css::uno::Reference< css::frame::XFrame >& xFrame , + const ::rtl::OUString& sTarget , + sal_Int32 nFlags ) { + // Check incoming parameter. + LOG_ASSERT2( implcp_ctor( xFrame, sTarget, nFlags ), "TargetInfo::TargetInfo( 1 )", "Invalid parameter detected!" ) + + // Set default values! + // So we must reset it to valid values only. + bChildrenExist = sal_False ; + bParentExist = sal_False ; + sFrameName = ::rtl::OUString(); + sParentName = ::rtl::OUString(); + + // Take given values into internal variables. + sTargetName = sTarget; + nSearchFlags = nFlags ; + + // Try to analyze environment of given frame to set all other member! + eFrameType = getFrameType( xFrame ); + switch( eFrameType ) + { + //case E_DESKTOP : // Nothing to do .. because: Desktop has no parent, no name ... Use default values! + // But - values for children info is set later ... + case E_PLUGINFRAME : + case E_TASK : + case E_FRAME : { + css::uno::Reference< css::frame::XFrame > xParent( xFrame->getCreator(), css::uno::UNO_QUERY ); + bParentExist = xParent.is(); + if( xParent.is() == sal_True ) + sParentName = xParent->getName(); + sFrameName = xFrame->getName(); + } + break; + } + + css::uno::Reference< css::frame::XFramesSupplier > xSupplier ( xFrame, css::uno::UNO_QUERY ); + css::uno::Reference< css::frame::XFrames > xChildrens ; + if( xSupplier.is() == sal_True ) + { + xChildrens = xSupplier->getFrames(); + if( xChildrens.is() == sal_True ) + { + bChildrenExist = xChildrens->hasElements(); + } + } + + bCreationAllowed = impl_getCreateFlag( nSearchFlags ); } -//***************************************************************************************************************** -// interface -//***************************************************************************************************************** -ETargetClass TargetFinder::classify( EFrameType eFrameType , - const OUString& sTargetName , - sal_Int32 nSearchFlags , - sal_Bool& bCreationAllowed , - sal_Bool bChildrenExist , - const OUString& sFrameName , - sal_Bool bParentExist , - const OUString& sParentName ) +/*-************************************************************************************************************//** + @short get an enum, which represent type of given frame + @descr This value can be used by calling following classify...() methods. + It regulate searching of targets. + Why we don't detect this type internal? + Mostly this helper is called from a frame or task implmentation directly and detection will be superflous. + But sometimes this information isn't available ... so we should support a generaly implementation + of this search algorithm :-) + + @seealso method classify...() + + @param "xFrame", reference to frame which should be detected + @return An enum value to classify the frame type. + + @onerror No error should occure ... if incoming parameters are correct :-) + @threadsafe No +*//*-*************************************************************************************************************/ +EFrameType TargetInfo::getFrameType( const css::uno::Reference< css::frame::XFrame >& xFrame ) +{ + // Check incoming parameter. + LOG_ASSERT2( implcp_getFrameType( xFrame ), "TargetFinder::getFrameType()", "Invalid parameter detected!" ) + + // Try to cast it to right interfaces to get informations about right frame type. + css::uno::Reference< css::frame::XDesktop > xDesktopCheck( xFrame, css::uno::UNO_QUERY ); + css::uno::Reference< css::mozilla::XPluginInstance > xPlugInCheck ( xFrame, css::uno::UNO_QUERY ); + css::uno::Reference< css::frame::XTask > xTaskCheck ( xFrame, css::uno::UNO_QUERY ); + css::uno::Reference< css::frame::XFrame > xFrameCheck ( xFrame, css::uno::UNO_QUERY ); + + EFrameType eType; + + if( xDesktopCheck.is() == sal_True ) { eType = E_DESKTOP ; } else + if( xPlugInCheck.is () == sal_True ) { eType = E_PLUGINFRAME; } else + if( xTaskCheck.is () == sal_True ) { eType = E_TASK ; } else + if( xFrameCheck.is () == sal_True ) { eType = E_FRAME ; } + #ifdef ENABLE_WARNINGS + else LOG_WARNING( "TargetFinder::getFrameType()", "Unknown frame implementation detected!" ) + #endif + + return eType; +} + +/*-************************************************************************************************************//** + @short get state of create flag + @descr These flag allow user to create a new frame if no one could be found! + + @attention Ignore it, if it is the only setted flag. + Why? Otherwise creation of frames by using same name without search for already existing frames + will be possible! This case produce more then one frame by using same name ... and it's not clear, which frame would be found + at further searches! It's better to ignore this case and disable creation. + + @seealso ctor + + @param "nSearchFlags", collection of setted flags + @return true , for setted flag + false, if CREATE flag the only one or isn't set + + @onerror We return false. +*//*-*************************************************************************************************************/ +sal_Bool TargetInfo::impl_getCreateFlag( sal_Int32 nSearchFlags ) +{ + bCreationAllowed = sal_False; + if( nSearchFlags != css::frame::FrameSearchFlag::CREATE ) + { + bCreationAllowed = (( nSearchFlags & css::frame::FrameSearchFlag::CREATE ) == css::frame::FrameSearchFlag::CREATE ); + } + return bCreationAllowed; +} + +/*-************************************************************************************************************//** + @short get a recommendation for searching right target + @descr Our caller search for a target which match with given parameter. + Give him a direction to find the right one. + These method never create or return a tree node! Thats your job! + We say: go up, go down or give you the permission to create new frame if search will fail! + + @attention XFrame::findFrame() and XDispatchProvider::queryDispatch() should understand + target names and searchflags ... but not in the same way. findFrame() can create + a new frame, if it is missing - queryDispatch() couldn't do that! Only the combination with a successfuly + dispatch() call should do that! + Another reason - there exist some "virtual" targets ... like "_helpagent", "_menubar". + These targets couldn't be handled by findFrame(); but by a queryDispatch(). + Thats why we implement different classify methods for different mechanism! + + @seealso method XFrame::findFrame() + @seealso method XDispatcher::queryDispatch() + @seealso struct TargetInfo + + @param "aInfo", information about search environment + @return An enum value to classify the direction for searching. + + @onerror E_UNKNOWN is returned. +*//*-*************************************************************************************************************/ +ETargetClass TargetFinder::classifyFindFrame( TargetInfo& aInfo ) { // Check incoming parameter - LOG_ASSERT2( implcp_classify( eFrameType, sTargetName, nSearchFlags, bCreationAllowed, bChildrenExist, sFrameName, bParentExist, sParentName ), "TargetFinder::classify()", "Invalid parameter detected!" ) + LOG_ASSERT2( implcp_classifyFindFrame( aInfo ), "TargetFinder::classifyFindFrame()", "Invalid parameter detected!" ) - // Initialize start values. - ETargetClass eResult = E_UNKNOWN ; // default result of method - bCreationAllowed = (( nSearchFlags & FrameSearchFlag::CREATE ) == FrameSearchFlag::CREATE ); // if search failed we must caller allow to create new task/frame + ETargetClass eResult = E_UNKNOWN; // Use some helper methods for different classes of tree nodes to get the result. - switch( eFrameType ) + switch( aInfo.eFrameType ) { - case E_DESKTOP : eResult = impl_classifyForDesktop( bChildrenExist, sTargetName, nSearchFlags ); + case E_DESKTOP : eResult = impl_classifyForDesktop_findFrame( aInfo.bChildrenExist, aInfo.sTargetName, aInfo.nSearchFlags ); break; - case E_PLUGINFRAME : eResult = impl_classifyForPlugInFrame( bParentExist, bChildrenExist, sFrameName, sTargetName, nSearchFlags ); + case E_PLUGINFRAME : eResult = impl_classifyForPlugInFrame_findFrame( aInfo.bParentExist, aInfo.bChildrenExist, aInfo.sFrameName, aInfo.sTargetName, aInfo.nSearchFlags ); break; - case E_TASK : eResult = impl_classifyForTask( bParentExist, bChildrenExist, sFrameName, sTargetName, nSearchFlags ); + case E_TASK : eResult = impl_classifyForTask_findFrame( aInfo.bParentExist, aInfo.bChildrenExist, aInfo.sFrameName, aInfo.sTargetName, aInfo.nSearchFlags ); break; - case E_FRAME : eResult = impl_classifyForFrame( bParentExist, bChildrenExist, sFrameName, sParentName, sTargetName, nSearchFlags ); + case E_FRAME : eResult = impl_classifyForFrame_findFrame( aInfo.bParentExist, aInfo.bChildrenExist, aInfo.sFrameName, aInfo.sParentName, aInfo.sTargetName, aInfo.nSearchFlags ); break; } // It doesnt matter if CREATE flag is set or not ... // If follow results are returned by our helper methods - the result will be clear! // In these cases we dont can allow (or must!) creation of new frames/tasks... + LOG_ASSERT2( eResult==E_MENUBAR || eResult==E_HELPAGENT, "TargetFinder::classifyFindFrame()", "Invalid search result found!") if ( - ( eResult == E_UNKNOWN ) || ( eResult == E_CREATETASK ) || ( eResult == E_SELF ) || ( eResult == E_PARENT ) || ( eResult == E_BEAMER ) ) { - bCreationAllowed = sal_False; + aInfo.bCreationAllowed = sal_False; } return eResult; } //***************************************************************************************************************** -// private method -//***************************************************************************************************************** -ETargetClass TargetFinder::impl_classifyForDesktop( sal_Bool bChildrenExist , - const OUString& sTargetName , - sal_Int32 nSearchFlags ) +ETargetClass TargetFinder::classifyQueryDispatch( TargetInfo& aInfo ) +{ + // Check incoming parameter + LOG_ASSERT2( implcp_classifyQueryDispatch( aInfo ), "TargetFinder::classifyQueryDispatch()", "Invalid parameter detected!" ) + + ETargetClass eResult = E_UNKNOWN; + + //************************************************************************************************************* + // I ) handle "_menubar" + // II) handle "_helpagent" + // DESKTOP => Could not be handled by our desktop ... + // because: Its a supported property of a task ... but which one should be used, if call comes from the top?! + // TASK & PLUGINFRAME => Supported! return SELF + // FRAME => Not supported ... but search for tasks ... if flags allow this search. + //************************************************************************************************************* + if( aInfo.sTargetName == SPECIALTARGET_MENUBAR ) + { + switch( aInfo.eFrameType ) + { + case E_PLUGINFRAME : + case E_TASK : eResult = E_MENUBAR; + break; + case E_FRAME : if( aInfo.bParentExist == sal_True ) + { + eResult = E_FORWARD_UP; + } + break; + } + } + else + if( aInfo.sTargetName == SPECIALTARGET_HELPAGENT ) + { + switch( aInfo.eFrameType ) + { + case E_PLUGINFRAME : + case E_TASK : eResult = E_HELPAGENT; + break; + case E_FRAME : if( aInfo.bParentExist == sal_True ) + { + eResult = E_FORWARD_UP; + } + break; + } + } + //************************************************************************************************************* + // III ) handle "_blank" + // DESKTOP => Only the desktop can create new tasks ... he has a special dispatch helper to do that! + // return CREATETASK + // TASK + // PLUGINFRAME + // FRAME => They couldn't create any new task => They must forward it to the desktop dispatch helper! + // return FORWARD_UP + //************************************************************************************************************* + else + if( aInfo.sTargetName == SPECIALTARGET_BLANK ) + { + switch( aInfo.eFrameType ) + { + case E_DESKTOP : eResult = E_CREATETASK; + break; + case E_PLUGINFRAME : + case E_TASK : + case E_FRAME : if( aInfo.bParentExist == sal_True ) + { + eResult = E_FORWARD_UP; + } + break; + } + } + //************************************************************************************************************* + // IV) There exist no other special targets or flag combinations ... + // I think we can use helper for normal findFrame() classify here! + //************************************************************************************************************* + else + { + switch( aInfo.eFrameType ) + { + case E_DESKTOP : eResult = impl_classifyForDesktop_findFrame( aInfo.bChildrenExist, aInfo.sTargetName, aInfo.nSearchFlags ); + break; + case E_PLUGINFRAME : eResult = impl_classifyForPlugInFrame_findFrame( aInfo.bParentExist, aInfo.bChildrenExist, aInfo.sFrameName, aInfo.sTargetName, aInfo.nSearchFlags ); + break; + case E_TASK : eResult = impl_classifyForTask_findFrame( aInfo.bParentExist, aInfo.bChildrenExist, aInfo.sFrameName, aInfo.sTargetName, aInfo.nSearchFlags ); + break; + case E_FRAME : eResult = impl_classifyForFrame_findFrame( aInfo.bParentExist, aInfo.bChildrenExist, aInfo.sFrameName, aInfo.sParentName, aInfo.sTargetName, aInfo.nSearchFlags ); + break; + } + } + + // It doesnt matter if CREATE flag is set or not ... + // If follow results are returned by our helper methods - the result will be clear! + // In these cases we dont can allow (or must!) creation of new frames/tasks... + if ( + ( eResult == E_CREATETASK ) || + ( eResult == E_SELF ) || + ( eResult == E_PARENT ) || + ( eResult == E_BEAMER ) || + ( eResult == E_MENUBAR ) || + ( eResult == E_HELPAGENT ) + ) + { + aInfo.bCreationAllowed = sal_False; + } + + return eResult; +} + +/*-************************************************************************************************************//** + @short helper methods for classify...() + @descr Every tree node (desktop, frame, task ...) has another preference shares to search a target. + With these helper methods we differ between these search algorithm! + + @seealso method classify...() + + @param "bParentExist" set if a parent exist for caller tree node + @param "bChildrenExist" set if some children exist for caller tree node + @param "sFrameName" name of current tree node (used for SELF flag to break search earlier!) + @param "sParentName" name of current tree node (used for PARENT flag to break search earlier!) + @param "sTargetName" name of searched target tree node + @param "nSearchFlags" flags to regulate search in tree + @param "bTopFrame" used to break upper searches at a top frame if search outside current task isnt allowed! + @return A decision about valid search direction. + + @onerror E_UNKNOWN is returned. +*//*-*************************************************************************************************************/ +ETargetClass TargetFinder::impl_classifyForDesktop_findFrame( sal_Bool bChildrenExist , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags ) { ETargetClass eResult = E_UNKNOWN; @@ -206,12 +504,12 @@ ETargetClass TargetFinder::impl_classifyForDesktop( sal_Bool bChildre // if no existing one can be found. //********************************************************************************************************* if ( - ( nSearchFlags & FrameSearchFlag::TASKS ) && + ( nSearchFlags & css::frame::FrameSearchFlag::TASKS ) && ( - !( nSearchFlags & FrameSearchFlag::CHILDREN ) && - !( nSearchFlags & FrameSearchFlag::SIBLINGS ) && - !( nSearchFlags & FrameSearchFlag::PARENT ) && - !( nSearchFlags & FrameSearchFlag::SELF ) + !( nSearchFlags & css::frame::FrameSearchFlag::CHILDREN ) && + !( nSearchFlags & css::frame::FrameSearchFlag::SIBLINGS ) && + !( nSearchFlags & css::frame::FrameSearchFlag::PARENT ) && + !( nSearchFlags & css::frame::FrameSearchFlag::SELF ) ) ) { @@ -224,8 +522,8 @@ ETargetClass TargetFinder::impl_classifyForDesktop( sal_Bool bChildre // Ignore flag if no childrens exist! //***************************************************************************************************** if ( - ( nSearchFlags & FrameSearchFlag::CHILDREN ) && - ( bChildrenExist == sal_True ) + ( nSearchFlags & css::frame::FrameSearchFlag::CHILDREN ) && + ( bChildrenExist == sal_True ) ) { eResult = E_DEEP_DOWN; @@ -236,7 +534,7 @@ ETargetClass TargetFinder::impl_classifyForDesktop( sal_Bool bChildre // These change a deep to a flat search! // Otherwise ... flag can be ignored - because the desktop has no siblings! //***************************************************************************************************** - if( nSearchFlags & FrameSearchFlag::SIBLINGS ) + if( nSearchFlags & css::frame::FrameSearchFlag::SIBLINGS ) { switch( eResult ) { @@ -259,29 +557,25 @@ ETargetClass TargetFinder::impl_classifyForDesktop( sal_Bool bChildre } //***************************************************************************************************************** -// private method -//***************************************************************************************************************** -ETargetClass TargetFinder::impl_classifyForPlugInFrame ( sal_Bool bParentExist , - sal_Bool bChildrenExist , - const OUString& sFrameName , - const OUString& sTargetName , - sal_Int32 nSearchFlags ) +ETargetClass TargetFinder::impl_classifyForPlugInFrame_findFrame( sal_Bool bParentExist , + sal_Bool bChildrenExist , + const ::rtl::OUString& sFrameName , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags ) { // At the moment a PlugInFrame is a special task ... but we can use the same search algorithm! - return impl_classifyForTask( bParentExist, bChildrenExist, sFrameName, sTargetName, nSearchFlags ); + return impl_classifyForTask_findFrame( bParentExist, bChildrenExist, sFrameName, sTargetName, nSearchFlags ); } //***************************************************************************************************************** -// private method -//***************************************************************************************************************** -ETargetClass TargetFinder::impl_classifyForTask( sal_Bool bParentExist , - sal_Bool bChildrenExist , - const OUString& sFrameName , - const OUString& sTargetName , - sal_Int32 nSearchFlags ) +ETargetClass TargetFinder::impl_classifyForTask_findFrame( sal_Bool bParentExist , + sal_Bool bChildrenExist , + const ::rtl::OUString& sFrameName , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags ) { - ETargetClass eResult = E_UNKNOWN ; - sal_Bool bLeaveTask = (( nSearchFlags & FrameSearchFlag::TASKS ) == FrameSearchFlag::TASKS ); // we must know if we can search outside current task + ETargetClass eResult = E_UNKNOWN ; + sal_Bool bLeaveTask = (( nSearchFlags & css::frame::FrameSearchFlag::TASKS ) == css::frame::FrameSearchFlag::TASKS ); // we must know if we can search outside current task //************************************************************************************************************* // I) Handle special target names. @@ -341,8 +635,8 @@ ETargetClass TargetFinder::impl_classifyForTask( sal_Bool bParentE // Use given frame name to do that. It couldn't be empty(!) - because this was handled in step I.II). //********************************************************************************************************* if ( - ( nSearchFlags & FrameSearchFlag::SELF ) && - ( sTargetName == sFrameName ) + ( nSearchFlags & css::frame::FrameSearchFlag::SELF ) && + ( sTargetName == sFrameName ) ) { eResult = E_SELF; @@ -354,10 +648,10 @@ ETargetClass TargetFinder::impl_classifyForTask( sal_Bool bParentE // Don't check name of parent here - otherwise we return the desktop as result ... //********************************************************************************************************* if ( - ( eResult != E_SELF ) && - ( nSearchFlags & FrameSearchFlag::PARENT ) && - ( bParentExist == sal_True ) && - ( bLeaveTask == sal_True ) + ( eResult != E_SELF ) && + ( nSearchFlags & css::frame::FrameSearchFlag::PARENT ) && + ( bParentExist == sal_True ) && + ( bLeaveTask == sal_True ) ) { eResult = E_FORWARD_UP; @@ -368,9 +662,9 @@ ETargetClass TargetFinder::impl_classifyForTask( sal_Bool bParentE // Ignore flag if no childrens exist! //********************************************************************************************************* if ( - ( eResult != E_SELF ) && - ( nSearchFlags & FrameSearchFlag::CHILDREN ) && - ( bChildrenExist == sal_True ) + ( eResult != E_SELF ) && + ( nSearchFlags & css::frame::FrameSearchFlag::CHILDREN ) && + ( bChildrenExist == sal_True ) ) { switch( eResult ) @@ -387,8 +681,8 @@ ETargetClass TargetFinder::impl_classifyForTask( sal_Bool bParentE // These change a deep to a flat search! //********************************************************************************************************* if ( - ( eResult != E_SELF ) && - ( nSearchFlags & FrameSearchFlag::SIBLINGS ) + ( eResult != E_SELF ) && + ( nSearchFlags & css::frame::FrameSearchFlag::SIBLINGS ) ) { switch( eResult ) @@ -416,14 +710,12 @@ ETargetClass TargetFinder::impl_classifyForTask( sal_Bool bParentE } //***************************************************************************************************************** -// private method -//***************************************************************************************************************** -ETargetClass TargetFinder::impl_classifyForFrame( sal_Bool bParentExist , - sal_Bool bChildrenExist , - const OUString& sFrameName , - const OUString& sParentName , - const OUString& sTargetName , - sal_Int32 nSearchFlags ) +ETargetClass TargetFinder::impl_classifyForFrame_findFrame( sal_Bool bParentExist , + sal_Bool bChildrenExist , + const ::rtl::OUString& sFrameName , + const ::rtl::OUString& sParentName , + const ::rtl::OUString& sTargetName , + sal_Int32 nSearchFlags ) { ETargetClass eResult = E_UNKNOWN; @@ -509,8 +801,8 @@ ETargetClass TargetFinder::impl_classifyForFrame( sal_Bool bParentE // Use given frame name to do that. It couldn't be empty(!) - because this was handled in step I.II). //********************************************************************************************************* if ( - ( nSearchFlags & FrameSearchFlag::SELF ) && - ( sTargetName == sFrameName ) + ( nSearchFlags & css::frame::FrameSearchFlag::SELF ) && + ( sTargetName == sFrameName ) ) { eResult = E_SELF; @@ -522,9 +814,9 @@ ETargetClass TargetFinder::impl_classifyForFrame( sal_Bool bParentE // Ignore flag if we are a top frame and search outside current task isnt allowed. //********************************************************************************************************* if ( - ( eResult != E_SELF ) && - ( nSearchFlags & FrameSearchFlag::PARENT ) && - ( bParentExist == sal_True ) + ( eResult != E_SELF ) && + ( nSearchFlags & css::frame::FrameSearchFlag::PARENT ) && + ( bParentExist == sal_True ) ) { if( sParentName == sTargetName ) @@ -542,10 +834,10 @@ ETargetClass TargetFinder::impl_classifyForFrame( sal_Bool bParentE // Ignore flag if no childrens exist! Combine it with already set decisions! //********************************************************************************************************* if ( - ( eResult != E_SELF ) && - ( eResult != E_PARENT ) && - ( nSearchFlags & FrameSearchFlag::CHILDREN ) && - ( bChildrenExist == sal_True ) + ( eResult != E_SELF ) && + ( eResult != E_PARENT ) && + ( nSearchFlags & css::frame::FrameSearchFlag::CHILDREN ) && + ( bChildrenExist == sal_True ) ) { switch( eResult ) @@ -562,9 +854,9 @@ ETargetClass TargetFinder::impl_classifyForFrame( sal_Bool bParentE // These change a deep to a flat search! //********************************************************************************************************* if ( - ( eResult != E_SELF ) && - ( eResult != E_PARENT ) && - ( nSearchFlags & FrameSearchFlag::SIBLINGS ) + ( eResult != E_SELF ) && + ( eResult != E_PARENT ) && + ( nSearchFlags & css::frame::FrameSearchFlag::SIBLINGS ) ) { switch( eResult ) @@ -591,4 +883,83 @@ ETargetClass TargetFinder::impl_classifyForFrame( sal_Bool bParentE return eResult; } +/*-****************************************************************************************************//** + @short debug-methods to check incoming parameter of some other mehods of this class + @descr The follow methods are used to check parameters for other methods + of this class. The return value is used directly for an ASSERT(...). + This mechanism is active in debug version only! + + @seealso FRAMEWORK_ASSERT in implementation! + + @param references to checking variables + @return sal_False on invalid parameter + @return sal_True otherwise + + @onerror - +*//*-*****************************************************************************************************/ + +#ifdef ENABLE_ASSERTIONS + +//***************************************************************************************************************** +sal_Bool TargetInfo::implcp_ctor( const ::rtl::OUString& sTarget , + sal_Int32 nFlags , + EFrameType eType , + sal_Bool bChildrens , + sal_Bool bParent , + const ::rtl::OUString& sFrame , + const ::rtl::OUString& sParent ) +{ + return( + ( &sTarget == NULL ) || + ( eType == E_UNKNOWNFRAME ) || + ( + ( bChildrens != sal_True ) && + ( bChildrens != sal_False ) + ) || + ( + ( bParent != sal_True ) && + ( bParent != sal_False ) + ) || + ( &sFrame == NULL ) || + ( &sParent == NULL ) + ); +} + +//***************************************************************************************************************** +// Attention: - empty "sTarget" is allowed! => equal to "_self" +// - there exist no test for flags! +sal_Bool TargetInfo::implcp_ctor( const css::uno::Reference< css::frame::XFrame >& xFrame , + const ::rtl::OUString& sTarget , + sal_Int32 nFlags ) +{ + return( + ( &xFrame == NULL ) || + ( xFrame.is() == sal_False ) || + ( &sTarget == NULL ) + ); +} + +//***************************************************************************************************************** +sal_Bool TargetInfo::implcp_getFrameType( const css::uno::Reference< css::frame::XFrame >& xFrame ) +{ + return( + ( &xFrame == NULL ) || + ( xFrame.is() == sal_False ) + ); +} + +//***************************************************************************************************************** +sal_Bool TargetFinder::implcp_classifyFindFrame( const TargetInfo& aInfo ) +{ + return( &aInfo == NULL ); +} + +//***************************************************************************************************************** +sal_Bool TargetFinder::implcp_classifyQueryDispatch( const TargetInfo& aInfo ) +{ + return( &aInfo == NULL ); +} + +#endif // #ifdef ENABLE_ASSERTIONS + } // namespace framework diff --git a/framework/source/helper/makefile.mk b/framework/source/helper/makefile.mk index 21a9aa511749..74c0db018b3b 100644 --- a/framework/source/helper/makefile.mk +++ b/framework/source/helper/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.14 $ +# $Revision: 1.15 $ # -# last change: $Author: cd $ $Date: 2001-06-13 06:02:04 $ +# last change: $Author: as $ $Date: 2001-07-02 13:40:07 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -81,23 +81,17 @@ CDEFS+=-DCOMPMOD_NAMESPACE=framework # --- Generate ----------------------------------------------------- SLOFILES= $(SLO)$/timerhelper.obj \ - $(SLO)$/helpagentdispatcher.obj \ $(SLO)$/otasksaccess.obj \ $(SLO)$/ostatusindicatorfactory.obj \ $(SLO)$/otasksenumeration.obj \ $(SLO)$/ocomponentaccess.obj \ $(SLO)$/ocomponentenumeration.obj \ - $(SLO)$/odispatchprovider.obj \ - $(SLO)$/odesktopdispatcher.obj \ $(SLO)$/oframes.obj \ $(SLO)$/opluginframedispatcher.obj \ $(SLO)$/ostatusindicatorfactory.obj \ $(SLO)$/ostatusindicator.obj \ - $(SLO)$/ointerceptionhelper.obj \ - $(SLO)$/omenudispatcher.obj \ $(SLO)$/imageproducer.obj \ - $(SLO)$/xmldocproperties.obj \ - $(SLO)$/omailtodispatcher.obj + $(SLO)$/xmldocproperties.obj # --- Targets ------------------------------------------------------ diff --git a/framework/source/register/registerservices.cxx b/framework/source/register/registerservices.cxx index 74cd669ca4d3..01c309b69dad 100644 --- a/framework/source/register/registerservices.cxx +++ b/framework/source/register/registerservices.cxx @@ -2,9 +2,9 @@ * * $RCSfile: registerservices.cxx,v $ * - * $Revision: 1.10 $ + * $Revision: 1.11 $ * - * last change: $Author: as $ $Date: 2001-02-16 12:20:19 $ + * last change: $Author: as $ $Date: 2001-07-02 13:40:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -118,6 +118,10 @@ #include <services/frame.hxx> #endif +#ifndef __FRAMEWORK_DISPATCH_SOUNDHANDLER_HXX_ +#include <dispatch/soundhandler.hxx> +#endif + COMPONENTGETIMPLEMENTATIONENVIRONMENT COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::URLTransformer ) @@ -126,6 +130,7 @@ COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::URLTransformer COMPONENTINFO( ::framework::Task ) COMPONENTINFO( ::framework::Frame ) COMPONENTINFO( ::framework::DocumentProperties ) + COMPONENTINFO( ::framework::SoundHandler ) ) COMPONENTGETFACTORY ( IFFACTORY( ::framework::URLTransformer ) else @@ -133,5 +138,6 @@ COMPONENTGETFACTORY ( IFFACTORY( ::framework::URLTransformer IFFACTORY( ::framework::Desktop ) else IFFACTORY( ::framework::Task ) else IFFACTORY( ::framework::Frame ) else - IFFACTORY( ::framework::DocumentProperties ) + IFFACTORY( ::framework::DocumentProperties ) else + IFFACTORY( ::framework::SoundHandler ) ) diff --git a/framework/source/register/registertemp.cxx b/framework/source/register/registertemp.cxx index da91cac190b7..3646162c0224 100644 --- a/framework/source/register/registertemp.cxx +++ b/framework/source/register/registertemp.cxx @@ -2,9 +2,9 @@ * * $RCSfile: registertemp.cxx,v $ * - * $Revision: 1.5 $ + * $Revision: 1.6 $ * - * last change: $Author: as $ $Date: 2001-03-29 13:17:14 $ + * last change: $Author: as $ $Date: 2001-07-02 13:40:08 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -107,16 +107,22 @@ #include <services/typedetection.hxx> #endif +#ifndef __FRAMEWORK_SERVICES_CONTENTHANDLERFACTORY_HXX_ +#include <services/contenthandlerfactory.hxx> +#endif + COMPONENTGETIMPLEMENTATIONENVIRONMENT COMPONENTWRITEINFO ( COMPONENTINFO( ::framework::MediaTypeDetectionHelper ) COMPONENTINFO( ::framework::FrameLoaderFactory ) COMPONENTINFO( ::framework::FilterFactory ) COMPONENTINFO( ::framework::TypeDetection ) + COMPONENTINFO( ::framework::ContentHandlerFactory ) ) COMPONENTGETFACTORY ( IFFACTORY( ::framework::MediaTypeDetectionHelper ) else IFFACTORY( ::framework::FrameLoaderFactory ) else IFFACTORY( ::framework::FilterFactory ) else - IFFACTORY( ::framework::TypeDetection ) + IFFACTORY( ::framework::TypeDetection ) else + IFFACTORY( ::framework::ContentHandlerFactory ) ) diff --git a/framework/source/services/desktop.cxx b/framework/source/services/desktop.cxx index 03cb523bda28..b0cd15caad3a 100644 --- a/framework/source/services/desktop.cxx +++ b/framework/source/services/desktop.cxx @@ -2,9 +2,9 @@ * * $RCSfile: desktop.cxx,v $ * - * $Revision: 1.14 $ + * $Revision: 1.15 $ * - * last change: $Author: as $ $Date: 2001-06-12 06:38:15 $ + * last change: $Author: as $ $Date: 2001-07-02 13:40:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,20 +67,16 @@ #include <services/desktop.hxx> #endif -//#ifndef __FRAMEWORK_FRAME_HXX_ -//#include <services/frame.hxx> -//#endif - -#ifndef __FRAMEWORK_OTASKSACCESS_HXX_ +#ifndef __FRAMEWORK_HELPER_OTASKSACCESS_HXX_ #include <helper/otasksaccess.hxx> #endif -#ifndef __FRAMEWORK_OCOMPONENTACCESS_HXX_ +#ifndef __FRAMEWORK_HELPER_OCOMPONENTACCESS_HXX_ #include <helper/ocomponentaccess.hxx> #endif -#ifndef __FRAMEWORK_ODESKTOPDISPATCHER_HXX_ -#include <helper/odesktopdispatcher.hxx> +#ifndef __FRAMEWORK_DISPATCH_DISPATCHPROVIDER_HXX_ +#include <dispatch/dispatchprovider.hxx> #endif #ifndef __FRAMEWORK_CLASSES_TARGETFINDER_HXX_ @@ -291,11 +287,16 @@ Desktop::Desktop( const Reference< XMultiServiceFactory >& xFactory ) // Safe impossible cases // We can't work without this helper! LOG_ASSERT( !(m_xFramesHelper.is()==sal_False), "Desktop::Desktop()\nFramesHelper is not valid. XFrames, XIndexAccess and XElementAcces are not supported!\n") - +/*OBSOLETE // Create a new helper to dispatch "_blank" in a correctly way. ODesktopDispatcher* pDispatchHelper = new ODesktopDispatcher( m_xFactory, this ); m_xDispatchHelper = Reference< XDispatch >( (OWeakObject*)pDispatchHelper, UNO_QUERY ); LOG_ASSERT( !(m_xDispatchHelper.is()==sal_False), "Desktop::Desktop()\nDispatchHelper is not valid. XDispatch will not work correctly for \"_blank\"!\n") +*/ + // Create a new helper to handle dispatches like: "_blank" ... + DispatchProvider* pDispatchHelper = new DispatchProvider( m_xFactory, this ); + m_xDispatchHelper = Reference< XDispatchProvider >( (OWeakObject*)pDispatchHelper, UNO_QUERY ); + LOG_ASSERT( !(m_xDispatchHelper.is()==sal_False), "Desktop::Desktop()\nDispatchHelper is not valid. XDispatch will not work correctly!\n") // I'am the desktop - and use my frame container in a special mode. // If last child task is removed I must die! @@ -785,30 +786,7 @@ Reference< XDispatch > SAL_CALL Desktop::queryDispatch( const URL& aURL { // Ready for multithreading ResetableGuard aGuard( m_aLock ); - // Safe impossible cases - // Method not defined for all incoming parameter. - LOG_ASSERT( impldbg_checkParameter_queryDispatch( aURL, sTargetFrameName, nSearchFlags ), "Desktop::queryDispatch()\nInvalid parameter detected!\n" ) - LOG_PARAMETER_QUERYDISPATCH( "Desktop", m_sName, aURL, sTargetFrameName, nSearchFlags ) - - // Set default return value. - Reference< XDispatch > xDispatcher; - - if( sTargetFrameName == SPECIALTARGET_BLANK ) - { - xDispatcher = m_xDispatchHelper; - } - else - { - Reference< XFrame > xTarget = findFrame( sTargetFrameName, nSearchFlags ); - if( xTarget.is() == sal_True ) - { - xDispatcher = Reference< XDispatchProvider >( xTarget, UNO_QUERY )->queryDispatch( aURL, SPECIALTARGET_SELF, FrameSearchFlag::SELF ); - } - } - - LOG_RESULT_QUERYDISPATCH( "Desktop", m_sName, xDispatcher ) - // Return dispatcher for given URL. - return xDispatcher; + return m_xDispatchHelper->queryDispatch( aURL, sTargetFrameName, nSearchFlags ); } //***************************************************************************************************************** @@ -818,54 +796,7 @@ Sequence< Reference< XDispatch > > SAL_CALL Desktop::queryDispatches( const Sequ { // Ready for multithreading ResetableGuard aGuard( m_aLock ); - - // Set default return value if no dispatcher will be found. - Sequence< Reference< XDispatch > > seqDispatcher; - - // Get count of all given discriptors ... - sal_Int32 nDescriptorCount = seqDescripts.getLength(); - if ( nDescriptorCount > 0 ) - { - // ... to get enough memory for expected dispatcher. - // We can't get more dispatcher as descriptors exist! - Reference< XDispatch >* pDispatcher = new Reference< XDispatch >[nDescriptorCount]; - // Safe first position in "dynamic memory list" for later access! - Reference< XDispatch >* pAnchor = pDispatcher; - // We must count all getted dispatcher to create return sequence. - // There can't be more but fewer dispatcher then given descriptors! - sal_Int32 nDispatcher = 0; - // This is a helper variable to hold current returned dispatcher of query. - Reference< XDispatch > xDispatcher; - - // Step over all descriptors and try to get any dispatcher for it. - for ( sal_Int32 nPosition=0; nPosition<nDescriptorCount; ++nPosition ) - { - xDispatcher = queryDispatch( seqDescripts[nPosition].FeatureURL , - seqDescripts[nPosition].FrameName , - seqDescripts[nPosition].SearchFlags ); - // If any dispatcher for given parameters found ... - if ( xDispatcher.is() == sal_True ) - { - // ... safe it temporaly in "memory list" ... - *pDispatcher = xDispatcher; - // .. actualize position in these list ... - ++pDispatcher; - // ... and count of found dispatcher. - ++nDispatcher; - } - } - - // Safe impossible cases. - // If we have more dispatcher then descriptors => we have a problem in algorithm! - LOG_ASSERT( !(nDispatcher>nDescriptorCount), "Desktop::queryDispatch()\nAlgorithm error. There are more dispatcher as reserved fields in memory!\n" ) - - // Copy "memory list" to return sequence. - // We copy all valid dispatcher to return sequence! (nDispatcher is count of these objects!) - seqDispatcher = Sequence< Reference< XDispatch > >( pDispatcher, nDispatcher ); - } - - // Return result of this operation. - return seqDispatcher; + return m_xDispatchHelper->queryDispatches( seqDescripts ); } //***************************************************************************************************************** @@ -992,12 +923,8 @@ Reference< XFrame > SAL_CALL Desktop::findFrame( const OUString& sTargetF Reference< XFrame > xSearchedFrame; // Ask helper for right decision for given parameter. - sal_Bool bCreationAllowed = sal_False; - ETargetClass eResult = TargetFinder::classify( E_DESKTOP , - sTargetFrameName , - nSearchFlags , - bCreationAllowed , - m_aChildTaskContainer.hasElements() ); + TargetInfo aInfo ( sTargetFrameName, nSearchFlags, E_DESKTOP, m_aChildTaskContainer.hasElements(), sal_False, ::rtl::OUString(), ::rtl::OUString() ); + ETargetClass eResult = TargetFinder::classifyFindFrame( aInfo ); switch( eResult ) { case E_CREATETASK : { @@ -1016,16 +943,21 @@ Reference< XFrame > SAL_CALL Desktop::findFrame( const OUString& sTargetF xSearchedFrame = m_aChildTaskContainer.searchFlatDown( sTargetFrameName ); } break; + #ifdef ENABLE_WARNINGS default : { - LOG_WARNING( "Desktop::findFrame()", "Unexpected result of TargetFinder::classify() detected!" ) + if( eResult != E_UNKNOWN ) + { + LOG_ERROR( "Desktop::findFrame()", "Unexpected result of TargetFinder::classify() detected!" ) + } } break; + #endif } // If no right target could be found - but CREATE flag was set ... do it; create a new task. if ( - ( xSearchedFrame.is() == sal_False ) && - ( bCreationAllowed == sal_True ) + ( xSearchedFrame.is() == sal_False ) && + ( aInfo.bCreationAllowed == sal_True ) ) { xSearchedFrame = m_aTaskCreator.createNewSystemTask( sTargetFrameName ); @@ -1185,7 +1117,7 @@ void SAL_CALL Desktop::dispose() throw( RuntimeException ) m_xLastFrame = Reference< XFrame >(); m_xFactory = Reference< XMultiServiceFactory >(); m_xFramesHelper = Reference< XFrames >(); - m_xDispatchHelper = Reference< XDispatch >(); + m_xDispatchHelper = Reference< XDispatchProvider >(); } } diff --git a/framework/source/services/frame.cxx b/framework/source/services/frame.cxx index ab4579b6d0de..6dd09df61bdf 100644 --- a/framework/source/services/frame.cxx +++ b/framework/source/services/frame.cxx @@ -2,9 +2,9 @@ * * $RCSfile: frame.cxx,v $ * - * $Revision: 1.33 $ + * $Revision: 1.34 $ * - * last change: $Author: rt $ $Date: 2001-06-22 10:39:28 $ + * last change: $Author: as $ $Date: 2001-07-02 13:40:10 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -67,12 +67,12 @@ #include <services/frame.hxx> #endif -#ifndef __FRAMEWORK_HELPER_ODISPATCHPROVIDER_HXX_ -#include <helper/odispatchprovider.hxx> +#ifndef __FRAMEWORK_DISPATCH_DISPATCHPROVIDER_HXX_ +#include <dispatch/dispatchprovider.hxx> #endif -#ifndef __FRAMEWORK_HELPER_OINTERCEPTIONHELPER_HXX_ -#include <helper/ointerceptionhelper.hxx> +#ifndef __FRAMEWORK_DISPATCH_INTERCEPTIONHELPER_HXX_ +#include <dispatch/interceptionhelper.hxx> #endif #ifndef __FRAMEWORK_HELPER_OFRAMES_HXX_ @@ -337,21 +337,21 @@ Frame::Frame( const css::uno::Reference< css::lang::XMultiServiceFactory >& xFac /*TODO a) Implement all helper as listener for disposing()! - b) Don't create ODispatchProvider here ... do it in OInterceptionHelper! + b) Don't create ODispatchProvider here ... do it in InterceptionHelper! */ //------------------------------------------------------------------------------------------------------------- // Initialize a new dispatchhelper-object to handle dispatches for "SELF" private and fast. // We use these helper as slave for our interceptor helper ... not directly! - ODispatchProvider* pDispatchHelper = new ODispatchProvider( m_xFactory, this ); + DispatchProvider* pDispatchHelper = new DispatchProvider( m_xFactory, this ); //------------------------------------------------------------------------------------------------------------- // Initialize a new interception helper object to handle dispatches and interceptor mechanism. // We hold member as reference ... not as pointer! - OInterceptionHelper* pInterceptionHelper = new OInterceptionHelper( this, - css::uno::Reference< css::frame::XDispatchProvider >( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY ) - ); + InterceptionHelper* pInterceptionHelper = new InterceptionHelper( this, + css::uno::Reference< css::frame::XDispatchProvider >( static_cast< ::cppu::OWeakObject* >(pDispatchHelper), css::uno::UNO_QUERY ) + ); m_xDispatchHelper = css::uno::Reference< css::frame::XDispatchProvider >( static_cast< ::cppu::OWeakObject* >(pInterceptionHelper), css::uno::UNO_QUERY ); //------------------------------------------------------------------------------------------------------------- @@ -818,15 +818,8 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl // Use helper to classify search direction. // Attention: If he return ...BOTH -> please search down first ... and upper direction then! - sal_Bool bCreationAllowed = sal_False; - ETargetClass eResult = TargetFinder::classify( E_FRAME , - sTargetFrameName , - nSearchFlags , - bCreationAllowed , - bChildrenExist , - sMyName , - bParentExist , - sParentName ); + TargetInfo aInfo ( sTargetFrameName, nSearchFlags, E_FRAME, bChildrenExist, bParentExist, sMyName, sParentName ); + ETargetClass eResult = TargetFinder::classifyFindFrame( aInfo ); switch( eResult ) { case E_SELF : { @@ -865,8 +858,15 @@ css::uno::Reference< css::frame::XFrame > SAL_CALL Frame::findFrame( const ::rtl } } break; - default: LOG_WARNING( "Frame::findFrame()", "Unexpected result of TargetFinder::classify() detected!" ) - break; + #ifdef ENABLE_WARNINGS + default : { + if( eResult != E_UNKNOWN ) + { + LOG_ERROR( "Frame::findFrame()", "Unexpected result of TargetFinder::classify() detected!" ) + } + } + break; + #endif } LOG_RESULT_FINDFRAME( "Frame", sMyName, xSearchedFrame ) // Return result of operation. diff --git a/framework/source/services/makefile.mk b/framework/source/services/makefile.mk index 708e37a6cf30..06e7ee7f0a41 100644 --- a/framework/source/services/makefile.mk +++ b/framework/source/services/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.7 $ +# $Revision: 1.8 $ # -# last change: $Author: cd $ $Date: 2001-05-23 07:05:01 $ +# last change: $Author: as $ $Date: 2001-07-02 13:40:10 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -89,8 +89,9 @@ SLOFILES= \ $(SLO)$/documentproperties.obj \ $(SLO)$/logindialog.obj \ $(SLO)$/menudocumenthandler.obj \ - $(SLO)$/attributelist.obj \ - $(SLO)$/saxnamespacefilter.obj + $(SLO)$/attributelist.obj \ + $(SLO)$/saxnamespacefilter.obj \ + $(SLO)$/contenthandlerfactory.obj SRCFILES= logindialog.src diff --git a/framework/test/typecfg/cfgview.cxx b/framework/test/typecfg/cfgview.cxx index 8dc5eab966e2..f39821eae749 100644 --- a/framework/test/typecfg/cfgview.cxx +++ b/framework/test/typecfg/cfgview.cxx @@ -2,9 +2,9 @@ * * $RCSfile: cfgview.cxx,v $ * - * $Revision: 1.2 $ + * $Revision: 1.3 $ * - * last change: $Author: as $ $Date: 2001-06-11 10:49:15 $ + * last change: $Author: as $ $Date: 2001-07-02 13:40:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -141,46 +141,48 @@ // const //_________________________________________________________________________________________________________________ -#define RDBFILE DECLARE_ASCII("typecfg.rdb" ) -#define ARGUMENT_DIRNAME DECLARE_ASCII("-dir=" ) // argument for output directory -#define ARGUMENT_VERSION DECLARE_ASCII("-ver=" ) // argument for file version to read [1|2|3] -#define ARGUMENTLENGTH 5 // same length for all arguemnts make it easier to detect it :-) -#define ARGUMENTFOUND 0 // OUString::compareTo returns 0 if searched string match given one - -#define MENU_HTML "menu.html" -#define BLANK_HTML "blank.html" - -#define FRAMESET_START_HTML "index.html" -#define FRAMESET_TYPES_HTML "fs_types.html" -#define FRAMESET_FILTERS_HTML "fs_filters.html" -#define FRAMESET_MODULFILTERS_HTML "fs_modulfilters.html" -#define FRAMESET_DETECTORS_HTML "fs_detectors.html" -#define FRAMESET_LOADERS_HTML "fs_loaders.html" -#define FRAMESET_INVALIDFILTERS_HTML "fs_invalidfilters.html" -#define FRAMESET_INVALIDDETECTORS_HTML "fs_invaliddetectors.html" -#define FRAMESET_INVALIDLOADERS_HTML "fs_invalidloaders.html" - -#define ALLTYPES_HTML "alltypes.html" -#define ALLFILTERS_HTML "allfilters.html" -#define ALLDETECTORS_HTML "alldetectors.html" -#define ALLLOADERS_HTML "allloaders.html" - -#define TYPEPROPERTIES_HTML "typeproperties.html" -#define FILTERPROPERTIES_HTML "filterproperties.html" -#define DETECTORPROPERTIES_HTML "detectorproperties.html" -#define LOADERPROPERTIES_HTML "loaderproperties.html" - -#define INVALIDFILTERS_HTML "invalidfilters.html" -#define INVALIDDETECTORS_HTML "invaliddetectors.html" -#define INVALIDLOADERS_HTML "invalidloaders.html" - -#define FILTERFLAGS_HTML "filterflags.html" -#define MODULFILTERS_HTML "modulfilters.html" - -#define TARGET_MENU "menu" -#define TARGET_VIEW "view" -#define TARGET_LIST "list" -#define TARGET_PROPERTIES "properties" +#define RDBFILE DECLARE_ASCII("typecfg.rdb" ) +#define ARGUMENT_DIRNAME DECLARE_ASCII("-dir=" ) // argument for output directory +#define ARGUMENT_VERSION DECLARE_ASCII("-ver=" ) // argument for file version to read [1|2|3] +#define ARGUMENTLENGTH 5 // same length for all arguemnts make it easier to detect it :-) +#define ARGUMENTFOUND 0 // OUString::compareTo returns 0 if searched string match given one + +#define MENU_HTML "menu.html" +#define BLANK_HTML "blank.html" + +#define FRAMESET_START_HTML "index.html" +#define FRAMESET_TYPES_HTML "fs_types.html" +#define FRAMESET_FILTERS_HTML "fs_filters.html" +#define FRAMESET_MODULFILTERS_HTML "fs_modulfilters.html" +#define FRAMESET_DETECTORS_HTML "fs_detectors.html" +#define FRAMESET_LOADERS_HTML "fs_loaders.html" +#define FRAMESET_INVALIDFILTERS_HTML "fs_invalidfilters.html" +#define FRAMESET_INVALIDDETECTORS_HTML "fs_invaliddetectors.html" +#define FRAMESET_INVALIDLOADERS_HTML "fs_invalidloaders.html" +#define FRAMESET_DOUBLEFILTERUINAMES_HTML "fs_doublefilteruinames.html" + +#define ALLTYPES_HTML "alltypes.html" +#define ALLFILTERS_HTML "allfilters.html" +#define ALLDETECTORS_HTML "alldetectors.html" +#define ALLLOADERS_HTML "allloaders.html" + +#define TYPEPROPERTIES_HTML "typeproperties.html" +#define FILTERPROPERTIES_HTML "filterproperties.html" +#define DETECTORPROPERTIES_HTML "detectorproperties.html" +#define LOADERPROPERTIES_HTML "loaderproperties.html" + +#define INVALIDFILTERS_HTML "invalidfilters.html" +#define INVALIDDETECTORS_HTML "invaliddetectors.html" +#define INVALIDLOADERS_HTML "invalidloaders.html" + +#define FILTERFLAGS_HTML "filterflags.html" +#define MODULFILTERS_HTML "modulfilters.html" +#define DOUBLEFILTERUINAMES_HTML "doublefilteruinames.html" + +#define TARGET_MENU "menu" +#define TARGET_VIEW "view" +#define TARGET_LIST "list" +#define TARGET_PROPERTIES "properties" //_________________________________________________________________________________________________________________ // namespace @@ -222,24 +224,25 @@ class CFGView : public Application //************************************************************************************************************* private: - void impl_parseCommandLine ( AppMember& rMember ); - void impl_generateHTMLView (); + void impl_parseCommandLine ( AppMember& rMember ); + void impl_generateHTMLView (); //************************************************************************************************************* private: - void impl_printCopyright (); - void impl_printSyntax (); - void impl_generateTypeListHTML (); - void impl_generateFilterListHTML (); - void impl_generateFilterModulListHTML (); - void impl_generateDetectorListHTML (); - void impl_generateLoaderListHTML (); - void impl_generateInvalidFiltersHTML (); - void impl_generateInvalidDetectorsHTML (); - void impl_generateInvalidLoadersHTML (); - void impl_generateFilterFlagsHTML (); - void impl_generateDefaultFiltersHTML (); - void impl_writeFile ( const ::rtl::OString& sFile, const ::rtl::OString& sContent ); + void impl_printCopyright (); + void impl_printSyntax (); + void impl_generateTypeListHTML (); + void impl_generateFilterListHTML (); + void impl_generateFilterModulListHTML (); + void impl_generateDetectorListHTML (); + void impl_generateLoaderListHTML (); + void impl_generateInvalidFiltersHTML (); + void impl_generateInvalidDetectorsHTML (); + void impl_generateInvalidLoadersHTML (); + void impl_generateFilterFlagsHTML (); + void impl_generateDefaultFiltersHTML (); + void impl_generateDoubleFilterUINamesHTML (); + void impl_writeFile ( const ::rtl::OString& sFile, const ::rtl::OString& sContent ); //************************************************************************************************************* private: @@ -396,46 +399,61 @@ void CFGView::impl_generateHTMLView() sMenuHTML.appendAscii( "<html>\n\t<head>\n\t\t<title>\n\t\t\tMenu\n\t\t</title>\n\t</head>\n\t<body>\n" ); // open html sMenuHTML.appendAscii( "\t\t<ul>\n" ); // open list + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "All Types" sMenuHTML.appendAscii( FRAMESET_TYPES_HTML ); sMenuHTML.appendAscii( "\" target=\"" ); sMenuHTML.appendAscii( TARGET_VIEW ); sMenuHTML.appendAscii( "\">All Types</a></li>\n" ); + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "All Filters" sMenuHTML.appendAscii( FRAMESET_FILTERS_HTML ); sMenuHTML.appendAscii( "\" target=\"" ); sMenuHTML.appendAscii( TARGET_VIEW ); sMenuHTML.appendAscii( "\">All Filters</a></li>\n" ); + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "All Filters sorted by modules" sMenuHTML.appendAscii( FRAMESET_MODULFILTERS_HTML ); sMenuHTML.appendAscii( "\" target=\"" ); sMenuHTML.appendAscii( TARGET_VIEW ); sMenuHTML.appendAscii( "\">Filters by Moduls</a></li>\n" ); + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "All Detectors" sMenuHTML.appendAscii( FRAMESET_DETECTORS_HTML ); sMenuHTML.appendAscii( "\" target=\"" ); sMenuHTML.appendAscii( TARGET_VIEW ); sMenuHTML.appendAscii( "\">All Detector Services</a></li>\n" ); + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "All Loaders" sMenuHTML.appendAscii( FRAMESET_LOADERS_HTML ); sMenuHTML.appendAscii( "\" target=\"" ); sMenuHTML.appendAscii( TARGET_VIEW ); sMenuHTML.appendAscii( "\">All Loader Services</a></li>\n" ); + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "Invalid Filter" sMenuHTML.appendAscii( FRAMESET_INVALIDFILTERS_HTML ); sMenuHTML.appendAscii( "\" target=\"" ); sMenuHTML.appendAscii( TARGET_VIEW ); sMenuHTML.appendAscii( "\">Invalid Filter</a></li>\n" ); + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "Invalid Detect Services" sMenuHTML.appendAscii( FRAMESET_INVALIDDETECTORS_HTML ); sMenuHTML.appendAscii( "\" target=\"" ); sMenuHTML.appendAscii( TARGET_VIEW ); sMenuHTML.appendAscii( "\">Invalid Detect Services</a></li>\n" ); + + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "Double Filter UINames" + sMenuHTML.appendAscii( FRAMESET_DOUBLEFILTERUINAMES_HTML ); + sMenuHTML.appendAscii( "\" target=\"" ); + sMenuHTML.appendAscii( TARGET_VIEW ); + sMenuHTML.appendAscii( "\">Double Filter UINames</a></li>\n" ); + sMenuHTML.appendAscii( "\t\t<li><a href=\"" ); // list entry for "Show Filter Flags" sMenuHTML.appendAscii( FILTERFLAGS_HTML ); sMenuHTML.appendAscii( "\" target=\"" ); sMenuHTML.appendAscii( TARGET_VIEW ); sMenuHTML.appendAscii( "\">Show Filter Flags</a></li>\n" ); + sMenuHTML.appendAscii( "\t\t</ul>\n" ); // close list sMenuHTML.appendAscii( "\t</body>\n</html>\n" ); // close html @@ -450,6 +468,7 @@ void CFGView::impl_generateHTMLView() impl_generateInvalidDetectorsHTML (); impl_generateInvalidLoadersHTML (); impl_generateFilterFlagsHTML (); + impl_generateDoubleFilterUINamesHTML(); } //***************************************************************************************************************** @@ -1460,6 +1479,99 @@ void CFGView::impl_generateDefaultFiltersHTML() } //***************************************************************************************************************** +void CFGView::impl_generateDoubleFilterUINamesHTML() +{ + //------------------------------------------------------------------------------------------------------------- + // generate frameset for double UINames + OUStringBuffer sFrameSet( 10000 ); + + sFrameSet.appendAscii( "<html>\n\t<head>\n\t\t<title>\n\t\t\tFrameset: Search doubl UINames\n\t\t</title>\n\t</head>\n" ); // open html + sFrameSet.appendAscii( "\t\t<frameset cols=\"40%,60%\">\n" ); // open frameset for cols + sFrameSet.appendAscii( "\t\t\t<frame name=\"" ); // generate frame "list" + sFrameSet.appendAscii( TARGET_LIST ); + sFrameSet.appendAscii( "\" src=\"" ); + sFrameSet.appendAscii( DOUBLEFILTERUINAMES_HTML ); + sFrameSet.appendAscii( "\" title=\"Double UINames\">\n" ); + sFrameSet.appendAscii( "\t\t\t<frame name=\"" ); // generate frame "properties" + sFrameSet.appendAscii( TARGET_PROPERTIES ); + sFrameSet.appendAscii( "\" src=\"" ); + sFrameSet.appendAscii( FILTERPROPERTIES_HTML ); + sFrameSet.appendAscii( "\" title=\"Properties\">\n" ); + sFrameSet.appendAscii( "\t\t</frameset>\n" ); // close frameset cols + sFrameSet.appendAscii( "</html>\n" ); // close html + + impl_writeFile( FRAMESET_DOUBLEFILTERUINAMES_HTML, U2B(sFrameSet.makeStringAndClear()) ); + + //------------------------------------------------------------------------------------------------------------- + // Search invalid registered detect services! + OUStringBuffer sHTML( 10000 ); + + sHTML.appendAscii( "<html>\n\t<head>\n\t\t<title>\n\t\t\tDouble Filter UINames\n\t\t</title>\n\t</head>\n\t<body>\n" ); // open html + sHTML.appendAscii( "\t\tPlease check follow filter entries in configuration. Her UINames are registered twice!<p>\n" ); // write "Note" + sHTML.appendAscii( "\t\t<table border=0>\n" ); // open table + sHTML.appendAscii( "\t<tr><td bgcolor=#ff8040><strong>Nr.</strong></td>\n" ); // generate table header + sHTML.appendAscii( "\t\t<td bgcolor=#ff8040><strong>UIName</strong></td>\n" ); + sHTML.appendAscii( "\t\t<td bgcolor=#ff8040><strong>Filters</strong></td>\n" ); + sHTML.appendAscii( "\t</tr>\n" ); + + StringHash lUINames ; + css::uno::Sequence< ::rtl::OUString > lFilters = m_aData.pCache->getAllFilterNames(); + sal_Int32 nFilterCount = lFilters.getLength() ; + Filter aFilter ; + ::rtl::OUStringBuffer sBuffer ; + ::rtl::OUString sUIName ; + + for( sal_Int32 nFilter=0; nFilter<nFilterCount; ++nFilter ) + { + aFilter = m_aData.pCache->getFilter( lFilters[nFilter] ); + for( ConstStringHashIterator pUIName=aFilter.lUINames.begin(); pUIName!= aFilter.lUINames.end(); ++pUIName ) + { + // Build key value by using localized UIName to register filter name + sBuffer.appendAscii( "[" ); + sBuffer.append ( pUIName->first ); + sBuffer.appendAscii( "] \"" ); + sBuffer.append ( pUIName->second ); + sBuffer.appendAscii( "\"" ); + sUIName = sBuffer.makeStringAndClear(); + + // insert filter into hash table + sBuffer.append ( lUINames[ sUIName ] ); + sBuffer.appendAscii ( "<a href=\"" ); + sBuffer.appendAscii ( FILTERPROPERTIES_HTML ); + sBuffer.appendAscii ( "#" ); + sBuffer.append ( aFilter.sName ); + sBuffer.appendAscii ( "\" target=\"" ); + sBuffer.appendAscii ( TARGET_PROPERTIES ); + sBuffer.appendAscii ( "\">" ); + sBuffer.append ( aFilter.sName ); + sBuffer.appendAscii ( "\"</a><br>\n" ); + lUINames[ sUIName ] = sBuffer.makeStringAndClear(); + } + } + + nFilter = 1; + for( ConstStringHashIterator pIterator=lUINames.begin(); pIterator!=lUINames.end(); ++pIterator ) + { + if( pIterator->second.indexOf( '\n' ) != pIterator->second.lastIndexOf( '\n' ) ) + { + sHTML.appendAscii ( "\t<tr><td bgcolor=#ff0000 color=#00ffff valign=top>" ); // generate row for uiname->filter entry + sHTML.append ( OUString::valueOf( nFilter ) ); + sHTML.appendAscii ( "</td><td valign=top>" ); + sHTML.append ( pIterator->first ); + sHTML.appendAscii ( "</td><td bgcolor=#f0f0f0 valign=top>" ); + sHTML.append ( pIterator->second ); + sHTML.appendAscii ( "</td></tr>\n" ); + + ++nFilter; + } + } + + sHTML.appendAscii( "</table>\n" ); // close table + sHTML.appendAscii( "</body>\n</html>\n" ); // close html + impl_writeFile( DOUBLEFILTERUINAMES_HTML, U2B(sHTML.makeStringAndClear()) ); +} + +//***************************************************************************************************************** void CFGView::impl_writeFile( const ::rtl::OString& sFile, const ::rtl::OString& sContent ) { ::rtl::OUStringBuffer sFullPath( 1000 ); diff --git a/framework/test/typecfg/xml2xcd.cxx b/framework/test/typecfg/xml2xcd.cxx index a27b4a27f0f6..1f3fd4b5dea3 100644 --- a/framework/test/typecfg/xml2xcd.cxx +++ b/framework/test/typecfg/xml2xcd.cxx @@ -2,9 +2,9 @@ * * $RCSfile: xml2xcd.cxx,v $ * - * $Revision: 1.4 $ + * $Revision: 1.5 $ * - * last change: $Author: as $ $Date: 2001-06-15 13:58:00 $ + * last change: $Author: as $ $Date: 2001-07-02 13:40:14 $ * * The Contents of this file are made available subject to the terms of * either of the following licenses @@ -183,31 +183,34 @@ using namespace ::framework ; /*-***************************************************************************************************************/ struct AppMember { - FilterCache* pFilterCache ; // pointer to configuration - StringHash aOldFilterNamesHash ; // converter tabel to restaurate old filter names - EFilterPackage ePackage ; // specify which package should be used => specify using of file name and buffer too! - ::rtl::OUString sFileNameStandard ; // file name of our standard filter cfg - ::rtl::OUString sFileNameAdditional ; // file name of our additional filter cfg - ::rtl::OUString sPackageStandard ; // package name of our standard filter cfg - ::rtl::OUString sPackageAdditional ; // package name of our additional filter cfg - ::rtl::OUStringBuffer sBufferStandard ; // buffer of our standard filter cfg - ::rtl::OUStringBuffer sBufferAdditional ; // buffer of our standard filter cfg - ::rtl::OUStringBuffer sStandardFilterList ; - ::rtl::OUStringBuffer sAdditionalFilterList ; - ::rtl::OUStringBuffer sStandardTypeList ; - ::rtl::OUStringBuffer sAdditionalTypeList ; - sal_Bool bWriteable ; // enable/disable writable configuration items - sal_Int32 nVersionInput ; // format version of input xml file - sal_Int32 nVersionOutput ; // format version of output xcd file - - sal_Int32 nOriginalTypes ; - sal_Int32 nOriginalFilters ; - sal_Int32 nOriginalDetectors ; - sal_Int32 nOriginalLoaders ; - sal_Int32 nWrittenTypes ; - sal_Int32 nWrittenFilters ; - sal_Int32 nWrittenDetectors ; - sal_Int32 nWrittenLoaders ; + FilterCache* pFilterCache ; // pointer to configuration + StringHash aOldFilterNamesHash ; // converter tabel to restaurate old filter names + EFilterPackage ePackage ; // specify which package should be used => specify using of file name and buffer too! + ::rtl::OUString sFileNameStandard ; // file name of our standard filter cfg + ::rtl::OUString sFileNameAdditional ; // file name of our additional filter cfg + ::rtl::OUString sPackageStandard ; // package name of our standard filter cfg + ::rtl::OUString sPackageAdditional ; // package name of our additional filter cfg + ::rtl::OUStringBuffer sBufferStandard ; // buffer of our standard filter cfg + ::rtl::OUStringBuffer sBufferAdditional ; // buffer of our standard filter cfg + ::rtl::OUStringBuffer sStandardFilterList ; + ::rtl::OUStringBuffer sAdditionalFilterList ; + ::rtl::OUStringBuffer sStandardTypeList ; + ::rtl::OUStringBuffer sAdditionalTypeList ; + sal_Bool bWriteable ; // enable/disable writable configuration items + sal_Int32 nVersionInput ; // format version of input xml file + sal_Int32 nVersionOutput ; // format version of output xcd file + + sal_Int32 nOriginalTypes ; + sal_Int32 nOriginalFilters ; + sal_Int32 nOriginalDetectors ; + sal_Int32 nOriginalLoaders ; + sal_Int32 nOriginalContentHandlers ; + + sal_Int32 nWrittenTypes ; + sal_Int32 nWrittenFilters ; + sal_Int32 nWrittenDetectors ; + sal_Int32 nWrittenLoaders ; + sal_Int32 nWrittenContentHandlers ; }; /*-***************************************************************************************************************/ @@ -219,57 +222,54 @@ class XCDGenerator : public Application //************************************************************************************************************* private: - void impl_printCopyright ( ); // print copyright to stdout :-) - void impl_printSyntax ( ); // print help to stout for user - void impl_parseCommandLine ( AppMember& rMember ); // parse command line arguments and fill given struct - - void impl_generateXCD ( ); // generate all xcd files by using current configuration - void impl_generateCopyright ( ); // generate copyrights - void impl_generateTypeTemplate ( ); // generate templates ... - void impl_generateFilterTemplate ( ); - void impl_generateDetectorTemplate ( ); - void impl_generateLoaderTemplate ( ); - void impl_generateTypeSet ( ); // generate sets - void impl_generateFilterSet ( ); - void impl_generateDetectorSet ( ); - void impl_generateLoaderSet ( ); - void impl_generateDefaults ( ); // generate defaults - #ifdef DRAFT_I - void impl_generateHandlerTemplate ( ); - void impl_generateHandlerSet ( ); - #endif - - void impl_generateFilterFlagTemplate ( const ::rtl::OUString& sName , // helper to write atomic elements - sal_Int32 nValue , - const ::rtl::OString& sDescription = ::rtl::OString() ); - void impl_generateIntProperty ( ::rtl::OUStringBuffer& sXCD , - const ::rtl::OUString& sName , - sal_Int32 nValue ); - void impl_generateBoolProperty ( ::rtl::OUStringBuffer& sXCD , - const ::rtl::OUString& sName , - sal_Bool bValue ); - void impl_generateStringProperty ( ::rtl::OUStringBuffer& sXCD , - const ::rtl::OUString& sName , - const ::rtl::OUString& sValue ); - void impl_generateStringListProperty ( ::rtl::OUStringBuffer& sXCD , - const ::rtl::OUString& sName , - const ::framework::StringList& lValue ); - void impl_generateUINamesProperty ( ::rtl::OUStringBuffer& sXCD , - const ::rtl::OUString& sName , - const StringHash& lUINames ); - ::rtl::OUString impl_getOldFilterName ( const ::rtl::OUString& sNewName ); // convert filter names to old format - - static void impl_classifyType ( const AppMember& rData , - const ::rtl::OUString& sTypeName , - EFilterPackage& ePackage ); // classify type as STANDARD or ADDITIONAL one - static void impl_classifyFilter ( const AppMember& rData , - const ::rtl::OUString& sFilterName , - EFilterPackage& ePackage , - sal_Int32& nOrder ); // classify filter as STANDARD or ADDITIONAL filter, set order of standard filter too - static ::rtl::OUString impl_filterSpecialSigns ( const ::rtl::OUString& sValue ); // encode strings for xml - static sal_Unicode impl_defineSeperator ( const ::framework::StringList& lList ); // search seperator for lists - static void impl_initFilterHashNew2Old ( StringHash& aHash ); // initialize converter table to restaurate old filter names - static void impl_orderAlphabetical ( css::uno::Sequence< ::rtl::OUString >& lList ); // sort stringlist of internal type-, filter- ... names in alphabetical order to generate xcd files everytime in the same way + void impl_printCopyright ( ); // print copyright to stdout :-) + void impl_printSyntax ( ); // print help to stout for user + void impl_parseCommandLine ( AppMember& rMember ); // parse command line arguments and fill given struct + + void impl_generateXCD ( ); // generate all xcd files by using current configuration + void impl_generateCopyright ( ); // generate copyrights + void impl_generateTypeTemplate ( ); // generate templates ... + void impl_generateFilterTemplate ( ); + void impl_generateDetectorTemplate ( ); + void impl_generateLoaderTemplate ( ); + void impl_generateTypeSet ( ); // generate sets + void impl_generateFilterSet ( ); + void impl_generateDetectorSet ( ); + void impl_generateLoaderSet ( ); + void impl_generateDefaults ( ); // generate defaults + void impl_generateContentHandlerTemplate ( ); + void impl_generateContentHandlerSet ( ); + void impl_generateFilterFlagTemplate ( const ::rtl::OUString& sName , // helper to write atomic elements + sal_Int32 nValue , + const ::rtl::OString& sDescription = ::rtl::OString() ); + void impl_generateIntProperty ( ::rtl::OUStringBuffer& sXCD , + const ::rtl::OUString& sName , + sal_Int32 nValue ); + void impl_generateBoolProperty ( ::rtl::OUStringBuffer& sXCD , + const ::rtl::OUString& sName , + sal_Bool bValue ); + void impl_generateStringProperty ( ::rtl::OUStringBuffer& sXCD , + const ::rtl::OUString& sName , + const ::rtl::OUString& sValue ); + void impl_generateStringListProperty ( ::rtl::OUStringBuffer& sXCD , + const ::rtl::OUString& sName , + const ::framework::StringList& lValue ); + void impl_generateUINamesProperty ( ::rtl::OUStringBuffer& sXCD , + const ::rtl::OUString& sName , + const StringHash& lUINames ); + ::rtl::OUString impl_getOldFilterName ( const ::rtl::OUString& sNewName ); // convert filter names to old format + + static void impl_classifyType ( const AppMember& rData , + const ::rtl::OUString& sTypeName , + EFilterPackage& ePackage ); // classify type as STANDARD or ADDITIONAL one + static void impl_classifyFilter ( const AppMember& rData , + const ::rtl::OUString& sFilterName , + EFilterPackage& ePackage , + sal_Int32& nOrder ); // classify filter as STANDARD or ADDITIONAL filter, set order of standard filter too + static ::rtl::OUString impl_filterSpecialSigns ( const ::rtl::OUString& sValue ); // encode strings for xml + static sal_Unicode impl_defineSeperator ( const ::framework::StringList& lList ); // search seperator for lists + static void impl_initFilterHashNew2Old ( StringHash& aHash ); // initialize converter table to restaurate old filter names + static void impl_orderAlphabetical ( css::uno::Sequence< ::rtl::OUString >& lList ); // sort stringlist of internal type-, filter- ... names in alphabetical order to generate xcd files everytime in the same way //************************************************************************************************************* private: @@ -316,6 +316,10 @@ void XCDGenerator::Main() m_aData.nOriginalFilters = m_aData.pFilterCache->getAllFilterNames().getLength() ; m_aData.nOriginalDetectors = m_aData.pFilterCache->getAllDetectorNames().getLength() ; m_aData.nOriginalLoaders = m_aData.pFilterCache->getAllLoaderNames().getLength() ; + if( m_aData.nVersionInput >= 5 ) + { + m_aData.nOriginalContentHandlers = m_aData.pFilterCache->getAllContentHandlerNames().getLength() ; + } // Start generation of xcd file(s). impl_generateXCD(); @@ -513,9 +517,10 @@ void XCDGenerator::impl_generateXCD() impl_generateTypeTemplate (); impl_generateFilterTemplate (); impl_generateDetectorTemplate(); - #ifdef DRAFT_I - impl_generateHandlerTemplate (); - #endif + if( m_aData.nVersionOutput >= 5 ) + { + impl_generateContentHandlerTemplate (); + } impl_generateLoaderTemplate (); m_aData.sBufferStandard.appendAscii ( "\t</schema:templates>\n" ); @@ -528,9 +533,10 @@ void XCDGenerator::impl_generateXCD() impl_generateTypeSet (); impl_generateFilterSet (); impl_generateDetectorSet (); - #ifdef DRAFT_I - impl_generateHandlerSet (); - #endif + if( m_aData.nVersionInput >= 5 ) + { + impl_generateContentHandlerSet (); + } impl_generateLoaderSet (); impl_generateDefaults (); @@ -1293,11 +1299,10 @@ void XCDGenerator::impl_generateDefaults() m_aData.sBufferStandard.appendAscii( "\t</schema:group>\n" ); } -#ifdef DRAFT_I //***************************************************************************************************************** -void XCDGenerator::impl_generateHandlerTemplate() +void XCDGenerator::impl_generateContentHandlerTemplate() { - m_aData.sBufferStandard.appendAscii( "\t\t<schema:group cfg:name=\"Handler\">\n" ); + m_aData.sBufferStandard.appendAscii( "\t\t<schema:group cfg:name=\"ContentHandler\">\n" ); m_aData.sBufferStandard.appendAscii( "\t\t\t<schema:value cfg:name=\"Types\" cfg:type=\"string\" cfg:derivedBy=\"list\" cfg:writable=\"" ); m_aData.sBufferStandard.appendAscii( m_aData.bWriteable==sal_True ? "true\">\n" : "false\">\n" ); m_aData.sBufferStandard.appendAscii( "\t\t\t\t<schema:documentation>\n" ); @@ -1308,12 +1313,46 @@ void XCDGenerator::impl_generateHandlerTemplate() } //***************************************************************************************************************** -void XCDGenerator::impl_generateHandlerSet() +void XCDGenerator::impl_generateContentHandlerSet() { - // write empty handler set! - m_aData.sBufferStandard.appendAscii( "\t<schema:set cfg:name=\"Handlers\" cfg:element-type=\"Handler\"/>\n" ); + if( m_aData.pFilterCache->hasContentHandlers() == sal_False ) + { + // write empty handler set! + m_aData.sBufferStandard.appendAscii( "\t<schema:set cfg:name=\"ContentHandlers\" cfg:element-type=\"ContentHandler\"/>\n" ); + } + else + { + // open set + m_aData.sBufferStandard.appendAscii( "\t<schema:set cfg:name=\"ContentHandlers\" cfg:element-type=\"ContentHandler\">\n" ); + + css::uno::Sequence< ::rtl::OUString > lNames = m_aData.pFilterCache->getAllContentHandlerNames(); + sal_Int32 nCount = lNames.getLength() ; + + XCDGenerator::impl_orderAlphabetical( lNames ); + + for( sal_Int32 nItem=0; nItem<nCount; ++nItem ) + { + ::rtl::OUString sName = lNames[nItem] ; + ContentHandler aItem = m_aData.pFilterCache->getContentHandler( sName ); + + ++m_aData.nWrittenContentHandlers; + + // open set node by using name + m_aData.sBufferStandard.appendAscii( "\t\t<default:group cfg:name=\"" ); + m_aData.sBufferStandard.append ( sName ); + m_aData.sBufferStandard.appendAscii( "\">\n" ); + + // write properties + impl_generateStringListProperty( m_aData.sBufferStandard, SUBKEY_TYPES, aItem.lTypes ); + + // close set node + m_aData.sBufferStandard.appendAscii( "\t\t</default:group>\n" ); + } + + // close set + m_aData.sBufferStandard.appendAscii( "\t</schema:set>\n" ); + } } -#endif //***************************************************************************************************************** void XCDGenerator::impl_generateIntProperty( ::rtl::OUStringBuffer& sXCD , diff --git a/framework/util/makefile.mk b/framework/util/makefile.mk index 9202c6f8ae00..4730f7094500 100644 --- a/framework/util/makefile.mk +++ b/framework/util/makefile.mk @@ -2,9 +2,9 @@ # # $RCSfile: makefile.mk,v $ # -# $Revision: 1.41 $ +# $Revision: 1.42 $ # -# last change: $Author: cd $ $Date: 2001-06-22 13:43:45 $ +# last change: $Author: as $ $Date: 2001-07-02 13:40:19 $ # # The Contents of this file are made available subject to the terms of # either of the following licenses @@ -120,8 +120,6 @@ SHL1OBJS= $(SLO)$/registerservices.obj \ $(SLO)$/argumentanalyzer.obj \ $(SLO)$/wildcard.obj \ $(SLO)$/asyncquit.obj \ - $(SLO)$/odesktopdispatcher.obj \ - $(SLO)$/ointerceptionhelper.obj \ $(SLO)$/oframes.obj \ $(SLO)$/opluginframedispatcher.obj \ $(SLO)$/ostatusindicatorfactory.obj \ @@ -130,15 +128,20 @@ SHL1OBJS= $(SLO)$/registerservices.obj \ $(SLO)$/ostatusindicator.obj \ $(SLO)$/otasksenumeration.obj \ $(SLO)$/ocomponentenumeration.obj \ - $(SLO)$/odispatchprovider.obj \ - $(SLO)$/omenudispatcher.obj \ - $(SLO)$/timerhelper.obj \ + $(SLO)$/interceptionhelper.obj \ + $(SLO)$/dispatchprovider.obj \ + $(SLO)$/basedispatcher.obj \ + $(SLO)$/blankdispatcher.obj \ + $(SLO)$/selfdispatcher.obj \ + $(SLO)$/menudispatcher.obj \ + $(SLO)$/mailtodispatcher.obj \ $(SLO)$/helpagentdispatcher.obj \ + $(SLO)$/timerhelper.obj \ $(SLO)$/menumanager.obj \ $(SLO)$/xmldocproperties.obj \ $(SLO)$/fltdlg.obj \ - $(SLO)$/omailtodispatcher.obj \ - $(SLO)$/droptargetlistener.obj + $(SLO)$/droptargetlistener.obj \ + $(SLO)$/soundhandler.obj SHL1STDLIBS= $(CPPULIB) \ $(CPPUHELPERLIB) \ @@ -171,6 +174,7 @@ SHL2IMPLIB= ifwl$(UPD)$(DLLPOSTFIX) SHL2OBJS= $(SLO)$/registertemp.obj \ $(SLO)$/mediatypedetectionhelper.obj\ $(SLO)$/frameloaderfactory.obj \ + $(SLO)$/contenthandlerfactory.obj \ $(SLO)$/filterfactory.obj \ $(SLO)$/typedetection.obj \ $(SLO)$/filtercachedata.obj \ |