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

OFileDialog Class Reference

A small QDialog swalloing a FileSelector. More...

#include </home/clem/local/src/opie/noncore/unsupported/libopie/ofiledialog.h>

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

Static Public Member Functions

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

Private Slots

void slotFileSelected (const QString &)
void slotDirSelected (const QString &)
void slotSelectorOk ()

Private Attributes

OFileDialogPrivate * d
OFileSelectorfile

Detailed Description

A small QDialog swalloing a FileSelector.

This class places a OFileSelector inside a QDialog. 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@slash* ";
 mimeTypes.insert( tr("Text"), types );
 mimeTypes.insert( tr("All"), " *@slash* " ); // 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.


Constructor & Destructor Documentation

OFileDialog::OFileDialog const QString caption,
QWidget *  ,
int  mode,
int  selector,
const QString dirName,
const QString fileName = QString::null,
const MimeTypes mimetypes = MimeTypes()
 


Member Function Documentation

QString OFileDialog::fileName  )  const
 

Returns:
the fileName

Definition at line 122 of file ofiledialog.cc.

Referenced by getOpenFileName(), and getSaveFileName().

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 146 of file ofiledialog.cc.

References fileName(), QString::isEmpty(), lastUsedDir(), OFileSelector::Open, saveLastDir(), and tr.

Referenced by ComposeMail::addAttachment(), ConfigDlg::addMap(), DemoApp::addTrigger(), TabDialog::bgImageClicked(), OpieTooth::ObexDialog::browse(), InputDialog::browse(), optionsDialog::BrowseSelected(), UserDialog::clickedPicture(), TextEdit::fileOpen(), WellenreiterMainWindow::getFileName(), ZSafe::loadDocument(), OpenEtext::open(), ImageViewer::openFile(), ZSafe::readAllEntries(), ZSafe::removeAsciiFile(), Opietooth2::OTSniffing::SLOT_Load(), Composer::slotAddAttach(), SearchMethodDlg::slotBrowse(), TransferDialog::slotFilename(), FifteenConfigDialog::slotLoadImage(), TinyKate::slotOpen(), and QTReaderApp::usefilebrowser().

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 174 of file ofiledialog.cc.

References fileName(), QString::isEmpty(), lastUsedDir(), OFileSelector::Save, saveLastDir(), and tr.

Referenced by WellenreiterMainWindow::getFileName(), QTReaderApp::gotobkmk(), InstallDlgImpl::optionsSelected(), CameraMainWindow::outputToMenuItemClicked(), TextEdit::saveAs(), Opietooth2::OTSniffing::SLOT_Save(), ViewMail::slotItemClicked(), TinyKate::slotSaveAs(), and ZSafe::zsaveDialog().

QString OFileDialog::mimetype  )  const
 

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

Definition at line 114 of file ofiledialog.cc.

References QString::null.

DocLnk OFileDialog::selectedDocument  )  const
 

return a DocLnk to the current file

Definition at line 130 of file ofiledialog.cc.

Referenced by AddAtt::addattachment().

void OFileDialog::slotDirSelected const QString  )  [private, slot]
 

Definition at line 207 of file ofiledialog.cc.

void OFileDialog::slotFileSelected const QString  )  [private, slot]
 

Definition at line 197 of file ofiledialog.cc.

void OFileDialog::slotSelectorOk  )  [private, slot]
 

Definition at line 202 of file ofiledialog.cc.


Member Data Documentation

OFileDialogPrivate* OFileDialog::d [private]
 

Definition at line 92 of file ofiledialog.h.

OFileSelector* OFileDialog::file [private]
 

Definition at line 94 of file ofiledialog.h.


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