svc_filemetadata.h 1.9 KB

123456789101112131415161718192021222324252627282930
  1. #pragma once
  2. #include "foundation/foundation.h"
  3. #include "nx/nxstring.h"
  4. #include "ifc_filemetadata_editor.h"
  5. // {92269164-30E1-469A-96C3-96879EF6C39E}
  6. static const GUID file_metadata_service_type_guid =
  7. { 0x92269164, 0x30e1, 0x469a, { 0x96, 0xc3, 0x96, 0x87, 0x9e, 0xf6, 0xc3, 0x9e } };
  8. class svc_filemetadata : public Wasabi2::Dispatchable
  9. {
  10. protected:
  11. svc_filemetadata() : Dispatchable(DISPATCHABLE_VERSION) {}
  12. ~svc_filemetadata() {}
  13. public:
  14. static GUID GetServiceType() { return file_metadata_service_type_guid; }
  15. // to make the implementation more flexible, you need to NXStringRelease on the extension you get (i.e. this function follows Apple's "Create" rule)
  16. int EnumerateExtensions(unsigned int index, nx_string_t *extension) { return FileMetadataService_EnumerateExtensions(index, extension); }
  17. int CreateFileMetadata(ifc_metadata **file_metadata, nx_uri_t filename, nx_file_t file, ifc_metadata *parent_metadata) { return FileMetadataService_CreateFileMetadata(file_metadata, filename, file, parent_metadata); }
  18. int CreateFileMetadataEditor(ifc_filemetadata_editor **file_metadata, nx_uri_t filename, nx_file_t file, ifc_metadata_editor *parent_metadata) { return FileMetadataService_CreateFileMetadataEditor(file_metadata, filename, file, parent_metadata); }
  19. enum
  20. {
  21. DISPATCHABLE_VERSION=0,
  22. };
  23. private:
  24. // implementation note: to make the implementation more flexible, you need to NXStringRetain on the extension you pass back (i.e. follow Apple's "Create" rule)
  25. virtual int WASABICALL FileMetadataService_EnumerateExtensions(unsigned int index, nx_string_t *extension)=0;
  26. virtual int WASABICALL FileMetadataService_CreateFileMetadata(ifc_metadata **file_metadata, nx_uri_t filename, nx_file_t file, ifc_metadata *parent_metadata)=0;
  27. virtual int WASABICALL FileMetadataService_CreateFileMetadataEditor(ifc_filemetadata_editor **file_metadata, nx_uri_t filename, nx_file_t file, ifc_metadata_editor *parent_metadata) { return NErr_NotImplemented; }
  28. };