summaryrefslogtreecommitdiff
authorzecke <zecke>2002-04-27 22:49:18 (UTC)
committer zecke <zecke>2002-04-27 22:49:18 (UTC)
commitdb95cde435e507833f58111237f86cb9f9ac927a (patch) (unidiff)
treeffc8883ee58398e99d47e5209affd5a451d579ed
parent8e3c0aa915801b862f97ba7a7598ef5f3bd350aa (diff)
downloadopie-db95cde435e507833f58111237f86cb9f9ac927a.zip
opie-db95cde435e507833f58111237f86cb9f9ac927a.tar.gz
opie-db95cde435e507833f58111237f86cb9f9ac927a.tar.bz2
View Interface
Diffstat (more/less context) (ignore whitespace changes)
-rw-r--r--libopie/libopie.pro2
-rw-r--r--libopie/ofileselector.cc1
-rw-r--r--libopie/ofileview.h79
3 files changed, 81 insertions, 1 deletions
diff --git a/libopie/libopie.pro b/libopie/libopie.pro
index b2ecd07..ba64bda 100644
--- a/libopie/libopie.pro
+++ b/libopie/libopie.pro
@@ -1,8 +1,8 @@
1TEMPLATE = lib 1TEMPLATE = lib
2CONFIG += qte warn_on release 2CONFIG += qte warn_on release
3 HEADERS = ofontmenu.h ofileselector.h ofiledialog.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h colordialog.h colorpopupmenu.h 3 HEADERS = ofontmenu.h ofileselector.h ofiledialog.h ofileview.h tododb.h todoevent.h todoresource.h todovcalresource.h xmltree.h colordialog.h colorpopupmenu.h
4 SOURCES = ofontmenu.cc ofileselector.cc ofiledialog.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp colordialog.cpp colorpopupmenu.cpp 4 SOURCES = ofontmenu.cc ofileselector.cc ofiledialog.cc xmltree.cc tododb.cpp todoevent.cpp todovcalresource.cpp colordialog.cpp colorpopupmenu.cpp
5 TARGET = opie 5 TARGET = opie
6INCLUDEPATH += $(OPIEDIR)/include 6INCLUDEPATH += $(OPIEDIR)/include
7DESTDIR = $(QTDIR)/lib$(PROJMAK) 7DESTDIR = $(QTDIR)/lib$(PROJMAK)
8#VERSION = 1.0.0 8#VERSION = 1.0.0
diff --git a/libopie/ofileselector.cc b/libopie/ofileselector.cc
index 0a6e595..0e508af 100644
--- a/libopie/ofileselector.cc
+++ b/libopie/ofileselector.cc
@@ -49,24 +49,25 @@
49#include <qpe/fileselector.h> 49#include <qpe/fileselector.h>
50#include <qpe/applnk.h> 50#include <qpe/applnk.h>
51#include <qpe/global.h> 51#include <qpe/global.h>
52#include <qpe/mimetype.h> 52#include <qpe/mimetype.h>
53#include <qpe/resource.h> 53#include <qpe/resource.h>
54#include <qpe/storage.h> 54#include <qpe/storage.h>
55 55
56#include <unistd.h> 56#include <unistd.h>
57#include <stdlib.h> 57#include <stdlib.h>
58#include <sys/stat.h> 58#include <sys/stat.h>
59 59
60#include "ofileselector.h" 60#include "ofileselector.h"
61//#include "ofileview.h"
61 62
62QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0; 63QMap<QString,QPixmap> *OFileSelector::m_pixmaps = 0;
63 64
64namespace { 65namespace {
65 66
66 int indexByString( const QComboBox *box, const QString &str ){ 67 int indexByString( const QComboBox *box, const QString &str ){
67 int index= -1; 68 int index= -1;
68 for(int i= 0; i < box->count(); i++ ){ 69 for(int i= 0; i < box->count(); i++ ){
69 if( str == box->text(i ) ){ 70 if( str == box->text(i ) ){
70 index= i; 71 index= i;
71 break; 72 break;
72 } 73 }
diff --git a/libopie/ofileview.h b/libopie/ofileview.h
new file mode 100644
index 0000000..48a71ca
--- a/dev/null
+++ b/libopie/ofileview.h
@@ -0,0 +1,79 @@
1/*
2               =. This file is part of the OPIE Project
3             .=l. Copyright (c) 2002 zecke <zecke@handhelds.org>
4           .>+-=
5 _;:,     .>    :=|. This library is free software; you can
6.> <`_,   >  .   <= redistribute it and/or modify it under
7:`=1 )Y*s>-.--   : the terms of the GNU Library General Public
8.="- .-=="i,     .._ License as published by the Free Software
9 - .   .-<_>     .<> Foundation; either version 2 of the License,
10     ._= =}       : or (at your option) any later version.
11    .%`+i>       _;_.
12    .i_,=:_.      -<s. This library is distributed in the hope that
13     +  .  -:.       = it will be useful, but WITHOUT ANY WARRANTY;
14    : ..    .:,     . . . without even the implied warranty of
15    =_        +     =;=|` MERCHANTABILITY or FITNESS FOR A
16  _.=:.       :    :=>`: PARTICULAR PURPOSE. See the GNU
17..}^=.=       =       ; Library General Public License for more
18++=   -.     .`     .: details.
19 :     =  ...= . :.=-
20 -.   .:....=;==+<; You should have received a copy of the GNU
21  -_. . .   )=.  = Library General Public License along with
22    --        :-=` this library; see the file COPYING.LIB.
23 If not, write to the Free Software Foundation,
24 Inc., 59 Temple Place - Suite 330,
25 Boston, MA 02111-1307, USA.
26
27*/
28
29#ifndef ofileview_h
30#define ofileview_h
31
32#include <qobject.h>
33#include <qwidget.h>
34
35class QFileInfo;
36class QDir;
37class DocLnk;
38class OFileSelectorView : public QWidget {
39 Q_OBJECT
40 public:
41 OFileSelectorView(QWidget *widget,
42 const char *name )
43 : QWidget(widget, name )
44{ };
45 virtual ~OFileSelectorView();
46
47 virtual void addFile(const QString &mine,
48 QFileInfo *info,
49 bool isSymlink = FALSE ) = 0;
50
51 virtual void addDir (const QString &mine,
52 QFileInfo *info,
53 bool isSymlink = FALSE ) = 0;
54
55 virtual void addSymlink(const QString &mime,
56 QFileInfo *info,
57 bool isSymlink = FALSE ) = 0;
58
59 virtual void cd(const QString &path );
60 signals:
61 void fileSelected(const QString &);
62 void fileSelected(const DocLnk & );
63 void contextMenu();
64 void changedDir(const QString &);
65 void changedDir(const QDir & );
66};
67
68class OFileViewFactory {
69 // Q_OBJECT
70 public:
71 OFileViewFactory() {} ;
72 virtual ~OFileViewFactory();
73
74 OFileSelectorView* newView(QWidget *parent, const char *name );
75 QString name()const;
76};
77
78
79#endif