/*
 * Licensed to the Apache Software Foundation (ASF) under one or more
 * contributor license agreements.  See the NOTICE file distributed with
 * this work for additional information regarding copyright ownership.
 * The ASF licenses this file to You under the Apache License, Version 2.0
 * (the "License"); you may not use this file except in compliance with
 * the License.  You may obtain a copy of the License at
 *
 *     http://www.apache.org/licenses/LICENSE-2.0
 *
 * Unless required by applicable law or agreed to in writing, software
 * distributed under the License is distributed on an "AS IS" BASIS,
 * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
 * See the License for the specific language governing permissions and
 * limitations under the License.
 */

#ifndef _org_apache_sis_openoffice_XReferencing_
#define _org_apache_sis_openoffice_XReferencing_

#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/lang/XLocalizable.idl>
#include <com/sun/star/beans/XPropertySet.idl>


/*
 * Define the methods to be invoked by OpenOffice.
 * This IDL file is converted in both a .urd file (used by OpenOffice) and a .class file (used by Java).
 */
module org {
  module apache {
    module sis {
      module openoffice {
        /// Methods from the org.apache.sis.referencing package to make available to OpenOffice.
        interface XReferencing {
          interface ::com::sun::star::uno::XInterface;

          /// used to set an add-in locale for formatting messages.
          [optional] interface ::com::sun::star::lang::XLocalizable;

          /// Returns an identified object name from an authority code.
          string getName(
            /// The authority code (e.g. "EPSG:4326").
            [in] string codeOrPath
          );

          /// Returns the scope of an identified object.
          string getScope(
            /// The authority code (e.g. "EPSG:4326").
            [in] string codeOrPath
          );

          /// Returns the domain of validity as country or region names for an identified object.
          string getDomainOfValidity(
            /// The authority code (e.g. "EPSG:4326").
            [in] string codeOrPath
          );

          /// Returns the domain of validity as a geographic bounding box for an identified object.
          sequence< sequence< double > > getGeographicArea(
            /// The authority code (e.g. "EPSG:4326").
            [in] string codeOrPath
          );

          /// Returns the accuracy of a transformation between two coordinate reference systems.
          double getAccuracy(
            /// The source coordinates to transform.
            [in] string sourceCRS,
            /// Authority code of the target coordinate reference system.
            [in] string targetCRS,
            /// An optional bounding box of source coordinates to transform.
            [in] any areaOfInterest
          ) raises (com::sun::star::lang::IllegalArgumentException);

          /// Returns the axis name for the specified dimension in an identified object.
          string getAxis(
            /// The authority code (e.g. "EPSG:4326").
            [in] string codeOrPath,
            /// The dimension (1, 2, ...).
            [in] long dimension
          );

          /// Transforms a list of coordinates from source CRS to target CRS.
          sequence< sequence< double > > transformPoints(
            /// Authority code of the source coordinate reference system.
            [in] string sourceCRS,
            /// Authority code of the target coordinate reference system.
            [in] string targetCRS,
            /// The source coordinates to transform.
            [in] sequence< sequence< double > > points
          );

          /// Transforms the envelope of given points from source CRS to target CRS.
          sequence< sequence< double > > transformEnvelope(
            /// Authority code of the source coordinate reference system.
            [in] string sourceCRS,
            /// Authority code of the target coordinate reference system.
            [in] string targetCRS,
            /// The source envelope to transform.
            [in] sequence< sequence< double > > envelope
          );

          /// Converts text in degrees-minutes-seconds to an angle in decimal degrees.
          sequence< sequence< double > > parseAngle(
            /// The text to be converted to an angle.
            [in] sequence< sequence< string > > text,
            /// The text that describes the format (example: "D MM.m'").
            [in] any pattern,
            /// The locale (example: "en", "fr").
            [in] any locale
          ) raises (com::sun::star::lang::IllegalArgumentException);

          /// Converts an angle to text according to a given format.
          sequence< sequence< string > > formatAngle(
            /// The angle value (in decimal degrees) to be converted.
            [in] sequence< sequence< double > > value,
            /// The text that describes the format (example: "D MM.m'").
            [in] any pattern,
            /// The locale (example: "en", "fr").
            [in] any locale
          ) raises (com::sun::star::lang::IllegalArgumentException);
        };

        /*
         * All interfaces exported by the referencing service.
         */
        service Referencing {
          interface XReferencing;
        };
      };
    };
  };
};

#endif
