summaryrefslogtreecommitdiff
path: root/libopie/ofileselector.cpp
authorzecke <zecke>2004-02-02 16:05:42 (UTC)
committer zecke <zecke>2004-02-02 16:05:42 (UTC)
commit44e49951c71b277bd05ecc9857ec39d73a61b35e (patch) (side-by-side diff)
tree1e55939962663d1b135bc4a23f5458d9751880bc /libopie/ofileselector.cpp
parent63746d6ac570b5935a75556a05fe92dacbc2d6ae (diff)
downloadopie-44e49951c71b277bd05ecc9857ec39d73a61b35e.zip
opie-44e49951c71b277bd05ecc9857ec39d73a61b35e.tar.gz
opie-44e49951c71b277bd05ecc9857ec39d73a61b35e.tar.bz2
Add some API Docu
Diffstat (limited to 'libopie/ofileselector.cpp') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/ofileselector.cpp78
1 files changed, 78 insertions, 0 deletions
diff --git a/libopie/ofileselector.cpp b/libopie/ofileselector.cpp
index 577e916..9afe9c7 100644
--- a/libopie/ofileselector.cpp
+++ b/libopie/ofileselector.cpp
@@ -628,6 +628,35 @@ void OFileViewFileSystem::activate( const QString& str) {
}
/* Selector */
+/**
+ * @short 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.
+ *
+ * <pre>
+ * QMap<QString, QStringList> mimeTypes;
+ * QStringList types;
+ * types << "text[slash]* ";
+ * types << "audio[slash]*";
+ * mimeTypes.insert( tr("Audio and Text"), types );
+ * mimeTypes.insert( tr("All"), "*[slash]*);
+ *
+ * now you could create your fileselector
+ * </pre>
+ *
+ *
+ * @param parent the parent of this widget
+ * @param mode The mode from the enum Mode (Open,Save,FILESELECTOR)
+ * @param sel The selector to be used
+ * @param dirName The name of the dir to start int
+ * @param fileName The fileName placed in the fileselector lineedit
+ * @param mimetypes The MimeType map of used mimetypes
+ * @param showNew Show a New Button. Most likely to be used in the FileSelector view.
+ * @param showClose Show a Close Button. Most likely to be used in FileSelector view.
+ *
+ */
OFileSelector::OFileSelector( QWidget* parent, int mode, int sel,
const QString& dirName, const QString& fileName,
const MimeTypes& mimetypes,
@@ -667,6 +696,10 @@ OFileSelector::OFileSelector( QWidget* parent, int mode, int sel,
slotViewChange( str );
}
+
+/**
+ * This a convience c'tor to just substitute the use of FileSelector
+ */
OFileSelector::OFileSelector( const QString& mimeFilter, QWidget* parent, const char* name,
bool showNew, bool showClose )
: QWidget( parent, name )
@@ -763,28 +796,65 @@ void OFileSelector::initViews() {
m_views.insert( QObject::tr("Files"), in );
m_views.insert( QObject::tr("All Files"), in );
}
+
+/**
+ * d'tor
+ */
OFileSelector::~OFileSelector() {
}
+
+/**
+ * Convience function for the fileselector
+ * make sure to delete the DocLnk
+ *
+ * @see DocLnk
+ * @todo remove in ODP
+ */
const DocLnk* OFileSelector::selected() {
DocLnk* lnk = new DocLnk( currentView()->selectedDocument() );
return lnk;
}
+
+/**
+ *
+ * @return the name of the selected file
+ */
QString OFileSelector::selectedName()const{
return currentView()->selectedName();
}
+
+/**
+ * @return the selected path
+ */
QString OFileSelector::selectedPath()const {
return currentView()->selectedPath();
}
+
+/**
+ * @return the directory name
+ */
QString OFileSelector::directory()const {
return currentView()->directory();
}
+
+/**
+ * @return a DocLnk for the selected document
+ */
DocLnk OFileSelector::selectedDocument()const {
return currentView()->selectedDocument();
}
+
+/**
+ * @return the number of items for the current view
+ */
int OFileSelector::fileCount()const {
return currentView()->fileCount();
}
+
+/**
+ * @return reparse the file content
+ */
void OFileSelector::reread() {
return currentView()->reread();
}
@@ -800,9 +870,17 @@ bool OFileSelector::showClose()const {
MimeTypes OFileSelector::mimeTypes()const {
return m_mimeType;
}
+
+/**
+ * @return the Mode of the OFileSelector
+ */
int OFileSelector::mode()const{
return m_mode;
}
+
+/**
+ * @return the Selector of the OFileSelector
+ */
int OFileSelector::selector()const{
return m_selector;
}