| Home · All Namespaces · All Classes |
#include <switcherbutton.h>


Public Slots | |
| void | switchToWindow () |
| Slot for notifying that the window represented by this button should be brought to front. | |
| void | close () |
| Slot for notifying that the window represented by this button should be closed. | |
| void | resetState () |
| void | setVisibilityPropertyEnabled (bool enable) |
| Enables or disables the setting of the visibility property of the button. | |
Signals | |
| void | windowToFront (Window window) |
| A signal for notifying that a window should be brought to front. | |
| void | closeWindow (Window window) |
| A signal for notifying that the window should be closed. | |
| void | closeAllWindows () |
| A signal for notifying that all windows should be closed. | |
Public Member Functions | |
| SwitcherButton (QGraphicsItem *parent=NULL) | |
| virtual | ~SwitcherButton () |
| Window | xWindow () |
| void | setXWindow (Window window) |
| virtual void | prepareGeometryChange () |
| void | setVisibleInSwitcherProperty (bool set) |
| | |
Protected Member Functions | |
| virtual void | enterDisplayEvent () |
| virtual void | exitDisplayEvent () |
SwitcherButton widget represents an open window in the Switcher.
Definition at line 32 of file switcherbutton.h.
| SwitcherButton::SwitcherButton | ( | QGraphicsItem * | parent = NULL |
) |
Constructs an SwitcherButton.
| parent | parent MWidget |
Definition at line 32 of file switcherbutton.cpp.
:
MButton(parent, new SwitcherButtonModel), visibilityPropertyEnabled(true)
{
// Configure timers
windowCloseTimer.setSingleShot(true);
connect(&windowCloseTimer, SIGNAL(timeout()), this, SLOT(resetState()));
if (visibleAtom == 0) {
// Get the icon geometry X11 Atom if it doesn't exist yet
visibleAtom = X11Wrapper::XInternAtom(QX11Info::display(), "_MEEGOTOUCH_VISIBLE_IN_SWITCHER", False);
}
connect(this, SIGNAL(clicked()), this, SLOT(switchToWindow()));
}

| SwitcherButton::~SwitcherButton | ( | ) | [virtual] |
| void SwitcherButton::close | ( | ) | [slot] |
Slot for notifying that the window represented by this button should be closed.
Definition at line 66 of file switcherbutton.cpp.
{
setVisible(false);
windowCloseTimer.start(5000);
emit closeWindow(model()->xWindow());
}

| void SwitcherButton::closeAllWindows | ( | ) | [signal] |
A signal for notifying that all windows should be closed.
| void SwitcherButton::closeWindow | ( | Window | window | ) | [signal] |
A signal for notifying that the window should be closed.
| void SwitcherButton::enterDisplayEvent | ( | ) | [protected, virtual] |
REIMPLEMENTATION
Reimplemented to update _MEEGO_VISIBLE_IN_SWITCHER property
Definition at line 85 of file switcherbutton.cpp.
{
setVisibleInSwitcherProperty(true);
}

| void SwitcherButton::exitDisplayEvent | ( | ) | [protected, virtual] |
REIMPLEMENTATION
Reimplemented to update _MEEGO_VISIBLE_IN_SWITCHER property
Definition at line 90 of file switcherbutton.cpp.
{
setVisibleInSwitcherProperty(false);
}

| void SwitcherButton::prepareGeometryChange | ( | ) | [virtual] |
REIMPLEMENTATION
Reimplemented here as public because it's protected in the base class so the view cannot access it.
Definition at line 74 of file switcherbutton.cpp.
| void SwitcherButton::resetState | ( | ) | [slot] |
A slot that should be called when window closing has been requested but the window has not closed during a certain time.
Definition at line 79 of file switcherbutton.cpp.
{
setVisible(true);
prepareGeometryChange();
}

| void SwitcherButton::setVisibilityPropertyEnabled | ( | bool | enable | ) | [slot] |
Enables or disables the setting of the visibility property of the button.
Definition at line 113 of file switcherbutton.cpp.
{
visibilityPropertyEnabled = enable;
if(enable) {
setVisibleInSwitcherProperty(visibility);
}
}

| void SwitcherButton::setVisibleInSwitcherProperty | ( | bool | set | ) |
Sets/unsets _MEEGO_VISIBLE_IN_SWITCHER property to the window.
Definition at line 95 of file switcherbutton.cpp.
{
if(visibilityPropertyEnabled) {
Display *dpy = QX11Info::display();
if (dpy) {
if (set) {
unsigned char data = 1;
X11Wrapper::XChangeProperty(dpy, xWindow(), visibleAtom, XA_CARDINAL, 8, PropModeReplace, &data, 1);
} else {
unsigned char data = 0;
X11Wrapper::XChangeProperty(dpy, xWindow(), visibleAtom, XA_CARDINAL, 8, PropModeReplace, &data, 1);
}
}
} else {
visibility = set;
}
}

| void SwitcherButton::setXWindow | ( | Window | window | ) |
Sets the X Window represented by this button
| window | the X Window represented by this button |
Definition at line 56 of file switcherbutton.cpp.
{
model()->setXWindow(window);
}
| void SwitcherButton::switchToWindow | ( | ) | [slot] |
Slot for notifying that the window represented by this button should be brought to front.
Definition at line 61 of file switcherbutton.cpp.
{
emit windowToFront(model()->xWindow());
}

| void SwitcherButton::windowToFront | ( | Window | window | ) | [signal] |
A signal for notifying that a window should be brought to front.
| Window SwitcherButton::xWindow | ( | ) |
Gets the X Window represented by this button
Definition at line 51 of file switcherbutton.cpp.
{
return model()->xWindow();
}
| Copyright © 2010 Nokia Corporation | Generated on Thu Nov 4 2010 18:20:42 Doxygen 1.7.1 |
MeeGo Touch |