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

tableviewer.h

Go to the documentation of this file.
00001 /**********************************************************************
00002 ** Copyright (C) 2000 Trolltech AS.  All rights reserved.
00003 **
00004 ** This file is part of Qtopia Environment.
00005 **
00006 ** This file may be distributed and/or modified under the terms of the
00007 ** GNU General Public License version 2 as published by the Free Software
00008 ** Foundation and appearing in the file LICENSE.GPL included in the
00009 ** packaging of this file.
00010 **
00011 ** This file is provided AS IS with NO WARRANTY OF ANY KIND, INCLUDING THE
00012 ** WARRANTY OF DESIGN, MERCHANTABILITY AND FITNESS FOR A PARTICULAR PURPOSE.
00013 **
00014 ** See http://www.trolltech.com/gpl/ for GPL licensing information.
00015 **
00016 ** Contact info@trolltech.com if any conditions of this licensing are
00017 ** not clear to you.
00018 **
00019 **********************************************************************/
00020 #ifndef Tableviewer_H
00021 #define Tableviewer_H
00022 
00023 #include <qmainwindow.h>
00024 #include "db/common.h"
00025 #include <qpe/fileselector.h>
00026 
00027 /* Forward class declarations */
00028 class QWidgetStack;
00029 class QDialog;
00030 class QMenuBar;
00031 
00032 class TVListView;
00033 class TVBrowseView;
00034 class TVFilterView;
00035 class TVEditView;
00036 
00037 class DBStore;
00038 
00039 class TableViewerWindow: public QMainWindow
00040 {
00041     Q_OBJECT
00042 public:
00043     static QString appName() { return QString::fromLatin1("tableviewer"); }
00044     TableViewerWindow( QWidget *parent = 0, 
00045                         const char *name = 0, WFlags f = 0 );
00046     ~TableViewerWindow();
00047 
00048 public slots:
00049     void selectDocument();
00050 
00051     void newDocument();
00052     void saveDocument();
00053     void setDocument(const QString &);
00054     void openDocument(const DocLnk &);
00055 
00056     void firstItem();
00057     void lastItem();
00058     void nextItem();
00059     void previousItem();
00060 
00061     void listViewSlot();
00062     void browseViewSlot();
00063     void filterViewSlot();
00064 
00065     void editItemSlot();
00066     void newItemSlot();
00067     void deleteItemSlot();
00068 
00069     void editKeysSlot();
00070 
00071     /* reveiw the sig. for this function TODO */
00072     void searchOnKey(int, TVVariant);
00073     void setPrimaryKey(int);
00074 
00075 /* TODO add new event */
00076 protected:
00077 
00078 /* TODO add new slots */
00079 private slots:
00080 
00081 /* TODO add other widgets used here */
00082 private:
00083     bool dirty;
00084 
00085     QMenuBar *menu;
00086     QToolBar *navigation;
00087 
00088     TVListView *listView;
00089     TVBrowseView *browseView;
00090     TVFilterView *filterView;
00091     TVEditView *editView;
00092     FileSelector *fileSelector;
00093 
00094     DocLnk doc;
00095 
00096     QWidgetStack *cw;
00097     DBStore *ds;
00098     TableState ts; /* not a pointer.. this class keeps the state */
00099 
00100     enum UserState {
00101         BrowseState = 0,
00102         ListState,
00103         FilterState,
00104         EditState,
00105   FileState,
00106     };
00107 
00108     UserState current_view;
00109 
00110     void applyFilter();
00111 };
00112 
00113 #endif

Generated on Sat Nov 5 16:17:08 2005 for OPIE by  doxygen 1.4.2