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

#include <SnipRunManager.h>

Public Types

typedef KeyValuePair< PMString,
SnpRunnable * > 
Snippet
 
typedef K2Vector< SnippetSnippetDict
 

Public Member Functions

void DeleteInstance ()
 
void AddSnippet (SnpRunnable *runnable)
 
void RemoveSnippet (SnpRunnable *runnable)
 
int32 GetNumberOfSnippets () const
 
const SnippetDictGetSnippets () const
 
SnpRunnableFindSnippet (const PMString &snippetName) const
 
void SortSnippets (void)
 

Static Public Member Functions

static SnipRunManagerInstance ()
 

Protected Member Functions

 SnipRunManager ()
 

Detailed Description

Manages all registered snippets. Singleton class that is instantiated when the first SnipRun object constructs. The SnipRun constructor adds each registered snippet to the list of SnipRun objects held by SnipRunManager.

Member Typedef Documentation

Snippet dictionary element, key is the name of the snippet, value is a pointer to its registered SnipRun object.

Dictionary of registered snippets.

Constructor & Destructor Documentation

SnipRunManager::SnipRunManager ()
protected

Constructor is protected because this is a singleton.

Member Function Documentation

void SnipRunManager::AddSnippet (SnpRunnablerunnable)

Add snippet to list of registered snippets. If a snippet is already registered under this name the request will be ignored.

Parameters
runnablesnippet to be registered.
void SnipRunManager::DeleteInstance ()

Destroys the single global instance of this singleton.

SnpRunnable * SnipRunManager::FindSnippet (const PMStringsnippetName) const

Lookup the named snippet in the list of registered snippets.

Parameters
snippetName
int32 SnipRunManager::GetNumberOfSnippets () const
inline

Get the number of registered snippets.

Returns
the number of registered snippets.
const SnippetDict& SnipRunManager::GetSnippets () const
inline

Return a dictionary of registered snippets.

Returns
a dictionary of registered snippets.
SnipRunManager * SnipRunManager::Instance ()
static

Returns the global instance of this singleton, call like this SnipRunManager::Instance().

Returns
the global instance of this singleton class.
void SnipRunManager::RemoveSnippet (SnpRunnablerunnable)

Remove snippet from list of registered snippets.

Parameters
runnablesnippet to be removed.
void SnipRunManager::SortSnippets (void )

Sort the list of registered snippets.