libopie API Documentation

OFileDialog Class Reference

This class places a OFileSelector inside a QDialog. A small QDialog swalloing a FileSelector. More...

#include <ofiledialog.h>

Inheritance diagram for OFileDialog:

Inheritance graph
[legend]
Collaboration diagram for OFileDialog:

Collaboration graph
[legend]
List of all members.

Public Member Functions

 OFileDialog (const QString &caption, QWidget *, int mode, int selector, const QString &dirName, const QString &fileName=QString::null, const MimeTypes &mimetypes=MimeTypes())
QString mimetype () const
QString fileName () const
DocLnk selectedDocument () const
 return a DocLnk to the current file


Static Public Member Functions

QString getOpenFileName (int selector, const QString &startDir=QString::null, const QString &fileName=QString::null, const MimeTypes &mime=MimeTypes(), QWidget *wid=0, const QString &caption=QString::null)
 This opens up a filedialog in Open mode.

QString getSaveFileName (int selector, const QString &startDir=QString::null, const QString &fileName=QString::null, const MimeTypes &mimefilter=MimeTypes(), QWidget *wid=0, const QString &caption=QString::null)
 This opens up a file dialog in save mode.


Detailed Description

This class places a OFileSelector inside a QDialog. A small QDialog swalloing a FileSelector.

It provides static method for letting a user chose a file for either opening or saving. Most of the time the c'tor will not be used instead using the static member functions is prefered.

QMap<QString, QStringList> mimeTypes; QStringList types; types << "text/* "; mimeTypes.insert( tr("Text"), types ); mimeTypes.insert( tr("All"), " */* " ); // remove the spaces in the 2nd comment QString fileName= OFileDialog::getOpenFileName( OFileSelector::EXTENDED_ALL, "foo","bar", mimeTypes);

See also:
QDialog

OFileSelector

Version:
0.1-unfinished
Author:
Holger Freyther ( zecke@handhelds.org )

Definition at line 60 of file ofiledialog.h.


Member Function Documentation

QString OFileDialog::mimetype  )  const
 

Returns:
the mimetype of the selected currently it return QString::null

Definition at line 117 of file ofiledialog.cc.

QString OFileDialog::fileName  )  const
 

Returns:
the fileName

Definition at line 125 of file ofiledialog.cc.

Referenced by getOpenFileName(), and getSaveFileName().

DocLnk OFileDialog::selectedDocument  )  const
 

return a DocLnk to the current file

Definition at line 133 of file ofiledialog.cc.

QString OFileDialog::getOpenFileName int  selector,
const QString _startDir = QString::null,
const QString file = QString::null,
const MimeTypes mimes = MimeTypes(),
QWidget wid = 0,
const QString caption = QString::null
[static]
 

This opens up a filedialog in Open mode.

Parameters:
selector the Selector Mode
startDir Where to start from
file A proposed filename
mimes A list of MimeTypes
wid the parent
caption of the dialog if QString::null tr("Open") will be used
Returns:
the fileName or QString::null

Definition at line 149 of file ofiledialog.cc.

References QDialog::exec(), fileName(), QString::isEmpty(), QWidget::showMaximized(), and QObject::tr().

QString OFileDialog::getSaveFileName int  selector,
const QString _startDir = QString::null,
const QString file = QString::null,
const MimeTypes mimes = MimeTypes(),
QWidget wid = 0,
const QString caption = QString::null
[static]
 

This opens up a file dialog in save mode.

See also:
getOpenFileName

Definition at line 177 of file ofiledialog.cc.

References QDialog::exec(), fileName(), QString::isEmpty(), QWidget::showMaximized(), and QObject::tr().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.1.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:53 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001