libopie API Documentation

OFileSelector Class Reference

a dropin replacement for the FileSelector More...

#include <ofileselector.h>

Inheritance diagram for OFileSelector:

Inheritance graph
[legend]
Collaboration diagram for OFileSelector:

Collaboration graph
[legend]
List of all members.

Public Types

enum  Mode {
  Open = 1, Save = 2, FileSelector = 4, OPEN = 1,
  SAVE = 2, FILESELECTOR = 4
}
 The Mode of the Fileselector Open = Open A File Save = Save a File FILESELECTOR = As A GUI in a screen to select a file. More...

enum  Selector {
  Normal = 0, Extended = 1, ExtendedAll = 2, Default = 3,
  NORMAL = 0, EXTENDED = 1, EXTENDED_ALL = 2, DEFAULT = 3
}
 Normal = The old FileSelector Extended = Dir View ExtendedAll = Dir View with all hidden files Default = What the vendor considers best. More...


Signals

void dirSelected (const QString &)
 dirSelected is emitted whenever changed into a different dir

void fileSelected (const DocLnk &)
 fileSelected is emitted when a file is selected it uses a DocLnk as parameter

void fileSelected (const QString &)
 fileSelected is emitted when a file is selected the complete path is a parameter

void newSelected (const DocLnk &)
 Create a new File with a DocLnk.

void closeMe ()
void ok ()
 Ok is emitted on a Qt::Key_Return or Q::Key_Enter in the line edit.

void cancel ()

Public Member Functions

 OFileSelector (QWidget *parent, int mode, int selector, const QString &dirName, const QString &fileName, const MimeTypes &mimetypes=MimeTypes(), bool newVisible=FALSE, bool closeVisible=FALSE)
 new and complete c'tor

 OFileSelector (const QString &mimeFilter, QWidget *parent, const char *name=0, bool newVisible=TRUE, bool closeVisible=FALSE)
 This a convience c'tor to just substitute the use of FileSelector.

 ~OFileSelector ()
 d'tor

const DocLnkselected ()
 Convience function for the fileselector make sure to delete the DocLnk.

QString selectedName () const
QString selectedPath () const
QString directory () const
DocLnk selectedDocument () const
int fileCount () const
void reread ()
int mode () const
int selector () const
void setNewVisible (bool b)
 Set the Icon visible.

void setCloseVisible (bool b)
 Set the Icon visible.

void setNameVisible (bool b)
 Set the Name Line visible.


Friends

class OFileViewFileListView

Detailed Description

a dropin replacement for the FileSelector

This class is first used insert the OFileDialog. It supports multiple view and mimetype filtering for now.

See also:
OFileDialog

FileSelector

Author:
zecke
Version:
0.1

Definition at line 67 of file ofileselector.h.


Member Enumeration Documentation

enum OFileSelector::Mode
 

The Mode of the Fileselector Open = Open A File Save = Save a File FILESELECTOR = As A GUI in a screen to select a file.

Definition at line 78 of file ofileselector.h.

enum OFileSelector::Selector
 

Normal = The old FileSelector Extended = Dir View ExtendedAll = Dir View with all hidden files Default = What the vendor considers best.

Definition at line 86 of file ofileselector.h.


Constructor & Destructor Documentation

OFileSelector::OFileSelector QWidget parent,
int  mode,
int  sel,
const QString dirName,
const QString fileName,
const MimeTypes mimetypes = MimeTypes(),
bool  showNew = FALSE,
bool  showClose = FALSE
 

new and complete c'tor

Create a OFileSelector to let the user select a file. It can either be used to open a file, select a save name in a dir or as a dropin for the FileSelector.

QMap<QString, QStringList> mimeTypes; QStringList types; types << "text/* "; types << "audio/*"; mimeTypes.insert( tr("Audio and Text"), types ); mimeTypes.insert( tr("All"), "*/*);

now you could create your fileselector

Parameters:
parent the parent of this widget
mode The mode from the enum Mode (Open,Save,FILESELECTOR)
sel The selector to be used
dirName The name of the dir to start int
fileName The fileName placed in the fileselector lineedit
mimetypes The MimeType map of used mimetypes
showNew Show a New Button. Most likely to be used in the FileSelector view.
showClose Show a Close Button. Most likely to be used in FileSelector view.

Definition at line 660 of file ofileselector.cpp.

References QComboBox::setCurrentItem(), QLineEdit::setText(), and QObject::tr().

OFileSelector::OFileSelector const QString mimeFilter,
QWidget parent,
const char *  name = 0,
bool  showNew = TRUE,
bool  showClose = FALSE
 

This a convience c'tor to just substitute the use of FileSelector.

Definition at line 703 of file ofileselector.cpp.

References QPEApplication::documentDir(), QMap::insert(), QString::isEmpty(), and QComboBox::setCurrentItem().

OFileSelector::~OFileSelector  ) 
 

d'tor

Definition at line 803 of file ofileselector.cpp.


Member Function Documentation

const DocLnk * OFileSelector::selected  ) 
 

Convience function for the fileselector make sure to delete the DocLnk.

See also:
DocLnk
Todo:
remove in ODP

Definition at line 814 of file ofileselector.cpp.

References selectedDocument().

QString OFileSelector::selectedName  )  const
 

Returns:
the name of the selected file

Definition at line 823 of file ofileselector.cpp.

QString OFileSelector::selectedPath  )  const
 

Returns:
the selected path

Definition at line 830 of file ofileselector.cpp.

QString OFileSelector::directory  )  const
 

Returns:
the directory name

Definition at line 837 of file ofileselector.cpp.

DocLnk OFileSelector::selectedDocument  )  const
 

Returns:
a DocLnk for the selected document

Definition at line 844 of file ofileselector.cpp.

Referenced by selected().

int OFileSelector::fileCount  )  const
 

Returns:
the number of items for the current view

Definition at line 851 of file ofileselector.cpp.

void OFileSelector::reread  ) 
 

Returns:
reparse the file content

Definition at line 858 of file ofileselector.cpp.

int OFileSelector::mode  )  const
 

Returns:
the Mode of the OFileSelector

Definition at line 877 of file ofileselector.cpp.

int OFileSelector::selector  )  const
 

Returns:
the Selector of the OFileSelector

Definition at line 884 of file ofileselector.cpp.

void OFileSelector::setNewVisible bool  b  ) 
 

Set the Icon visible.

Parameters:
b Show or Hide the New Button

Definition at line 921 of file ofileselector.cpp.

void OFileSelector::setCloseVisible bool  b  ) 
 

Set the Icon visible.

Definition at line 925 of file ofileselector.cpp.

void OFileSelector::setNameVisible bool  b  ) 
 

Set the Name Line visible.

Definition at line 929 of file ofileselector.cpp.

References QWidget::hide(), and QWidget::show().

void OFileSelector::dirSelected const QString  )  [signal]
 

dirSelected is emitted whenever changed into a different dir

void OFileSelector::fileSelected const DocLnk  )  [signal]
 

fileSelected is emitted when a file is selected it uses a DocLnk as parameter

void OFileSelector::fileSelected const QString  )  [signal]
 

fileSelected is emitted when a file is selected the complete path is a parameter

void OFileSelector::newSelected const DocLnk  )  [signal]
 

Create a new File with a DocLnk.

void OFileSelector::ok  )  [signal]
 

Ok is emitted on a Qt::Key_Return or Q::Key_Enter in the line edit.


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:55 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001