// tp-qt code class BaseProtocol : public QObject { public: BaseProtocol(...) // Proto properties // should fail if we already expose this interface bool plugInterface(const BaseProtocolInterfacePtr protoInterface); QList pluggedInterfaces() const; protected SLOTS: // Proto "virtual" methods; }; class BaseProtocolInterface { // maybe we find something to add here }; class BaseProtocolPresence : public BaseProtocolInterface { ṕublic: BaseProtocolPresence(); BaseProtocolPresence(const PresenceSpecList &statuses); PresenceSpecList &statuses() const; // no set method as this property is immutable // no protected slot as the interface has no methods }; // CM code class MyProtocol : public BaseProtocol { MyProtocol(...) { PresenceSpecList statuses = myStatuses(); plugInterface(BaseProtocolInterfacePtr(new BaseProtocolPresence(statuses)); } // reimplement "virtual" methods }; int main(...) { ... MyCM cm = MyCM::create(); cm->addProtocol(MyProtocol::create()); cm->registerObject(); }