Home · All Classes · Annotated · Functions

Qtopia Class Reference

The Qtopia namespace contains miscellaneous functionality. More...

#include <Qtopia>

Public Types

Public Functions


Detailed Description

The Qtopia namespace contains miscellaneous functionality.

Word list related

A list of words relevant to the current locale is maintained by the system. The list is held in a DAWG (implemented by the QDawg class). This list is used, for example, by the pickboard input method.

The global QDawg is returned by fixedDawg(); this cannot be updated. An updatable copy of the global QDawg is returned by addedDawg(). Applications may have their own word lists stored in QDawgs which are returned by dawg(). Use addWords() to add words to the updateable copy of the global QDawg or to named application QDawgs.


Member Type Documentation

enum Qtopia::Lockflags

This enum controls what type of locking is performed on a file.

Current defined values are:

ConstantValueDescription
Qtopia::LockShare1Allow lock to be shared. Reserved for future use
Qtopia::LockWrite2Create at a write lock.
Qtopia::LockBlock4Block the process when lock is encountered. Under WIN32 this blocking is limited to ten(10) failed attempts to access locked file. Reserved for future use.


Member Function Documentation

void Qtopia::actionConfirmation ( const QPixmap & pixmap, const QString & text )

Displays a message dialog containing the specified pixmap and text for a short time.

void Qtopia::addAlarm ( QDateTime when, const QString & channel, const QString & message, int data = 0 )

Schedules an alarm to go off at (or soon after) time when. When the alarm goes off, the QCop message will be sent to channel, with data as a parameter.

If channel does not contain the / character, it will be interpreted as a QCop service name. For example, specifying Calendar as channel will direct the alarm to the configured calendar program.

Note that these alarms fire regardless of whether the application that created them is running, indeed for some hardware, even if the device is not powered on.

If this function is called with exactly the same data as a previous call the subsequent call is ignored, so there is only ever one alarm with a given set of parameters.

See also deleteAlarm().

void Qtopia::addWords ( const QStringList & wordlist )

Adds wordlist to the addedDawg(). Words that are already there are not added. Words that are in the 'deleted' dictionary are removed from there.

Note that the addition of words persists between program executions (they are saved in the dictionary files), so you should confirm the words with the user before adding them.

This is a slow operation. Call it once with a large list rather than multiple times with a small list.

void Qtopia::addWords ( const QString & dictname, const QStringList & wordlist )

This is an overloaded member function, provided for convenience.

Adds wordlist to the dawg() named dictname.

Note that the addition of words persists between program executions (they are saved in the dictionary files), so you should confirm the words with the user before adding them.

This is a slow operation. Call it once with a large list rather than multiple times with a small list.

const QDawg & Qtopia::addedDawg ()

Returns the changeable QDawg that contains general words for the current locale.

See also fixedDawg().

QString Qtopia::applicationFileName ( const QString & appname, const QString & filename )

Returns the full path for the application called appname, with the given filename. Returns QString() if there was a problem creating the directory tree for appname. If filename contains "/", it is the caller's responsibility to ensure that those directories exist.

QString Qtopia::architecture ()

Returns the device architecture string. This is a sequence of identifiers separated by "/", from most general to most specific (eg. "IBM/PC").

bool Qtopia::confirmDelete ( QWidget * parent, const QString & caption, const QString & object )

Shows a dialog with caption to confirm deletion of object with user.

If parent is 0, the dialog becomes an application-global modal dialog box. If parent is a widget, the dialog becomes modal relative to parent.

const QDawg & Qtopia::dawg ( const QString & name, const QString & language = QString() )

Returns the QDawg with the given name. This is an application-specific word list.

name should not contain "/". If name starts with "_", it is a read-only system word list.

language allows the specific selection of a dictionary for a particular language. This option applies to read-only system word list only and is ignored otherwise. If no language is given the dictionary of the current language is loaded.

QString Qtopia::dehyphenate ( const QString & s )

Returns the string equivalent to s, but with any soft-hyphens removed.

void Qtopia::deleteAlarm ( QDateTime when, const QString & channel, const QString & message, int data = 0 )

Deletes previously scheduled alarms which match when, channel, message, and data.

Passing null values for when, channel, or for the QCop message, acts as a wildcard meaning "any". Similarly, passing -1 for data indicates "any".

If there is no matching alarm, nothing happens.

See also addAlarm().

QString Qtopia::deviceId ()

Returns a unique ID for this device. The value can change, if for example, the device is reset.

QString Qtopia::documentDir ()

Returns the user's current Document directory. There is a trailing "/".

void Qtopia::execute ( const QString & app, const QString & document = QString() )

Executes the application identfied by app, passing document if it isn't null.

Note that a better approach might be to send a QCop message to the application's QPE/Application/appname channel.

void Qtopia::findDocuments ( QContentSet * folder, const QString & mimefilter = QString() )

Finds all documents in the system's document directories which match the filter mimefilter, and appends the resulting QContent objects to folder.

const QDawg & Qtopia::fixedDawg ()

Returns the unchangeable QDawg that contains general words for the current locale.

See also addedDawg().

bool Qtopia::hasKey ( int key )

Returns true if key is available on the device. The buttons may be either fixed function buttons, such as Key_Menu, or user mappable buttons, such as Key_F1.

See also QSoftMenuBar and QDeviceButtonManager.

