TuttleOFX  1
ofxProgress.h
Go to the documentation of this file.
00001 /*
00002  * Software License :
00003  *
00004  * Copyright (c) 2007-2009, The Open Effects Association Ltd. All rights reserved.
00005  *
00006  * Redistribution and use in source and binary forms, with or without
00007  * modification, are permitted provided that the following conditions are met:
00008  *
00009  * Redistributions of source code must retain the above copyright notice,
00010  *    this list of conditions and the following disclaimer.
00011  * Redistributions in binary form must reproduce the above copyright notice,
00012  *    this list of conditions and the following disclaimer in the documentation
00013  *    and/or other materials provided with the distribution.
00014  * Neither the name The Open Effects Association Ltd, nor the names of its
00015  *    contributors may be used to endorse or promote products derived from this
00016  *    software without specific prior written permission.
00017  *
00018  * THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDERS AND CONTRIBUTORS "AS IS" AND
00019  * ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT LIMITED TO, THE IMPLIED
00020  * WARRANTIES OF MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE ARE
00021  * DISCLAIMED. IN NO EVENT SHALL THE COPYRIGHT OWNER OR CONTRIBUTORS BE LIABLE FOR
00022  * ANY DIRECT, INDIRECT, INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES
00023  * (INCLUDING, BUT NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES;
00024  * LOSS OF USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON
00025  * ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT
00026  * (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF THIS
00027  * SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
00028  */
00029 
00030 #ifndef _ofxProgressSuite_h_
00031 #define _ofxProgressSuite_h_
00032 
00033 #include "ofxCore.h"
00034 
00035 /** @brief suite for displaying a progress bar */
00036 #define kOfxProgressSuite "OfxProgressSuite"
00037 
00038 /** @brief A suite that provides progress feedback from a plugin to an application
00039  *
00040  *  A plugin instance can initiate, update and close a progress indicator with
00041  *  this suite.
00042  *
00043  *  This is an optional suite in the Image Effect API.
00044  */
00045 typedef struct OfxProgressSuiteV1
00046 {
00047 
00048         /** @brief Initiate a progress bar display.
00049          *
00050          *  Call this to initiate the display of a progress bar.
00051          *
00052          *  \arg \e effectInstance - the instance of the plugin this progress bar is
00053          *                           associated with. It cannot be NULL.
00054          *  \arg \e label          - a text label to display in any message portion of the
00055          *                           progress object's user interface. A UTF8 string.
00056          *
00057          *  \returns
00058          *  - ::kOfxStatOK - the handle is now valid for use
00059          *  - ::kOfxStatFailed - the progress object failed for some reason
00060          *  - ::kOfxStatErrBadHandle - effectInstance was invalid
00061          */
00062         OfxStatus ( *progressStart )( void*       effectInstance,
00063                                       const char* label );
00064 
00065         /** @brief Indicate how much of the processing task has been completed and reports on any abort status.
00066          *
00067          *  \arg \e effectInstance - the instance of the plugin this progress bar is
00068          *                            associated with. It cannot be NULL.
00069          *  \arg \e progress - a number between 0.0 and 1.0 indicating what proportion of the current task has been processed.
00070          *
00071          *  \returns
00072          *  - ::kOfxStatOK - the progress object was successfully updated and the task should continue
00073          *  - ::kOfxStatReplyNo - the progress object was successfully updated and the task should abort
00074          *  - ::kOfxStatErrBadHandle - the progress handle was invalid,
00075          */
00076         OfxStatus ( *progressUpdate )( void* effectInstance, double progress );
00077 
00078         /** @brief Signal that we are finished with the progress meter.
00079          *
00080          *  Call this when you are done with the progress meter and no
00081          *  longer need it displayed.
00082          *
00083          *  \arg \e effectInstance - the instance of the plugin this progress bar is
00084          *                            associated with. It cannot be NULL.
00085          *
00086          *  \postcondition - you can no longer call progressUpdate on the instance
00087          *
00088          *  \returns
00089          *  - ::kOfxStatOK - the progress object was successfully closed
00090          *  - ::kOfxStatErrBadHandle - the progress handle was invalid,
00091          */
00092         OfxStatus ( *progressEnd )( void* effectInstance );
00093 
00094 
00095 
00096 } OfxProgressSuiteV1 ;
00097 
00098 #endif