Home · All Namespaces · All Classes
Public Member Functions

VolumeBarWindow Class Reference

#include <volumebarwindow.h>

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

List of all members.

Public Member Functions

 VolumeBarWindow (QWidget *parent=0)
 Constructs a new VolumeBarWindow instance.
 ~VolumeBarWindow ()
 Destructs a VolumeBarWindow instance.

Detailed Description

The VolumeBarWindow allows to display a volume-bar based on current-volume on hardware-volume-key presses and lets user to modify the volume by touching the full-screen VolumeBar widget...

Definition at line 42 of file volumebarwindow.h.


Constructor & Destructor Documentation

VolumeBarWindow::VolumeBarWindow ( QWidget parent = 0  ) 

Constructs a new VolumeBarWindow instance.

Definition at line 26 of file volumebarwindow.cpp.

                                                 :
    MWindow (parent),
    logic (new VolumeBarLogic),
    volumeBar (0),
    overlay (0),
#ifdef HAVE_QMSYSTEM
    hwkeys (0),
#endif
    locked (false)
{
#ifdef HAVE_QMSYSTEM
    hwkeys = new MeeGo::QmKeys (this);
    locks = new MeeGo::QmLocks (this);

    connect (locks, SIGNAL (stateChanged(MeeGo::QmLocks::Lock, MeeGo::QmLocks::State)),
             SLOT (locksChanged(MeeGo::QmLocks::Lock, MeeGo::QmLocks::State)));
#endif

#ifdef HAVE_LIBRESOURCEQT
    hwkeyResource = new ResourcePolicy::ResourceSet ("event");
    hwkeyResource->setAlwaysReply ();

    ResourcePolicy::ScaleButtonResource *volumeKeys = new ResourcePolicy::ScaleButtonResource;

    hwkeyResource->addResourceObject (volumeKeys);

    connect (hwkeyResource, SIGNAL (resourcesGranted (QList<ResourcePolicy::ResourceType>)),
             this, SLOT (hwKeyResourceAcquired ()));
    connect (hwkeyResource, SIGNAL (lostResources ()),
             this, SLOT (hwKeyResourceLost ()));

    hwkeyResource->acquire ();
#endif

    // create the VolumeBar widget
    volumeBar = new VolumeBar;
    connect (volumeBar, SIGNAL (volumeChanged (int)), SLOT (volumeBarChanged (int)));
    connect (volumeBar, SIGNAL (animationsFinished ()), SLOT (hide ()));

    connect (this, SIGNAL (orientationChangeFinished(M::Orientation)),
             volumeBar, SLOT (updateContents ()));

    // create&set-up an overlay
    overlay = new MOverlay;
    overlay->setWidget (volumeBar);

    // create a scenemanager and show the overlay
    setSceneManager (new MSceneManager);
    sceneManager ()->appearSceneWindow (overlay);

    // and set the window attributes
    setTranslucentBackground (true);
    setAttribute (Qt::WA_X11NetWmWindowTypeNotification, true);
    setAttribute (Qt::WA_X11DoNotAcceptFocus, true);
    setObjectName ("VolumeBarWindow");
    setProperty("followsCurrentApplicationWindowOrientation", true);
}

VolumeBarWindow::~VolumeBarWindow (  ) 

Destructs a VolumeBarWindow instance.

Definition at line 84 of file volumebarwindow.cpp.

{
#ifdef HAVE_LIBRESOURCEQT
    //Free the resources here
    hwkeyResource->deleteResource (ResourcePolicy::ScaleButtonType);
#endif

    delete logic;
    delete overlay;
}


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

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