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 
00069         KoProperty::Set* currentPropertySet() const;
00070 
00071         uint currentRow() const;
00072 
00073         inline KoProperty::Set* at(uint row) const { return m_sets[row]; }
00074 
00078         KoProperty::Set* findPropertySetForItem(KexiTableItem& item);
00079 
00083         int findRowForPropertyValue(const QCString& propertyName, const QVariant& value);
00084 
00085     signals:
00090         void rowDeleted();
00091 
00094         void rowInserted();
00095 
00096     public slots:
00097         void removeCurrentPropertySet();
00098 
00099         void clear(uint minimumSize = 0);
00100 
00113         void insert(uint row, KoProperty::Set* set, bool newOne = false);
00114 
00116         void remove(uint row);
00117 
00118     protected slots:
00120         void slotDataSet( KexiTableViewData *data );
00121 
00123         void slotRowDeleted();
00124 
00126         void slotRowsDeleted( const QValueList<int> &rows );
00127 
00129         void slotRowInserted(KexiTableItem* item, uint row, bool repaint);
00130 
00132         void slotCellSelected(int, int row);
00133 
00135         void slotReloadRequested();
00136 
00137     protected:
00138         SetVector m_sets; 
00139 
00140         QGuardedPtr<KexiViewBase> m_view;
00141         KexiDataAwareObjectInterface* m_dataObject;
00142 //      QGuardedPtr<KexiTableView> m_tableView;
00143         QGuardedPtr<KexiTableViewData> m_currentTVData;
00144 
00145         int m_row; 
00146 };
00147 
00148 #endif
00149 
KDE Home | KDE Accessibility Home | Description of Access Keys