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

OFileSelector Class Reference

a dropin replacement for the FileSelector More...

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

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
}
enum  Selector {
  Normal = 0, Extended = 1, ExtendedAll = 2, Default = 3,
  NORMAL = 0, EXTENDED = 1, EXTENDED_ALL = 2, DEFAULT = 3
}

Signals

void dirSelected (const QString &)
void fileSelected (const DocLnk &)
void fileSelected (const QString &)
void newSelected (const DocLnk &)
void closeMe ()
void ok ()
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)
 ~OFileSelector ()
const DocLnkselected ()
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)
void setCloseVisible (bool b)
void setNameVisible (bool b)

Private Slots

void slotMimeTypeChanged ()
void slotDocLnkBridge (const DocLnk &)
void slotFileBridge (const QString &)
void slotViewChange (const QString &)
bool eventFilter (QObject *o, QEvent *e)

Private Member Functions

bool showNew () const
bool showClose () const
MimeTypes mimeTypes () const
QStringList currentMimeType () const
void initUI ()
void initMime ()
void initViews ()
OFileViewInterfacecurrentView () const

Private Attributes

QLineEdit * m_lneEdit
QComboBox * m_cmbView
QComboBox * m_cmbMime
QWidgetStack * m_stack
OFileViewInterfacem_current
bool m_shNew: 1
bool m_shClose: 1
MimeTypes m_mimeType
QMap< QString, OFileViewInterface * > m_views
QHBox * m_nameBox
QHBox * m_cmbBox
QString m_startDir
int m_mode
int m_selector
Datad

Friends

class OFileViewInterface
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

Enumeration values:
Open 
Save 
FileSelector 
OPEN 
SAVE 
FILESELECTOR 

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

Enumeration values:
Normal 
Extended 
ExtendedAll 
Default 
NORMAL 
EXTENDED 
EXTENDED_ALL 
DEFAULT 

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@slash* ";
  types << "audio@slash*";
  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 655 of file ofileselector.cpp.

References Extended, ExtendedAll, initMime(), initUI(), initViews(), m_cmbView, m_current, m_lneEdit, m_mimeType, m_mode, m_selector, m_shClose, m_shNew, m_startDir, Normal, slotViewChange(), str, and 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 698 of file ofileselector.cpp.

References QPEApplication::documentDir(), FileSelector, initMime(), initUI(), initViews(), QMap< Key, T >::insert(), QString::isEmpty(), m_cmbView, m_current, m_mimeType, m_mode, m_selector, m_shClose, m_shNew, m_startDir, Normal, slotViewChange(), QStringList::split(), and tr.

OFileSelector::~OFileSelector  ) 
 

d'tor

Definition at line 798 of file ofileselector.cpp.


Member Function Documentation

void OFileSelector::cancel  )  [signal]
 

void OFileSelector::closeMe  )  [signal]
 

QStringList OFileSelector::currentMimeType  )  const [private]
 

Definition at line 882 of file ofileselector.cpp.

References m_cmbMime, and m_mimeType.

OFileViewInterface * OFileSelector::currentView  )  const [private]
 

Definition at line 856 of file ofileselector.cpp.

References m_current.

Referenced by directory(), Opie::Ui::OFileSelector::directory(), fileCount(), Opie::Ui::OFileSelector::fileCount(), reread(), Opie::Ui::OFileSelector::reread(), selected(), Opie::Ui::OFileSelector::selected(), selectedDocument(), Opie::Ui::OFileSelector::selectedDocument(), selectedName(), Opie::Ui::OFileSelector::selectedName(), selectedPath(), Opie::Ui::OFileSelector::selectedPath(), setCloseVisible(), Opie::Ui::OFileSelector::setCloseVisible(), setNewVisible(), and Opie::Ui::OFileSelector::setNewVisible().

QString OFileSelector::directory  )  const
 

Returns:
the directory name

Definition at line 832 of file ofileselector.cpp.

References currentView().

void OFileSelector::dirSelected const QString  )  [signal]
 

dirSelected is emitted whenever changed into a different dir

bool OFileSelector::eventFilter QObject *  o,
QEvent *  e
[private, slot]
 

Definition at line 751 of file ofileselector.cpp.

References KeyPress, and ok().

int OFileSelector::fileCount  )  const
 

Returns:
the number of items for the current view

