Home · All Namespaces · All Classes · Main Classes
Signals | Public Member Functions

McpBrief Class Reference

Brief is the descriptor used for constructing the buttons that launches the applet. More...

#include <mcpbrief.h>

Inheritance diagram for McpBrief:
Inheritance graph
[legend]
Collaboration diagram for McpBrief:
Collaboration graph
[legend]

List of all members.

Signals

void valuesChanged ()
void activateSignal ()

Public Member Functions

virtual ~McpBrief ()
virtual int widgetTypeID () const
 This method tell what kind of Brief Widget the applet needs.
virtual QString valueText () const
 returns the value that is to be displayed on second line
virtual QString icon () const
virtual QString toggleIconId () const
virtual Qt::Alignment align () const
virtual bool toggle () const
 Returns the initial state of the toggle in the brief widget.
virtual void setToggle (bool toggle)
 Gets called when toggle state changes.
virtual QString image () const
 returns the file name for the image in the brief widget
void activate ()
 Sends the activateSignal() signal to activate the applet.
virtual QString titleText () const

Detailed Description

Brief is the descriptor used for constructing the buttons that launches the applet.

These buttons are displaying the applet name and the current value. Value must be provided and formatted by the applet implementation. Clicking on this widget displays the applet itself This class provides all the information from which a widget describing above can be constructed.

Definition at line 38 of file mcpbrief.h.


Constructor & Destructor Documentation

McpBrief::~McpBrief (  )  [virtual]

Definition at line 26 of file mcpbrief.cpp.

{
}


Member Function Documentation

void McpBrief::activate (  ) 

Sends the activateSignal() signal to activate the applet.

Definition at line 91 of file mcpbrief.cpp.

{
    emit activateSignal();
}

Here is the call graph for this function:

void McpBrief::activateSignal (  )  [signal]

The applet can activate itself by sending this signal. The control panel will start up the applet the same way it is activated when the user clicked on the brief widget.

Qt::Alignment McpBrief::align (  )  const [virtual]
Returns:
the alignment of the text in the brief widget. if AlignLeft (default), then the text will be on the left side, the button/picture on the right.

Definition at line 67 of file mcpbrief.cpp.

{
    return Qt::AlignLeft;
}

QString McpBrief::icon (  )  const [virtual]
Returns:
the name of the icon for the brief

If the applet provides this virtual function the returned string will be used as an icon name to set the image in the brief representing the applet. The icon will be refreshed when the valuesChanged() signal is emitted.

Please note that the image() method overrides this one, if the applet provides an image file name, the icon name will not be used.

Definition at line 43 of file mcpbrief.cpp.

{
    return QString();
}

QString McpBrief::image (  )  const [virtual]

returns the file name for the image in the brief widget

If the applet provides this function the return value will be used as a filename, to load the image shown in the brief widget representing the plugin. The image will be refreshed when the valuesChanged() signal is emitted.

This method overrides the icon() method.

Definition at line 79 of file mcpbrief.cpp.

{
    return QString();
}

void McpBrief::setToggle ( bool  toggle  )  [virtual]

Gets called when toggle state changes.

If the widget type is toggle, and the user changes the toggle button state, this function will be called, so that the applet can handle the setting change.

Parameters:
toggle The new state

Definition at line 85 of file mcpbrief.cpp.

{
}

QString McpBrief::titleText (  )  const [virtual]

By redefining this function you specify the title text for the brief view of the applet.

The other option is to leave this default and specify your title text in the desktop file.

Definition at line 61 of file mcpbrief.cpp.

{
    return QString();
}

bool McpBrief::toggle (  )  const [virtual]

Returns the initial state of the toggle in the brief widget.

If the widget type is toggle, then this function returns the initial state of the toggle button. The default value is false.

Definition at line 73 of file mcpbrief.cpp.

{
    return false;
}

QString McpBrief::toggleIconId (  )  const [virtual]
Returns:
the current icon for the toggle button

Definition at line 49 of file mcpbrief.cpp.

{
    return QString();
}

void McpBrief::valuesChanged (  )  [signal]

Should be emitted when some of the values changed. Causes the widget to be refreshed with current values.

QString McpBrief::valueText (  )  const [virtual]

returns the value that is to be displayed on second line

Value should be formatted properly as the user should see it. For example language code can be formatted with MLocale or the current time that comes from the system

Definition at line 55 of file mcpbrief.cpp.

{
    return QString();
}

int McpBrief::widgetTypeID (  )  const [virtual]

This method tell what kind of Brief Widget the applet needs.

Returns the brief widget type code for the plugin variant. This value can also defined in the desktop file using the "MCP/WidgetType" key. If none of these specified the "McpWidgetType::Label" will be used as default.

FIXME: If we are defining all the acceptable IDs the return value of this function should be an enum.

Default implementation of the widgetTypeID() virtual function. This function should return an invalid value so that we know that we should search the desktop file for a textual representation of the required widget type.

Definition at line 37 of file mcpbrief.cpp.

{
    return McpWidgetType::BriefInvalid;
}


The documentation for this class was generated from the following files:

Copyright © 2009 Nokia Corporation Generated on Thu Nov 4 2010 18:21:33
Doxygen 1.7.1
DirectUI