Kaydet (Commit) 974e3a06 authored tarafından Vladimir Glazounov's avatar Vladimir Glazounov

INTEGRATION: CWS jsc3 (1.3.2); FILE MERGED

2006/02/17 16:02:00 jsc 1.3.2.2: #i56247# insert new command for calc addins
2006/01/20 13:19:10 jsc 1.3.2.1: #i56247# extend new componenttype clac add-in
üst 49a503f6
...@@ -4,9 +4,9 @@ ...@@ -4,9 +4,9 @@
* *
* $RCSfile: skeletoncommon.hxx,v $ * $RCSfile: skeletoncommon.hxx,v $
* *
* $Revision: 1.3 $ * $Revision: 1.4 $
* *
* last change: $Author: hr $ $Date: 2005-12-28 18:02:14 $ * last change: $Author: vg $ $Date: 2006-03-15 09:20:08 $
* *
* The Contents of this file are made available subject to * The Contents of this file are made available subject to
* the terms of GNU Lesser General Public License Version 2.1. * the terms of GNU Lesser General Public License Version 2.1.
...@@ -32,51 +32,88 @@ ...@@ -32,51 +32,88 @@
* MA 02111-1307 USA * MA 02111-1307 USA
* *
************************************************************************/ ************************************************************************/
#ifndef _UNO_DEVTOOLS_SKELETONCOMMON_HXX_ #ifndef INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCOMMON_HXX
#define _UNO_DEVTOOLS_SKELETONCOMMON_HXX_ #define INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCOMMON_HXX
#ifndef _RTL_STRING_HXX_ #ifndef _RTL_STRING_HXX_
#include <rtl/string.hxx> #include "rtl/string.hxx"
#endif #endif
#ifndef _REGISTRY_READER_HXX_ #ifndef INCLUDED_registry_reader_hxx
#include <registry/reader.hxx> #include "registry/reader.hxx"
#endif #endif
#ifndef _CODEMAKER_TYPEMANAGER_HXX_ #ifndef INCLUDED_CODEMAKER_TYPEMANAGER_HXX
#include <codemaker/typemanager.hxx> #include "codemaker/typemanager.hxx"
#endif #endif
#ifndef _CODEMAKER_UNOTYPE_HXX_ #ifndef INCLUDED_CODEMAKER_UNOTYPE_HXX
#include <codemaker/unotype.hxx> #include "codemaker/unotype.hxx"
#endif #endif
#include <fstream>
#include <hash_set> #include <hash_set>
#include <hash_map> #include <hash_map>
// #ifndef _UNO_DEVTOOLS_SKELETONMAKER_HXX_
// #include "skeletonmaker.hxx"
// #endif
namespace skeletonmaker { namespace skeletonmaker {
struct ProgramOptions { struct ProgramOptions {
ProgramOptions(): java5(true), all(false), dump(false), ProgramOptions(): java5(true), all(false), dump(false), license(false),
shortnames(false), language(1) {} shortnames(false), supportpropertysetmixin(false),
language(1), componenttype(1) {}
bool java5; bool java5;
bool all; bool all;
bool dump; bool dump;
bool license;
bool shortnames; bool shortnames;
bool supportpropertysetmixin;
// language specifier - is extendable // language specifier - is extendable
// 1 = Java // 1 = Java
// 2 = C++ // 2 = C++
short language; short language;
// component type
// 1 = default UNO component - is extendable
// 2 = calc add-in
// 3 = add-on
short componenttype;
rtl::OString outputpath; rtl::OString outputpath;
rtl::OString implname; rtl::OString implname;
}; };
typedef ::std::hash_map< ::rtl::OString, // typedef ::std::hash_map< ::rtl::OString,
std::pair< rtl::OString, sal_Int16 >, // ::std::pair< rtl::OString, sal_Int16 >,
rtl::OStringHash > StringPairHashMap; // rtl::OStringHash > StringPairHashMap;
typedef ::std::vector< ::std::pair< rtl::OString,
::std::pair< rtl::OString, sal_Int16 > > > AttributeInfo;
/**
print the standard OpenOffice.org license header
@param o specifies the output stream
@param filename specifies the source file name
*/
void printLicenseHeader(std::ostream& o, rtl::OString const & filename);
/**
create dependent on the output path, the implementation name and the
extension a new output file. If output path is equal "stdout" the tool
generates the output to standard out.
@param options the program options including the output path and the
implementation name
@param extension specifies the file extensions (e.g. .cxx or .java)
@param ppOutputStream out parameter returning the output stream
@param targetSourceFileName out parameter returning the generated file name
constructed on base of the output path, the
implementation name and the extension
@param tmpSourceFileName out parameter returning the temporary file name based
on the output path and a generated temporary file name.
@return true if output is generated to standard out or else false
*/
bool getOutputStream(ProgramOptions const & options,
rtl::OString const & extension,
std::ostream** ppOutputStream,
rtl::OString & targetSourceFileName,
rtl::OString & tmpSourceFileName);
codemaker::UnoType::Sort decomposeResolveAndCheck( codemaker::UnoType::Sort decomposeResolveAndCheck(
TypeManager const & manager, rtl::OString const & type, TypeManager const & manager, rtl::OString const & type,
...@@ -88,30 +125,57 @@ void checkType(TypeManager const & manager, ...@@ -88,30 +125,57 @@ void checkType(TypeManager const & manager,
rtl::OString const & type, rtl::OString const & type,
std::hash_set< rtl::OString, rtl::OStringHash >& interfaceTypes, std::hash_set< rtl::OString, rtl::OStringHash >& interfaceTypes,
std::hash_set< rtl::OString, rtl::OStringHash >& serviceTypes, std::hash_set< rtl::OString, rtl::OStringHash >& serviceTypes,
StringPairHashMap& properties); AttributeInfo& properties);
void checkDefaultInterfaces( void checkDefaultInterfaces(
std::hash_set< rtl::OString, rtl::OStringHash >& interfaces, std::hash_set< rtl::OString, rtl::OStringHash >& interfaces,
const std::hash_set< rtl::OString, rtl::OStringHash >& services, const std::hash_set< rtl::OString, rtl::OStringHash >& services,
const rtl::OString & propertyhelper); const rtl::OString & propertyhelper);
rtl::OString checkPropertyHelper(TypeManager const & manager, rtl::OString checkPropertyHelper(
const std::hash_set< rtl::OString, rtl::OStringHash >& services, ProgramOptions const & options, TypeManager const & manager,
StringPairHashMap& attributes, const std::hash_set< rtl::OString, rtl::OStringHash >& services,
std::hash_set< rtl::OString, rtl::OStringHash >& propinterfaces); const std::hash_set< rtl::OString, rtl::OStringHash >& interfaces,
AttributeInfo& attributes,
bool checkXComponentSupport(TypeManager const & manager, std::hash_set< rtl::OString, rtl::OStringHash >& propinterfaces);
typereg::Reader const & reader);
/**
// if XComponent is directly specified, return true and remove it from the checks whether the return and parameters types are valid and allowed
// supported interfaces list calc add-in type. The function throws a CannotDumpException with an
detailed error description which type is wrong
@param manager a type manager
@param reader a registry type reader of an interface defining
calc add-in functions
*/
void checkAddInTypes(TypeManager const & manager,
typereg::Reader const & reader);
/**
checks if XComponent have to be supported, if yes it removes it from the
supported interfaces list becuase it becmoes implmented by the appropriate
helper
@param manager a type manager
@param interfaces a list of interfaces which should be implemented
@return true if XComponent have to be supported
*/
bool checkXComponentSupport(TypeManager const & manager, bool checkXComponentSupport(TypeManager const & manager,
std::hash_set< rtl::OString, rtl::OStringHash >& interfaces); std::hash_set< rtl::OString, rtl::OStringHash >& interfaces);
sal_uInt16 checkAdditionalPropertyFlags(typereg::Reader const & reader, sal_uInt16 checkAdditionalPropertyFlags(typereg::Reader const & reader,
sal_uInt16 field, sal_uInt16 method); sal_uInt16 field, sal_uInt16 method);
void generateFunctionParameterMap(std::ostream& o,
ProgramOptions const & options,
TypeManager const & manager,
const std::hash_set< ::rtl::OString, ::rtl::OStringHash >& interfaces);
} }
#endif // _UNO_DEVTOOLS_SKELETONCOMMON_HXX_ #endif // INCLUDED_UNODEVTOOLS_SOURCE_SKELETONMAKER_SKELETONCOMMON_HXX
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment