LaunchyPlugin.h File Reference

#include <string>
#include <vector>
#include <map>

Go to the source code of this file.

Data Structures

struct  SearchResult
 When you want to add an index item to Launchy, a SearchResult is used. More...

Typedefs

typedef unsigned int uint

Functions

void FreeSearchResult (SearchResult *sr)
 Internally used by Launchy to free results after you have returned them.
SearchResult makeResult (wstring DisplayString, wstring FullPath, wstring Location, HICON icon)
 Use this function to quickly build SearchResults.
SearchResultResultVectorToArray (vector< SearchResult > results)
 Convert a vector of SearchResults into a C SearchResult array.
vector< wstring > TCHARListToVector (int numStrings, const TCHAR *Strings)
 Convert a list of TCHAR strings to a vector of wstrings.
TCHAR * string2TCHAR (wstring str)
 Convert a wstring to a TCHAR*.
TCHAR * StringVectorToTCHAR (vector< wstring > &Strings)
 Convert a vector of wstrings to a TCHAR*.
unsigned long GenerateID (wstring str)
 Create a generated ID number from your plugin name.
TCHAR * SerializeStringMap (map< wstring, wstring > m)
 Convert a map of string->string into a TCHAR*.
void StoreString (wstring name, wstring value)
 Have Launchy store a string value in its archive.
wstring RetrieveString (wstring name)
 Have Launchy retrieve a string value from its archive.
void StoreInt (wstring name, int value)
 Have Launchy store an int into its archive.
int RetrieveInt (wstring name, bool &exists)
 Have Launchy retrieve an int from its archive.
void StoreFloat (wstring name, float value)
 Have Launchy store a float into its archive.
float RetrieveFloat (wstring name, bool &exists)
 Have Launchy retrieve a float from its archive.
void PluginSaveOptions ()
 This event is called when Launchy is about to archive its options If you have not yet performed your StoreInt/Float/String functions this is the time to do so.
SearchResultPluginGetIdentifiers (int *iNumResults)
 Every time Launchy reindexes it clears the list of Plugin provided files and asks for them again This function is where you tell Launchy what "files" you would like it to index.
SearchResultPluginUpdateSearch (int NumStrings, const TCHAR *Strings, const TCHAR *FinalString, int *NumResults)
 If your plugin would like to add some items to the main Launchy index, such as "Google" or "Amazon" then this is the place to do it.PluginGetIdentifiers() is called at plugin initialization time and each time the index is reloaded.
SearchResultPluginFileOptions (const TCHAR *FullPath, int NumStrings, const TCHAR *Strings, const TCHAR *FinalString, int *NumResults)
 When a user presses TAB on a file owned by the normal Launchy index, Launchy asks each of the plugins if they would like to provide SearchResults for this file.
void PluginDoAction (int NumStrings, const TCHAR *Strings, const TCHAR *FinalString, const TCHAR *FullPath)
 This is called when the user has pressed enter on a SearchResult that this plugin created It is up to the plugin to do something with the file, such as execute it.
TCHAR * PluginGetRegexs (int *iNumResults)
 If your plugin would like to claim ownership of all user input that matches a regular expression, then provide Launchy with a list of regular expressions here An example is Weby which owns all searches that include www or http The regular expressions are PERL regular expressions to be interpreted by the BOOST regex library.
TCHAR * PluginGetSeparator ()
 The character used to separate input items when the user hits the TAB key, typically L'|'.
void PluginFreeResults (SearchResult *, int num)
 This is used interally by Launchy to free the SearchResults that you have returned.
void PluginFreeStrings (TCHAR *str)
 This is used internally by Launchy to free any strings that you have returned.
TCHAR * PluginGetName ()
 This is called at load when Launchy would like to know the name of your plugin.
TCHAR * PluginGetDescription ()
 Launchy will list a brief description of your plugin in the "Plugins" dialog, this is where Launchy gets that description.
void PluginInitialize ()
 This function is called when the plugin is first loaded.
void PluginClose ()
 This function is called just before the plugin is unloaded.
void PluginCallOptionsDlg (HWND hwnd)
 This function is called when the user has pressed the "plugin options" button on your plugin You should create a dialog window to interface with this user from this function An example plugin that has such a dialog is Runny.
void PluginGetStorage (int *NumItems, TCHAR **ItemNames, TCHAR **ItemValues)
 Called from Launchy when it wants the plugin's information to be archived.
void PluginSetStorage (int NumItems, TCHAR *ItemNames, TCHAR *ItemValues)
 Called from Launchy when it wants to tell the plugin what information it has archived.
bool PluginHasOptionsDlg (void)
 Used by Launchy to determine if it should call your plugin's PluginCallOptionsDlg function.

