Main Page | Namespace List | Class Hierarchy | Alphabetical List | Class List | Directories | File List | Namespace Members | Class Members | File Members | Related Pages

Global Class Reference

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

#include </home/clem/local/src/opie/library/global.h>

Inheritance diagram for Global:

Inheritance graph
[legend]
Collaboration diagram for Global:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 Global ()

Static Public Member Functions

static const QDawgfixedDawg ()
static const QDawgaddedDawg ()
static const QDawgdawg (const QString &name)
static void addWords (const QStringList &word)
static void addWords (const QString &dictname, const QStringList &word)
static void createDocDir ()
static void findDocuments (DocLnkSet *folder, const QString &mimefilter=QString::null)
static QString applicationFileName (const QString &appname, const QString &filename)
static void setBuiltinCommands (Command *)
static void execute (const QString &exec, const QString &document=QString::null)
static void setDocument (QWidget *receiver, const QString &document)
static bool terminateBuiltin (const QString &)
static void terminate (const AppLnk *)
static bool isBuiltinCommand (const QString &name)
static void applyStyle ()
static void statusMessage (const QString &)
static QWidget * shutdown (bool=FALSE)
static QWidget * restart (bool=FALSE)
static void hideInputMethod ()
static void showInputMethod ()
static void writeHWClock ()
static QString shellQuote (const QString &s)
static QString stringQuote (const QString &s)

Static Private Member Functions

static void invoke (const QString &exec)

Static Private Attributes

static Commandbuiltin = 0
static QGuardedPtr< QWidget > * running = 0

Classes

struct  Command
 The Global::Command class is internal. More...

Detailed Description

The Global class provides application-wide global functions.

The Global functions are grouped as follows:

The statusMessage() function provides short-duration messages to the user. The showInputMethod() function shows the current input method, and hideInputMethod() hides the input method. @section Document related The findDocuments() function creates a set of \link doclnk.html DocLnk\endlink objects in a particular folder. @section Filesystem related Global provides an applicationFileName() function that returns the full path of an application-specific file. The execute() function runs an application. @section Word list related A list of words relevant to the current locale is maintained by the system. The list is held in a \link qdawg.html DAWG\endlink (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 \l{QDawg}s which are returned by dawg(). Use addWords() to add words to the updateable copy of the global QDawg or to named application \l{QDawg}s. @section Quoting The shellQuote() function quotes a string suitable for passing to a shell. The stringQuote() function backslash escapes '\' and '"' characters. @section Hardware The implementation of the writeHWClock() function depends on the AlarmServer implementation. If the AlarmServer is using atd the clock will be synced to hardware. If opie-alarm is used the hardware clock will be synced before suspending the device. opie-alarm is used by iPAQ and Zaurii implementation Definition at line 31 of file global.h.


Constructor & Destructor Documentation

Global::Global  ) 
 

For internal use only.

Definition at line 206 of file global.cpp.


Member Function Documentation

const QDawg & Global::addedDawg  )  [static]
 

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

See also:
fixedDawg()

Definition at line 263 of file global.cpp.

References dawg().

Referenced by DictFilterConfig::add().

void Global::addWords const QString dictname,
const QStringList wordlist
[static]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds wordlist to the addedDawg().

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.

Definition at line 312 of file global.cpp.

References all, QDawg::allWords(), applicationFileName(), QDawg::createFromWords(), d, dawg(), IO_WriteOnly, QFile::open(), and QDawg::write().

void Global::addWords const QStringList wordlist  )  [static]
 

This is an overloaded member function, provided for convenience. It differs from the above function only in what argument(s) it accepts. Adds wordlist to the addedDawg().

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.

Definition at line 299 of file global.cpp.

Referenced by Board::checkTurn(), and PickboardAdd::exec().

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.

Definition at line 338 of file global.cpp.

References d, QFile::exists(), false, QDir::mkdir(), and QString::null.

