kexi

kexidataawareview.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2005 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 
00025 class KexiDataAwareObjectInterface;
00026 class KexiSharedActionClient;
00027 
00038 class KEXIEXTWIDGETS_EXPORT KexiDataAwareView : public KexiViewBase
00039 {
00040     Q_OBJECT
00041 
00042     public:
00043         KexiDataAwareView(KexiMainWindow *mainWin, QWidget *parent, const char *name = 0);
00044 
00045         QWidget* mainWidget();
00046 
00047         virtual QSize minimumSizeHint() const;
00048         virtual QSize sizeHint() const;
00049         KexiDataAwareObjectInterface* dataAwareObject() const { return m_dataAwareObject; }
00050 
00051     public slots:
00052         void deleteAllRows();
00053         void deleteCurrentRow();
00054         void deleteAndStartEditCurrentCell();
00055         void startEditOrToggleValue();
00056         bool acceptRowEdit();
00057         void cancelRowEdit();
00058         void sortAscending();
00059         void sortDescending();
00060         void copySelection();
00061         void cutSelection();
00062         void paste();
00063 
00064     protected slots:
00065 //      void slotCellSelected(const QVariant& v); //!< @internal
00066         void slotCellSelected(int col, int row);
00067         void reloadActions();
00068         void slotUpdateRowActions(int row);
00069         void slotClosing(bool& cancel);
00070 
00071     protected:
00072         void init( QWidget* viewWidget, KexiSharedActionClient* actionClient,
00073             KexiDataAwareObjectInterface* dataAwareObject, 
00074         // temporary, for KexiFormView in design mode 
00075             bool noDataAware = false
00076         );
00077         void initActions();
00078         virtual void updateActions(bool activated);
00079 
00080         //KexiViewBase
00081         QWidget* m_internalView;
00082         KexiSharedActionClient* m_actionClient;
00083         KexiDataAwareObjectInterface* m_dataAwareObject;
00084 };
00085 
00086 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys