api_tagz.h 1.3 KB

1234567891011121314151617181920212223242526272829303132333435363738394041424344454647484950515253545556
  1. #ifndef NULLSOFT_API_TAGZH
  2. #define NULLSOFT_API_TAGZH
  3. #include <bfc/dispatch.h>
  4. #include <bfc/platform/types.h>
  5. #include "ifc_tagprovider.h"
  6. #include "ifc_tagparams.h"
  7. enum
  8. {
  9. TAGZ_SUCCESS=0,
  10. TAGZ_FAILURE=1,
  11. TAGZ_UNDEFINED_VARIABLE=2,
  12. };
  13. class api_tagz : public Dispatchable
  14. {
  15. protected:
  16. api_tagz() {}
  17. ~api_tagz() {}
  18. public:
  19. DISPATCH_CODES
  20. {
  21. API_TAGZ_FORMAT = 10,
  22. API_TAGZ_HELP_STRING=20,
  23. API_TAGZ_ADD_FUNC=30,
  24. API_TAGZ_SET_VARIABLE = 40,
  25. };
  26. int format(const wchar_t *spec, wchar_t *out, size_t outCch, ifc_tagprovider *tagProvider, ifc_tagparams *parameters);
  27. char *manual();
  28. void SetVariable(const wchar_t *name, const wchar_t *value);
  29. //TODO: int AddFunction();
  30. };
  31. inline int api_tagz::format(const wchar_t *spec, wchar_t *out, size_t outCch, ifc_tagprovider *tagProvider, ifc_tagparams *parameters)
  32. {
  33. return _call(API_TAGZ_FORMAT, (int)0, spec, out, outCch, tagProvider, parameters);
  34. }
  35. inline char *api_tagz::manual()
  36. {
  37. return _call(API_TAGZ_HELP_STRING, (char *)0);
  38. }
  39. inline void api_tagz::SetVariable(const wchar_t *name, const wchar_t *value)
  40. {
  41. _voidcall(API_TAGZ_SET_VARIABLE, name, value);
  42. }
  43. // {063CD9FD-57C1-4da2-9A8F-15FFFA9ABF50}
  44. static const GUID tagzGUID =
  45. { 0x63cd9fd, 0x57c1, 0x4da2, { 0x9a, 0x8f, 0x15, 0xff, 0xfa, 0x9a, 0xbf, 0x50 } };
  46. #endif