kexi

kexicontextmenuutils.h
1/* This file is part of the KDE project
2 Copyright (C) 2006-2007 Jaroslaw Staniek <js@iidea.pl>
3
4 This program is free software; you can redistribute it and/or
5 modify it under the terms of the GNU Library General Public
6 License as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
8
9 This program is distributed in the hope that it will be useful,
10 but WITHOUT ANY WARRANTY; without even the implied warranty of
11 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12 Library General Public License for more details.
13
14 You should have received a copy of the GNU Library General Public License
15 along with this program; see the file COPYING. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19
20#ifndef KexiContextMenuUtils_H
21#define KexiContextMenuUtils_H
22
23#include <kexidb/queryschema.h>
24#include <tdepopupmenu.h>
25#include <kurl.h>
26
27class TDEActionCollection;
29
31
33class KEXIGUIUTILS_EXPORT KexiContextMenuUtils
34{
35 public:
38 static bool updateTitle(TQPopupMenu *menu, const TQString& objectName,
39 const TQString& objectTypeName, const TQString& iconName);
40};
41
43
50class KEXIGUIUTILS_EXPORT KexiImageContextMenu : public TDEPopupMenu
51{
52 TQ_OBJECT
53
54
55 public:
56 KexiImageContextMenu(TQWidget *parent);
57 virtual ~KexiImageContextMenu();
58
59 TDEActionCollection* actionCollection() const;
60
64 static bool updateTitle(TQPopupMenu *menu, const TQString& title, const TQString& iconName = TQString());
65
66 public slots:
67 void updateActionsAvailability();
68
69 virtual void insertFromFile();
70 virtual void saveAs();
71 virtual void cut();
72 virtual void copy();
73 virtual void paste();
74 virtual void clear();
75 virtual void showProperties();
76
77 signals:
80 void updateActionsAvailabilityRequested(bool& valueIsNull, bool& valueIsReadOnly);
81
83 void insertFromFileRequested(const KURL &url);
84
88 void aboutToSaveAsRequested(TQString& origFilename, TQString& fileExtension, bool& dataIsEmpty);
89
91 void saveAsRequested(const TQString& fileName);
92
95
98
101
104
107
108 protected:
109 class Private;
110 Private *d;
111};
112
113#endif
A set of helpers for updating popup menu titles.
static bool updateTitle(TQPopupMenu *menu, const TQString &objectName, const TQString &objectTypeName, const TQString &iconName)
An interface for declaring widgets to be data-aware.
void copyRequested()
Emitted when "copy" action was requested.
void showPropertiesRequested()
Emitted when "showProperties" action was requested.
void cutRequested()
Emitted when "cut" action was requested.
void saveAsRequested(const TQString &fileName)
Emitted when "saveAs" action was requested.
void pasteRequested()
Emitted when "paste" action was requested.
static bool updateTitle(TQPopupMenu *menu, const TQString &title, const TQString &iconName=TQString())
void aboutToSaveAsRequested(TQString &origFilename, TQString &fileExtension, bool &dataIsEmpty)
void updateActionsAvailabilityRequested(bool &valueIsNull, bool &valueIsReadOnly)
void insertFromFileRequested(const KURL &url)
void clearRequested()
Emitted when "clear" action was requested.