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

HomeApplication Class Reference

#include <homeapplication.h>

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

List of all members.

Signals

void focusToLauncherAppRequested (const QString &fileEntryPath)
 A Signal to request launcher focus on specific launcher application.

Public Member Functions

 HomeApplication (int &argc, char **argv, const QString &appIdentifier=QString())
 ~HomeApplication ()
void addXEventListener (XEventListener *listener)
void removeXEventListener (XEventListener *listener)

Protected Member Functions

virtual bool x11EventFilter (XEvent *event)
 REIMPLEMENTATION

Detailed Description

HomeApplication extends MApplication with additional services.

Definition at line 33 of file homeapplication.h.


Constructor & Destructor Documentation

HomeApplication::HomeApplication ( int &  argc,
char **  argv,
const QString &  appIdentifier = QString() 
)

Constructs an application object.

Parameters:
argc number of arguments passed to the application from the command line
argv argument strings passed to the application from the command line
appIdentifier An optional identifier for the application

Definition at line 78 of file homeapplication.cpp.

                                                                                     :
    MApplication(argc, argv, appIdentifier),
    homeScreenService(new HomeScreenService),
    xEventListeners(),
    iteratorActiveForEventListenerContainer(false),
    toBeRemovedEventListeners()
{
    // Enable prestart mode
    MApplication::setPrestartMode(M::TerminateOnClose);

    // launch a timer for sending a dbus-signal upstart when home is ready
    // and on screen
    upstartMode = isUpstartMode(argc, argv);
    connect(&startupNotificationTimer, SIGNAL(timeout()),
            this, SLOT(sendStartupNotifications()));
    startupNotificationTimer.setSingleShot(true);
    startupNotificationTimer.setInterval(0);
    startupNotificationTimer.start();

    new HomeScreenAdaptor(homeScreenService);

    QDBusConnection connection = QDBusConnection::sessionBus();

    connection.registerService(MEEGO_CORE_HOME_SCREEN_SERVICE_NAME);
    connection.registerObject(MEEGO_CORE_HOME_SCREEN_OBJECT_PATH, homeScreenService);

    connect(homeScreenService, SIGNAL(focusToLauncherApp(const QString&)), this, SIGNAL(focusToLauncherAppRequested(const QString &)));

    // Initialize the X11 atoms used in the UI components
    WindowInfo::initializeAtoms();
}

Here is the call graph for this function:

HomeApplication::~HomeApplication (  ) 

Destroys the HomeApplication.

Definition at line 110 of file homeapplication.cpp.

{
    delete homeScreenService;
}


Member Function Documentation

void HomeApplication::addXEventListener ( XEventListener listener  ) 

Adds an X event listener object for this application. When X events arrive, they are forwarded to the listener. Before destroying the event listener object, remove the listener from the application by calling removeXEventListener.

Parameters:
listener the X event listener

Definition at line 115 of file homeapplication.cpp.

{
    if (listener != NULL && !xEventListeners.contains(listener)) {
        xEventListeners.append(listener);
    }
}

void HomeApplication::focusToLauncherAppRequested ( const QString &  fileEntryPath  )  [signal]

A Signal to request launcher focus on specific launcher application.

void HomeApplication::removeXEventListener ( XEventListener listener  ) 

Removes the X11 event listener object. The listener won't receive anymore events from this application.

Parameters:
listener the listener object to remove.

Definition at line 122 of file homeapplication.cpp.

{
    if (iteratorActiveForEventListenerContainer) {
        toBeRemovedEventListeners.append(listener);
    } else {
        xEventListeners.removeOne(listener);
    }
}

bool HomeApplication::x11EventFilter ( XEvent *  event  )  [protected, virtual]

REIMPLEMENTATION

Definition at line 145 of file homeapplication.cpp.

{
    bool eventHandled = false;
    iteratorActiveForEventListenerContainer = true;
    foreach (XEventListener* listener, xEventListeners) {
        if (!toBeRemovedEventListeners.contains(listener)) {
            if (listener->handleXEvent(*event)) {
                eventHandled = true;
            }
        }
    }
    iteratorActiveForEventListenerContainer = false;

    // Remove now any event listeners that got removed while going through the event listeners
    foreach (XEventListener* listener, toBeRemovedEventListeners) {
        xEventListeners.removeOne(listener);
    }
    toBeRemovedEventListeners.clear();

    if (!eventHandled) {
        eventHandled = MApplication::x11EventFilter(event);
    }

    return eventHandled;
}

Here is the call graph for this function:


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

Copyright © 2010 Nokia Corporation Generated on Thu Nov 4 2010 18:20:42
Doxygen 1.7.1
MeeGo Touch