Topic reference -  Old but interesting topic reference - old design MSN Protocol Library Ideas

On this page, I'm hoping to provide first of all a design document which can be changed until the API freeze is hit (which we haven't set yet), and second of all, once the API freeze *is* hit, a documentation page for the plugins API of KMess 2.1.

The API comes in a form of QObject-derived classes which have slots and signals. Something like a "plugin master" then creates QtScript objects out of these objects, and hands them over to the scripts in the so-called Global Object. The scripts can then connect their own functions to their signals, or even connect the objects' own slots to their signals.

I'm thinking one object for every aspect that plugins can have influence on, or read information from.

Current proposal of objects, properties, signals and slots:

  • KMessInfo (done!)
    • properties:
      • kmessVersion (read-only)
      • kdeVersion (read-only)
      • qtVersion (read-only)
      • kdeCompileVersion (read-only)
      • qtCompileVersion (read-only)
  • Session
    • properties:
      • friendlyName
      • personalMessage
      • handle (read-only)
      • displayPicture (read-only, because we need to thoroughly check input)
    • slots:
      • setDisplayPicture (sets displayPicture, and does the checking if it's valid - warning: setDisplayPicture is not currently exported because KMessSession does not have a setDisplayPicture.)
  • ContactList
    • properties:
      • contacts (read-only - or getContacts slot)
      • groups (read-only - or getGroups slot)
    • slots:
      • addContact
      • deleteContact
      • addGroup
      • deleteGroup
      • addContactToGroup
      • removeContactFromGroup
    • signals:
      • contactAdded
      • contactDeleted
      • groupAdded
      • groupDeleted
  • Chat
    • properties:
      • activeChats (read-only - or getActiveChats slot)
    • signals:
      • messageReceivedFrom()
      • sendingMessage()
      • messageAboutToDisplay( message, bool incoming ) - the original message is sent here just before it goes into the RichTextParser, so the message can be modified for display only
      • commandEntered()
    • slots:
      • sendMessageTo()
      • commandHandled()
  • PluginDbus (note: could alternatively also be a C++ function mapped to a QtScript function)
    • slots:
      • sendSignal or whatever
  • PluginConfig
    • properties:
      • dynamic?
    • slots:
      • getPluginSetting( name )
      • setPluginSetting( name, value )

About QtScript functions

You can use these ECMAScript functions in QtScript:  http://www.websina.com/bugzero/kb/javascript-ecma.html