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 /framework/test | |
parent | 19c01d03312f3d2b69d156972f57f2325d200b44 (diff) |
#79955# use new DispatchProviderinc/services/frame.hxx
Diffstat (limited to 'framework/test')
-rw-r--r-- | framework/test/typecfg/cfgview.cxx | 226 | ||||
-rw-r--r-- | framework/test/typecfg/xml2xcd.cxx | 221 |
2 files changed, 299 insertions, 148 deletions
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 , |