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

MimeType Class Reference

The MimeType class provides MIME type information. More...

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

Collaboration diagram for MimeType:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 MimeType (const QString &ext_or_id)
 MimeType (const DocLnk &)
QString id () const
QString description () const
QPixmap pixmap () const
QPixmap bigPixmap () const
const AppLnkapplication () const

Static Public Member Functions

static QString appsFolderName ()
static void updateApplications ()
static void clear ()
static void registerApp (const AppLnk &)

Private Member Functions

void init (const QString &ext_or_id)

Static Private Member Functions

static void updateApplications (AppLnkSet *folder)
static void loadExtensions ()
static void loadExtensions (const QString &)
static Privatedata ()
static MimeTypeDatadata (const QString &id)

Private Attributes

QString i

Static Private Attributes

static Privated = 0

Classes

class  Private

Detailed Description

The MimeType class provides MIME type information.

A MimeType object is a light-weight value which provides information about a MIME type.

Definition at line 33 of file mimetype.h.


Constructor & Destructor Documentation

MimeType::MimeType const QString ext_or_id  ) 
 

Constructs a MimeType. Normally, ext_or_id is a MIME type, but if ext_or_id starts with / or contains no /, it is interpretted as a filename and the extension (eg. .txt) is used as the MIME type.

Definition at line 148 of file mimetype.cpp.

References init().

MimeType::MimeType const DocLnk lnk  ) 
 

Constructs a MimeType from the type() of lnk.

Definition at line 156 of file mimetype.cpp.

References init(), and AppLnk::type().


Member Function Documentation

const AppLnk * MimeType::application  )  const
 

Returns the AppLnk defining the application associated with this MIME type, or 0 if none is associated.

The caller must not retain the pointer, but of course you can dereference it to take a copy if needed.

See also:
Service::binding()

Definition at line 226 of file mimetype.cpp.

References MimeTypeData::apps, d, data(), and i.

Referenced by DocLnk::exec(), DocLnk::init(), DocLnk::invoke(), TypeCombo::reread(), FileView::showFileMenu(), AdvancedFm::showFileMenu(), and LauncherView::updateTools().

QString MimeType::appsFolderName  )  [static]
 

Returns a Qtopia folder containing application definitions.

Definition at line 349 of file mimetype.cpp.

References QPEApplication::qpeDir().

Referenced by ButtonUtils::ButtonUtils(), DocumentList::DiffAppLnks(), DocumentList::DocumentList(), MagicTextBrowser::generateQpe(), AppLnkManager::init(), TabsSettings::init(), Opie::Core::OGlobal::isAppLnkFileName(), StartMenu::loadMenu(), Opie::Global::isAppLnkFileName(), DocumentList::reloadAppLnks(), and updateApplications().

QPixmap MimeType::bigPixmap  )  const
 

Returns a larger QPixmap appropriate for the MIME type.

Definition at line 211 of file mimetype.cpp.

References MimeTypeData::bigIcon(), d, data(), and i.

Referenced by AppLnk::pixmap().

void MimeType::clear  )  [static]
 

For internal use only.

Definition at line 271 of file mimetype.cpp.

References appsUpdated, d, and FALSE.

Referenced by Launcher::allApplicationsRemoved(), and cleanupMime().

MimeTypeData * MimeType::data const QString id  )  [static, private]
 

Definition at line 335 of file mimetype.cpp.

References d, data(), and s.

MimeType::Private & MimeType::data  )  [static, private]
 

Definition at line 116 of file mimetype.cpp.

References cleanupMime(), d, FALSE, QPtrCollection::setAutoDelete(), and TRUE.

Referenced by application(), bigPixmap(), data(), description(), pixmap(), and registerApp().

QString MimeType::description  )  const
 

Returns a description of the MIME Type. This is usually based on the application() associated with the type.

Definition at line 173 of file mimetype.cpp.

References d, data(), MimeTypeData::description(), i, and QString::null.

Referenced by FileItem::FileItem().

QString MimeType::id  )  const
 

Returns the MIME type identifier.

Definition at line 164 of file mimetype.cpp.

References i.

Referenced by OFileViewFileListView::addFile(), Opie::Ui::Internal::OFileViewFileListView::addFile(), DrawPadCanvas::exportPage(), FileItem::FileItem(), and AppLnk::type().

void MimeType::init const QString ext_or_id  )  [private]
 

Definition at line 317 of file mimetype.cpp.

References appsUpdated, i, QString::isNull(), loadExtensions(), QString::lower(), and updateApplications().

Referenced by MimeType().

void MimeType::loadExtensions const QString  )  [static, private]
 

Definition at line 290 of file mimetype.cpp.

References QValueList< T >::append(), QTextStream::atEnd(), QValueList< T >::begin(), QValueList< T >::contains(), QValueList< T >::end(), in, IO_ReadOnly, QFile::open(), QTextStream::readLine(), QValueList< T >::remove(), and QStringList::split().

void MimeType::loadExtensions  )  [static, private]
 

Definition at line 280 of file mimetype.cpp.

References QPEApplication::qpeDir().

Referenced by init().

QPixmap MimeType::pixmap  )  const
 

Returns a small QPixmap appropriate for the MIME type.

Definition at line 182 of file mimetype.cpp.

References d, data(), i, and MimeTypeData::regIcon().

Referenced by OFileViewFileListView::addFile(), Opie::Ui::Internal::OFileViewFileListView::addFile(), FileItem::FileItem(), AppLnk::pixmap(), OpieFtp::populateLocalView(), AdvancedFm::populateView(), and ViewAtt::update().

void MimeType::registerApp const AppLnk lnk  )  [static]
 

For internal use only.

Definition at line 244 of file mimetype.cpp.

References MimeTypeData::apps, QValueList< T >::begin(), data(), QValueList< T >::end(), l, list, AppLnk::mimeTypes(), Config::readEntry(), serviceBinding(), and Config::setGroup().

Referenced by Launcher::applicationAdded(), and updateApplications().

void MimeType::updateApplications AppLnkSet folder  )  [static, private]
 

Definition at line 365 of file mimetype.cpp.

References AppLnkSet::children(), and registerApp().

void MimeType::updateApplications  )  [static]
 

Reloads application definitions.

Definition at line 357 of file mimetype.cpp.

References appsFolderName(), and appsUpdated.

Referenced by LnkProperties::done(), init(), main(), and Server::systemMsg().


Member Data Documentation

MimeType::Private * MimeType::d = 0 [static, private]
 

Definition at line 111 of file mimetype.cpp.

Referenced by application(), bigPixmap(), clear(), data(), description(), and pixmap().

QString MimeType::i [private]
 

Definition at line 69 of file mimetype.h.

Referenced by application(), bigPixmap(), description(), id(), init(), and pixmap().


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