kexi

editlistviewdialog.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2004 Cedric Pasteur <cedric.pasteur@free.fr>
00003 
00004    This library 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 library 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 library; see the file COPYING.LIB.  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 EDITLISTVIEW_DIALOG_H
00021 #define EDITLISTVIEW_DIALOG_H
00022 
00023 #include <qintdict.h>
00024 #include <qtoolbutton.h>
00025 #include <kdialogbase.h>
00026 
00027 class QFrame;
00028 class QListView;
00029 class QListViewItem;
00030 class KListViewItem;
00031 class KListView;
00032 class KListBox;
00033 class QListBoxItem;
00034 
00035 namespace KoProperty {
00036     class Property;
00037     class Set;
00038     class Editor;
00039 }
00040 
00041 namespace KFormDesigner {
00042 
00044 
00049 class KFORMEDITOR_EXPORT EditListViewDialog : public KDialogBase
00050 {
00051     Q_OBJECT
00052 
00053     public:
00054         EditListViewDialog(QWidget *parent);
00055         ~EditListViewDialog() {}
00056 
00057         int exec(QListView *listview);
00058 
00059     public slots:
00060         // Columns page
00061         void updateItemProperties(QListBoxItem*);
00062         void newItem();
00063         void removeItem();
00064         void MoveItemUp();
00065         void MoveItemDown();
00066         void changeProperty(KoProperty::Set& set, KoProperty::Property& property);
00067 
00068         // Contents page
00069         void updateButtons(QListViewItem*);
00070         void newRow();
00071         void newChildRow();
00072         void removeRow();
00073         void MoveRowUp();
00074         void MoveRowDown();
00075 
00076     protected:
00079         void loadChildNodes(QListView *listview, QListViewItem *item, QListViewItem *parent);
00080 
00081     protected:
00082         enum { BNewRow = 10, BNewChild, BRemRow, BRowUp, BRowDown , BColAdd = 20, BColRem, BColUp, BColDown };
00083         KoProperty::Editor  *m_editor;
00084         KoProperty::Set  *m_propSet;
00085         QFrame   *m_contents, *m_column;
00086         KListBox  *m_listbox;
00087         KListView  *m_listview;
00088         QIntDict<QToolButton>  m_buttons;
00089 };
00090 
00091 }
00092 
00093 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys