![]() | InDesign SDK 20.5 |
#include <SnipRunLog.h>
Public Member Functions | |
| virtual | ~SnipRunLog () |
| void | Log (const PMString &message) |
| void | Clear () |
| void | UpdateTextControl () |
| void | SaveLog (InterfacePtr< IPMStream > stream) |
| bool16 | GetTrace () const |
| void | SetTrace (bool16 traceState) |
| void | Resize () |
| void | ResizeComplete () |
Static Public Member Functions | |
| static SnipRunLog * | Instance () |
| static void | DeleteInstance () |
| static SnipRunLog * | PeekAtSnipRunLog () |
Protected Member Functions | |
| SnipRunLog (const WidgetID &logPanelWidgetID, const WidgetID &logWidgetID, const WidgetID &scrollBarWidgetID) | |
Friends | |
| class | SnipRunPanelWidgetObserver |
Log that records messages in a multi line text widget on a panel.
This is a singleton instance. The lifetime extends from the first use of the log, until the SnipRunManager instance is destroyed. This allows the log to be used when snippets are executed through alternative mechansisms (scripting or quick apply) when the snippet runner panel might be hidden.
| protected |
Constructor is protected because this is a singleton class.
| logPanelWidgetID | IN of panel containing the text widget that will display log. |
| logWidgetID | IN of text widget that will display messages. |
| scrollBarWidgetID | IN of log scroll bar. |
| virtual |
Destructor
| void SnipRunLog::Clear | ( | void | ) |
Clears the log of messages.
| static |
Destroys the single global instance of this singleton class. If there is no instance in existance, just returns.
| inline |
GetTrace
| static |
Returns the global instance of this singleton class.
| void SnipRunLog::Log | ( | const PMString & | message | ) |
Records the given message on a new line in the log, call like this SnipRunLog::Instance()->Log("Hiya"),
| message | to be logged. |
| inlinestatic |
Let's client code see if the log has been instantiaed. Used to workaround a problem that happens when the log UI (a panel) gets resized (see SnipRunControlView::Resize).
| void SnipRunLog::Resize | ( | ) |
The user is resizing the log panel that displays the log. The content of the log is saved for later restoration and then the log is cleared for the duration of the resize. Resize runs much faster if there is no data in the multi line text widget. This method schedules a command kSnipRunRestoreLogCmdBoss that will get processed when the user finishes dragging the resize handle and the command calls SnipRunLog::ResizeComplete.
| void SnipRunLog::ResizeComplete | ( | ) |
Restores the saved contents of the log into the multi-line text widget.
| void SnipRunLog::SaveLog | ( | InterfacePtr< IPMStream > | stream | ) |
SaveLog
| stream | IN log data to be saved into. |
| inline |
Controls whether log messages are echoed to TRACE.
| traceState | kTrue to enable echo of log calls to TRACE |
| void SnipRunLog::UpdateTextControl | ( | ) |
UpdateTextControl that displays the log.