Home · All Classes · Main Classes · Deprecated
Public Member Functions | Static Public Member Functions | Protected Attributes

MDeviceProfile Class Reference

The MDeviceProfile class holds physical and simulated properties of the target device. More...

Inherits QObject.

List of all members.

Public Member Functions

 MDeviceProfile (QObject *parent=0)
virtual ~MDeviceProfile ()
QSize resolution () const
QSize pixelsPerInch () const
bool showStatusbar () const
M::Orientation orientationFromAngle (M::OrientationAngle angle) const
bool orientationAngleIsSupported (M::OrientationAngle angle, bool isKeyboardOpen) const
int mmToPixels (qreal mm)
qreal mmToPixelsF (qreal mm)
int ptToPixels (qreal pt)
qreal ptToPixelsF (qreal pt)
int pixelsToPt (int pixels)
qreal pixelsToPtF (qreal pixels)

Static Public Member Functions

static MDeviceProfileinstance ()

Protected Attributes

MDeviceProfilePrivate *const d_ptr

Detailed Description

The MDeviceProfile class holds physical and simulated properties of the target device.


Constructor & Destructor Documentation

MDeviceProfile::MDeviceProfile ( QObject parent = 0  ) 

Default constructor.

Only used by MApplication class. Client classes should be using MDeviceProfile::instance() method.

MDeviceProfile::~MDeviceProfile (  )  [virtual]

Default destructor.


Member Function Documentation

MDeviceProfile * MDeviceProfile::instance (  )  [static]

Returns the global MDeviceProfile instance.

int MDeviceProfile::mmToPixels ( qreal  mm  ) 

Returns the number of pixels required to display a length of mm millimeters on this device.

qreal MDeviceProfile::mmToPixelsF ( qreal  mm  ) 

Returns the number of pixels required to display a length of mm millimeters on this device using floating point precision.

bool MDeviceProfile::orientationAngleIsSupported ( M::OrientationAngle  angle,
bool  isKeyboardOpen 
) const

Returns true if orientation angle is supported for given keyboard state.

M::Orientation MDeviceProfile::orientationFromAngle ( M::OrientationAngle  angle  )  const

Returns the resulting orientation of a device for a given rotation angle.

The rotation is relative to the position where the device's display has its top edge on top.

For devices whose display native resolution is landscape:

  • Angle0 and Angle180 are landscape angles.
  • Angle90 and Angle270 are portrait angles.

For devices whose display native resolution is portrait:

  • Angle0 and Angle180 are portrait angles.
  • Angle90 and Angle270 are landscape angles.

orientationFromAngle(M::Angle0) returns the display's native orientation.

QSize MDeviceProfile::pixelsPerInch (  )  const

Return the target device pixels per inch.

int MDeviceProfile::pixelsToPt ( int  pixels  ) 

Returns the result of pixels to points conversion.

qreal MDeviceProfile::pixelsToPtF ( qreal  pixels  ) 

Returns the result of pixels to points conversion.

int MDeviceProfile::ptToPixels ( qreal  pt  ) 

Returns point size in pixels on this device.

qreal MDeviceProfile::ptToPixelsF ( qreal  pt  ) 

Returns point size in pixels using floating point precision on this device.

QSize MDeviceProfile::resolution (  )  const

Return the target device resolution.

bool MDeviceProfile::showStatusbar (  )  const

Return whether the status bar should be shown on target device.


Member Data Documentation

MDeviceProfilePrivate* const MDeviceProfile::d_ptr [protected]

Copyright © 2010 Nokia Corporation
MeeGo Touch