TDE core libraries
You can not select more than 25 topics Topics must start with a letter or number, can include dashes ('-') and can be up to 35 characters long.

DESIGN.mimetypes 2.2KB

12345678910111213141516171819202122232425262728293031323334
  1. TODO: servicetypes
  2. TODO: mimetypes
  3. Service type inheritance (X-TDE-Derived)
  4. ========================================
  5. X-TDE-Derived is for service types. ST1 derives from ST2 means ST1 is more specific than ST2.
  6. If a service implements ST1, it also implements ST2, but not the other way round.
  7. For instance, KoDocument derives from KParts/ReadWritePart, which derives from KParts/ReadOnlyPart,
  8. so KWord's part (which implements KoDocument) can be used as a readonly viewer for KWord files
  9. in Konqueror (which looks for a KParts/ReadOnlyPart).
  10. Mimetype "inheritance"
  11. ======================
  12. We need a mechanism to also say that "text/xml is a special case of text/plain",
  13. or "text/docbook is a kind of text/sgml", or "application/x-smb-workgroup is a kind
  14. of inode/directory", etc. See below.
  15. Why mimetype "inheritance" doesn't use X-TDE-Derived
  16. ====================================================
  17. The confusing thing is that we said "a mimetype is a servicetype". But that's not exactly correct.
  18. As Waldo noted, "the ability to open a mimetype" is what's a servicetype.
  19. So if text/xml said X-TDE-Derived=text/plain (i.e. ST1=text/xml, ST2=text/plain),
  20. then an application opening text/xml (ST1) could also open text/plain (ST2) - which is not necessarily true.
  21. We want the other way round: to be able to open special kinds of text/plain in a plain text editor.
  22. This is what X-TDE-IsAlso was introduced for. X-TDE-IsAlso kind of "works the other way" than X-TDE-Derived.
  23. If M1 is a special kind of M2 (mimetypes), then "the ability to open M2" derives from "the ability to open M1"
  24. So we say in text/xml: X-TDE-IsAlso=text/plain, and applications that can open text/plain can also open text/xml.
  25. Pattern Accuracy
  26. ======================
  27. In some cases of inheritance several mimetypes shares the same extension (with the primary case being Ogg Multimedia files).
  28. This has been solved sofar by matching the extension to most generic mimetype. To indicate that the mimetype can be refined further, the flag X-TDE-PatternsAccuracy can be set. The value to X-TDE-PatternsAccuracy is a number between 0-100, with 100 being the default if not set. Any values below 100 is interpreted as the possibility of further mimetype refinement.