kexi

kexidataawareview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005-2007 Jaroslaw Staniek <js@iidea.pl>
00003 
00004    This program is free software; you can redistribute it and/or
00005    modify it under the terms of the GNU Library General Public
00006    License as published by the Free Software Foundation; either
00007    version 2 of the License, or (at your option) any later version.
00008 
00009    This program is distributed in the hope that it will be useful,
00010    but WITHOUT ANY WARRANTY; without even the implied warranty of
00011    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
00012    Library General Public License for more details.
00013 
00014    You should have received a copy of the GNU Library General Public License
00015    along with this program; see the file COPYING.  If not, write to
00016    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
00017  * Boston, MA 02110-1301, USA.
00018 */
00019 
00020 #ifndef KEXIDATAAWAREVIEW_H
00021 #define KEXIDATAAWAREVIEW_H
00022 
00023 #include <kexiviewbase.h>
00024 #include <kexisearchandreplaceiface.h>
00025 
00026 class KexiDataAwareObjectInterface;
00027 class KexiSharedActionClient;
00028 
00041 class KEXIEXTWIDGETS_EXPORT KexiDataAwareView : public KexiViewBase, 
00042     public KexiSearchAndReplaceViewInterface
00043 {
00044     Q_OBJECT
00045 
00046     public:
00047         KexiDataAwareView(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0);
00048 
00049         QWidget* mainWidget();
00050 
00051         virtual QSize minimumSizeHint() const;
00052         
00053         virtual QSize sizeHint() const;
00054         
00055         KexiDataAwareObjectInterface* dataAwareObject() const { return m_dataAwareObject; }
00056 
00059         virtual bool setupFindAndReplace(QStringList& columnNames, QStringList& columnCaptions,
00060             QString& currentColumnName);
00061 
00064         virtual tristate find(const QVariant& valueToFind, 
00065             const KexiSearchAndReplaceViewInterface::Options& options, bool next);
00066 
00069         virtual tristate findNextAndReplace(const QVariant& valueToFind, 
00070             const QVariant& replacement, 
00071             const KexiSearchAndReplaceViewInterface::Options& options, bool replaceAll);
00072 
00073     public slots:
00074         void deleteAllRows();
00075         void deleteCurrentRow();
00076         void deleteAndStartEditCurrentCell();
00077         void startEditOrToggleValue();
00078         bool acceptRowEdit();
00079         void cancelRowEdit();
00080         void sortAscending();
00081         void sortDescending();
00082         void copySelection();
00083         void cutSelection();
00084         void paste();
00085         void slotGoToFirstRow();
00086         void slotGoToPreviusRow();
00087         void slotGoToNextRow();
00088         void slotGoToLastRow();
00089         void slotGoToNewRow();
00090 /*      void editFind();
00091         void slotFind();
00092         void editFindNext();
00093         void editFindPrevious();
00094         void editReplace();*/
00095 
00096     protected slots:
00097 //      void slotCellSelected(const QVariant& v); //!< @internal
00098         void slotCellSelected(int col, int row);
00099         void reloadActions();
00100         void slotUpdateRowActions(int row);
00101         void slotClosing(bool& cancel);
00102 
00103     protected:
00104         void init( QWidget* viewWidget, KexiSharedActionClient* actionClient,
00105             KexiDataAwareObjectInterface* dataAwareObject, 
00106         // temporary, for KexiFormView in design mode 
00107             bool noDataAware = false
00108         );
00109         void initActions();
00110         virtual void updateActions(bool activated);
00111 
00112         QWidget* m_internalView;
00113         KexiSharedActionClient* m_actionClient;
00114         KexiDataAwareObjectInterface* m_dataAwareObject;
00115 };
00116 
00117 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys