lib

KoSelectAction.h
1/* This file is part of the KDE project
2 Copyright (C) 2004 Peter Simonsson <psn@linux.se>
3
4 This library 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 library 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 library; see the file COPYING.LIB. If not, write to
16 the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17 * Boston, MA 02110-1301, USA.
18*/
19#ifndef KOSELECTACTION_H
20#define KOSELECTACTION_H
21
22#include <tdeaction.h>
23#include <koffice_export.h>
24class TDEPopupMenu;
25class TQPoint;
26
31class KOFFICEUI_EXPORT KoSelectAction : public TDEAction
32{
33 TQ_OBJECT
34
35 public:
42 KoSelectAction(const TQString& text, const TQString& icon, TQObject* parent = 0, const char* name = 0);
51 KoSelectAction(const TQString& text, const TQString& icon, const TQObject* receiver,
52 const char* slot, TQObject* parent, const char* name = 0);
54
56 TDEPopupMenu* popupMenu() const;
60 void popup(const TQPoint& global);
61
62 virtual int plug(TQWidget* widget, int index = -1);
63
65 virtual int currentSelection();
66
68 void setShowCurrentSelection(bool show);
69
70 signals:
73
74 public slots:
78 virtual void setCurrentSelection(int index);
79
80 protected slots:
84 virtual void execute(int index);
85
86 private:
87 class KoSelectActionPrivate;
88 KoSelectActionPrivate* d;
89};
90
91#endif
TDEPopupMenu * popupMenu() const
Returns a pointer to the popup menu.
virtual int currentSelection()
Returns the index of the currently selected item.
virtual void execute(int index)
Execute an item.
void selectionChanged(int)
Emited when the selection changed.
KoSelectAction(const TQString &text, const TQString &icon, TQObject *parent=0, const char *name=0)
Constructs a KoSelectAction with a text and an icon.
void popup(const TQPoint &global)
Shows the popup menu.
virtual void setCurrentSelection(int index)
Set which item that should be selected.
void setShowCurrentSelection(bool show)
If the current selection selection should be shown or not in the menu.
TDEAction(const TQString &text, const TDEShortcut &cut, const TQObject *receiver, const char *slot, TDEActionCollection *parent, const char *name)
virtual TQString text() const
virtual int plug(TQWidget *widget, int index=-1)