/*
 *    GeoTools - OpenSource mapping toolkit
 *    http://geotools.org
 *    (C) 2005-2006, GeoTools Project Managment Committee (PMC)
 *  
 *    This library is free software; you can redistribute it and/or
 *    modify it under the terms of the GNU Lesser General Public
 *    License as published by the Free Software Foundation;
 *    version 2.1 of the License.
 *
 *    This library is distributed in the hope that it will be useful,
 *    but WITHOUT ANY WARRANTY; without even the implied warranty of
 *    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
 *    Lesser General Public License for more details.
 */

// Guard against multiple includes
#ifndef _org_geotools_openoffice_XReferencing_
#define _org_geotools_openoffice_XReferencing_

// Must be included always for compatibility reasons
#include <com/sun/star/uno/XInterface.idl>
#include <com/sun/star/beans/XPropertySet.idl>
#include <com/sun/star/sheet/AddIn.idl>


module org {
  module geotools {
    module openoffice {
      /// Methods from the org.geotools.referencing package to make available to OpenOffice.
      interface XReferencing : com::sun::star::uno::XInterface {
        /// Converts text in degrees-minutes-seconds to an angle in decimal degrees.
        double getValueAngle(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The text to be converted to an angle.
          [in] string text,
          /// The text that describes the format (example: "D°MM.m'").
          [in] any pattern
        ) raises (com::sun::star::lang::IllegalArgumentException);

        /// Converts an angle to text according to a given format.
        string getTextAngle(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The angle value (in decimal degrees) to be converted.
          [in] double value,
          /// The text that describes the format (example: "D°MM.m'").
          [in] any pattern
        ) raises (com::sun::star::lang::IllegalArgumentException);

        /// Converts a longitude to text according to a given format.
        string getTextLongitude(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The longitude value (in decimal degrees) to be converted.
          [in] double value,
          /// The text that describes the format (example: "D°MM.m'").
          [in] any pattern
        ) raises (com::sun::star::lang::IllegalArgumentException);

        /// Converts a latitude to text according to a given format.
        string getTextLatitude(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The latitude value (in decimal degrees) to be converted.
          [in] double value,
          /// The text that describes the format (example: "D°MM.m'").
          [in] any pattern
        ) raises (com::sun::star::lang::IllegalArgumentException);

        /// Returns an identified object description from an authority code.
        string getDescription(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The authority code (e.g. "EPSG:4326").
          [in] string authorityCode
        );

        /// Returns the scope for an identified object.
        string getScope(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The authority code (e.g. "EPSG:4326").
          [in] string authorityCode
        );

        /// Returns the valid area as a textual description for an identified object.
        string getValidArea(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The authority code (e.g. "EPSG:4326").
          [in] string authorityCode
        );

        /// Returns the valid area as a geographic bounding box for an identified object.
        sequence< sequence< double > > getBoundingBox(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The authority code (e.g. "EPSG:4326").
          [in] string authorityCode
        );

        /// Returns the remarks for an identified object.
        string getRemarks(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The authority code (e.g. "EPSG:4326").
          [in] string authorityCode
        );

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

        /// Returns the value for a coordinate reference system parameter.
        any getParameter(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The authority code (e.g. "EPSG:4326").
          [in] string authorityCode,
          /// The parameter name (e.g. "False easting").
          [in] string parameter
        );

        /// Returns the Well Know Text (WKT) for an identified object.
        string getWKT(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The authority code (e.g. "EPSG:4326").
          [in] string authorityCode,
          /// The authority name for choice of parameter names. Usually "OGC".
          [in] any authority
        );

        /// Returns the Well Know Text (WKT) of a transformation between two coordinate reference systems.
        string getTransformWKT(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// Authority code of the source coordinate reference system.
          [in] string sourceCRS,
          /// Authority code of the target coordinate reference system.
          [in] string targetCRS,
          /// The authority name for choice of parameter names. Usually "OGC".
          [in] any authority
        );

        /// Returns the accuracy of a transformation between two coordinate reference systems.
        double getAccuracy(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The source coordinates to transform.
          [in] string sourceCRS,
          /// Authority code of the target coordinate reference system.
          [in] string targetCRS
        );

        /// Transforms a list of coordinates from source CRS to target CRS.
        sequence< sequence< double > > getTransformedCoordinates(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The source coordinates to transform.
          [in] sequence< sequence< double > > coordinates,
          /// Authority code of the source coordinate reference system.
          [in] string sourceCRS,
          /// Authority code of the target coordinate reference system.
          [in] string targetCRS
        );

        /// Computes the orthodromic distance and azimuth between two coordinates.
        sequence< sequence< double > > getOrthodromicDistance(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The source positions.
          [in] sequence< sequence< double > > source,
          /// The target positions.
          [in] sequence< sequence< double > > target,
          /// Authority code of the coordinate reference system.
          [in] any CRS
        );

        /// Computes the coordinates after a displacement of the specified distance.
        sequence< sequence< double > > getOrthodromicForward(
          [in] com::sun::star::beans::XPropertySet xOptions,
          /// The source positions.
          [in] sequence< sequence< double > > source,
          /// The distance and azimuth.
          [in] sequence< sequence< double > > displacement,
          /// Authority code of the coordinate reference system.
          [in] any CRS
        );
      };

      /*
       * Exported interfaces:
       * This is where we put all interfaces that this service exports.
       */
      service Referencing {
        interface XReferencing;

        /*
         * Necessary base service.
         * All add-ins must implement this service
         */
        service com::sun::star::sheet::AddIn;
      };
    };
  };
};

#endif
