Qt API | Qtopia API | Qtopia Documentation | ![]() |
The AppLnk class represents an application available on the system. More...
#include <qtopia/applnk.h>
Inherited by DocLnk and DocLnk.
Every Qtopia application app has a corresponding app.desktop file. When one of these files is read its data is stored as an AppLnk object.
The AppLnk class introduces some Qtopia-specific concepts, and provides a variety of functions, as described in the following sections.
Every AppLnk object has a type. For applications, games and settings the type is Application; for documents the type is the document's MIME type.
When you create an AppLnk (or more likely, a DocLnk), you don't deal directly with filenames in the filesystem. Instead you do this:
DocLnk d; d.setType("text/plain"); d.setName("My Nicely Named Document / Whatever"); // Yes, "/" is legal.At this point, the file() and linkFile() are unknown. Normally this is uninteresting, and the names become automatically known, and more importantly, becomes reserved, when you ask what they are:
QString fn = d.file();This invents a filename, and creates the file on disk (an empty reservation file) to prevent the name being used by another application.
In some circumstances, you don't want to create the file if it doesn't already exist (e.g. in the Document tab, some of the DocLnk objects represented by icons are DocLnk's created just for that view - they don't have corresponding .desktop files. To avoid littering empty reservation files around, we check in a few places to see whether the file really needs to exist).
AppLnk objects are created by calling the constructor with the name of a .desktop file. The object can be checked for validity using isValid().
The following functions are used to set or retrieve information about the application:
Get Function | Set Function | Short Description |
---|---|---|
name() | setName() | application's name |
pixmap() | none | application's icon |
bigPixmap() | none | application's large icon |
none | setIcon() | sets the icon's filename |
type() | setType() | see Types above |
rotation() | none | 0, 90, 180 or 270 degrees |
comment() | setComment() | text for the Details dialog |
exec() | setExec() | executable's filename |
file() | none | document's filename |
linkFile() | setLinkFile() | .desktop filename |
mimeTypes() | none | the mime types the application can view or edit |
categories() | setCategories() | see the function descriptions |
fileKnown() | none | see Files and Links above |
linkFileKnown() | none | see Files and Links above |
property() | setProperty() | any AppLnk property can be retrieved or set (if writeable) using these |
To save an AppLnk to disk use writeLink(). To execute the application that the AppLnk object refers to, use execute().
AppLnk's can be deleted from disk using removeLinkFile(). To remove both the link and the application's executable use removeFiles().
Icon sizes can be globally changed (but only for AppLnk objects created after the calls) with setSmallIconSize() and setBigIconSize().
See also Qtopia Classes.
See also isValid().
See also writeLink().
See also AppLnkSet::add() and AppLnkSet::remove().
See also setBigIconSize() and setIcon().
See also pixmap() and setIcon().
Returns a shallow copy of the Categories property.
See the CategoryWidget for more details.
See also setCategories().
Returns the Comment property.
See also setComment().
You should not need to use this function.
Returns the Exec property. This is the name of the executable program associated with the AppLnk.
See also setExec().
See also exec().
Executes the application associated with this AppLnk.
See also exec().
Returns TRUE is the file associated with AppLnk is already known. If FALSE, calling file() will generate a file name.
Returns the Icon property.
See also setIcon().
Returns the id of the AppLnk. If the AppLnk is not in an AppLnkSet, this value is 0, otherwise it is a value that is unique for the duration of the current process.
See also AppLnkSet::find().
See also execute().
Returns TRUE if this AppLnk is valid; otherwise returns FALSE.
See also file(), exec() and name().
Returns TRUE is the link file associated with AppLnk is already known. If FALSE, calling linkFile() will generate a file name.
Returns the MimeTypeIcons property of the AppLnk.
Returns the MimeTypes property. This is the list of MIME types that the application can view or edit.
Returns the Name property. This is the user-visible name for the document or application, not the filename.
See Files and Links.
See also setName().
See also bigPixmap() and setIcon().
See also setProperty().
See also removeLinkFile().
See also removeFiles().
Returns the Rotation property. The value is 0, 90, 180 or 270 degrees.
See also bigIconSize() and setIcon().
See the CategoryWidget for more details.
See also categories().
This text is displayed in the 'Details Dialog', for example if the user uses the 'press-and-hold' gesture.
See also comment().
See also icon(), setSmallIconSize() and setBigIconSize().
See also linkFile().
See also name().
See also property().
See also smallIconSize() and setIcon().
For applications, games and settings the type should be Application; for documents the type should be the document's MIME type.
See also type().
See also setSmallIconSize() and setIcon().
In addition, the "linkChanged(QString)" message is sent to the "QPE/System" QCop channel.
This file is part of the Qtopia , copyright © 1995-2002 Trolltech, all rights reserved.
Copyright © 2001-2002 Trolltech | Trademarks | Qtopia version 1.7.0
|