Qtopia library API Documentation

FileSelector Class Reference

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

#include <fileselector.h>

Inheritance diagram for FileSelector:

Inheritance graph
[legend]
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)
void setTypeComboVisible (bool b=TRUE)
void setCategorySelectVisible (bool b=TRUE)
void reread ()
int fileCount ()
DocLnk selectedDocument () const
QValueList< DocLnkfileList () const

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 48 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 283 of file fileselector.cpp.

References QWhatsThis::add(), QToolTip::add(), closeMe(), QObject::connect(), Categories::load(), QHBox::QHBox(), QWidget::QWidget(), reread(), QWidget::setBackgroundMode(), setCloseVisible(), QWidget::setFixedSize(), QFrame::setMargin(), QButton::setPixmap(), QHBox::setSpacing(), QPEApplication::setStylusOperation(), and QObject::tr().

FileSelector::~FileSelector  ) 
 

Destroys the widget.

Definition at line 350 of file fileselector.cpp.


Member Function Documentation

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 473 of file fileselector.cpp.

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 489 of file fileselector.cpp.

Referenced by FileSelector().

void FileSelector::reread  ) 
 

Rereads the list of documents.

Definition at line 519 of file fileselector.cpp.

References Global::findDocuments().

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 360 of file fileselector.cpp.

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

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

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.

void FileSelector::closeMe  )  [signal]
 

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

Referenced by FileSelector().


The documentation for this class was generated from the following files:
KDE Logo
This file is part of the documentation for OPIE Version 1.5.5.
Documentation copyright © 1997-2003 the KDE developers. 2003 OPIE developers
Generated on Tue Feb 10 20:24:20 2004 by doxygen 1.3.5 written by Dimitri van Heesch, © 1997-2001