00001 /* 00002 * The information in this file is 00003 * Copyright(c) 2007 Ball Aerospace & Technologies Corporation 00004 * and is subject to the terms and conditions of the 00005 * GNU Lesser General Public License Version 2.1 00006 * The license text is available from 00007 * http://www.gnu.org/licenses/lgpl.html 00008 */ 00009 00010 #ifndef PLUGINCALLBACK_H_ 00011 #define PLUGINCALLBACK_H_ 00012 00013 class PlugIn; 00014 class Progress; 00015 00016 class PlugInCallback 00017 { 00018 public: 00019 /** 00020 * This is called when cleanup has finished in the core. 00021 */ 00022 virtual void operator()() = 0; 00023 00024 /** 00025 * This blocks until the plug-in thread has finished. 00026 * 00027 * Usually just a wrapper around BThread::ThreadWait(). 00028 * 00029 * @return Returns \b true if successful, otherwise returns \b false. 00030 */ 00031 virtual bool finish() = 0; 00032 00033 /** 00034 * Returns the Progress object for the plug-in that registered this 00035 * callback. 00036 * 00037 * @return The Progress object for the registering plug-in. 00038 */ 00039 virtual Progress* progress() const = 0; 00040 00041 /** 00042 * Returns a pointer to the plug-in that is registering this callback. 00043 * 00044 * @return A pointer to the plug-in that has registered this callback. 00045 * \b NULL may be returned if the plug-in has been registered as a 00046 * background executing plug-in. 00047 * 00048 * @see ViewerShell, DesktopServices::registerCallback() 00049 */ 00050 virtual PlugIn* getPlugIn() const = 0; 00051 00052 /** 00053 * This should be implemented in subclasses. 00054 */ 00055 virtual ~PlugInCallback() {} 00056 }; 00057 00058 #endif