Referenced by CfgDlg::accept(), addressbookPersonalVCardName(), addWords(), Password::authenticate(), ComposeMail::ComposeMail(), dateBookFilename(), dawg(), QTReaderApp::do_saveconfig(), QTReaderApp::fileClose(), DrawPad::finishStartup(), BackupAndRestore::getExcludeFile(), QTReaderApp::gotobkmk(), HelpWindow::HelpWindow(), QTReaderApp::infoClose(), AlarmServer::initialize(), QTReaderApp::listBkmkFiles(), QIMPenProfile::loadData(), ZkbWidget::loadKeymap(), WordGame::loadRules(), main(), OContactAccessBackend_SQL::OContactAccessBackend_SQL(), OContactAccessBackend_XML::OContactAccessBackend_XML(), ODateBookAccessBackend_SQL::ODateBookAccessBackend_SQL(), Opie::ODateBookAccessBackend_SQL::ODateBookAccessBackend_SQL(), ODateBookAccessBackend_XML::ODateBookAccessBackend_XML(), Opie::ODateBookAccessBackend_XML::ODateBookAccessBackend_XML(), Opie::OPimContactAccessBackend_SQL::OPimContactAccessBackend_SQL(), Opie::OPimContactAccessBackend_XML::OPimContactAccessBackend_XML(), Opie::OPimTodoAccessBackendSQL::OPimTodoAccessBackendSQL(), Opie::OPimTodoAccessXML::OPimTodoAccessXML(), OTodoAccessBackendSQL::OTodoAccessBackendSQL(), OTodoAccessXML::OTodoAccessXML(), SyncAuthentication::ownerName(), QTReaderApp::PopulateConfig(), QTReaderApp::QTReaderApp(), QTReaderApp::readbkmks(), HelpBrowser::readBookmarks(), QTReaderApp::readconfig(), QTReaderApp::readfilelist(), IRCServer::realname(), Opie::Security::Internal::runPlugins(), QTReaderApp::savebkmks(), QTReaderApp::savefilelist(), saveState(), QTReaderApp::setBackgroundBitmap(), Today::setOwnerField(), Network::settingsDir(), SFCave::SFCave(), Converter::start_upgrade(), Todo::TemplateManager::TemplateManager(), NewGame::updateRuleSets(), KVNCBookmarkDlg::writeBookmarks(), QTReaderApp::writeUrl(), DrawPad::~DrawPad(), and HelpBrowser::~HelpBrowser().

void Global::applyStyle  )  [static]
 

For internal use only.

Definition at line 381 of file global.cpp.

References qApp, and QCopChannel::send().

Referenced by Appearance::accept().

void Global::createDocDir  )  [static]
 

For internal use only.

Definition at line 357 of file global.cpp.

References docDirCreated, QPEApplication::documentDir(), and TRUE.

Referenced by dawg(), fixedDawg(), and OpieObex::OtherHandler::targetName().

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 "/".

Definition at line 274 of file global.cpp.

References applicationFileName(), createDocDir(), QDict< type >::find(), QDict< type >::insert(), IO_ReadOnly, QFile::open(), and QDawg::readFile().

Referenced by addedDawg(), addWords(), Board::checkTurn(), Board::score(), and ComputerPlayer::step().

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.

Definition at line 662 of file global.cpp.

References QString::isNull().

Referenced by SafeMode::action(), AppLnk::invoke(), LauncherClock::mousePressEvent(), TaskSwitcher::onKeyPress(), TaskSelector::select(), Launcher::select(), ServerApplication::showSafeMode(), and TimeZoneSelector::slotExecute().

void Global::findDocuments DocLnkSet folder,
const QString mimefilter = QString::null
[static]
 

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

let's do intellegint way of searching these files a) the user don't want to check mediums global b) the user wants to check but use the global options for it c) the user wants to check it but not this medium d) the user wants to check and this medium as well

In all cases we need to apply a different mimefilter to the medium. a) mimefilter.isEmpty() we need to apply the responding filter either the global or the one on the medium

b) mimefilter is set to an application we need to find out if the mimetypes are included in the mime mask of the medium

Definition at line 724 of file global.cpp.

References QValueList< T >::append(), QValueList< T >::count(), d, Config::File, StorageInfo::fileSystems(), QValueList< T >::isEmpty(), Config::readBoolEntry(), Config::readListEntry(), and Config::setGroup().

Referenced by PlayListWidget::addAllToList(), Server::readLocalIpks(), ImageFileSelector::reread(), FileSelector::reread(), PlayListFileView::scanFiles(), PlayListWidget::scanForAudio(), PlayListWidget::scanForVideo(), and Doc_DirLister::setStartPath().

const QDawg & Global::fixedDawg  )  [static]
 

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

See also:
addedDawg()

Definition at line 216 of file global.cpp.

References QValueList< T >::begin(), createDocDir(), QDawg::createFromWords(), dictDir(), docDirCreated, QValueList< T >::end(), QFile::exists(), in, IO_ReadOnly, IO_WriteOnly, QFile::open(), QDawg::readFile(), and QDawg::write().

Referenced by DictFilterConfig::add(), Board::checkTurn(), QIMPenMatch::matchWords(), QIMPenInput::QIMPenInput(), Board::score(), QIMPenInput::selectProfile(), and ComputerPlayer::step().

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()

Definition at line 437 of file global.cpp.

References QCopChannel::send().

Referenced by QTReaderApp::closeEvent(), QTReaderApp::do_regaction(), QTReaderApp::findClose(), QTReaderApp::hidetoolbars(), QPEApplication::qwsEventFilter(), QTReaderApp::regClose(), QIMPenInput::setup(), QTReaderApp::showEditTools(), HandwritingHelp::showEvent(), and ShutdownImpl::ShutdownImpl().

void Global::invoke const QString c  )  [static, private]
 

Low-level function to run command c.

Warning:
Do not use this function. Use execute instead.
See also:
execute()

Definition at line 533 of file global.cpp.

References StartingAppList::add(), QPtrList< type >::append(), QPtrList< type >::at(), QPtrList< type >::count(), QValueList< T >::count(), QFile::exists(), QCopChannel::isRegistered(), StartingAppList::isStarting(), QString::latin1(), list, NULL, pid, qDebug(), qpeDir(), quickexecv(), QStringList::split(), warning(), and write().

