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

Opie::Ui::OFileDialog Class Reference

A small QDialog swalloing a FileSelector. More...

#include </home/clem/local/src/opie/libopie2/opieui/fileselector/ofiledialog.h>

Collaboration diagram for Opie::Ui::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)
static QString getDirectory (int selector, const QString &startDir=QString::null, 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"), " * / * " ); // 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 64 of file ofiledialog.h.


Constructor & Destructor Documentation

Opie::Ui::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 127 of file ofiledialog.cpp.

Referenced by getOpenFileName().

QString OFileDialog::getDirectory int  selector,
const QString _startDir = QString::null,
QWidget *  wid = 0,
const QString caption = QString::null
[static]
 

This opens up a filedialog in select directory mode

Parameters:
selector the Selector Mode
startDir Where to start from
wid the parent
caption of the dialog if QString::null tr("Open") will be used
Returns:
the directoryName or QString::null

Definition at line 219 of file ofiledialog.cpp.

References Opie::Ui::OFileSelector::DirectorySelector, QPEApplication::execDialog(), QString::isEmpty(), lastUsedDir(), saveLastDir(), and tr.

Referenced by PlayListWidget::openDirectory(), BackupAndRestore::selectLocation(), PlaylistView::slotAppendDir(), OIpkgConfigDlg::slotOptSelectSourceListsPath(), OIpkgDestDlg::slotSelectPath(), EntryDlg::slotSelectPath(), and ConfigureDlg::slotSelectSwordPath().

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 151 of file ofiledialog.cpp.

References QPEApplication::execDialog(), fileName(), QString::isEmpty(), lastUsedDir(), Opie::Ui::OFileSelector::Open, saveLastDir(), and tr.

Referenced by AddressbookWindow::importvCard(), Clock::slotBrowseMp3File(), and PlaylistView::slotOpenM3u().

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 179 of file ofiledialog.cpp.

References QPEApplication::execDialog(), file, QString::isEmpty(), lastUsedDir(), Opie::Ui::OFileSelector::Save, saveLastDir(), and tr.

Referenced by AddressbookWindow::exportvCard(), IRCMessageParser::parseCTCPDCC(), InstallDlg::slotBtnOptions(), ScreenshotControl::slotGrab(), and PlaylistView::slotSaveAsM3u().

QString OFileDialog::mimetype  )  const
 

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

Definition at line 119 of file ofiledialog.cpp.

References QString::null.

DocLnk OFileDialog::selectedDocument  )  const
 

return a DocLnk to the current file

Definition at line 135 of file ofiledialog.cpp.

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

Definition at line 250 of file ofiledialog.cpp.

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

Definition at line 240 of file ofiledialog.cpp.

void OFileDialog::slotSelectorOk  )  [private, slot]
 

Definition at line 245 of file ofiledialog.cpp.


Member Data Documentation

OFileDialogPrivate* Opie::Ui::OFileDialog::d [private]
 

Definition at line 102 of file ofiledialog.h.

OFileSelector* Opie::Ui::OFileDialog::file [private]
 

Definition at line 104 of file ofiledialog.h.

Referenced by getSaveFileName().


The documentation for this class was generated from the following files:
Generated on Sat Nov 5 18:01:51 2005 for OPIE by  doxygen 1.4.2