From kde-multimedia Sun Sep 19 08:38:59 2004 From: Marco Lohse Date: Sun, 19 Sep 2004 08:38:59 +0000 To: kde-multimedia Subject: Re: kdemm backends & Helix Message-Id: <414D45A3.2050509 () cs ! uni-sb ! de> X-MARC-Message: https://marc.info/?l=kde-multimedia&m=109558307227098 Matthias Welwarsky wrote: [..] > > >As a sidenote, this is also how plugins are accessed in Trolltechs Qtopia >environment. Basically, you are guaranteed that each plugin implements a >queryInterface() method which can be asked by means of a UUID: " do you >support this interface?". In case of a match, queryInterface() returns a >pointer to an instance implementing said interface, or a null pointer in case >of a mismatch. Of course you need to static_cast<> the pointer you receive. > > > Just a short remark: NMM provides 'built-in' support for such things using its object-oriented interface system. You can ask any plug-in what interfaces (i.e. what functionality) it supports, e.g.: INode* readfile = graph.getINode(readfile_descr); IFileHandler_var filehandler (readfile-> getParentObject()-> getCheckedInterface ()); filehandler-> setFilename(argv[1]); (the _var type is just a C++ auto_ptr<>) => tries to get the interface IFileHandler from the plug-in node readfile. When using the 'checked' get interface method, if this interface is not available, an InterfaceNotFoundExceotion is thrown. Or you can use getInterface() which will return a null pointer in this case. Have fun, Marco. _______________________________________________ kde-multimedia mailing list kde-multimedia@kde.org https://mail.kde.org/mailman/listinfo/kde-multimedia