LaunchyPlugin.h

Go to the documentation of this file.
00001 #ifndef LAUNCHY_PLUGIN_H
00002 #define LAUNCHY_PLUGIN_H
00003 
00004 // Create a Win32 dll
00005 // Use Unicode Character Set
00006 
00007 #include <string>
00008 #include <vector>
00009 #include <map>
00010 //#include "stdafx.h"
00011 
00012 using namespace std;
00013 typedef unsigned int uint;
00014 
00018 extern map<wstring,wstring> Storage;
00019 
00024 struct SearchResult {
00026         TCHAR* DisplayString; // Must be set
00029         //                  otherwise multiple files with the same name will get confused by Launchy
00030         TCHAR* FullPath;
00032         TCHAR* Location; // Can be NULL
00034         HICON DisplayIcon; // Make sure you 0 this on creation!!
00035 };
00036 
00038 void FreeSearchResult (SearchResult* sr);
00039 
00051 SearchResult makeResult(wstring DisplayString, wstring FullPath, wstring Location, HICON icon);
00052 
00059 SearchResult* ResultVectorToArray(vector<SearchResult> results);
00060 
00068 vector<wstring> TCHARListToVector(int numStrings, const TCHAR* Strings);
00069 
00075 TCHAR* string2TCHAR(wstring str);
00076 
00083 TCHAR* StringVectorToTCHAR( vector<wstring>& Strings);
00084 
00091 unsigned long GenerateID(wstring str);
00092 
00099 TCHAR* SerializeStringMap(map<wstring,wstring> m);
00100 
00107 void StoreString(wstring name, wstring value);
00108 
00114 wstring RetrieveString(wstring name);
00115 
00122 void StoreInt(wstring name, int value);
00129 int RetrieveInt(wstring name, bool& exists);
00130 
00137 void StoreFloat(wstring name, float value);
00138 
00145 float RetrieveFloat(wstring name, bool& exists);
00146 
00152 void PluginSaveOptions();
00153 
00154 extern "C" {
00164 __declspec(dllexport) SearchResult* PluginGetIdentifiers (int* iNumResults);
00175 __declspec(dllexport) SearchResult* PluginUpdateSearch (int NumStrings, const TCHAR* Strings, const TCHAR* FinalString, int* NumResults);
00187 __declspec(dllexport) SearchResult* PluginFileOptions (const TCHAR* FullPath, int NumStrings, const TCHAR* Strings, const TCHAR* FinalString, int* NumResults);
00201 __declspec(dllexport) void PluginDoAction (int NumStrings, const TCHAR* Strings, const TCHAR* FinalString, const TCHAR* FullPath);
00211 __declspec(dllexport) TCHAR* PluginGetRegexs(int* iNumResults);
00216 __declspec(dllexport) TCHAR* PluginGetSeparator();
00221 __declspec(dllexport) void PluginFreeResults (SearchResult*, int num);
00226 __declspec(dllexport) void PluginFreeStrings (TCHAR* str);
00233 __declspec(dllexport) TCHAR* PluginGetName();
00239 __declspec(dllexport) TCHAR* PluginGetDescription();
00244 __declspec(dllexport) void PluginInitialize();
00248 __declspec(dllexport) void PluginClose();
00255 __declspec(dllexport) void PluginCallOptionsDlg(HWND hwnd);
00260 __declspec(dllexport) void PluginGetStorage(int* NumItems, TCHAR** ItemNames, TCHAR** ItemValues);
00265 __declspec(dllexport) void PluginSetStorage(int NumItems, TCHAR* ItemNames, TCHAR* ItemValues);
00270 __declspec(dllexport) bool PluginHasOptionsDlg(void);
00271 }
00272 
00273 
00274 
00275 
00276 /*
00277 extern "C" __declspec(dllexport) SearchResult* PluginGetIdentifiers (int* iNumResults);
00278 extern "C" __declspec(dllexport) SearchResult* PluginUpdateSearch (int NumStrings, const TCHAR* Strings, const TCHAR* FinalString, int* NumResults);
00279 extern "C" __declspec(dllexport) SearchResult* PluginFileOptions (const TCHAR* FullPath, int NumStrings, const TCHAR* Strings, const TCHAR* FinalString, int* NumResults);
00280 extern "C" __declspec(dllexport) void PluginDoAction (int NumStrings, const TCHAR* Strings, const TCHAR* FinalString, const TCHAR* FullPath);
00281 extern "C" __declspec(dllexport) TCHAR* PluginGetRegexs(int* iNumResults);
00282 extern "C" __declspec(dllexport) TCHAR* PluginGetSeparator();
00283 extern "C" __declspec(dllexport) void PluginFreeResults (SearchResult*, int num);
00284 extern "C" __declspec(dllexport) void PluginFreeStrings (TCHAR* str);
00285 extern "C" __declspec(dllexport) TCHAR* PluginGetName();
00286 extern "C" __declspec(dllexport) TCHAR* PluginGetDescription();
00287 extern "C" __declspec(dllexport) void PluginInitialize();
00288 extern "C" __declspec(dllexport) void PluginClose();
00289 extern "C" __declspec(dllexport) void PluginCallOptionsDlg(HWND hwnd);
00290 extern "C" __declspec(dllexport) void PluginGetStorage(int* NumItems, TCHAR** ItemNames, TCHAR** ItemValues);
00291 extern "C" __declspec(dllexport) void PluginSetStorage(int NumItems, TCHAR* ItemNames, TCHAR* ItemValues);
00292 extern "C" __declspec(dllexport) bool PluginHasOptionsDlg(void);
00293 */
00294 #endif

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