00001 #ifndef LAUNCHY_PLUGIN_H
00002 #define LAUNCHY_PLUGIN_H
00003
00004
00005
00006
00007 #include <string>
00008 #include <vector>
00009 #include <map>
00010
00011
00012 using namespace std;
00013 typedef unsigned int uint;
00014
00018 extern map<wstring,wstring> Storage;
00019
00024 struct SearchResult {
00026 TCHAR* DisplayString;
00029
00030 TCHAR* FullPath;
00032 TCHAR* Location;
00034 HICON DisplayIcon;
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
00278
00279
00280
00281
00282
00283
00284
00285
00286
00287
00288
00289
00290
00291
00292
00293
00294 #endif