kexi

kexicontextmenuutils.h

00001 /* This file is part of the KDE project
00002    Copyright (C) 2006-2007 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 KexiContextMenuUtils_H
00021 #define KexiContextMenuUtils_H
00022 
00023 #include <kexidb/queryschema.h>
00024 #include <kpopupmenu.h>
00025 #include <kurl.h>
00026 
00027 class KActionCollection;
00028 class KexiDataItemInterface;
00029 
00031 
00033 class KEXIGUIUTILS_EXPORT KexiContextMenuUtils
00034 {
00035     public:
00038         static bool updateTitle(QPopupMenu *menu, const QString& objectName, 
00039             const QString& objectTypeName, const QString& iconName);
00040 };
00041 
00043 
00050 class KEXIGUIUTILS_EXPORT KexiImageContextMenu : public KPopupMenu
00051 {
00052     Q_OBJECT
00053 
00054     public:
00055         KexiImageContextMenu(QWidget *parent);
00056         virtual ~KexiImageContextMenu();
00057 
00058         KActionCollection* actionCollection() const;
00059 
00063         static bool updateTitle(QPopupMenu *menu, const QString& title, const QString& iconName = QString::null);
00064 
00065     public slots:
00066         void updateActionsAvailability();
00067 
00068         virtual void insertFromFile();
00069         virtual void saveAs();
00070         virtual void cut();
00071         virtual void copy();
00072         virtual void paste();
00073         virtual void clear();
00074         virtual void showProperties();
00075 
00076     signals:
00079         void updateActionsAvailabilityRequested(bool& valueIsNull, bool& valueIsReadOnly);
00080 
00082         void insertFromFileRequested(const KURL &url);
00083 
00087         void aboutToSaveAsRequested(QString& origFilename, QString& fileExtension, bool& dataIsEmpty);
00088 
00090         void saveAsRequested(const QString& fileName);
00091 
00093         void cutRequested();
00094 
00096         void copyRequested();
00097 
00099         void pasteRequested();
00100 
00102         void clearRequested();
00103 
00105         void showPropertiesRequested();
00106 
00107     protected:
00108         class Private;
00109         Private *d;
00110 };
00111 
00112 #endif
KDE Home | KDE Accessibility Home | Description of Access Keys