Interface to provide import/export progress feedback and cancellation.
All well behaved SketchUp importer/exporter plugins should support progress feedback and cancellation through this interface. SketchUp will pop up a progress/cancel dialog prior to calling the appropriate Convert method on the importer/exporter plugin and supply a concrete implementation of this interface. The plugin should supply feedback to the user by estimating how far along the conversion is (via SetPercentDone or SetStepSize and Step), provide some textual progress (via SetProgressMessage) and test for cancellation by calling HasBeenCancelled.
For example, the main loop of an importer plugin may look like this:
progress_callback->SetProgressMessage("Importing 50 things!");
progress_callback->SetStepSize(1.0);
for (int steps = 0; steps < 50; ++steps) {
progress_callback->Step();
if (progress_callback->HasBeenCancelled()) {
return false;
}
}
progress_callback->SetProgressMessage("We're half way there!");
progress_callback->SetPercentDone(75.0);
progress_callback->SetProgressMessage("Finishing up!");
progress_callback->SetPercentDone(100.0);
return true;