| Classes | Functions | DevRef | Qt API | Qtopia Documentation |

# Global Class Reference

The Global class provides application-wide global functions. More...

`#include <global.h>`

List of all member functions.

## Static Public Members

- const QDawg & fixedDawg ()
- const QDawg & addedDawg ()
- const QDawg & dawg ( const QString & name )
- void addWords ( const QStringList & wordlist )
- void addWords ( const QString & dictname, const QStringList & wordlist )
- void findDocuments ( DocLnkSet * folder, const QString & mimefilter = QString::null )
- QString applicationFileName ( const QString & appname, const QString & filename )
- void invoke ( const QString & c )
- void execute ( const QString & c, const QString & document = QString::null )
- void statusMessage ( const QString & message )
- void hideInputMethod ()
- void showInputMethod ()
- void writeHWClock ()
- QString shellQuote ( const QString & s )
- QString stringQuote ( const QString & s )

## Detailed Description

The Global class provides application-wide global functions.

The Global functions are grouped as follows:

- User Interface
- Document related
- Filesystem related
- Word list related
- Quoting
- Hardware

### User Interface

The statusMessage() function provides short-duration messages to the user. The showInputMethod() function shows the current input method, and hideInputMethod() hides the input method.

### Document related

The findDocuments() function creates a set of DocLnk objects in a particular folder.

### Filesystem related

Global provides an applicationFileName() function that returns the full path of an application. The execute() function runs an application.

### 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.

### Quoting

The shellQuote() function quotes a string suitable for passing to a shell. The stringQuote() function backslash escapes '\' and '"' characters.

### Hardware

The writeHWClock() function sets the hardware clock to the system clock's date and time.

## Member Function Documentation

### void Global::addWords ( const QString & dictname, const QStringList & wordlist )`[static]`

Adds wordlist to the dawg() named dictname.

### void Global::addWords ( const QStringList & wordlist )`[static]`

This is an overloaded member function, provided for convenience. It behaves essentially like the above function.

Adds wordlist to the addedDawg().

### const QDawg & Global::addedDawg ()`[static]`

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

See also fixedDawg().

### QString Global::applicationFileName ( const QString & appname, const QString & filename )`[static]`

Returns the full path for the application called appname, with the given filename. Returns QString::null 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.

### const QDawg & Global::dawg ( const QString & name )`[static]`

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

name should not contain "/".

### void Global::execute ( const QString & c, const QString & document = QString::null )`[static]`

Executes the application identfied by c, 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 Global::findDocuments ( DocLnkSet * folder, const QString & mimefilter = QString::null )`[static]`

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

### const QDawg & Global::fixedDawg ()`[static]`

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

See also addedDawg().

### void Global::hideInputMethod ()`[static]`

Explicitly hide the current input method.

The current input method is still indicated in the taskbar, but no longer takes up screen space, and can no longer be interacted with.

See also showInputMethod().

### void Global::invoke ( const QString & c )`[static]`

Low-level function to run command c.

Warning: Do not use this function.

See also execute().

### QString Global::shellQuote ( const QString & s )`[static]`

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

See also stringQuote().

### void Global::showInputMethod ()`[static]`

Explicitly show the current input method.

Input methods are indicated in the taskbar by a small icon. If the input method is activated (shown) then it takes up some proportion of the bottom of the screen, to allow the user to interact (input characters) with it.

See also hideInputMethod().

### void Global::statusMessage ( const QString & message )`[static]`

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

### QString Global::stringQuote ( const QString & s )`[static]`

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

See also shellQuote().

### void Global::writeHWClock ()`[static]`

Writes the system clock to the hardware clock.

This file is part of the Qtopia , copyright © 1995-2002 Trolltech, all rights reserved.