ttdeaction.h
1/*
2 * Kivio - Visual Modelling and Flowcharting
3 * Copyright (C) 2000 theKompany.com
4 *
5 * This program is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU General Public License
7 * as published by the Free Software Foundation; either version 2
8 * of the License, or (at your option) any later version.
9 *
10 * This program is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
13 * GNU General Public License for more details.
14 *
15 * You should have received a copy of the GNU General Public License
16 * along with this program; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor,
18 * Boston, MA 02110-1301, USA.
19 */
20#ifndef TTDEACTION_H
21#define TTDEACTION_H
22
23#include <tdeaction.h>
24#include <tqstringlist.h>
25#include <koffice_export.h>
26namespace TK {
27 enum IconMode { IconOnly, IconAndText, TextOnly };
28}
29
30class TTDEToolBarButton;
31class TKComboBox;
32
33class KOFFICEUI_EXPORT TTDEAction : public TDEAction
34{ TQ_OBJECT
35
36public:
37 TTDEAction(TQObject* parent, const char* name);
38 ~TTDEAction();
39
40 virtual int plug(TQWidget* widget, int index = -1);
41
42 TK::IconMode iconMode();
43
44protected:
45 virtual void initToolBarButton(TTDEToolBarButton*);
46
47 TQWidget* createLayout(TQWidget* parent, TQWidget* children);
48 void updateLayout();
49 virtual void updateLayout(TQWidget*);
50
51public slots:
52 virtual void setIconMode(TK::IconMode);
53 void setText(const TQString&);
54 void setIcon(const TQString&);
55
56private:
57 TK::IconMode m_imode;
58 class TTDEActionPrivate;
59 TTDEActionPrivate *d;
60};
61/******************************************************************************/
62class KOFFICEUI_EXPORT TKBaseSelectAction : public TTDEAction
63{ TQ_OBJECT
64
65friend class TTDESelectAction;
66public:
67 TKBaseSelectAction(TQObject* parent, const char* name);
68 ~TKBaseSelectAction();
69
70 virtual int plug(TQWidget* widget, int index = -1);
71
72 int currentItem();
73 bool isEditable();
74
75 void activate(int);
76
77protected:
78 virtual void initComboBox(TKComboBox*);
79
80public slots:
81 virtual void setCurrentItem(int index);
82 virtual void setEditable(bool);
83
84protected slots:
85 virtual void slotActivated(int);
86
87signals:
88 void activated(int);
89
90private:
91 int m_current;
92 bool m_editable;
93 class TKBaseSelectActionPrivate;
94 TKBaseSelectActionPrivate *d;
95};
96/******************************************************************************/
97class KOFFICEUI_EXPORT TTDESelectAction : public TKBaseSelectAction
98{ TQ_OBJECT
99
100public:
101 TTDESelectAction(TQObject* parent, const char* name);
102 ~TTDESelectAction();
103
104 TQStringList items() const;
105
106public slots:
107 virtual void setItems(const TQStringList& );
108 virtual void setEditText(const TQString&);
109 virtual void clear();
110
111protected:
112 virtual void initComboBox(TKComboBox*);
113
114protected slots:
115 void slotActivated(const TQString&);
116
117signals:
118 void activated(const TQString&);
119
120private:
121 TQStringList m_list;
122 class TTDESelectActionPrivate;
123 TTDESelectActionPrivate *d;
124};
125/******************************************************************************/
126#endif
virtual void activate()
virtual void setText(const TQString &text)
void activated()
virtual int plug(TQWidget *widget, int index=-1)
TDEAction * clear(const TQObject *recvr, const char *slot, TDEActionCollection *parent, const char *name=0)