Variables

map< wstring, wstring > Storage
 Internal structure used for storage of plugin defined options.


Typedef Documentation

typedef unsigned int uint

Definition at line 13 of file LaunchyPlugin.h.


Function Documentation

void FreeSearchResult ( SearchResult sr  ) 

Internally used by Launchy to free results after you have returned them.

SearchResult makeResult ( wstring  DisplayString,
wstring  FullPath,
wstring  Location,
HICON  icon 
)

Use this function to quickly build SearchResults.

See also:
SearchResult
Parameters:
DisplayString The shortened string that Launchy will search on
FullPath The full path (including filename) of the file pointed at if it is a file. Important: Make sure that FullPath is unique, e.g. append ".YourPluginName" to DisplayString otherwise multiple files with the same name will get confused by Launchy
Location The location of your file, set to your Plugin Name if it is not for a file
icon Currently unused
Returns:
The composed SearchResult

SearchResult* ResultVectorToArray ( vector< SearchResult results  ) 

Convert a vector of SearchResults into a C SearchResult array.

See also:
makeResult
Parameters:
results The vector of search results to convert
Returns:
The array of SearchResults

vector<wstring> TCHARListToVector ( int  numStrings,
const TCHAR *  Strings 
)

Convert a list of TCHAR strings to a vector of wstrings.

See also:
StringVectorToTCHAR()
Parameters:
numStrings The number of strings in the TCHAR to convert
Strings The TCHAR* to convert
Returns:
The vector of strings

TCHAR* string2TCHAR ( wstring  str  ) 

Convert a wstring to a TCHAR*.

Parameters:
str The wstring to convert
Returns:
The THCAR* representation of the string

TCHAR* StringVectorToTCHAR ( vector< wstring > &  Strings  ) 

Convert a vector of wstrings to a TCHAR*.

See also:
TCHARListToVector()
Parameters:
Strings The vector of wstrings to convert
Returns:
The TCHAR* representation of the string vector

unsigned long GenerateID ( wstring  str  ) 

Create a generated ID number from your plugin name.

Warning:
This is meant for internal Launchy use
Parameters:
str Your plugin name
Returns:
The generated ID

TCHAR* SerializeStringMap ( map< wstring, wstring >  m  ) 

Convert a map of string->string into a TCHAR*.

Warning:
This is meant for internal Launchy use
Parameters:
m The map to convert
Returns:
The serialized map as a TCHAR*

void StoreString ( wstring  name,
wstring  value 
)

Have Launchy store a string value in its archive.

Parameters:
name The identifier of the value to store
value The value of the identifier
Returns:
void

wstring RetrieveString ( wstring  name  ) 

Have Launchy retrieve a string value from its archive.

Parameters:
name The identifier of the value to retrieve
Returns:
The string associated with the identifier in Launchy's archive

void StoreInt ( wstring  name,
int  value 
)

Have Launchy store an int into its archive.

Parameters:
name The identifier of the value to store
value The value of the identifier
Returns:
void

int RetrieveInt ( wstring  name,
bool &  exists 
)

Have Launchy retrieve an int from its archive.

Parameters:
name The identifier of the value to retrieve
exists This value is set to whether or not the identifier was found in the archive
Returns:
The retrieved integer

void StoreFloat ( wstring  name,
float  value 
)

Have Launchy store a float into its archive.

Parameters:
name The identifier of the value to store
value The value of the identifier
Returns:
void

float RetrieveFloat ( wstring  name,
bool &  exists 
)

Have Launchy retrieve a float from its archive.

Parameters:
name The identifier of the value to retrieve
exists This value is set to whether or not the identifier was found in the archive
Returns:
The retrieved float

void PluginSaveOptions (  ) 

This event is called when Launchy is about to archive its options If you have not yet performed your StoreInt/Float/String functions this is the time to do so.

SearchResult* PluginGetIdentifiers ( int *  iNumResults  ) 

Every time Launchy reindexes it clears the list of Plugin provided files and asks for them again This function is where you tell Launchy what "files" you would like it to index.

See also:
SearchResult

makeResult()

ResultVectorToArray()

Parameters:
iNumResults Be sure to set the value of iNumResults to the number of results you have returned in the SearchResult*
Returns:
You must return a list of SearchResults

SearchResult* PluginUpdateSearch ( int  NumStrings,
const TCHAR *  Strings,
const TCHAR *  FinalString,
int *  NumResults 
)

If your plugin would like to add some items to the main Launchy index, such as "Google" or "Amazon" then this is the place to do it.PluginGetIdentifiers() is called at plugin initialization time and each time the index is reloaded.