Definition at line 846 of file ofileselector.cpp.

References currentView().

void OFileSelector::fileSelected const QString  )  [signal]
 

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

void OFileSelector::fileSelected const DocLnk  )  [signal]
 

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

Referenced by slotDocLnkBridge(), Opie::Ui::OFileSelector::slotDocLnkBridge(), slotFileBridge(), and Opie::Ui::OFileSelector::slotFileBridge().

void OFileSelector::initMime  )  [private]
 

Definition at line 768 of file ofileselector.cpp.

References QMap< Key, T >::begin(), QMap< Key, T >::end(), m_cmbMime, m_mimeType, and slotMimeTypeChanged().

Referenced by OFileSelector().

void OFileSelector::initUI  )  [private]
 

Definition at line 729 of file ofileselector.cpp.

References m_cmbBox, m_cmbMime, m_cmbView, m_lneEdit, m_nameBox, m_stack, and tr.

Referenced by OFileSelector().

void OFileSelector::initViews  )  [private]
 

Definition at line 779 of file ofileselector.cpp.

References in, QMap< Key, T >::insert(), m_cmbView, m_views, slotViewChange(), and tr.

Referenced by OFileSelector().

MimeTypes OFileSelector::mimeTypes  )  const [private]
 

Definition at line 865 of file ofileselector.cpp.

References m_mimeType.

int OFileSelector::mode  )  const
 

Returns:
the Mode of the OFileSelector

Definition at line 872 of file ofileselector.cpp.

References m_mode.

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

Referenced by eventFilter(), and Opie::Ui::OFileSelector::eventFilter().

void OFileSelector::reread  ) 
 

Returns:
reparse the file content

Definition at line 853 of file ofileselector.cpp.

References currentView().

Referenced by slotMimeTypeChanged(), and Opie::Ui::OFileSelector::slotMimeTypeChanged().

const DocLnk * OFileSelector::selected void   ) 
 

Convience function for the fileselector make sure to delete the DocLnk

See also:
DocLnk
Todo:
remove in ODP

Definition at line 809 of file ofileselector.cpp.

References currentView(), and selectedDocument().

DocLnk OFileSelector::selectedDocument  )  const
 

Returns:
a DocLnk for the selected document

Definition at line 839 of file ofileselector.cpp.

References currentView().

Referenced by selected(), and Opie::Ui::OFileSelector::selected().

QString OFileSelector::selectedName  )  const
 

Returns:
the name of the selected file

Definition at line 818 of file ofileselector.cpp.

References currentView().

QString OFileSelector::selectedPath  )  const
 

Returns:
the selected path

Definition at line 825 of file ofileselector.cpp.

References currentView().

int OFileSelector::selector  )  const
 

Returns:
the Selector of the OFileSelector

Definition at line 879 of file ofileselector.cpp.

References m_selector.

void OFileSelector::setCloseVisible bool  b  ) 
 

Set the Icon visible

Definition at line 920 of file ofileselector.cpp.

References currentView(), and m_shClose.

void OFileSelector::setNameVisible bool  b  ) 
 

Set the Name Line visible

Definition at line 924 of file ofileselector.cpp.

References m_nameBox.

void OFileSelector::setNewVisible bool  b  ) 
 

Set the Icon visible

Parameters:
b Show or Hide the New Button

Definition at line 916 of file ofileselector.cpp.

References currentView(), and m_shNew.

bool OFileSelector::showClose  )  const [private]
 

Definition at line 862 of file ofileselector.cpp.

References m_shClose.

bool OFileSelector::showNew  )  const [private]
 

Definition at line 859 of file ofileselector.cpp.

References m_shNew.

void OFileSelector::slotDocLnkBridge const DocLnk  )  [private, slot]
 

Definition at line 888 of file ofileselector.cpp.

References fileSelected(), m_lneEdit, and AppLnk::name().

void OFileSelector::slotFileBridge const QString  )  [private, slot]
 

Definition at line 893 of file ofileselector.cpp.

References fileSelected().

void OFileSelector::slotMimeTypeChanged  )  [private, slot]
 

Definition at line 885 of file ofileselector.cpp.

References reread().

Referenced by initMime(), and Opie::Ui::OFileSelector::initMime().

void OFileSelector::slotViewChange const QString  )  [private, slot]
 

