1 /*************************************************************************
3 * DO NOT ALTER OR REMOVE COPYRIGHT NOTICES OR THIS FILE HEADER.
5 * Copyright 2008 by Sun Microsystems, Inc.
7 * OpenOffice.org - a multi-platform office productivity suite
9 * $RCSfile: XNumberFormats.idl,v $
12 * This file is part of OpenOffice.org.
14 * OpenOffice.org is free software: you can redistribute it and/or modify
15 * it under the terms of the GNU Lesser General Public License version 3
16 * only, as published by the Free Software Foundation.
18 * OpenOffice.org is distributed in the hope that it will be useful,
19 * but WITHOUT ANY WARRANTY; without even the implied warranty of
20 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
21 * GNU Lesser General Public License version 3 for more details
22 * (a copy is included in the LICENSE file that accompanied this code).
24 * You should have received a copy of the GNU Lesser General Public License
25 * version 3 along with OpenOffice.org. If not, see
26 * <http://www.openoffice.org/license.html>
27 * for a copy of the LGPLv3 License.
29 ************************************************************************/
30 #ifndef __com_sun_star_util_XNumberFormats_idl__
31 #define __com_sun_star_util_XNumberFormats_idl__
33 #ifndef __com_sun_star_uno_XInterface_idl__
34 #include
<com
/sun
/star
/uno
/XInterface.idl
>
37 #ifndef __com_sun_star_beans_XPropertySet_idl__
38 #include
<com
/sun
/star
/beans
/XPropertySet.idl
>
41 #ifndef __com_sun_star_lang_Locale_idl__
42 #include
<com
/sun
/star
/lang
/Locale.idl
>
45 #ifndef __com_sun_star_util_MalformedNumberFormatException_idl__
46 #include
<com
/sun
/star
/util
/MalformedNumberFormatException.idl
>
50 //=============================================================================
52 module com
{ module sun
{ module star
{ module util
{
54 //=============================================================================
56 /** provides access to multiple <type>NumberFormat</type>s.
58 published
interface XNumberFormats
: com
::sun
::star
::uno
::XInterface
60 //-------------------------------------------------------------------------
63 a readonly <type>NumberFormatProperties</type>.
65 com
::sun
::star
::beans
::XPropertySet getByKey
( [in] long nKey
);
67 //-------------------------------------------------------------------------
70 a sequence of the keys of all number formats with the specified type and language.
73 the type of number formats to return. Must be one of the
74 <type>NumberFormat</type> constants.
77 the language of number formats to return.
80 <TRUE/>: create new entries if no formats for the selected language exist<BR>
81 <FALSE/>: return an empty list if no formats for the selected language exist
83 sequence
<long> queryKeys
( [in] short nType
,
84 [in] com
::sun
::star
::lang
::Locale nLocale
,
85 [in] boolean bCreate
);
87 //-------------------------------------------------------------------------
89 /** finds a number format by its format string and returns its key.
91 long queryKey
( [in] string aFormat
,
92 [in] com
::sun
::star
::lang
::Locale nLocale
,
95 //-------------------------------------------------------------------------
97 /** adds a new number format to the list, using a format string.
99 long addNew
( [in] string aFormat
,
100 [in] com
::sun
::star
::lang
::Locale nLocale
)
101 raises
( com
::sun
::star
::util
::MalformedNumberFormatException
);
103 //-------------------------------------------------------------------------
105 /** adds a new number format to the list, using a format
106 string in a different locale than the desired locale of the
107 resulting number format.
109 long addNewConverted
( [in] string aFormat
,
110 [in] com
::sun
::star
::lang
::Locale nLocale
,
111 [in] com
::sun
::star
::lang
::Locale nNewLocale
)
112 raises
( com
::sun
::star
::util
::MalformedNumberFormatException
);
114 //-------------------------------------------------------------------------
116 /** removes a number format from the list.
118 void removeByKey
( [in] long nKey
);
120 //-------------------------------------------------------------------------
122 /** generates a format string from several parameters without
123 creating an actual number format.
125 string generateFormat
( [in] long nBaseKey
,
126 [in] com
::sun
::star
::lang
::Locale nLocale
,
127 [in] boolean bThousands
,
129 [in] short nDecimals
,
130 [in] short nLeading
);
134 //=============================================================================