See also:
TCHARListToVector()
Parameters:
NumStrings The number of strings in parameter "Strings"
Strings Each time the user hits the TAB key the user's current string is appended to Strings
FinalString This is the user's current string, e.g. for "Google | Launchy" "Google" would be in Strings and FinalString would equal "Launchy"
NumResults Set this value to the number of SearchResults that you are returning
Returns:
The set of SearchResults for this user search

SearchResult* PluginFileOptions ( const TCHAR *  FullPath,
int  NumStrings,
const TCHAR *  Strings,
const TCHAR *  FinalString,
int *  NumResults 
)

When a user presses TAB on a file owned by the normal Launchy index, Launchy asks each of the plugins if they would like to provide SearchResults for this file.

For instance, Explory will return results if the file in question is a .lnk to a directory such as My Documents

See also:
PluginGetIdentifiers()
Parameters:
NumStrings The number of strings in parameter "Strings"
Strings Each time the user hits the TAB key the user's current string is appended to Strings
FinalString This is the user's current string, e.g. for "Google | Launchy" "Google" would be in Strings and FinalString would equal "Launchy"
NumResults Set this value to the number of SearchResults that you are returning
FullPath The FullPath of the SearchResult in question
Returns:
The set of SearchResults for this user search

void PluginDoAction ( int  NumStrings,
const TCHAR *  Strings,
const TCHAR *  FinalString,
const TCHAR *  FullPath 
)

This is called when the user has pressed enter on a SearchResult that this plugin created It is up to the plugin to do something with the file, such as execute it.

See also:
PluginGetIdentifiers()

PluginUpdateSearch()

SearchResult

makeResults()

Parameters:
NumStrings The number of strings in parameter "Strings"
Strings Each time the user hits the TAB key the user's current string is appended to Strings
FinalString This is the user's current string, e.g. for "Google | Launchy" "Google" would be in Strings and FinalString would equal "Launchy"
FullPath This is the FullPath value of the SearchResult supplied by the plugin
Returns:
nothing

TCHAR* PluginGetRegexs ( int *  iNumResults  ) 

If your plugin would like to claim ownership of all user input that matches a regular expression, then provide Launchy with a list of regular expressions here An example is Weby which owns all searches that include www or http The regular expressions are PERL regular expressions to be interpreted by the BOOST regex library.

See also:
StringVectorToTCHAR()
Warning:
Be sure to escape your \'s with \'s, in other words an \ is actually \\ in your returned string
Parameters:
iNumResults The number of regular expressions you are returning
Returns:
The list of regular expressions

TCHAR* PluginGetSeparator (  ) 

The character used to separate input items when the user hits the TAB key, typically L'|'.

Returns:
The separator character

void PluginFreeResults ( SearchResult ,
int  num 
)

This is used interally by Launchy to free the SearchResults that you have returned.

Warning:
This function is internal to Launchy

void PluginFreeStrings ( TCHAR *  str  ) 

This is used internally by Launchy to free any strings that you have returned.

Warning:
This function is internal to Launchy

TCHAR* PluginGetName (  ) 

This is called at load when Launchy would like to know the name of your plugin.

Warning:
Any name is fine, but please try to keep it short and do not use the same name

as other known plugins

Returns:
The name of your plugin

TCHAR* PluginGetDescription (  ) 

Launchy will list a brief description of your plugin in the "Plugins" dialog, this is where Launchy gets that description.

Returns:
A very brief description of your plugin

void PluginInitialize (  ) 

This function is called when the plugin is first loaded.

void PluginClose (  ) 

This function is called just before the plugin is unloaded.

void PluginCallOptionsDlg ( HWND  hwnd  ) 

This function is called when the user has pressed the "plugin options" button on your plugin You should create a dialog window to interface with this user from this function An example plugin that has such a dialog is Runny.

Parameters:
hwnd This is Launchy's hwnd and should be the parent window of your window

void PluginGetStorage ( int *  NumItems,
TCHAR **  ItemNames,
TCHAR **  ItemValues 
)

Called from Launchy when it wants the plugin's information to be archived.

Warning:
This function is internal to Launchy

void PluginSetStorage ( int  NumItems,
TCHAR *  ItemNames,
TCHAR *  ItemValues 
)

Called from Launchy when it wants to tell the plugin what information it has archived.

Warning:
This function is internal to Launchy

bool PluginHasOptionsDlg ( void   ) 

Used by Launchy to determine if it should call your plugin's PluginCallOptionsDlg function.

Returns:
Return true if your plugin has a functioning PluginCallOptionsDlg function, else false


Variable Documentation

map<wstring,wstring> Storage

Internal structure used for storage of plugin defined options.


Generated on Sat Apr 21 16:30:32 2007 for LaunchyPluginAPI by  doxygen 1.5.2