summaryrefslogtreecommitdiff
path: root/libopie2/opieui/fileselector
Unidiff
Diffstat (limited to 'libopie2/opieui/fileselector') (more/less context) (show whitespace changes)
-rw-r--r--libopie2/opieui/fileselector/ofileselector.cpp5
-rw-r--r--libopie2/opieui/fileselector/ofileselector.h12
-rw-r--r--libopie2/opieui/fileselector/ofileselector_p.h2
3 files changed, 10 insertions, 9 deletions
diff --git a/libopie2/opieui/fileselector/ofileselector.cpp b/libopie2/opieui/fileselector/ofileselector.cpp
index c4d5033..a9ec8c4 100644
--- a/libopie2/opieui/fileselector/ofileselector.cpp
+++ b/libopie2/opieui/fileselector/ofileselector.cpp
@@ -1,12 +1,13 @@
1
1/* 2/*
2               =. This file is part of the OPIE Project 3               =. This file is part of the OPIE Project
3             .=l. Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org> 4             .=l. Copyright (C) 2002,2003 Holger Freyther <zecke@handhelds.org>
4           .>+-= 5           .>+-=
5 _;:,     .>    :=|. This library is free software; you can 6 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under 7.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public 8:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software 9.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License, 10 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version. 11     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_. 12    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that 13    .i_,=:_.      -<s. This library is distributed in the hope that
@@ -46,29 +47,29 @@
46#include <qdir.h> 47#include <qdir.h>
47#include <qhbox.h> 48#include <qhbox.h>
48#include <qheader.h> 49#include <qheader.h>
49#include <qlabel.h> 50#include <qlabel.h>
50#include <qlayout.h> 51#include <qlayout.h>
51#include <qlineedit.h> 52#include <qlineedit.h>
52#include <qlistview.h> 53#include <qlistview.h>
53#include <qpopupmenu.h> 54#include <qpopupmenu.h>
54#include <qwidgetstack.h> 55#include <qwidgetstack.h>
55#include <qregexp.h> 56#include <qregexp.h>
56#include <qobjectlist.h> 57#include <qobjectlist.h>
57 58
58using namespace Opie::Ui::Private; 59using namespace Opie::Ui::Internal;
59 60
60namespace Opie { 61namespace Opie {
61namespace Ui { 62namespace Ui {
62namespace Private { 63namespace Internal {
63OFileViewInterface::OFileViewInterface( OFileSelector* selector ) 64OFileViewInterface::OFileViewInterface( OFileSelector* selector )
64 : m_selector( selector ) 65 : m_selector( selector )
65{} 66{}
66 67
67OFileViewInterface::~OFileViewInterface() 68OFileViewInterface::~OFileViewInterface()
68{} 69{}
69 70
70QString OFileViewInterface::name()const 71QString OFileViewInterface::name()const
71{ 72{
72 return m_name; 73 return m_name;
73} 74}
74 75
diff --git a/libopie2/opieui/fileselector/ofileselector.h b/libopie2/opieui/fileselector/ofileselector.h
index 2205963..8bcd9ee 100644
--- a/libopie2/opieui/fileselector/ofileselector.h
+++ b/libopie2/opieui/fileselector/ofileselector.h
@@ -46,46 +46,46 @@
46#include <qstringlist.h> 46#include <qstringlist.h>
47 47
48class QLineEdit; 48class QLineEdit;
49class QComboBox; 49class QComboBox;
50class QWidgetStack; 50class QWidgetStack;
51class QHBox; 51class QHBox;
52 52
53typedef QMap<QString, QStringList> MimeTypes; 53typedef QMap<QString, QStringList> MimeTypes;
54 54
55namespace Opie { 55namespace Opie {
56namespace Ui { 56namespace Ui {
57 57
58namespace Private { 58namespace Internal {
59class OFileViewInterface; 59class OFileViewInterface;
60class OFileViewFileListView; 60class OFileViewFileListView;
61} 61}
62 62
63 63
64/** 64/**
65 * @short a dropin replacement for the FileSelector 65 * @short a dropin replacement for the FileSelector
66 * 66 *
67 * This class is first used insert the OFileDialog. 67 * This class is first used insert the OFileDialog.
68 * It supports multiple view and mimetype filtering for now. 68 * It supports multiple view and mimetype filtering for now.
69 * 69 *
70 * @see OFileDialog 70 * @see OFileDialog
71 * @see FileSelector 71 * @see FileSelector
72 * @author zecke 72 * @author zecke
73 * @version 0.1 73 * @version 0.1
74 */ 74 */
75class OFileSelector : public QWidget 75class OFileSelector : public QWidget
76{ 76{
77 Q_OBJECT 77 Q_OBJECT
78 friend class Private::OFileViewInterface; 78 friend class Internal::OFileViewInterface;
79 friend class Private::OFileViewFileListView; 79 friend class Internal::OFileViewFileListView;
80 80
81public: 81public:
82 /** 82 /**
83 * The Mode of the Fileselector 83 * The Mode of the Fileselector
84 * Open = Open A File 84 * Open = Open A File
85 * Save = Save a File 85 * Save = Save a File
86 * FILESELECTOR = As A GUI in a screen to select a file 86 * FILESELECTOR = As A GUI in a screen to select a file
87 */ 87 */
88 enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 }; 88 enum Mode { Open=1, Save=2, FileSelector=4, OPEN=1, SAVE=2, FILESELECTOR=4 };
89 // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 }; 89 // enum OldMode { OPEN=1, SAVE=2, FILESELECTOR = 4 };
90 /** 90 /**
91 * Normal = The old FileSelector 91 * Normal = The old FileSelector
@@ -178,31 +178,31 @@ private:
178private: 178private:
179 /* inits the Widgets */ 179 /* inits the Widgets */
180 void initUI(); 180 void initUI();
181 /* inits the MimeType ComboBox content + connects signals and slots */ 181 /* inits the MimeType ComboBox content + connects signals and slots */
182 void initMime(); 182 void initMime();
183 /* init the Views :) */ 183 /* init the Views :) */
184 void initViews(); 184 void initViews();
185 185
186private: 186private:
187 QLineEdit* m_lneEdit; // the LineEdit for the Name 187 QLineEdit* m_lneEdit; // the LineEdit for the Name
188 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType 188 QComboBox *m_cmbView, *m_cmbMime; // two ComboBoxes to select the View and MimeType
189 QWidgetStack* m_stack; // our widget stack which will contain the views 189 QWidgetStack* m_stack; // our widget stack which will contain the views
190 Private::OFileViewInterface* currentView() const; // returns the currentView 190 Internal::OFileViewInterface* currentView() const; // returns the currentView
191 Private::OFileViewInterface* m_current; // here is the view saved 191 Internal::OFileViewInterface* m_current; // here is the view saved
192 bool m_shNew : 1; // should we show New? 192 bool m_shNew : 1; // should we show New?
193 bool m_shClose : 1; // should we show Close? 193 bool m_shClose : 1; // should we show Close?
194 MimeTypes m_mimeType; // list of mimetypes 194 MimeTypes m_mimeType; // list of mimetypes
195 195
196 QMap<QString, Private::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr 196 QMap<QString, Internal::OFileViewInterface*> m_views; // QString translated view name + ViewInterface Ptr
197 QHBox* m_nameBox; // the LineEdit + Label is hold here 197 QHBox* m_nameBox; // the LineEdit + Label is hold here
198 QHBox* m_cmbBox; // this holds the two combo boxes 198 QHBox* m_cmbBox; // this holds the two combo boxes
199 199
200 QString m_startDir; 200 QString m_startDir;
201 int m_mode; 201 int m_mode;
202 int m_selector; 202 int m_selector;
203 203
204 struct Data; // used for future versions 204 struct Data; // used for future versions
205 Data *d; 205 Data *d;
206 206
207private slots: 207private slots:
208 void slotMimeTypeChanged(); 208 void slotMimeTypeChanged();
diff --git a/libopie2/opieui/fileselector/ofileselector_p.h b/libopie2/opieui/fileselector/ofileselector_p.h
index 376dc98..a3ef8e2 100644
--- a/libopie2/opieui/fileselector/ofileselector_p.h
+++ b/libopie2/opieui/fileselector/ofileselector_p.h
@@ -50,25 +50,25 @@
50 * I'll take c) -zecke 50 * I'll take c) -zecke
51 */ 51 */
52 52
53typedef QMap<QString, QStringList> MimeTypes; 53typedef QMap<QString, QStringList> MimeTypes;
54 54
55/* the View Interface */ 55/* the View Interface */
56class QFileInfo; 56class QFileInfo;
57class QToolButton; 57class QToolButton;
58 58
59namespace Opie{ 59namespace Opie{
60namespace Ui{ 60namespace Ui{
61class OFileSelector; 61class OFileSelector;
62namespace Private { 62namespace Internal {
63 63
64class OFileViewInterface 64class OFileViewInterface
65{ 65{
66public: 66public:
67 OFileViewInterface( OFileSelector* selector ); 67 OFileViewInterface( OFileSelector* selector );
68 virtual ~OFileViewInterface(); 68 virtual ~OFileViewInterface();
69 virtual QString selectedName()const = 0; 69 virtual QString selectedName()const = 0;
70 virtual QString selectedPath()const = 0; 70 virtual QString selectedPath()const = 0;
71 virtual QString directory()const = 0; 71 virtual QString directory()const = 0;
72 virtual void reread() = 0; 72 virtual void reread() = 0;
73 virtual int fileCount()const = 0; 73 virtual int fileCount()const = 0;
74 virtual DocLnk selectedDocument()const; 74 virtual DocLnk selectedDocument()const;