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

FileSelector Class Reference

The FileSelector widget allows the user to select DocLnk objects. More...

#include </home/clem/local/src/opie/library/fileselector.h>

Collaboration diagram for FileSelector:

Collaboration graph
[legend]
List of all members.

Signals

void fileSelected (const DocLnk &)
void newSelected (const DocLnk &)
void closeMe ()

Public Member Functions

 FileSelector (const QString &mimefilter, QWidget *parent, const char *name=0, bool newVisible=TRUE, bool closeVisible=TRUE)
 ~FileSelector ()
void setNewVisible (bool b)
void setCloseVisible (bool b) QPE_DEPRECATED
void setTypeComboVisible (bool b=TRUE)
void setCategorySelectVisible (bool b=TRUE)
void reread ()
int fileCount ()
DocLnk selectedDocument () const
QValueList< DocLnkfileList () const

Private Slots

void createNew ()
void fileClicked (int, QListViewItem *, const QPoint &, int)
void filePressed (int, QListViewItem *, const QPoint &, int)
void fileClicked (QListViewItem *)
void typeSelected (const QString &type)
void catSelected (int)
void cardMessage (const QCString &, const QByteArray &)

Private Member Functions

void updateView ()
void updateWhatsThis ()
const DocLnkselected () QPE_DEPRECATED

Private Attributes

FileSelectorViewview
QString filter
QToolButton * buttonNew
QToolButton * buttonClose
FileSelectorPrivated

Detailed Description

The FileSelector widget allows the user to select DocLnk objects.

This class presents a file selection dialog to the user. This widget is usually the first widget seen in a document-oriented application. The developer will most often create this widget in combination with a QWidgetStack and the appropriate editor and/or viewer widget for their application. This widget should be shown first and the user can the select which document they wish to operate on. Please refer to the implementation of texteditor for an example of how to tie these classes together.

Use setNewVisible() depending on whether the application can be used to create new files or not. Use setCloseVisible() depending on whether the user may leave the dialog without creating or selecting a document or not. The number of files in the view is available from fileCount(). To force the view to be updated call reread().

If the user presses the 'New Document' button the newSelected() signal is emitted. If the user selects an existing file the fileSelected() signal is emitted. The selected file's DocLnk is available from the selected() function. If the file selector is no longer necessary the closeMe() signal is emitted.

See also:
FileManager

Definition at line 49 of file fileselector.h.


Constructor & Destructor Documentation

FileSelector::FileSelector const QString f,
QWidget *  parent,
const char *  name = 0,
bool  newVisible = TRUE,
bool  closeVisible = TRUE
 

Constructs a FileSelector with mime filter f. The standard Qt parent and name parameters are passed to the parent widget.

If newVisible is TRUE, the widget has a button to allow the user the create "new" documents; this is useful for applications that can create and edit documents but not suitable for applications that only provide viewing.

closeVisible is deprecated

See also:
DocLnkSet::DocLnkSet()

Definition at line 281 of file fileselector.cpp.

References add, buttonClose, cardMessage(), categoryFileName(), FileSelectorPrivate::catId, FileSelectorPrivate::catSelect, catSelected(), channel, closeMe(), d, fileClicked(), filePressed(), Categories::load(), Resource::loadPixmap(), QPEMenuToolFocusManager::manager(), FileSelectorPrivate::newDocItem, reread(), QPEApplication::RightOnHold, selected(), CategorySelect::setAllCategories(), CategorySelect::setCategories(), setCloseVisible(), CategorySelect::setRemoveCategoryEdit(), QPEApplication::setStylusOperation(), FileSelectorPrivate::showNew, FileSelectorPrivate::toolbar, tr, TRUE, FileSelectorPrivate::typeCombo, typeSelected(), updateWhatsThis(), and view.

FileSelector::~FileSelector  ) 
 

Destroys the widget.

Definition at line 348 of file fileselector.cpp.

References d.


Member Function Documentation

void FileSelector::cardMessage const QCString ,
const QByteArray
[private, slot]
 

Definition at line 425 of file fileselector.cpp.

References reread().

Referenced by FileSelector().

void FileSelector::catSelected int   )  [private, slot]
 

Definition at line 419 of file fileselector.cpp.

References FileSelectorPrivate::catId, d, and updateView().

Referenced by FileSelector().

void FileSelector::closeMe  )  [signal]
 

This signal is emitted when the user no longer needs to view the widget.

Referenced by createNew(), fileClicked(), and FileSelector().

void FileSelector::createNew  )  [private, slot]
 

Calling this function is the programmatic equivalent of the user pressing the "new" button.

See also:
newSelected(), closeMe()

Definition at line 369 of file fileselector.cpp.

References closeMe(), f, and newSelected().

Referenced by fileClicked().

void FileSelector::fileClicked QListViewItem *   )  [private, slot]
 

Definition at line 398 of file fileselector.cpp.

References closeMe(), createNew(), d, fileSelected(), and FileSelectorPrivate::newDocItem.

void FileSelector::fileClicked int  ,
QListViewItem *  ,
const QPoint &  ,
int 
[private, slot]
 

Definition at line 376 of file fileselector.cpp.

References Qt::LeftButton.

Referenced by FileSelector().

int FileSelector::fileCount  ) 
 

Returns the number of files in the view. If this is zero, an editor application might bypass the selector and immediately start with a "new" document.

Definition at line 358 of file fileselector.cpp.

References DocLnkSet::children(), d, and FileSelectorPrivate::files.

Referenced by ODocumentFileView::fileCount(), and Opie::Ui::Internal::ODocumentFileView::fileCount().

QValueList<DocLnk> FileSelector::fileList  )  const [inline]
 

Definition at line 74 of file fileselector.h.

