D-Pointer is proud to present a library that you can use to integrate your Qt C++ application with the Events view found in the Nokia N9 Harmattan MeeGo phone. This library is a C++ port of the similar library, Python Eventfeed for Harmattan, written by Thomas Perl.

Usage

To use the library you need to initiate a HarmattanEventFeed object, that represent the connection to the Event view. Then you use the HarmattanEventFeedItem to populate the feed with your updates. Each event item on the feed page has a mandatory icon and title text. The icon is a file located on the device’s local file system.

You can then populate the item with text, one or more images and a footer text. You can also combine text with images. Images can also have a “Play” indicator that is overlayed on top of the image indicating a video. You can also associated a URL to the item that will be opened in the web browser when the user taps the item.

Create a new Event feed object.

HarmattanEventFeed *feed =  new HarmattanEventFeed("MyUpdates", "A longer name for your application", parent);

Create a new Event item with some text, a footer text and an image.

HarmattanEventFeedItem item("Item with an image.", "/path/to/an/iconimage);
item.setBody("We can update the Harmattan event feed easily with Qt.");
item.setImageList(QStringList() << "path/to/image");
item.setFooter("We can also set the footer that is next to the time stamp of the item.");

The requests are sent async, so if you want to be notified when the action is completed, and store the ID for each item, you need to connect to the signal feedRequestCompleted(int) where the parameter is the item’s ID that was added. If the request is an update or remove request, the ID will be 0.

 connect(feed, SIGNAL(feedRequestCompleted(int)),
      this, SLOT(requestCompleted(int)));

If you wish to associate with the item a URL that is opened when the item is tapped, you do this with the setUrlToOpen() method before sending it to the feed.

 item.setUrlToOpen("http://urltothepicture.com"); 

And last publish the item on the Event view:

 feed->addItem(item);

Please refer to the test application in Gitorious for a complete application. The source can be found here: https://gitorious.org/libharmattaneventview/libharmattaneventview/blobs/master/harmattaneventtester.cpp

Code

The code is licensed under the LGPL license.

The code can be obtained from Gitorious.org: https://gitorious.org/libharmattaneventview

git clone git://gitorious.org/libharmattaneventview/libharmattaneventview.git

Please note

Please note that some features are not yet implemented or not working on the device with the firmware version 1.2011.22-6_PR_RM680 and the device Nokia N950. Nokia N9 and later firmware versions have not been tested.

  • Updating items is implemented in the library, but not working on the device.
  • Registering callback methods for handling custom click events is not implemented in the library.