QStringList Qtopia::helpPaths ()

Returns a list of directory names where help files are found.

QString Qtopia::homePath ()

Returns the name of the directory to be used as the current users home directory.

QStringList Qtopia::installPaths ()

Returns the list of base directories into which Qtopia packages may have been installed.

The first element in the list is the directory into which Qtopia packages that are always available are installed. The other elements may be on removable media, etc.

Some directories in the list, or their subdirectories, may not be writable.

The first element is equals to [qt_prefix] and additional values are set by the colon-seperated environment variable QTOPIA_PATH.

bool Qtopia::isApplicationFileName ( const QString & file )

Returns true if file is the filename of an application.

bool Qtopia::isDocumentFileName ( const QString & file )

Returns true if file is the filename of a document.

bool Qtopia::isFileLocked ( QFile & f, int flags = -1 )

Could a request to lock file with given flags succeed f must be an opened file flags the desired lock type required

QStringList Qtopia::languageList ()

Returns the list of language identifiers for the languages the user has selected as meaningful to them.

The first string in the list is the users primary language. All information presented to the user should be in the language earliest in the list.

bool Qtopia::lockFile ( QFile & f, int flags = -1 )

Lock region of file. Any locks created should be released before the program exits. Returns true if sucessfull.

f must be an open file flags any combination of LockShare, LockWrite, LockBlock

bool Qtopia::mousePreferred ()

Returns true if the application can expect the user to be able to easily produce mouse events.

Returns false if the user cannot produce mouse events, or chooses not to (eg. does not plug in a mouse).

Applications may use this to tune interactions.

Note that you should only call this function after an instance of QtopiaApplication has been created. This function will return an undefined value if called prior to this.

void Qtopia::msleep ( unsigned long msecs )

System independant sleep. Suspend process for msecs milliseconds.

See also QThread::msleep().

QString Qtopia::ownerName ()

Returns the name of the owner of the device.

QString Qtopia::qtopiaDir ()

Returns the base directory into which Qtopia system packages are installed.

This is the first item in the installPaths() list.

void Qtopia::removeWords ( const QStringList & wordlist )

Removes wordlist from the addedDawg(). If the words are in the fixed dictionary, they are added to the "deleted" dictionary.

This is a slow operation. Call it once with a large list rather than multiple times with a small list.

void Qtopia::removeWords ( const QString & dictname, const QStringList & wordlist )

This is an overloaded member function, provided for convenience.

Removes wordlist from the dawg() named dictname.

This is a slow operation. Call it once with a large list rather than multiple times with a small list.

void Qtopia::setWeekStartsOnMonday ( bool v )

Sets the day the user regards their week starting on. If v is true, then the week begins on Monday. If v is false, then the week begins on Sunday.

See also weekStartsOnMonday().

QString Qtopia::shellQuote ( const QString & s )

Returns the string s with the characters '', '"', and '$' quoted by a preceeding '', and enclosed by double-quotes (").

See also stringQuote().

QString Qtopia::simplifyMultiLineSpace ( const QString & multiLine )

Returns the result of using QString::simplified() on multiLine, but with linebreaks preserved.

void Qtopia::sleep ( unsigned long secs )

System independant sleep. Suspend process for secs seconds.

See also QThread::sleep().

void Qtopia::soundAlarm ()

Sounds the audible system alarm. This is used for applications such as Calendar when it needs to inform the user of an event.

void Qtopia::statusMessage ( const QString & message )

Displays a status message to the user. This usually appears in the taskbar for a short amount of time, then disappears.

QString Qtopia::stringQuote ( const QString & s )

Returns the string s with the characters '' and '"' quoted by a preceeding ''.

See also shellQuote().

QString Qtopia::tempDir ()

Returns the default system path for storing temporary files. The path is unique to the display to which the application is connected. The path has a trailing directory separator character.

The returned directory is created if it does not exist.

See also QDir::tempPath().

QString Qtopia::tempName ( const QString & fname )

Returns a filename suitable for use as a temporary file using fname as a base. Currently returns the filename with "_new" inserted prior to the extension.

No attempt is made to check that the file does not already exist.

QString Qtopia::translate ( const QString & key, const QString & c, const QString & str )

Translate str in the context c, using only the translation files defined by key. The key may be either a single name, such as "QtopiaSettings", or it may be a 'wildcard', such as "Categories-*". The key thus defines the set of translation files in which to search for a translation.

bool Qtopia::truncateFile ( QFile & f, int size )

Truncate file to size specified f must be an open file size must be a positive value

bool Qtopia::unlockFile ( QFile & f )

Unlock a region of file f must be an open file previously locked

void Qtopia::usleep ( unsigned long usecs )

System independant sleep. Suspend process for usecs microseconds.

See also QThread::usleep().

QString Qtopia::version ()

Returns the Qtopia version string. This is of the form: major .minor .patchlevel (eg. "1.2.3"), possibly followed by a space and special information (eg. "1.2.3 beta4").

bool Qtopia::weekStartsOnMonday ()

Returns true if the user regards their week as starting on Monday. Returns false if the user regards their week as starting on Sunday.

See also setWeekStartsOnMonday().

void Qtopia::writeHWClock ()

Writes the system clock to the hardware clock.


Copyright © 2006 Trolltech Trademarks
Qtopia 4.1.7