kexi

kexidataawarepropertyset.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004-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 KEXIDATAAWAREPROPERTYSET_H
00021 #define KEXIDATAAWAREPROPERTYSET_H
00022 
00023 #include <qguardedptr.h>
00024 #include <qptrvector.h>
00025 #include <koproperty/set.h>
00026 
00027 typedef QPtrVector<KoProperty::Set> SetVector;
00028 
00029 class KexiViewBase;
00030 class KexiTableItem;
00031 class KexiTableViewData;
00032 class KexiDataAwareObjectInterface;
00033 
00053 class KEXIDATATABLE_EXPORT KexiDataAwarePropertySet : public QObject
00054 {
00055     Q_OBJECT
00056 
00057     public:
00063         KexiDataAwarePropertySet(KexiViewBase *view, KexiDataAwareObjectInterface* dataObject);
00064 
00065         virtual ~KexiDataAwarePropertySet();
00066 
00067         uint size() const;
00068         KoProperty::Set* currentPropertySet() const;
00069         inline KoProperty::Set* at(uint row) const { return m_sets[row]; }
00070 
00074         KoProperty::Set* listForItem(KexiTableItem& item);
00075 
00076     signals:
00081         void rowDeleted();
00082 
00085         void rowInserted();
00086 
00087     public slots:
00088         void removeCurrentPropertySet();
00089 
00090         void clear(uint minimumSize = 0);
00091 
00104         void insert(uint row, KoProperty::Set* buf, bool newOne = false);
00105 
00107         void remove(uint row);
00108 
00109     protected slots:
00111         void slotDataSet( KexiTableViewData *data );
00112 
00114         void slotRowDeleted();
00115 
00117         void slotRowsDeleted( const QValueList<int> &rows );
00118 
00120         void slotRowInserted(KexiTableItem* item, uint row, bool repaint);
00121 
00123         void slotCellSelected(int, int row);
00124 
00126         void slotReloadRequested();
00127 
00128     protected:
00129         SetVector m_sets; 
00130 
00131         QGuardedPtr<KexiViewBase> m_view;
00132         KexiDataAwareObjectInterface* m_dataObject;
00133 //      QGuardedPtr<KexiTableView> m_tableView;
00134         QGuardedPtr<KexiTableViewData> m_currentTVData;
00135 
00136         int m_row; 
00137 };
00138 
00139 #endif
00140 
KDE Home | KDE Accessibility Home | Description of Access Keys