bool Global::isBuiltinCommand const QString name  )  [static]
 

For internal use only.

Definition at line 448 of file global.cpp.

References builtin, FALSE, i, and TRUE.

Referenced by AppLnkSet::findChildren().

QWidget * Global::restart bool  = FALSE  )  [static]
 

For internal use only.

Definition at line 404 of file global.cpp.

References QCopChannel::send().

Referenced by SafeMode::action().

void Global::setBuiltinCommands Command list  )  [static]
 

For internal use only.

Definition at line 472 of file global.cpp.

References builtin, and running.

Referenced by Server::Server().

void Global::setDocument QWidget *  receiver,
const QString document
[static]
 

For internal use only.

Definition at line 490 of file global.cpp.

References emitter.

Referenced by AppLauncher::executeBuiltin(), QPEApplication::pidMessage(), and QPEApplication::showMainDocumentWidget().

QString Global::shellQuote const QString s  )  [static]
 

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

See also:
stringQuote()

Definition at line 683 of file global.cpp.

References i, QString::latin1(), and QString::length().

Referenced by Converter::sqliteMoveAndConvert(), and OpieObex::Receiver::tidyUp().

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()

Definition at line 422 of file global.cpp.

References QCopChannel::send().

Referenced by QTReaderApp::addanno(), QTReaderApp::do_regedit(), QTReaderApp::editFind(), HandwritingHelp::hideEvent(), QTReaderApp::OnWordSelected(), QPEApplication::qwsEventFilter(), QIMPenInput::setup(), QTReaderApp::showAnnotation(), and QTReaderApp::showEditTools().

QWidget * Global::shutdown bool  = FALSE  )  [static]
 

For internal use only.

Definition at line 393 of file global.cpp.

References QCopChannel::send().

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.

Definition at line 370 of file global.cpp.

Referenced by BackupAndRestore::backupRootFs(), BackupAndRestore::backupUserData(), Interface::callProcess(), POP3wrapper::deleteMail(), MHwrapper::fetchRawBody(), MBOXwrapper::fetchRawBody(), XINE::Lib::handleXineEvent(), CPlucker_base::hyperlink(), POP3wrapper::listMessages(), MHwrapper::listMessages(), MBOXwrapper::listMessages(), IMAPwrapper::listMessages(), POP3wrapper::login(), IMAPwrapper::login(), IMAPwrapper::mvcpMail(), ProcessInvoker::notifyStatus(), Opie::Net::OManufacturerDB::OManufacturerDB(), QTReaderApp::OnWordSelected(), CameraMainWindow::performCapture(), KeyHelperWidget::reload(), BackupAndRestore::restore(), InterfaceSetupImp::saveChanges(), ZSafe::saveDocument(), CameraMainWindow::shutterClicked(), OpieStumbler::slotAssociated(), OpieStumbler::slotCheckDHCP(), IMAPwrapper::start_tls(), MHwrapper::statusFolder(), MBOXwrapper::statusFolder(), KVNC::statusMessage(), MBOXwrapper::storeMessage(), IMAPwrapper::storeMessage(), Text::unsuspend(), CHM::unsuspend(), KeyHelperWidget::version(), ConfigDialog::writeConfiguration(), and SkinLoader::~SkinLoader().

QString Global::stringQuote const QString s  )  [static]
 

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

See also:
shellQuote()

Definition at line 704 of file global.cpp.

References i.

void Global::terminate const AppLnk app  )  [static]
 

For internal use only.

Definition at line 514 of file global.cpp.

References channel, and QCopChannel::isRegistered().

bool Global::terminateBuiltin const QString n  )  [static]
 

For internal use only.

Definition at line 498 of file global.cpp.

References builtin, FALSE, i, running, and TRUE.

Referenced by Server::activate(), Launcher::eventFilter(), and ServerApplication::login().

void Global::writeHWClock  )  [static]
 

The implementation depends on the mode of AlarmServer. If the AlarmServer uses atd the current system time will be written to the hardware clock. If the AlarmServer relies on opie-alarm the time will be written once the device gets suspended. opie-alarm is used by the Zaurus, iPAQs and SIMpad

Definition at line 496 of file alarmserver.cpp.

References TRUE.


Member Data Documentation

Global::Command * Global::builtin = 0 [static, private]
 

Definition at line 460 of file global.cpp.

Referenced by Opie::Core::OGlobal::builtinCommands(), isBuiltinCommand(), Opie::Global::builtinCommands(), setBuiltinCommands(), and terminateBuiltin().

QGuardedPtr< QWidget > * Global::running = 0 [static, private]
 

Definition at line 461 of file global.cpp.

Referenced by Opie::Core::OGlobal::builtinRunning(), Opie::Global::builtinRunning(), setBuiltinCommands(), and terminateBuiltin().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 17:34:14 2005 for OPIE by  doxygen 1.4.2