kexi

kexidbutils.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2006-2007 Jaroslaw Staniek <js@iidea.pl>
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 KDBWIDGETS_UTILS_H
00021 #define KDBWIDGETS_UTILS_H
00022 
00023 #include <qpopupmenu.h>
00024 #include <kexidataiteminterface.h>
00025 
00026 QColor lighterGrayBackgroundColor(const QPalette& palette);
00027 
00029 
00031 class KexiDBWidgetContextMenuExtender : public QObject
00032 {
00033     public:
00034         KexiDBWidgetContextMenuExtender( QObject* parent, KexiDataItemInterface* iface );
00035         ~KexiDBWidgetContextMenuExtender();
00036 
00038         void createTitle(QPopupMenu *menu);
00039 
00042         void updatePopupMenuActions();
00043 
00047         static bool updateContextMenuTitleForDataItem(QPopupMenu *menu, KexiDataItemInterface* iface, 
00048             const QString& icon = QString::null);
00049 
00050     protected:
00051         KexiDataItemInterface* m_iface;
00052         QGuardedPtr<QPopupMenu> m_contextMenu;
00053         bool m_contextMenuHasTitle; 
00054 };
00055 
00056 class KexiDBAutoField;
00057 
00059 class KexiSubwidgetInterface
00060 {
00061     public:
00062         KexiSubwidgetInterface();
00063         virtual ~KexiSubwidgetInterface();
00064 
00065         virtual bool appendStretchRequired(KexiDBAutoField* autoField) const
00066             { Q_UNUSED(autoField); return false; }
00067         virtual bool subwidgetStretchRequired(KexiDBAutoField* autoField) const
00068             { Q_UNUSED(autoField); return false; }
00069 };
00070 
00071 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys