{*
 *******************************************************************************
 *
 *  Copyright 2026 RIEGL Laser Measurement Systems
 *
 *  Licensed 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.
 *
 *  SPDX-License-Identifier: Apache-2.0
 *
 *******************************************************************************
 *}
{*!
 *******************************************************************************
 *
 * \file    riegl.rdb.progress.pas
 * \author  RIEGL LMS GmbH, Austria
 * \brief   Operation progress feedback tools (Pascal wrapper code)
 * \version 2016-06-14/AW: Initial version
 *
 *******************************************************************************
 *}

unit riegl.rdb.progress;

{******************************************************************************}
{***} INTERFACE {**************************************************************}
{******************************************************************************}

//---< INCLUDES >---------------------------------------------------------------

uses
  riegl.rdb;

//---< TYPE DEFINITIONS >-------------------------------------------------------

//______________________________________________________________________________
{*!
 * \brief Progress callback function type
 *
 * Various RDB API functions may accept an optional progress function pointer.
 * That progress function will be called by the API function on a regular basis
 * to communicate the progress of the operation to the client application.
 *
 * Along with the function pointer a pointer to some user data may be provided
 * to the API function. This pointer will then be provided to the callback
 * function which can use it to get or store some context information. Please
 * note that the library doesn't use the user data in any way - it is just
 * relayed from the caller to the progress callback function.
 *
 * It is guaranteed that the callback function is only called from within the
 * API function (i.e. it is not called after the API function returned). But
 * it is =NOT= guaranteed that the callback function is called from within the
 * same thread context as the API function.
 *}
type TRDBProgress = procedure(
  Progress : TRDBUInt8; //!< progress value in percent [0..100%]
  Userdata : Pointer    //!< pointer to user (client) data
) cdecl;

// Variation to accept functions that are not declared as 'cdecl'
type TRDBProgressFunction = procedure(
  Progress : TRDBUInt8; //!< progress value in percent [0..100%]
  Userdata : Pointer    //!< pointer to user (client) data
);

// Variation to accept class methods
type TRDBProgressMethod = procedure(
  Progress : TRDBUInt8 //!< progress value in percent [0..100%]
) of object;

{******************************************************************************}
{***} IMPLEMENTATION {*********************************************************}
{******************************************************************************}

end.
