InDesign SDK  20.5
 All Classes Namespaces Functions Variables Typedefs Enumerations Enumerator Friends Groups Pages
SnipRunLog Class Reference

#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 SnipRunLogInstance ()
 
static void DeleteInstance ()
 
static SnipRunLogPeekAtSnipRunLog ()
 

Protected Member Functions

 SnipRunLog (const WidgetID &logPanelWidgetID, const WidgetID &logWidgetID, const WidgetID &scrollBarWidgetID)
 

Friends

class SnipRunPanelWidgetObserver
 

Detailed Description

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.

Constructor & Destructor Documentation

SnipRunLog::SnipRunLog (const WidgetIDlogPanelWidgetID,
const WidgetIDlogWidgetID,
const WidgetIDscrollBarWidgetID 
)
protected

Constructor is protected because this is a singleton class.

Parameters
logPanelWidgetIDIN of panel containing the text widget that will display log.
logWidgetIDIN of text widget that will display messages.
scrollBarWidgetIDIN of log scroll bar.
SnipRunLog::~SnipRunLog ()
virtual

Destructor

Member Function Documentation

void SnipRunLog::Clear (void )

Clears the log of messages.

void SnipRunLog::DeleteInstance ()
static

Destroys the single global instance of this singleton class. If there is no instance in existance, just returns.

bool16 SnipRunLog::GetTrace () const
inline

GetTrace

SnipRunLog * SnipRunLog::Instance ()
static

Returns the global instance of this singleton class.

Returns
the global instance of this singleton class.
void SnipRunLog::Log (const PMStringmessage)

Records the given message on a new line in the log, call like this SnipRunLog::Instance()->Log("Hiya"),

Parameters
messageto be logged.
static SnipRunLog* SnipRunLog::PeekAtSnipRunLog ()
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).

Returns
pointer to the log object if instantiated, nil otherwise.
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< IPMStreamstream)

SaveLog

Parameters
streamIN log data to be saved into.
void SnipRunLog::SetTrace (bool16 traceState)
inline

Controls whether log messages are echoed to TRACE.

Parameters
traceStatekTrue to enable echo of log calls to TRACE
void SnipRunLog::UpdateTextControl ()

UpdateTextControl that displays the log.