References QValueList< T >::append(), FileSelectorItem::file(), list, and view.

void FileSelector::filePressed int  ,
QListViewItem *  ,
const QPoint &  ,
int 
[private, slot]
 

Definition at line 385 of file fileselector.cpp.

References d, l, FileSelectorPrivate::newDocItem, prop, reread(), and Qt::RightButton.

Referenced by FileSelector().

void FileSelector::fileSelected const DocLnk f  )  [signal]
 

This signal is emitted when the user selects a document. f is the document.

Referenced by fileClicked().

void FileSelector::newSelected const DocLnk f  )  [signal]
 

This signal is emitted when the user selects a "new" document. f is a DocLnk for the document. You will need to set the type of the document after copying it.

Referenced by createNew().

void FileSelector::reread  ) 
 

Rereads the list of documents.

Definition at line 517 of file fileselector.cpp.

References AppLnkSet::clear(), d, FileSelectorPrivate::files, filter, Global::findDocuments(), TypeCombo::reread(), FileSelectorPrivate::typeCombo, and updateView().

Referenced by cardMessage(), PlayListWidget::deletePlaylist(), filePressed(), FileSelector(), ODocumentFileView::reread(), Opie::Ui::Internal::ODocumentFileView::reread(), TableViewerWindow::selectDocument(), MainWindow::selectorShow(), MainWindow::slotImportExcelOpen(), and PlayListWidget::tabChanged().

const DocLnk * FileSelector::selected  )  [private]
 

Returns the selected DocLnk. The caller is responsible for deleting the returned value.

Definition at line 436 of file fileselector.cpp.

References d, FileSelectorItem::file(), FileSelectorPrivate::newDocItem, NULL, and view.

Referenced by FileSelector().

DocLnk FileSelector::selectedDocument  )  const [inline]
 

Definition at line 62 of file fileselector.h.

Referenced by PlayListWidget::current(), PlayListWidget::deletePlaylist(), ODocumentFileView::selectedDocument(), Opie::Ui::Internal::ODocumentFileView::selectedDocument(), ODocumentFileView::selectedName(), and Opie::Ui::Internal::ODocumentFileView::selectedName().

void FileSelector::setCategorySelectVisible bool  b = TRUE  ) 
 

Definition at line 507 of file fileselector.cpp.

References FileSelectorPrivate::catSelect, and d.

void FileSelector::setCloseVisible bool  b  ) 
 

If b is TRUE a "close" or "no document" button is visible; if b is FALSE this button is not visible and the user is unable to leave the dialog without creating or selecting a document.

This function is deprecated.

Definition at line 487 of file fileselector.cpp.

References d, and FileSelectorPrivate::toolbar.

Referenced by FileSelector(), ODocumentFileView::reread(), Opie::Ui::Internal::ODocumentFileView::reread(), and TableViewerWindow::TableViewerWindow().

void FileSelector::setNewVisible bool  b  ) 
 

If b is TRUE a "new document" entry is visible; if b is FALSE this entry is not visible and the user is unable to create new documents from the dialog.

Definition at line 471 of file fileselector.cpp.

References d, FileSelectorPrivate::showNew, updateView(), and updateWhatsThis().

Referenced by ODocumentFileView::reread(), Opie::Ui::Internal::ODocumentFileView::reread(), and TableViewerWindow::TableViewerWindow().

void FileSelector::setTypeComboVisible bool  b = TRUE  ) 
 

Definition at line 498 of file fileselector.cpp.

References d, and FileSelectorPrivate::typeCombo.

void FileSelector::typeSelected const QString type  )  [private, slot]
 

Definition at line 410 of file fileselector.cpp.

References QValueList< T >::append(), QValueList< T >::begin(), QValueList< T >::clear(), d, QValueList< T >::end(), FALSE, FileSelectorPrivate::mimeFilters, QStringList::split(), TRUE, and updateView().

Referenced by FileSelector().

void FileSelector::updateView  )  [private]
 

Definition at line 525 of file fileselector.cpp.

References QValueList< T >::begin(), FileSelectorPrivate::catId, DocLnkSet::children(), QValueList< T >::count(), d, QValueList< T >::end(), FALSE, FileSelectorItem::file(), FileSelectorPrivate::files, FileSelectorPrivate::mimeFilters, FileSelectorPrivate::newDocItem, FileSelectorPrivate::showNew, TRUE, and view.

Referenced by catSelected(), reread(), setNewVisible(), and typeSelected().

void FileSelector::updateWhatsThis  )  [private]
 

Definition at line 568 of file fileselector.cpp.

References add, d, remove(), FileSelectorPrivate::showNew, text, and tr.

Referenced by FileSelector(), and setNewVisible().


Member Data Documentation

QToolButton * FileSelector::buttonClose [private]
 

Definition at line 112 of file fileselector.h.

Referenced by FileSelector().

QToolButton* FileSelector::buttonNew [private]
 

Definition at line 112 of file fileselector.h.

FileSelectorPrivate* FileSelector::d [private]
 

Definition at line 113 of file fileselector.h.

Referenced by catSelected(), fileClicked(), fileCount(), filePressed(), FileSelector(), reread(), selected(), setCategorySelectVisible(), setCloseVisible(), setNewVisible(), setTypeComboVisible(), typeSelected(), updateView(), updateWhatsThis(), and ~FileSelector().

QString FileSelector::filter [private]
 

Definition at line 111 of file fileselector.h.

Referenced by reread(), ODocumentFileView::reread(), and Opie::Ui::Internal::ODocumentFileView::reread().

FileSelectorView* FileSelector::view [private]
 

Definition at line 110 of file fileselector.h.

Referenced by fileList(), FileSelector(), selected(), and updateView().


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