1*7e178966SAndrew Rist/**************************************************************
2cdf0e10cSrcweir *
3*7e178966SAndrew Rist * Licensed to the Apache Software Foundation (ASF) under one
4*7e178966SAndrew Rist * or more contributor license agreements.  See the NOTICE file
5*7e178966SAndrew Rist * distributed with this work for additional information
6*7e178966SAndrew Rist * regarding copyright ownership.  The ASF licenses this file
7*7e178966SAndrew Rist * to you under the Apache License, Version 2.0 (the
8*7e178966SAndrew Rist * "License"); you may not use this file except in compliance
9*7e178966SAndrew Rist * with the License.  You may obtain a copy of the License at
10*7e178966SAndrew Rist *
11*7e178966SAndrew Rist *   http://www.apache.org/licenses/LICENSE-2.0
12*7e178966SAndrew Rist *
13*7e178966SAndrew Rist * Unless required by applicable law or agreed to in writing,
14*7e178966SAndrew Rist * software distributed under the License is distributed on an
15*7e178966SAndrew Rist * "AS IS" BASIS, WITHOUT WARRANTIES OR CONDITIONS OF ANY
16*7e178966SAndrew Rist * KIND, either express or implied.  See the License for the
17*7e178966SAndrew Rist * specific language governing permissions and limitations
18*7e178966SAndrew Rist * under the License.
19*7e178966SAndrew Rist *
20*7e178966SAndrew Rist *************************************************************/
21*7e178966SAndrew Rist
22*7e178966SAndrew Rist
23cdf0e10cSrcweir
24cdf0e10cSrcweir
25cdf0e10cSrcweir#include <com/sun/star/uno/XInterface.idl>
26cdf0e10cSrcweir#include <com/sun/star/beans/XPropertySet.idl>
27cdf0e10cSrcweir#include <com/sun/star/sheet/LocalizedName.idl>
28cdf0e10cSrcweir
29cdf0e10cSrcweirmodule com
30cdf0e10cSrcweir{
31cdf0e10cSrcweirmodule sun
32cdf0e10cSrcweir{
33cdf0e10cSrcweirmodule star
34cdf0e10cSrcweir{
35cdf0e10cSrcweirmodule sheet
36cdf0e10cSrcweir{
37cdf0e10cSrcweirmodule addin
38cdf0e10cSrcweir{
39cdf0e10cSrcweir    interface XCompatibilityNames  : com::sun::star::uno::XInterface
40cdf0e10cSrcweir    {
41cdf0e10cSrcweir        /// @return a sequence with all localized names for a programmatic name
42cdf0e10cSrcweir        sequence< com::sun::star::sheet::LocalizedName > getCompatibilityNames ( [in] string aProgrammaticName );
43cdf0e10cSrcweir    };
44cdf0e10cSrcweir
45cdf0e10cSrcweir    /**
46cdf0e10cSrcweir     * Interface with date functions.
47cdf0e10cSrcweir     */
48cdf0e10cSrcweir    interface XDateFunctions : com::sun::star::uno::XInterface
49cdf0e10cSrcweir    {
50cdf0e10cSrcweir        /// calculates the number of weeks between two dates.
51cdf0e10cSrcweir        long getDiffWeeks(
52cdf0e10cSrcweir                    [in] com::sun::star::beans::XPropertySet xOptions,
53cdf0e10cSrcweir                    [in] long nStartDate, [in] long nEndDate, [in] long nMode )
54cdf0e10cSrcweir            raises( com::sun::star::lang::IllegalArgumentException );
55cdf0e10cSrcweir
56cdf0e10cSrcweir        /// calculates the number of months between two dates.
57cdf0e10cSrcweir        long getDiffMonths(
58cdf0e10cSrcweir                    [in] com::sun::star::beans::XPropertySet xOptions,
59cdf0e10cSrcweir                    [in] long nStartDate, [in] long nEndDate, [in] long nMode )
60cdf0e10cSrcweir            raises( com::sun::star::lang::IllegalArgumentException );
61cdf0e10cSrcweir
62cdf0e10cSrcweir        /// calculates the number of years between two dates.
63cdf0e10cSrcweir        long getDiffYears(
64cdf0e10cSrcweir                    [in] com::sun::star::beans::XPropertySet xOptions,
65cdf0e10cSrcweir                    [in] long nStartDate, [in] long nEndDate, [in] long nMode )
66cdf0e10cSrcweir            raises( com::sun::star::lang::IllegalArgumentException );
67cdf0e10cSrcweir
68cdf0e10cSrcweir        /// checks if a date is in a leap year.
69cdf0e10cSrcweir        long getIsLeapYear(
70cdf0e10cSrcweir                    [in] com::sun::star::beans::XPropertySet xOptions,
71cdf0e10cSrcweir                    [in] long nDate )
72cdf0e10cSrcweir            raises( com::sun::star::lang::IllegalArgumentException );
73cdf0e10cSrcweir
74cdf0e10cSrcweir        /// calculates the number of days in a month.
75cdf0e10cSrcweir        long getDaysInMonth(
76cdf0e10cSrcweir                    [in] com::sun::star::beans::XPropertySet xOptions,
77cdf0e10cSrcweir                    [in] long nDate )
78cdf0e10cSrcweir            raises( com::sun::star::lang::IllegalArgumentException );
79cdf0e10cSrcweir
80cdf0e10cSrcweir        /// calculates the number of days in a year.
81cdf0e10cSrcweir        long getDaysInYear(
82cdf0e10cSrcweir                    [in] com::sun::star::beans::XPropertySet xOptions,
83cdf0e10cSrcweir                    [in] long nDate )
84cdf0e10cSrcweir            raises( com::sun::star::lang::IllegalArgumentException );
85cdf0e10cSrcweir
86cdf0e10cSrcweir        /// calculates the number of weeks in a year.
87cdf0e10cSrcweir        long getWeeksInYear(
88cdf0e10cSrcweir                    [in] com::sun::star::beans::XPropertySet xOptions,
89cdf0e10cSrcweir                    [in] long nDate )
90cdf0e10cSrcweir            raises( com::sun::star::lang::IllegalArgumentException );
91cdf0e10cSrcweir    };
92cdf0e10cSrcweir
93cdf0e10cSrcweir    /**
94cdf0e10cSrcweir     * Interface with miscellaneous functions.
95cdf0e10cSrcweir     */
96cdf0e10cSrcweir    interface XMiscFunctions : com::sun::star::uno::XInterface
97cdf0e10cSrcweir    {
98cdf0e10cSrcweir        /// Encrypts or decrypts a string using the ROT13 algorithm.
99cdf0e10cSrcweir        string getRot13( [in] string aSrcString )
100cdf0e10cSrcweir            raises( com::sun::star::lang::IllegalArgumentException );
101cdf0e10cSrcweir    };
102cdf0e10cSrcweir
103cdf0e10cSrcweir    service DateFunctions
104cdf0e10cSrcweir    {
105cdf0e10cSrcweir        // exported interfaces:
106cdf0e10cSrcweir        interface XDateFunctions;
107cdf0e10cSrcweir        interface XMiscFunctions;
108cdf0e10cSrcweir    };
109cdf0e10cSrcweir};
110cdf0e10cSrcweir};
111cdf0e10cSrcweir};
112cdf0e10cSrcweir};
113cdf0e10cSrcweir};
114cdf0e10cSrcweir
115