Home · All Namespaces · All Classes · Main Classes

Controlling control panel

Description

Control panel has a servicefw interface, with which you can control it from other applications through dbus.

<node>
    <interface name="com.nokia.DuiControlPanelIf">
        <method name="launch">
        </method>
        <method name="mainPage">
        </method>
        <method name="categoryPage">
            <arg name="category" type="s" direction="in"/>
        </method>
        <method name="appletPage">
            <arg name="appletName" type="s" direction="in"/>
            <arg name="" type="b" direction="out"/>
        </method>
    </interface>
</node>

com.nokia.DuiControlPanelIf.xml describes control panel's servicefw interface

For this you have to link with libduicontrolpanel, and

You can either pop up the mainpage, an applet or an appletcategory.

Popping up an applet

Use DuiControlPanelIf::appletPage() with the applet name as parameter.

You can find out the applet's name from the desktop file of the applet, which is a file under /usr/share/duicontrolpanel/desktops/*.desktop or /usr/lib/duicontrolpanel/*.desktop. For example you find there that:

[Desktop Entry]
Type=ControlPanelApplet
Name=This is my name
X-logical-id=qtn_sett_main_my_name
...

Than the applet's name is "This is my name".

Popping up the main page

Use DuiControlPanelIf::mainPage().

//Be sure to include this 
#include <duicontrolpanelif.h>
...
{
  DuiControlPanelIf *dcpIf = new DuiControlPanelIf();
  if (dcpIf->isValid()) {
    dcpIf->mainPage(); //To show main page
    //or
    dcpIf->appletPage("Internet"); //To show "internet applet" for example 
    //or
    dcpIf->categoryPage("Applications"); //To show "Applications" category
  }
  delete dcpIf;
}

above example demonstrates how to show up different pages/categories


Copyright © 2009 Nokia Corporation Generated on Tue Jul 5 2011 15:01:31
Doxygen 1.7.1
Meego control panel