Hi Muthu,
On Sun, Apr 09, 2006 at 20:58:54 +0530, Muthu Subramanian wrote:
> This is regarding i47233. I am trying to move the ordinal suffix part to
> i18npool.
> I created some skeleton code in i18npool and offapi. The problem is that i
> am not able
> to call the function from sc. Am I missing something here?
If you didn't omit anything, it looks like you don't have any UNO
service implementing the interface that could be instantiated.
> I was not able to include the file OrdinalSuffix.hpp/hxx ( i don't know how
> to create hpp file)
After having done changes in module offapi and dmake'd and deliver'ed
them, go to module offuh and issue the build command there and deliver.
That generates the *.hpp/*.hdl for global use in the Office code.
For module i18npool please add a corresponding line to
i18npool/source/unotypes/makefile.mk
> This is what i used (in table4.cxx),
> #include <com/sun/star/i18n/OrdinalSuffix.hpp>
For the interface that should be com/sun/star/i18n/XOrdinalSuffix.hpp
instead, note the leading 'X'. For the service it may be called
OrdinalSuffix.idl
> XOrdinalSuffix.idl (offapi):
> ------------------
> #ifndef __com_sun_star_i18n_Ordinal_Suffix_idl__
The include guard define and .idl name should match, please change to
#ifndef __com_sun_star_i18n_XOrdinalSuffix_idl__
> #include <com/sun/star/lang/Locale.idl>
> #include <rtl/string.hxx>
An .idl is no place were C/C++ headers are included. Please remove.
Remember that IDLs are language independent definitions of the API.
> //============================================================================
>
> module com { module sun { module star { module i18n {
>
> //============================================================================
>
>
> published interface XOrdinalSuffix : com::sun::star::uno::XInterface
Btw, never declare an interface as published before it is finalized.
> //------------------------------------------------------------------------
> rtl::OUString getOrdinalSuffix([in] rtl::OUString aValue, [in] long
> nDigits);
Here rtl::OUString is not to be used, use only IDL types in IDLs, which
for string is simply 'string'.
A service definition, for example OrdinalSuffix.idl, that defines
a service that implements the XOrdinalSuffix interface is missing.
> ordinalsuffix.hxx (i18npool/inc)
> --------------------------------
> #include <cppuhelper/implbase2.hxx> // helper for implementations
> #include <com/sun/star/lang/XServiceInfo.hpp>
>
> using namespace ::rtl;
Please _never_ use the 'using' directive in header files. Doing so may
lead to ambiguities if more than one namespace is used by an
implementation including several header files. Always specify the full
qualified name in header files.
> class OrdinalSuffix
> {
> public:
> OUString SAL_CALL getOrdinalSuffix(OUString aValue,long nDigits);
Btw, non-POD object type parameters should be passed as a const
reference, not as object instance, so const rtl::OUString& rValue
would be better.
Here and in ordinalsuffix.cxx all XServiceInfo related implementation is
missing.
I strongly suggest you get acquainted with the UNO development model and
API conventions first before you proceed.
The basics of the Professional UNO chapter about the API Concepts
http://api.openoffice.org/docs/DevelopersGuide/ProfUNO/ProfUNO.htm#1+2+API+Concepts
The API Design Guidelines
http://api.openoffice.org/docs/DevelopersGuide/Appendix/IDLDesignGuide/IDLDesignGuide.xhtml
and the IDL Documentation Guidelines
http://api.openoffice.org/docs/DevelopersGuide/Appendix/IDLDocumentationGuide/IDLDocumentationGuide.xhtml
Of the UDK Tutorials/Examples section the Guide to C++ UNO
http://udk.openoffice.org/cpp/man/tutorial/unointro.html
may also be of help.
This all sounds like much wood to be chomped, but it is worth it if you
seriously want to develop UNO based components. Also bear in mind that
once an interface is published with an OOo release it can not be changed
anymore in incompatible ways, it has to live on, and can only be
superseded by another interface.
Eike
P.S.: Please consider to subscribe to the mailing lists you're posting
to. By doing so you won't miss replies that are directed to the list
only. When answering, please reply only to the list (Reply-To header is
set), not to my personal account. Thanks.
--
OOo/SO Calc core developer. Number formatter stricken i18n transpositionizer.
GnuPG key 0x293C05FD: 997A 4C60 CE41 0149 0DB3 9E96 2F1A D073 293C 05FD
---------------------------------------------------------------------
To unsubscribe, e-mail: [EMAIL PROTECTED]
For additional commands, e-mail: [EMAIL PROTECTED]