• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeui
 

tdeui

  • tdeui
kstdguiitem.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 2001 Holger Freyther <freyther@kde.org>
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 version 2 as published by the Free Software Foundation.
7 
8  This library is distributed in the hope that it will be useful,
9  but WITHOUT ANY WARRANTY; without even the implied warranty of
10  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
11  Library General Public License for more details.
12 
13  You should have received a copy of the GNU Library General Public License
14  along with this library; see the file COPYING.LIB. If not, write to
15  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
16  Boston, MA 02110-1301, USA.
17 */
18 
19 #include "kstdguiitem.h"
20 
21 #include <kguiitem.h>
22 #include <tdelocale.h>
23 #include <tdeapplication.h>
24 
25 KGuiItem KStdGuiItem::guiItem ( StdItem ui_enum )
26 {
27  switch (ui_enum ) {
28  case Ok : return ok();
29  case Cancel : return cancel();
30  case Yes : return yes();
31  case No : return no();
32  case Discard : return discard();
33  case Save : return save();
34  case DontSave : return dontSave();
35  case SaveAs : return saveAs();
36  case Apply : return apply();
37  case Clear : return clear();
38  case Help : return help();
39  case Close : return close();
40  case Defaults : return defaults();
41  case Back : return back();
42  case Forward : return forward();
43  case Print : return print();
44  case Continue : return cont();
45  case Open : return open();
46  case Quit : return quit();
47  case AdminMode: return adminMode();
48  case Reset : return reset();
49  case Delete : return del();
50  case Insert : return insert();
51  case Find : return find();
52  case Stop : return stop();
53  case Add : return add();
54  case Remove : return remove();
55  case Test : return test();
56  case Properties : return properties();
57  case Overwrite : return overwrite();
58  default : return KGuiItem();
59  };
60 }
61 
62 TQString KStdGuiItem::stdItem( StdItem ui_enum )
63 {
64  switch (ui_enum ) {
65  case Ok : return TQString::fromLatin1("ok");
66  case Cancel : return TQString::fromLatin1("cancel");
67  case Yes : return TQString::fromLatin1("yes");
68  case No : return TQString::fromLatin1("no");
69  case Discard : return TQString::fromLatin1("discard");
70  case Save : return TQString::fromLatin1("save");
71  case DontSave : return TQString::fromLatin1("dontSave");
72  case SaveAs : return TQString::fromLatin1("saveAs");
73  case Apply : return TQString::fromLatin1("apply");
74  case Help : return TQString::fromLatin1("help");
75  case Close : return TQString::fromLatin1("close");
76  case Defaults : return TQString::fromLatin1("defaults");
77  case Back : return TQString::fromLatin1("back");
78  case Forward : return TQString::fromLatin1("forward");
79  case Print : return TQString::fromLatin1("print");
80  case Continue : return TQString::fromLatin1("continue");
81  case Open : return TQString::fromLatin1("open");
82  case Quit : return TQString::fromLatin1("quit");
83  case AdminMode: return TQString::fromLatin1("adminMode");
84  case Delete : return TQString::fromLatin1("delete");
85  case Insert : return TQString::fromLatin1("insert");
86  case Find : return TQString::fromLatin1("find");
87  case Stop : return TQString::fromLatin1("stop");
88  case Add : return TQString::fromLatin1("add");
89  case Remove : return TQString::fromLatin1("remove");
90  case Test : return TQString::fromLatin1("test");
91  case Properties : return TQString::fromLatin1("properties");
92  case Overwrite : return TQString::fromLatin1("overwrite");
93  default : return TQString::null;
94  };
95 }
96 
97 KGuiItem KStdGuiItem::ok()
98 {
99  return KGuiItem( i18n( "&OK" ), "button_ok" );
100 }
101 
102 
103 KGuiItem KStdGuiItem::cancel()
104 {
105  return KGuiItem( i18n( "&Cancel" ), "button_cancel" );
106 }
107 
108 KGuiItem KStdGuiItem::yes()
109 {
110  return KGuiItem( i18n( "&Yes" ), "button_ok", i18n( "Yes" ) );
111 }
112 
113 KGuiItem KStdGuiItem::no()
114 {
115  return KGuiItem( i18n( "&No" ), "window-close", i18n( "No" ) );
116 }
117 
118 KGuiItem KStdGuiItem::discard()
119 {
120  return KGuiItem( i18n( "&Discard" ), "edittrash", i18n( "Discard changes" ),
121  i18n( "Pressing this button will discard all recent "
122  "changes made in this dialog" ) );
123 }
124 
125 KGuiItem KStdGuiItem::save()
126 {
127  return KGuiItem( i18n( "&Save" ), "document-save", i18n( "Save data" ) );
128 }
129 
130 KGuiItem KStdGuiItem::dontSave()
131 {
132  return KGuiItem( i18n( "&Do Not Save" ), "edittrash",
133  i18n( "Don't save data" ) );
134 }
135 
136 KGuiItem KStdGuiItem::saveAs()
137 {
138  return KGuiItem( i18n( "Save &As..." ), "document-save-as",
139  i18n( "Save file with another name" ) );
140 }
141 
142 KGuiItem KStdGuiItem::apply()
143 {
144  return KGuiItem( i18n( "&Apply" ), "apply", i18n( "Apply changes" ),
145  i18n( "When clicking <b>Apply</b>, the settings will be "
146  "handed over to the program, but the dialog "
147  "will not be closed.\n"
148  "Use this to try different settings." ) );
149 }
150 
151 KGuiItem KStdGuiItem::adminMode()
152 {
153  return KGuiItem( i18n( "Administrator &Mode..." ), "wizard", i18n( "Enter Administrator Mode" ),
154  i18n( "When clicking <b>Administrator Mode</b> you will be prompted "
155  "for the administrator (root) password in order to make changes "
156  "which require root privileges." ) );
157 }
158 
159 KGuiItem KStdGuiItem::clear()
160 {
161  return KGuiItem( i18n( "C&lear" ), "locationbar_erase",
162  i18n( "Clear input" ),
163  i18n( "Clear the input in the edit field" ) );
164 }
165 
166 KGuiItem KStdGuiItem::help()
167 {
168  return KGuiItem( i18n( "show help", "&Help" ), "help",
169  i18n( "Show help" ) );
170 }
171 
172 KGuiItem KStdGuiItem::close()
173 {
174  return KGuiItem( i18n( "&Close" ), "window-close",
175  i18n( "Close the current window or document" ) );
176 }
177 
178 KGuiItem KStdGuiItem::defaults()
179 {
180  return KGuiItem( i18n( "&Defaults" ), "reload",
181  i18n( "Reset all items to their default values" ) );
182 }
183 
184 KGuiItem KStdGuiItem::back( BidiMode useBidi )
185 {
186  TQString icon = ( useBidi == UseRTL && TQApplication::reverseLayout() )
187  ? "forward" : "back";
188  return KGuiItem( i18n( "go back", "&Back" ), icon,
189  i18n( "Go back one step" ) );
190 }
191 
192 KGuiItem KStdGuiItem::forward( BidiMode useBidi )
193 {
194  TQString icon = ( useBidi == UseRTL && TQApplication::reverseLayout() )
195  ? "back" : "forward";
196  return KGuiItem( i18n( "go forward", "&Forward" ), icon,
197  i18n( "Go forward one step" ) );
198 }
199 
200 TQPair<KGuiItem, KGuiItem> KStdGuiItem::backAndForward()
201 {
202  return tqMakePair( back( UseRTL ), forward( UseRTL ) );
203 }
204 
205 KGuiItem KStdGuiItem::print()
206 {
207  return KGuiItem( i18n( "&Print..." ), "document-print",
208  i18n( "Opens the print dialog to print "
209  "the current document" ) );
210 }
211 
212 KGuiItem KStdGuiItem::cont()
213 {
214  return KGuiItem( i18n( "C&ontinue" ), TQString::null,
215  i18n( "Continue operation" ) );
216 }
217 
218 KGuiItem KStdGuiItem::del()
219 {
220  return KGuiItem( i18n( "&Delete" ), "edit-delete",
221  i18n( "Delete item(s)" ) );
222 }
223 
224 KGuiItem KStdGuiItem::open()
225 {
226  return KGuiItem( i18n( "&Open..." ), "document-open",
227  i18n( "Open file" ) );
228 }
229 
230 KGuiItem KStdGuiItem::quit()
231 {
232  return KGuiItem( i18n( "&Quit" ), "system-log-out",
233  i18n( "Quit application" ) );
234 }
235 
236 KGuiItem KStdGuiItem::reset()
237 {
238  return KGuiItem( i18n( "&Reset" ), "edit-undo",
239  i18n( "Reset configuration" ) );
240 }
241 
242 KGuiItem KStdGuiItem::insert()
243 {
244  return KGuiItem( i18n( "Verb", "&Insert" ), "edit-paste");
245 }
246 
247 KGuiItem KStdGuiItem::configure()
248 {
249  return KGuiItem( i18n( "Confi&gure..." ), "configure" );
250 }
251 
252 KGuiItem KStdGuiItem::find()
253 {
254  return KGuiItem( i18n("&Find"), "edit-find" );
255 }
256 
257 KGuiItem KStdGuiItem::stop()
258 {
259  return KGuiItem( i18n("Stop"), "process-stop" );
260 }
261 
262 KGuiItem KStdGuiItem::add()
263 {
264  return KGuiItem( i18n("Add"), "add" );
265 }
266 
267 KGuiItem KStdGuiItem::remove()
268 {
269  return KGuiItem( i18n("Remove"), "remove" );
270 }
271 
272 KGuiItem KStdGuiItem::test()
273 {
274  return KGuiItem( i18n("Test") );
275 }
276 
277 KGuiItem KStdGuiItem::properties()
278 {
279  return KGuiItem( i18n("Properties"), "document-properties" );
280 }
281 
282 KGuiItem KStdGuiItem::overwrite()
283 {
284  return KGuiItem( i18n("&Overwrite"), "document-save-as" );
285 }
KStdGuiItem::stop
static KGuiItem stop()
Returns a "stop" item.
Definition: kstdguiitem.cpp:257
KStdGuiItem::back
static KGuiItem back(BidiMode useBidi=IgnoreRTL)
Return a GUI item for a 'back' action, like Konqueror's back button.
Definition: kstdguiitem.cpp:184
KStdGuiItem::forward
static KGuiItem forward(BidiMode useBidi=IgnoreRTL)
Return a GUI item for a 'forward' action, like Konqueror's forward button.
Definition: kstdguiitem.cpp:192
KStdGuiItem::remove
static KGuiItem remove()
Returns a "remove" item.
Definition: kstdguiitem.cpp:267
KStdGuiItem::Properties
Definition: kstdguiitem.h:58
Test
KStdGuiItem::cont
static KGuiItem cont()
Returns a "continue" item.
Definition: kstdguiitem.cpp:212
KStdGuiItem::Stop
Definition: kstdguiitem.h:54
KStdGuiItem::Find
Definition: kstdguiitem.h:53
tdelocale.h
KGuiItem
An abstract class for GUI data such as ToolTip and Icon.
Definition: kguiitem.h:38
KStdGuiItem::overwrite
static KGuiItem overwrite()
Definition: kstdguiitem.cpp:282
KStdGuiItem::configure
static KGuiItem configure()
Returns a "configure" item.
Definition: kstdguiitem.cpp:247
KStdGuiItem::del
static KGuiItem del()
Returns a "delete" item.
Definition: kstdguiitem.cpp:218
KStdGuiItem::Overwrite
Definition: kstdguiitem.h:59
KStdGuiItem::Add
Definition: kstdguiitem.h:55
KStdGuiItem::find
static KGuiItem find()
Returns a "find" item.
Definition: kstdguiitem.cpp:252
KStdGuiItem::BidiMode
BidiMode
The back and forward items by default use the RTL settings for Hebrew and Arab countries.
Definition: kstdguiitem.h:45
KStdGuiItem::add
static KGuiItem add()
Returns a "add" item.
Definition: kstdguiitem.cpp:262
KStdGuiItem::test
static KGuiItem test()
Returns a "test" item.
Definition: kstdguiitem.cpp:272
KStdGuiItem::Remove
Definition: kstdguiitem.h:56
KStdGuiItem::properties
static KGuiItem properties()
Definition: kstdguiitem.cpp:277
KStdGuiItem::adminMode
static KGuiItem adminMode()
Returns a KGuiItem suiting for cases where code or functionality runs under root privileges.
Definition: kstdguiitem.cpp:151
KStdGuiItem::backAndForward
static TQPair< KGuiItem, KGuiItem > backAndForward()
Return both a back and a forward item.
Definition: kstdguiitem.cpp:200

tdeui

Skip menu "tdeui"
  • Main Page
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeui

Skip menu "tdeui"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  •     tdecore
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  • tdeioslave
  •   http
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.8
This website is maintained by Timothy Pearson.