Definition at line 897 of file ofileselector.cpp.

References OFileViewInterface::activate(), m_current, m_stack, m_views, OFileViewInterface::reread(), and OFileViewInterface::widget().

Referenced by initViews(), Opie::Ui::OFileSelector::initViews(), and OFileSelector().


Friends And Related Function Documentation

friend class OFileViewFileListView [friend]
 

Definition at line 70 of file ofileselector.h.

friend class OFileViewInterface [friend]
 

Definition at line 68 of file ofileselector.h.


Member Data Documentation

Data* OFileSelector::d [private]
 

Definition at line 195 of file ofileselector.h.

QHBox* OFileSelector::m_cmbBox [private]
 

Definition at line 189 of file ofileselector.h.

Referenced by initUI(), and Opie::Ui::OFileSelector::initUI().

QComboBox * OFileSelector::m_cmbMime [private]
 

Definition at line 179 of file ofileselector.h.

Referenced by currentMimeType(), Opie::Ui::OFileSelector::currentMimeType(), initMime(), Opie::Ui::OFileSelector::initMime(), initUI(), and Opie::Ui::OFileSelector::initUI().

QComboBox* OFileSelector::m_cmbView [private]
 

Definition at line 179 of file ofileselector.h.

Referenced by initUI(), Opie::Ui::OFileSelector::initUI(), initViews(), Opie::Ui::OFileSelector::initViews(), and OFileSelector().

OFileViewInterface* OFileSelector::m_current [private]
 

Definition at line 182 of file ofileselector.h.

Referenced by currentView(), Opie::Ui::OFileSelector::currentView(), OFileSelector(), slotViewChange(), and Opie::Ui::OFileSelector::slotViewChange().

QLineEdit* OFileSelector::m_lneEdit [private]
 

Definition at line 178 of file ofileselector.h.

Referenced by initUI(), Opie::Ui::OFileSelector::initUI(), OFileSelector(), slotDocLnkBridge(), and Opie::Ui::OFileSelector::slotDocLnkBridge().

MimeTypes OFileSelector::m_mimeType [private]
 

Definition at line 185 of file ofileselector.h.

Referenced by currentMimeType(), Opie::Ui::OFileSelector::currentMimeType(), initMime(), Opie::Ui::OFileSelector::initMime(), mimeTypes(), Opie::Ui::OFileSelector::mimeTypes(), and OFileSelector().

int OFileSelector::m_mode [private]
 

Definition at line 192 of file ofileselector.h.

Referenced by Opie::Ui::OFileSelector::initViews(), mode(), Opie::Ui::OFileSelector::mode(), and OFileSelector().

QHBox* OFileSelector::m_nameBox [private]
 

Definition at line 188 of file ofileselector.h.

Referenced by initUI(), Opie::Ui::OFileSelector::initUI(), setNameVisible(), and Opie::Ui::OFileSelector::setNameVisible().

int OFileSelector::m_selector [private]
 

Definition at line 193 of file ofileselector.h.

Referenced by OFileSelector(), selector(), and Opie::Ui::OFileSelector::selector().

bool OFileSelector::m_shClose [private]
 

Definition at line 184 of file ofileselector.h.

Referenced by OFileSelector(), setCloseVisible(), Opie::Ui::OFileSelector::setCloseVisible(), showClose(), and Opie::Ui::OFileSelector::showClose().

bool OFileSelector::m_shNew [private]
 

Definition at line 183 of file ofileselector.h.

Referenced by OFileSelector(), setNewVisible(), Opie::Ui::OFileSelector::setNewVisible(), showNew(), and Opie::Ui::OFileSelector::showNew().

QWidgetStack* OFileSelector::m_stack [private]
 

Definition at line 180 of file ofileselector.h.

Referenced by initUI(), Opie::Ui::OFileSelector::initUI(), slotViewChange(), and Opie::Ui::OFileSelector::slotViewChange().

QString OFileSelector::m_startDir [private]
 

Definition at line 191 of file ofileselector.h.

Referenced by OFileSelector().

QMap<QString, OFileViewInterface*> OFileSelector::m_views [private]
 

Definition at line 187 of file ofileselector.h.

Referenced by initViews(), Opie::Ui::OFileSelector::initViews(), slotViewChange(), and Opie::Ui::OFileSelector::slotViewChange().


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