27 #include "kactionclasses.h"
31 #include <fontconfig/fontconfig.h>
34 #include <tqclipboard.h>
35 #include <tqfontdatabase.h>
36 #include <tqobjectlist.h>
37 #include <tqwhatsthis.h>
42 #include <dcopclient.h>
45 #include <kapplication.h>
48 #include <kfontcombo.h>
49 #include <kfontdialog.h>
51 #include <kmainwindow.h>
53 #include <kpopupmenu.h>
55 #include <ktoolbarbutton.h>
57 #include <kstandarddirs.h>
58 #include <kstringhandler.h>
60 class KToggleAction::KToggleActionPrivate
63 KToggleActionPrivate()
70 TQString m_exclusiveGroup;
77 :
KAction( text, cut, parent, name )
79 d =
new KToggleActionPrivate;
83 const TQObject* receiver,
const char* slot,
84 TQObject* parent,
const char* name )
85 :
KAction( text, cut, receiver, slot, parent, name )
87 d =
new KToggleActionPrivate;
92 TQObject* parent,
const char* name )
93 :
KAction( text, pix, cut, parent, name )
95 d =
new KToggleActionPrivate;
100 TQObject* parent,
const char* name )
101 :
KAction( text, pix, cut, parent, name )
103 d =
new KToggleActionPrivate;
108 const TQObject* receiver,
109 const char* slot, TQObject* parent,
111 :
KAction( text, pix, cut, receiver, slot, parent, name )
113 d =
new KToggleActionPrivate;
118 const TQObject* receiver,
119 const char* slot, TQObject* parent,
121 :
KAction( text, pix, cut, receiver, slot, parent, name )
123 d =
new KToggleActionPrivate;
129 d =
new KToggleActionPrivate;
134 delete d->m_checkedGuiItem;
140 if ( !::tqqt_cast<TQPopupMenu *>( widget ) && !::tqqt_cast<KToolBar *>( widget ) )
142 kdWarning() <<
"Can not plug KToggleAction in " << widget->className() <<
endl;
145 if (kapp && !kapp->authorizeKAction(name()))
152 if ( ::tqqt_cast<KToolBar *>( widget ) ) {
155 bar->
setToggle( itemId( _index ),
true );
160 updateChecked( _index );
167 if ( c == d->m_checked )
173 int len = containerCount();
175 for(
int i = 0; i < len; ++i )
179 const TQObjectList list = parent()->childrenListObject();
180 if ( !list.isEmpty() ) {
181 TQObjectListIt it( list );
182 for( ; it.current(); ++it ) {
183 if ( ::tqqt_cast<KToggleAction *>( it.current() ) && it.current() !=
this &&
188 emit a->toggled(
false );
196 void KToggleAction::updateChecked(
int id )
198 TQWidget *w = container(
id );
200 if ( ::tqqt_cast<TQPopupMenu *>( w ) ) {
201 TQPopupMenu* pm =
static_cast<TQPopupMenu*
>(w);
202 int itemId_ = itemId(
id );
203 if ( !d->m_checkedGuiItem )
204 pm->setItemChecked( itemId_, d->m_checked );
207 if ( d->m_checkedGuiItem->hasIcon() )
208 pm->changeItem( itemId_, gui->iconSet(
KIcon::Small ), gui->text() );
210 pm->changeItem( itemId_, gui->text() );
214 if ( d->m_checkedGuiItem->text() ==
guiItem().text() )
215 pm->setItemChecked( itemId_, d->m_checked );
217 if ( !d->m_checkedGuiItem->whatsThis().isEmpty() )
218 pm->TQMenuData::setWhatsThis( itemId_, gui->whatsThis() );
219 updateShortcut( pm, itemId_ );
222 else if ( ::tqqt_cast<TQMenuBar *>( w ) )
223 static_cast<TQMenuBar*
>(w)->setItemChecked( itemId(
id ), d->m_checked );
224 else if ( ::tqqt_cast<KToolBar *>( w ) )
226 TQWidget* r =
static_cast<KToolBar*
>( w )->getButton( itemId(
id ) );
227 if ( r && ::tqqt_cast<KToolBarButton *>( r ) ) {
228 static_cast<KToolBar*
>( w )->setButton( itemId(
id ), d->m_checked );
229 if ( d->m_checkedGuiItem && d->m_checkedGuiItem->hasIcon() ) {
237 void KToggleAction::slotActivated()
240 KAction::slotActivated();
251 d->m_exclusiveGroup = name;
256 return d->m_exclusiveGroup;
261 delete d->m_checkedGuiItem;
262 d->m_checkedGuiItem =
new KGuiItem( checkedItem );
267 if ( d->m_checkedGuiItem && d->m_checked )
268 return d->m_checkedGuiItem->toolTip();
274 TQObject* parent,
const char* name )
280 const TQObject* receiver,
const char* slot,
281 TQObject* parent,
const char* name )
288 TQObject* parent,
const char* name )
295 TQObject* parent,
const char* name )
302 const TQObject* receiver,
const char* slot,
303 TQObject* parent,
const char* name )
304 :
KToggleAction( text, pix, cut, receiver, slot, parent, name )
310 const TQObject* receiver,
const char* slot,
311 TQObject* parent,
const char* name )
312 :
KToggleAction( text, pix, cut, receiver, slot, parent, name )
321 void KRadioAction::slotActivated()
325 const TQObject *senderObj = TQT_TQOBJECT_CONST(sender());
327 if ( !senderObj || !::tqqt_cast<const KToolBarButton *>( senderObj ) )
335 KToggleAction::slotActivated();
338 class KSelectAction::KSelectActionPrivate
341 KSelectActionPrivate()
344 m_menuAccelsEnabled =
true;
348 m_maxComboViewCount = -1;
351 bool m_menuAccelsEnabled;
356 int m_maxComboViewCount;
358 TQString makeMenuText(
const TQString &_text )
360 if ( m_menuAccelsEnabled )
362 TQString
text = _text;
364 while ( i < text.length() ) {
365 if ( text[ i ] ==
'&' ) {
366 text.insert( i,
'&' );
377 TQObject* parent,
const char* name )
378 :
KAction( text, cut, parent, name )
380 d =
new KSelectActionPrivate;
384 const TQObject* receiver,
const char* slot,
385 TQObject* parent,
const char* name )
386 :
KAction( text, cut, receiver, slot, parent, name )
388 d =
new KSelectActionPrivate;
393 TQObject* parent,
const char* name )
394 :
KAction( text, pix, cut, parent, name )
396 d =
new KSelectActionPrivate;
401 TQObject* parent,
const char* name )
402 :
KAction( text, pix, cut, parent, name )
404 d =
new KSelectActionPrivate;
409 const TQObject* receiver,
410 const char* slot, TQObject* parent,
412 :
KAction( text, pix, cut, receiver, slot, parent, name )
414 d =
new KSelectActionPrivate;
419 const TQObject* receiver,
420 const char* slot, TQObject* parent,
422 :
KAction( text, pix, cut, receiver, slot, parent, name )
424 d =
new KSelectActionPrivate;
430 d =
new KSelectActionPrivate;
442 if (
id >= (
int)d->m_list.count() ) {
443 Q_ASSERT(
id < (
int)d->m_list.count());
449 if ( d->m_current >= 0 )
450 d->m_menu->setItemChecked( d->m_current,
false );
452 d->m_menu->setItemChecked(
id,
true );
457 int len = containerCount();
459 for(
int i = 0; i < len; ++i )
460 updateCurrentItem( i );
472 d->m_comboWidth=width;
474 int len = containerCount();
476 for(
int i = 0; i < len; ++i )
477 updateComboWidth( i );
483 d->m_maxComboViewCount = n;
491 d->m_menu =
new KPopupMenu(0L,
"KSelectAction::popupMenu()");
493 if ( d->m_current >= 0 )
494 d->m_menu->setItemChecked( d->m_current,
true );
500 void KSelectAction::setupMenu()
const
506 TQStringList::ConstIterator it = d->m_list.begin();
507 for( uint
id = 0; it != d->m_list.end(); ++it, ++id ) {
509 if ( !text.isEmpty() )
510 d->m_menu->insertItem( d->makeMenuText( text ),
this, TQT_SLOT( slotActivated(
int ) ), 0, id );
512 d->m_menu->insertSeparator();
518 if ( index < 0 || index >= (
int)d->m_list.count() )
520 kdWarning() <<
"KSelectAction::changeItem Index out of scope" <<
endl;
524 d->m_list[ index ] =
text;
527 d->m_menu->changeItem( index, d->makeMenuText( text ) );
529 int len = containerCount();
530 for(
int i = 0; i < len; ++i )
539 TQWidget* w = container(
id );
540 if ( ::tqqt_cast<KToolBar *>( w ) )
542 TQWidget* r = (
static_cast<KToolBar*
>( w ))->getWidget( itemId(
id ) );
543 if ( ::tqqt_cast<TQComboBox *>( r ) )
545 TQComboBox *b =
static_cast<TQComboBox*
>( r );
546 b->changeItem(text, index );
558 int len = containerCount();
559 for(
int i = 0; i < len; ++i )
574 return TQString::null;
584 void KSelectAction::updateCurrentItem(
int id )
586 if ( d->m_current < 0 )
589 TQWidget* w = container(
id );
590 if ( ::tqqt_cast<KToolBar *>( w ) ) {
591 TQWidget* r =
static_cast<KToolBar*
>( w )->getWidget( itemId(
id ) );
592 if ( ::tqqt_cast<TQComboBox *>( r ) ) {
593 TQComboBox *b =
static_cast<TQComboBox*
>( r );
594 b->setCurrentItem( d->m_current );
601 return d->m_comboWidth;
604 void KSelectAction::updateComboWidth(
int id )
606 TQWidget* w = container(
id );
607 if ( ::tqqt_cast<KToolBar *>( w ) ) {
608 TQWidget* r =
static_cast<KToolBar*
>( w )->getWidget( itemId(
id ) );
609 if ( ::tqqt_cast<TQComboBox *>( r ) ) {
610 TQComboBox *cb =
static_cast<TQComboBox*
>( r );
611 cb->setMinimumWidth( d->m_comboWidth );
612 cb->setMaximumWidth( d->m_comboWidth );
617 void KSelectAction::updateItems(
int id )
619 kdDebug(129) <<
"KAction::updateItems( " <<
id <<
", lst )" <<
endl;
620 TQWidget* w = container(
id );
621 if ( ::tqqt_cast<KToolBar *>( w ) ) {
622 TQWidget* r =
static_cast<KToolBar*
>( w )->getWidget( itemId(
id ) );
623 if ( ::tqqt_cast<TQComboBox *>( r ) ) {
624 TQComboBox *cb =
static_cast<TQComboBox*
>( r );
627 TQStringList::ConstIterator it = lst.begin();
628 for( ; it != lst.end(); ++it )
629 cb->insertItem( *it );
641 if (kapp && !kapp->authorizeKAction(name()))
643 kdDebug(129) <<
"KSelectAction::plug( " << widget <<
", " << index <<
" )" <<
endl;
644 if ( ::tqqt_cast<TQPopupMenu *>( widget) )
649 TQPopupMenu* menu =
static_cast<TQPopupMenu*
>( widget );
652 id = menu->insertItem(
iconSet(),
text(), d->m_menu, -1, index );
654 id = menu->insertItem(
text(), d->m_menu, -1, index );
657 menu->setItemEnabled(
id,
false );
660 if ( !wth.isEmpty() )
661 menu->TQMenuData::setWhatsThis(
id, wth );
663 addContainer( menu,
id );
664 connect( menu, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
666 return containerCount() - 1;
668 else if ( ::tqqt_cast<KToolBar *>( widget ) )
673 TQT_SIGNAL(
activated(
const TQString & ) ),
this,
674 TQT_SLOT( slotActivated(
const TQString & ) ),
isEnabled(),
677 TQComboBox *cb = bar->
getCombo( id_ );
680 if (!
isEditable()) cb->setFocusPolicy(TQ_NoFocus);
681 cb->setMinimumWidth( cb->sizeHint().width() );
682 if ( d->m_comboWidth > 0 )
684 cb->setMinimumWidth( d->m_comboWidth );
685 cb->setMaximumWidth( d->m_comboWidth );
687 cb->setInsertionPolicy( TQComboBox::NoInsertion );
689 if ( d->m_maxComboViewCount != -1 ) cb->setSizeLimit( d->m_maxComboViewCount );
692 addContainer( bar, id_ );
694 connect( bar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
696 updateCurrentItem( containerCount() - 1 );
698 return containerCount() - 1;
700 else if ( ::tqqt_cast<TQMenuBar *>( widget ) )
705 TQMenuBar* menu =
static_cast<TQMenuBar*
>( widget );
706 int id = menu->insertItem(
text(), d->m_menu, -1, index );
709 menu->setItemEnabled(
id,
false );
712 if ( !wth.isEmpty() )
713 menu->TQMenuData::setWhatsThis(
id, wth );
715 addContainer( menu,
id );
716 connect( menu, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
718 return containerCount() - 1;
721 kdWarning() <<
"Can not plug KAction in " << widget->className() <<
endl;
727 if( d->m_menuAccelsEnabled ) {
729 TQStringList::ConstIterator it = d->m_list.begin();
730 for( ; it != d->m_list.end(); ++it )
733 int i = item.find(
'&' );
735 item = item.remove( i, 1 );
749 int len = containerCount();
750 for(
int i = 0; i < len; ++i )
754 void KSelectAction::updateClear(
int id )
756 TQWidget* w = container(
id );
757 if ( ::tqqt_cast<KToolBar *>( w ) ) {
758 TQWidget* r =
static_cast<KToolBar*
>( w )->getWidget( itemId(
id ) );
759 if ( ::tqqt_cast<TQComboBox *>( r ) ) {
760 TQComboBox *b =
static_cast<TQComboBox*
>( r );
766 void KSelectAction::slotActivated(
int id )
768 if ( d->m_current ==
id )
774 TQTimer::singleShot( 0,
this, TQT_SLOT( slotActivated() ) );
777 void KSelectAction::slotActivated(
const TQString &text )
781 TQStringList lst = d->m_list;
782 if(!lst.contains(text))
789 int i = d->m_list.findIndex( text );
796 TQTimer::singleShot( 0,
this, TQT_SLOT( slotActivated() ) );
799 void KSelectAction::slotActivated()
801 KAction::slotActivated();
829 d->m_menuAccelsEnabled = b;
834 return d->m_menuAccelsEnabled;
837 class KListAction::KListActionPrivate
848 TQObject* parent,
const char* name )
851 d =
new KListActionPrivate;
855 const TQObject* receiver,
const char* slot,
856 TQObject* parent,
const char* name )
859 d =
new KListActionPrivate;
861 connect(
this, TQT_SIGNAL(
activated(
int ) ), receiver, slot );
866 TQObject* parent,
const char* name )
869 d =
new KListActionPrivate;
874 TQObject* parent,
const char* name )
877 d =
new KListActionPrivate;
881 const KShortcut& cut,
const TQObject* receiver,
882 const char* slot, TQObject* parent,
886 d =
new KListActionPrivate;
888 connect(
this, TQT_SIGNAL(
activated(
int ) ), receiver, slot );
892 const KShortcut& cut,
const TQObject* receiver,
893 const char* slot, TQObject* parent,
897 d =
new KListActionPrivate;
899 connect(
this, TQT_SIGNAL(
activated(
int ) ), receiver, slot );
905 d =
new KListActionPrivate;
916 d->m_current = index;
933 class KRecentFilesAction::KRecentFilesActionPrivate
936 KRecentFilesActionPrivate()
943 TQMap<TQString, TQString> m_shortNames;
944 TQMap<TQString, KURL> m_urls;
949 TQObject* parent,
const char* name,
953 d =
new KRecentFilesActionPrivate;
961 const TQObject* receiver,
963 TQObject* parent,
const char* name,
967 d =
new KRecentFilesActionPrivate;
978 const TQIconSet& pix,
980 TQObject* parent,
const char* name,
984 d =
new KRecentFilesActionPrivate;
993 TQObject* parent,
const char* name,
997 d =
new KRecentFilesActionPrivate;
1004 const TQIconSet& pix,
1006 const TQObject* receiver,
1008 TQObject* parent,
const char* name,
1012 d =
new KRecentFilesActionPrivate;
1023 const TQString& pix,
1025 const TQObject* receiver,
1027 TQObject* parent,
const char* name,
1031 d =
new KRecentFilesActionPrivate;
1045 d =
new KRecentFilesActionPrivate;
1051 void KRecentFilesAction::init()
1055 connect(d->m_popup, TQT_SIGNAL(aboutToShow()),
this, TQT_SLOT(menuAboutToShow()));
1056 connect(d->m_popup, TQT_SIGNAL(
activated(
int)),
this, TQT_SLOT(menuItemActivated(
int)));
1057 connect(
this, TQT_SIGNAL(
activated(
const TQString& ) ),
1058 this, TQT_SLOT( itemSelected(
const TQString& ) ) );
1071 return d->m_maxItems;
1077 uint oldCount = lst.count();
1086 TQString lastItem = lst.last();
1087 d->m_shortNames.erase( lastItem );
1088 d->m_urls.erase( lastItem );
1089 lst.remove( lastItem );
1093 if( lst.count() != oldCount )
1110 const TQStringList::Iterator end = lst.end();
1111 for ( TQStringList::Iterator it = lst.begin(); it != end; ++it )
1113 TQString title = (*it);
1114 if ( title.endsWith( file +
"]" ) )
1117 d->m_urls.erase( title );
1118 d->m_shortNames.erase( title );
1123 if( lst.count() == d->m_maxItems )
1126 const TQString lastItem = lst.last();
1127 d->m_shortNames.erase( lastItem );
1128 d->m_urls.erase( lastItem );
1129 lst.remove( lastItem );
1133 const TQString title = name +
" [" + file +
"]";
1134 d->m_shortNames.insert( title, name );
1135 d->m_urls.insert( title, url );
1136 lst.prepend( title );
1146 TQStringList::Iterator end = lst.end();
1147 for ( TQStringList::Iterator it = lst.begin(); it != end; ++it )
1149 if ( (*it).endsWith( file +
"]" ))
1151 d->m_shortNames.erase( (*it) );
1152 d->m_urls.erase( (*it) );
1163 d->m_shortNames.clear();
1178 oldGroup = config->
group();
1180 if (groupname.isEmpty())
1181 groupname =
"RecentFiles";
1185 for(
unsigned int i = 1 ; i <= d->m_maxItems ; i++ )
1187 key = TQString(
"File%1" ).arg( i );
1195 nameKey = TQString(
"Name%1" ).arg( i );
1197 title = nameValue +
" [" + value +
"]";
1198 if (!value.isNull())
1200 lst.append( title );
1201 d->m_shortNames.insert( title, nameValue );
1202 d->m_urls.insert( title, url );
1219 oldGroup = config->
group();
1221 if (groupname.isEmpty())
1222 groupname =
"RecentFiles";
1227 for(
unsigned int i = 1 ; i <= lst.count() ; i++ )
1230 key = TQString(
"File%1" ).arg( i );
1231 value = d->m_urls[ lst[ i - 1 ] ].pathOrURL();
1233 key = TQString(
"Name%1" ).arg( i );
1234 value = d->m_shortNames[ lst[ i - 1 ] ];
1241 void KRecentFilesAction::itemSelected(
const TQString& text )
1249 void KRecentFilesAction::menuItemActivated(
int id )
1251 TQString text = d->m_popup->text(
id);
1258 void KRecentFilesAction::menuAboutToShow()
1263 for ( TQStringList::Iterator it = list.begin(); it != list.end(); ++it )
1265 menu->insertItem(*it);
1271 if (kapp && !kapp->authorizeKAction(name()))
1275 if ( ::tqqt_cast<KToolBar *>( widget ) )
1282 if ( m_parentCollection )
1283 instance = m_parentCollection->
instance();
1287 bar->
insertButton( icon(), id_, TQT_SIGNAL( clicked() ),
this,
1288 TQT_SLOT( slotClicked() ),
isEnabled(), plainText(),
1291 addContainer( bar, id_ );
1293 connect( bar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
1298 TQWhatsThis::add( bar->
getButton( id_ ), whatsThisWithIcon() );
1300 return containerCount() - 1;
1306 void KRecentFilesAction::slotClicked()
1308 KAction::slotActivated();
1311 void KRecentFilesAction::slotActivated(
const TQString& text)
1313 KListAction::slotActivated(text);
1317 void KRecentFilesAction::slotActivated(
int id)
1319 KListAction::slotActivated(
id);
1323 void KRecentFilesAction::slotActivated()
1333 TQStringList result;
1335 for(
unsigned int i = 1 ; i <= lst.count() ; i++ )
1350 class KFontAction::KFontActionPrivate
1353 KFontActionPrivate()
1356 TQStringList m_fonts;
1359 KFontAction::KFontAction(
const TQString& text,
1364 d =
new KFontActionPrivate;
1370 KFontAction::KFontAction(
const TQString& text,
const KShortcut& cut,
1371 const TQObject* receiver,
const char* slot,
1372 TQObject* parent,
const char* name )
1375 d =
new KFontActionPrivate;
1381 KFontAction::KFontAction(
const TQString& text,
const TQIconSet& pix,
1383 TQObject* parent,
const char* name )
1386 d =
new KFontActionPrivate;
1392 KFontAction::KFontAction(
const TQString& text,
const TQString& pix,
1394 TQObject* parent,
const char* name )
1397 d =
new KFontActionPrivate;
1403 KFontAction::KFontAction(
const TQString& text,
const TQIconSet& pix,
1405 const TQObject* receiver,
const char* slot,
1406 TQObject* parent,
const char* name )
1407 :
KSelectAction( text, pix, cut, receiver, slot, parent, name )
1409 d =
new KFontActionPrivate;
1415 KFontAction::KFontAction(
const TQString& text,
const TQString& pix,
1417 const TQObject* receiver,
const char* slot,
1418 TQObject* parent,
const char* name )
1419 :
KSelectAction( text, pix, cut, receiver, slot, parent, name )
1421 d =
new KFontActionPrivate;
1427 KFontAction::KFontAction( uint fontListCriteria,
const TQString& text,
1432 d =
new KFontActionPrivate;
1438 KFontAction::KFontAction( uint fontListCriteria,
const TQString& text,
const TQString& pix,
1440 TQObject* parent,
const char* name )
1443 d =
new KFontActionPrivate;
1449 KFontAction::KFontAction( TQObject* parent,
const char* name )
1452 d =
new KFontActionPrivate;
1458 KFontAction::~KFontAction()
1467 void KFontAction::setFont(
const TQString &family )
1469 TQString lowerName = family.lower();
1471 for ( TQStringList::Iterator it = d->m_fonts.begin(); it != d->m_fonts.end(); ++it, ++i )
1473 if ((*it).lower() == lowerName)
1479 i = lowerName.find(
" [");
1482 lowerName = lowerName.left(i);
1484 for ( TQStringList::Iterator it = d->m_fonts.begin(); it != d->m_fonts.end(); ++it, ++i )
1486 if ((*it).lower() == lowerName)
1496 for ( TQStringList::Iterator it = d->m_fonts.begin(); it != d->m_fonts.end(); ++it, ++i )
1498 if ((*it).lower().startsWith(lowerName))
1507 FcPattern *pattern = NULL;
1508 FcConfig *config = NULL;
1510 TQString realFamily;
1511 TQRegExp regExp(
"[-:]");
1512 pattern = FcNameParse( (
unsigned char*) family.ascii() );
1513 FcDefaultSubstitute(pattern);
1514 FcConfigSubstitute (config, pattern, FcMatchPattern);
1515 pattern = FcFontMatch(NULL, pattern, &result);
1516 realFamily = (
char*)FcNameUnparse(pattern);
1517 realFamily.remove(realFamily.find(regExp), realFamily.length());
1519 if ( !realFamily.isEmpty() && realFamily != family )
1520 setFont( realFamily );
1522 kdDebug(129) <<
"Font not found " << family.lower() <<
endl;
1525 int KFontAction::plug( TQWidget *w,
int index )
1527 if (kapp && !kapp->authorizeKAction(
name()))
1529 if ( ::tqqt_cast<KToolBar *>( w ) )
1534 connect( cb, TQT_SIGNAL( activated(
const TQString & ) ),
1535 TQT_SLOT( slotActivated(
const TQString & ) ) );
1536 cb->setEnabled( isEnabled() );
1538 cb->setMinimumWidth( cb->sizeHint().width() );
1540 addContainer( bar, id_ );
1542 connect( bar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
1544 updateCurrentItem( containerCount() - 1 );
1546 return containerCount() - 1;
1551 class KFontSizeAction::KFontSizeActionPrivate
1554 KFontSizeActionPrivate()
1559 KFontSizeAction::KFontSizeAction(
const TQString& text,
1561 TQObject* parent,
const char* name )
1567 KFontSizeAction::KFontSizeAction(
const TQString& text,
1569 const TQObject* receiver,
const char* slot,
1570 TQObject* parent,
const char* name )
1576 KFontSizeAction::KFontSizeAction(
const TQString& text,
const TQIconSet& pix,
1578 TQObject* parent,
const char* name )
1584 KFontSizeAction::KFontSizeAction(
const TQString& text,
const TQString& pix,
1586 TQObject* parent,
const char* name )
1592 KFontSizeAction::KFontSizeAction(
const TQString& text,
const TQIconSet& pix,
1594 const TQObject* receiver,
1595 const char* slot, TQObject* parent,
1597 :
KSelectAction( text, pix, cut, receiver, slot, parent, name )
1602 KFontSizeAction::KFontSizeAction(
const TQString& text,
const TQString& pix,
1604 const TQObject* receiver,
1605 const char* slot, TQObject* parent,
1607 :
KSelectAction( text, pix, cut, receiver, slot, parent, name )
1612 KFontSizeAction::KFontSizeAction( TQObject* parent,
const char* name )
1618 KFontSizeAction::~KFontSizeAction()
1624 void KFontSizeAction::init()
1626 d =
new KFontSizeActionPrivate;
1628 setEditable(
true );
1629 TQFontDatabase fontDB;
1630 TQValueList<int> sizes = fontDB.standardSizes();
1632 for ( TQValueList<int>::Iterator it = sizes.begin(); it != sizes.end(); ++it )
1633 lst.append( TQString::number( *it ) );
1638 void KFontSizeAction::setFontSize(
int size )
1640 if ( size == fontSize() ) {
1641 setCurrentItem( items().findIndex( TQString::number( size ) ) );
1646 kdWarning() <<
"KFontSizeAction: Size " << size <<
" is out of range" <<
endl;
1650 int index = items().findIndex( TQString::number( size ) );
1651 if ( index == -1 ) {
1653 TQValueList<int> lst;
1655 TQStringList itemsList = items();
1656 for (TQStringList::Iterator it = itemsList.begin() ; it != itemsList.end() ; ++it)
1657 lst.append( (*it).toInt() );
1663 TQStringList strLst;
1664 for (TQValueList<int>::Iterator it = lst.begin() ; it != lst.end() ; ++it)
1665 strLst.append( TQString::number(*it) );
1668 index = lst.findIndex( size );
1669 setCurrentItem( index );
1672 setCurrentItem( index );
1681 int KFontSizeAction::fontSize()
const
1683 return currentText().toInt();
1686 void KFontSizeAction::slotActivated(
int index )
1688 KSelectAction::slotActivated( index );
1690 emit fontSizeChanged( items()[ index ].toInt() );
1693 void KFontSizeAction::slotActivated(
const TQString& size )
1695 setFontSize( size.toInt() );
1696 KSelectAction::slotActivated( size );
1697 emit fontSizeChanged( size.toInt() );
1700 class KActionMenu::KActionMenuPrivate
1703 KActionMenuPrivate()
1705 m_popup =
new KPopupMenu(0L,
"KActionMenu::KActionMenuPrivate");
1707 m_stickyMenu =
true;
1709 ~KActionMenuPrivate()
1711 delete m_popup; m_popup = 0;
1718 KActionMenu::KActionMenu( TQObject* parent,
const char* name )
1721 d =
new KActionMenuPrivate;
1725 KActionMenu::KActionMenu(
const TQString& text, TQObject* parent,
1727 :
KAction( text, 0, parent, name )
1729 d =
new KActionMenuPrivate;
1733 KActionMenu::KActionMenu(
const TQString& text,
const TQIconSet& icon,
1734 TQObject* parent,
const char* name )
1735 :
KAction( text, icon, 0, parent, name )
1737 d =
new KActionMenuPrivate;
1741 KActionMenu::KActionMenu(
const TQString& text,
const TQString& icon,
1742 TQObject* parent,
const char* name )
1743 :
KAction( text, icon, 0, parent, name )
1745 d =
new KActionMenuPrivate;
1749 KActionMenu::~KActionMenu()
1752 kdDebug(129) <<
"KActionMenu::~KActionMenu()" <<
endl;
1756 void KActionMenu::popup(
const TQPoint& global )
1758 popupMenu()->popup( global );
1766 void KActionMenu::insert(
KAction* cmd,
int index )
1769 cmd->
plug( d->m_popup, index );
1772 void KActionMenu::remove(
KAction* cmd )
1775 cmd->
unplug( d->m_popup );
1779 return d->m_delayed;
1783 d->m_delayed = _delayed;
1787 return d->m_stickyMenu;
1791 d->m_stickyMenu = sticky;
1796 if (kapp && !kapp->authorizeKAction(name()))
1798 kdDebug(129) <<
"KActionMenu::plug( " << widget <<
", " << index <<
" )" <<
endl;
1799 if ( ::tqqt_cast<TQPopupMenu *>( widget ) )
1801 TQPopupMenu* menu =
static_cast<TQPopupMenu*
>( widget );
1804 id = menu->insertItem(
iconSet(),
text(), d->m_popup, -1, index );
1806 id = menu->insertItem(
text(), d->m_popup, -1, index );
1809 menu->setItemEnabled(
id,
false );
1811 addContainer( menu,
id );
1812 connect( menu, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
1814 if ( m_parentCollection )
1817 return containerCount() - 1;
1819 else if ( ::tqqt_cast<KToolBar *>( widget ) )
1825 if ( icon().isEmpty() && !
iconSet().isNull() )
1827 TQT_SLOT( slotActivated() ),
isEnabled(), plainText(),
1833 if ( m_parentCollection )
1834 instance = m_parentCollection->
instance();
1838 bar->
insertButton( icon(), id_, TQT_SIGNAL( clicked() ),
this,
1839 TQT_SLOT( slotActivated() ),
isEnabled(), plainText(),
1843 addContainer( bar, id_ );
1848 connect( bar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
1856 if ( m_parentCollection )
1859 return containerCount() - 1;
1861 else if ( ::tqqt_cast<TQMenuBar *>( widget ) )
1863 TQMenuBar *bar =
static_cast<TQMenuBar *
>( widget );
1867 id = bar->insertItem(
text(), popupMenu(), -1, index );
1872 addContainer( bar,
id );
1873 connect( bar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
1875 return containerCount() - 1;
1884 const TQString& icon,
1886 TQObject* parent,
const char* name )
1887 :
KAction( text, icon, cut, parent, name )
1891 m_stickyMenu =
true;
1895 const TQString& icon,
1897 const TQObject* receiver,
1898 const char* slot, TQObject* parent,
1900 :
KAction( text, icon, cut, receiver, slot, parent, name )
1904 m_stickyMenu =
true;
1909 const TQObject* receiver,
1912 :
KAction( item, cut, receiver, slot, parent, name )
1916 m_stickyMenu =
true;
1919 KToolBarPopupAction::~KToolBarPopupAction()
1933 return m_stickyMenu;
1937 m_stickyMenu = sticky;
1942 if (kapp && !kapp->authorizeKAction(name()))
1946 if ( ::tqqt_cast<KToolBar *>( widget ) )
1952 if ( icon().isEmpty() && !
iconSet().isNull() ) {
1953 bar->
insertButton(
iconSet().pixmap(), id_, TQT_SIGNAL( buttonClicked(
int, TQt::ButtonState) ),
this,
1959 if ( m_parentCollection )
1960 instance = m_parentCollection->
instance();
1964 bar->
insertButton( icon(), id_, TQT_SIGNAL( buttonClicked(
int, TQt::ButtonState) ),
this,
1970 addContainer( bar, id_ );
1972 connect( bar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
1981 TQWhatsThis::add( bar->
getButton( id_ ), whatsThisWithIcon() );
1983 return containerCount() - 1;
2003 , m_toolBarName( toolBarName )
2011 , m_toolBarName( 0 ), m_toolBar( toolBar )
2015 KToggleToolBarAction::~KToggleToolBarAction()
2021 if (kapp && !kapp->authorizeKAction(name()))
2028 while ( !tl->isDialog() && ( n = tl->parentWidget() ) )
2034 m_toolBar = mw->
toolBar( m_toolBarName );
2038 setChecked( m_toolBar->isVisible() );
2039 connect( m_toolBar, TQT_SIGNAL(visibilityChanged(
bool)),
this, TQT_SLOT(setChecked(
bool)) );
2041 connect( m_toolBar, TQT_SIGNAL(visibilityChanged(
bool)),
this, TQT_SIGNAL(toggled(
bool)) );
2049 void KToggleToolBarAction::setChecked(
bool c )
2051 if( m_toolBar && c != m_toolBar->isVisible() ) {
2057 TQMainWindow* mw = m_toolBar->mainWindow();
2058 if ( mw && ::tqqt_cast<KMainWindow *>( mw ) )
2059 static_cast<KMainWindow *
>( mw )->setSettingsDirty();
2067 const TQObject* receiver,
const char* slot,
2068 TQObject* parent, TQWidget* window,
2070 :
KToggleAction( TQString::null, cut, receiver, slot, parent, name ),
2076 KToggleFullScreenAction::~KToggleFullScreenAction()
2083 window->removeEventFilter(
this );
2086 window->installEventFilter(
this );
2089 void KToggleFullScreenAction::setChecked(
bool c )
2093 setText(i18n(
"Exit F&ull Screen Mode"));
2094 setIcon(
"window_nofullscreen");
2098 setText(i18n(
"F&ull Screen Mode"));
2099 setIcon(
"window_fullscreen");
2106 if( TQT_BASE_OBJECT(o) == TQT_BASE_OBJECT(window) )
2107 if( e->type() == TQEvent::WindowStateChange )
2109 if( window->isFullScreen() !=
isChecked())
2118 const TQString& text,
const KShortcut& cut,
2119 const TQObject* receiver,
const char* slot,
2121 :
KAction( text, cut, receiver, slot, parent, name )
2122 , m_widget( widget )
2123 , m_autoSized( false )
2125 connect(
this, TQT_SIGNAL(enabled(
bool)), widget, TQT_SLOT(
setEnabled(
bool)) );
2128 KWidgetAction::~KWidgetAction()
2132 void KWidgetAction::setAutoSized(
bool autoSized )
2134 if( m_autoSized == autoSized )
2137 m_autoSized = autoSized;
2143 int i = findContainer( toolBar );
2146 int id = itemId( i );
2153 if (kapp && !kapp->authorizeKAction(name()))
2156 if ( !::tqqt_cast<KToolBar *>( w ) ) {
2157 kdError() <<
"KWidgetAction::plug: KWidgetAction must be plugged into KToolBar." <<
endl;
2161 kdError() <<
"KWidgetAction::plug: Widget was deleted or null!" <<
endl;
2169 m_widget->reparent( toolBar, TQPoint() );
2173 TQWhatsThis::add( m_widget,
whatsThis() );
2174 addContainer( toolBar,
id );
2176 connect( toolBar, TQT_SIGNAL( toolbarDestroyed() ),
this, TQT_SLOT( slotToolbarDestroyed() ) );
2177 connect( toolBar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
2179 return containerCount() - 1;
2190 disconnect( toolBar, TQT_SIGNAL( toolbarDestroyed() ),
this, TQT_SLOT( slotToolbarDestroyed() ) );
2191 m_widget->reparent( 0L, TQPoint(),
false );
2196 void KWidgetAction::slotToolbarDestroyed()
2204 m_widget->reparent( 0L, TQPoint(),
false );
2209 KActionSeparator::KActionSeparator( TQObject *parent,
const char *name )
2214 KActionSeparator::~KActionSeparator()
2218 int KActionSeparator::plug( TQWidget *widget,
int index )
2220 if ( ::tqqt_cast<TQPopupMenu *>( widget) )
2222 TQPopupMenu* menu =
static_cast<TQPopupMenu*
>( widget );
2224 int id = menu->insertSeparator( index );
2226 addContainer( menu,
id );
2227 connect( menu, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
2229 return containerCount() - 1;
2231 else if ( ::tqqt_cast<TQMenuBar *>( widget ) )
2233 TQMenuBar *menuBar =
static_cast<TQMenuBar *
>( widget );
2235 int id = menuBar->insertSeparator( index );
2237 addContainer( menuBar,
id );
2239 connect( menuBar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
2241 return containerCount() - 1;
2243 else if ( ::tqqt_cast<KToolBar *>( widget ) )
2249 addContainer( toolBar,
id );
2251 connect( toolBar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
2253 return containerCount() - 1;
2260 const TQString& icon,
2262 const TQObject* receiver,
2263 const char* slot, TQObject* parent,
2265 :
KAction( text, icon, cut, receiver, slot, parent, name )
2268 connect(m_popup, TQT_SIGNAL(aboutToShow()),
this, TQT_SLOT(menuAboutToShow()));
2269 connect(m_popup, TQT_SIGNAL(
activated(
int)),
this, TQT_SLOT(menuItemActivated(
int)));
2270 m_popup->setCheckable(
true);
2274 KPasteTextAction::~KPasteTextAction()
2286 if (kapp && !kapp->authorizeKAction(name()))
2288 if ( ::tqqt_cast<KToolBar *>( widget ) )
2295 if ( m_parentCollection )
2296 instance = m_parentCollection->
instance();
2300 bar->
insertButton( icon(), id_, TQT_SIGNAL( clicked() ),
this,
2301 TQT_SLOT( slotActivated() ),
isEnabled(), plainText(),
2304 addContainer( bar, id_ );
2306 connect( bar, TQT_SIGNAL( destroyed() ),
this, TQT_SLOT( slotDestroyed() ) );
2311 TQWhatsThis::add( bar->
getButton( id_ ), whatsThisWithIcon() );
2313 return containerCount() - 1;
2319 void KPasteTextAction::menuAboutToShow()
2325 DCOPRef klipper(
"klipper",
"klipper");
2326 DCOPReply reply = klipper.call(
"getClipboardHistoryMenu");
2330 TQString clipboardText = tqApp->clipboard()->text(TQClipboard::Clipboard);
2332 list << clipboardText;
2334 for ( TQStringList::ConstIterator it = list.begin(); it != list.end(); ++it )
2337 text.replace(
"&",
"&&");
2338 int id = m_popup->insertItem(text);
2339 if (!found && *it == clipboardText)
2341 m_popup->setItemChecked(
id,
true);
2347 void KPasteTextAction::menuItemActivated(
int id)
2351 DCOPRef klipper(
"klipper",
"klipper");
2352 DCOPReply reply = klipper.call(
"getClipboardHistoryItem(int)", m_popup->indexOf(
id));
2355 TQString clipboardText = reply;
2356 reply = klipper.call(
"setClipboardContents(TQString)", clipboardText);
2358 kdDebug(129) <<
"Clipboard: " << TQString(tqApp->clipboard()->text(TQClipboard::Clipboard)) << endl;
2360 TQTimer::singleShot(20,
this, TQT_SLOT(slotActivated()));
2363 void KPasteTextAction::slotActivated()
2366 TQWidget *w = tqApp->widgetAt(TQCursor::pos(),
true);
2367 TQMimeSource *data = TQApplication::clipboard()->data();
2368 if (!data->provides(
"text/plain") && w) {
2369 m_popup->popup(w->mapToGlobal(TQPoint(0, w->height())));
2371 KAction::slotActivated();
2373 KAction::slotActivated();
2377 void KToggleAction::virtual_hook(
int id,
void* data )
2378 { KAction::virtual_hook(
id, data ); }
2380 void KRadioAction::virtual_hook(
int id,
void* data )
2381 { KToggleAction::virtual_hook(
id, data ); }
2383 void KSelectAction::virtual_hook(
int id,
void* data )
2384 { KAction::virtual_hook(
id, data ); }
2386 void KListAction::virtual_hook(
int id,
void* data )
2387 { KSelectAction::virtual_hook(
id, data ); }
2389 void KRecentFilesAction::virtual_hook(
int id,
void* data )
2390 { KListAction::virtual_hook(
id, data ); }
2392 void KFontAction::virtual_hook(
int id,
void* data )
2393 { KSelectAction::virtual_hook(
id, data ); }
2395 void KFontSizeAction::virtual_hook(
int id,
void* data )
2396 { KSelectAction::virtual_hook(
id, data ); }
2398 void KActionMenu::virtual_hook(
int id,
void* data )
2399 { KAction::virtual_hook(
id, data ); }
2401 void KToolBarPopupAction::virtual_hook(
int id,
void* data )
2402 { KAction::virtual_hook(
id, data ); }
2404 void KToggleToolBarAction::virtual_hook(
int id,
void* data )
2405 { KToggleAction::virtual_hook(
id, data ); }
2407 void KToggleFullScreenAction::virtual_hook(
int id,
void* data )
2408 { KToggleAction::virtual_hook(
id, data ); }
2410 void KWidgetAction::virtual_hook(
int id,
void* data )
2411 { KAction::virtual_hook(
id, data ); }
2413 void KActionSeparator::virtual_hook(
int id,
void* data )
2414 { KAction::virtual_hook(
id, data ); }
2416 void KPasteTextAction::virtual_hook(
int id,
void* data )
2417 { KAction::virtual_hook(
id, data ); }
2422 #include "kactionclasses.moc"
virtual ~KSelectAction()
Destructor.
virtual void setShortcutConfigurable(bool)
Indicate whether the user may configure the action's shortcut.
A managed set of KAction objects.
bool isChecked() const
Returns the actual state of the action.
virtual void setCurrentItem(int index)
Sets the currently checked item.
void slotButtonClicked(int, TQt::ButtonState state)
virtual void setComboWidth(int width)
When this action is plugged into a toolbar, it creates a combobox.
bool isApplicationRegistered(const TQCString &remApp)
virtual TQString whatsThis() const
Get the What's this text for the action.
Remove this class in KDE-4.0. It doesn't add anything to KSelectAction.
void clearURLList()
Removes all entries from the recent files list.
virtual TQStringList items() const
void setMaxComboViewCount(int n)
Sets the maximum items that are visible at once if the action is a combobox, that is the number of it...
kdbgstream kdError(int area=0)
TQIconSet iconSet() const
Remove in KDE4.
TQString fileName(bool _ignore_trailing_slash_in_path=true) const
virtual ~KToggleAction()
Destructor.
virtual void setExclusiveGroup(const TQString &name)
Defines which "exclusive group" this action is part of.
virtual void setChecked(bool)
Sets the state of the action.
kdbgstream kdDebug(int area=0)
static void getFontList(TQStringList &list, uint fontListCriteria)
Creates a list of font strings.
KListAction(const TQString &text, const KShortcut &cut=KShortcut(), TQObject *parent=0, const char *name=0)
Constructs a list action with text and potential keyboard accelerator but nothing else...
TQString pathOrURL() const
KSelectAction(const TQString &text, const KShortcut &cut=KShortcut(), TQObject *parent=0, const char *name=0)
Constructs a select action with text and potential keyboard accelerator but nothing else...
void setGroup(const TQString &group)
void setMixedMode(bool mode)
Controls the behavior of the clipboard history menu popup.
virtual TQString currentText() const
Returns the text of the currently selected item.
virtual int currentItem() const
Returns the index of the current item.
virtual bool eventFilter(TQObject *o, TQEvent *e)
void loadEntries(KConfig *config, TQString groupname=TQString::null)
Loads the recent files entries from a given KConfig object.
TQString readPathEntry(const TQString &pKey, const TQString &aDefault=TQString::null) const
KPasteTextAction(const TQString &text, const TQString &icon, const KShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent=0, const char *name=0)
Create a KPasteTextAction, with a text, an icon, an accelerator, a slot connected to the action...
virtual ~KRecentFilesAction()
Destructor.
Action for selecting one of several items.
virtual void setEditable(bool)
When this action is plugged into a toolbar, it creates a combobox.
virtual int plug(TQWidget *widget, int index=-1)
"Plug" or insert this action into a given widget.
uint maxItems() const
Returns the maximum of items in the recent files list.
void urlSelected(const KURL &url)
This signal gets emited when the user selects an URL.
static KStandardDirs * dirs()
virtual bool isPlugged() const
returns whether the action is plugged into any container widget or not.
static TQString cEmSqueeze(const TQString &name, const TQFontMetrics &fontMetrics, uint maxlen=30)
const KGuiItem & guiItem() const
Return the underlying KGuiItem.
KDE top level main window
virtual void setItems(const TQStringList &lst)
Sets the items to be displayed in this action You need to call this.
KInstance * instance() const
The instance with which this class is associated.
TQStringList completeItems() const
void setCheckedState(const KGuiItem &checkedItem)
Defines the text (and icon, tooltip, whatsthis) that should be displayed instead of the normal text...
A combobox that lists the available fonts.
An abstract class for GUI data such as ToolTip and Icon.
void removeURL(const KURL &url)
Remove an URL from the recent files list.
void addURL(const KURL &url)
Add URL to recent files list.
virtual TQString toolTip() const
Get the tooltip text for the action.
kdbgstream kdWarning(int area=0)
static int getToolButtonID()
How it works.
virtual void unplug(TQWidget *w)
"Unplug" or remove this action from a given widget.
void saveEntries(KConfig *config, TQString groupname=TQString::null)
Saves the current recent files entries to a given KConfig object.
virtual bool isEditable() const
When this action is plugged into a toolbar, it creates a combobox.
virtual int plug(TQWidget *widget, int index=-1)
"Plug" or insert this action into a given widget.
void setMenuAccelsEnabled(bool b)
Sets whether any occurrence of the ampersand character ( & ) in items should be interpreted as keyboa...
virtual int plug(TQWidget *widget, int index=-1)
"Plug" or insert this action into a given widget.
bool deleteGroup(const TQString &group, bool bDeep=true, bool bGlobal=false)
TQPopupMenu * popupMenu() const
Returns a pointer to the popup menu used by this action.
static KInstance * instance()
virtual ~KListAction()
Destructor.
KRadioAction(const TQString &text, const KShortcut &cut=KShortcut(), TQObject *parent=0, const char *name=0)
Constructs a radio action with text and potential keyboard accelerator but nothing else...
void setRemoveAmpersandsInCombo(bool b) KDE_DEPRECATED
TQString relativeLocation(const char *type, const TQString &absPath)
TQStringList comboItems() const
Depending on the menuAccelsEnabled property this method will return the actions items in a way for in...
virtual int comboWidth() const
When this action is plugged into a toolbar, it creates a combobox.
virtual void setCurrentItem(int index)
Sets the currently checked item.
virtual int plug(TQWidget *widget, int index=-1)
"Plug" or insert this action into a given widget.
TQString name(StdAccel id)
bool menuAccelsEnabled() const
KToggleAction(const TQString &text, const KShortcut &cut=KShortcut(), TQObject *parent=0, const char *name=0)
Constructs a toggle action with text and potential keyboard accelerator but nothing else...
virtual TQString text() const
Get the text associated with this action.
Class to encapsulate user-driven action or event.
virtual TQStringList items() const
void connectHighlight(TQWidget *container, KAction *action)
Call this function if you want to receive a signal whenever a KAction is highlighted in a menu or a t...
void remove(const KKeySequence &keySeq)
virtual void clear()
Clears up all the items in this action.
bool removeAmpersandsInCombo() const
KToggleFullScreenAction(const KShortcut &cut, const TQObject *receiver, const char *slot, TQObject *parent, TQWidget *window, const char *name)
Create a KToggleFullScreenAction.
virtual TQString toolTip() const
Reimplemented for internal reasons.
void activated()
Emitted when this action is activated.
void writePathEntry(const TQString &pKey, const TQString &path, bool bPersistent=true, bool bGlobal=false, bool bNLS=false)
virtual int currentItem() const
Returns the index of the current item.
kndbgstream & endl(kndbgstream &s)
KToolBar * toolBar(const char *name=0)
Returns a pointer to the toolbar with the specified name.
virtual void setEnabled(bool enable)
Enables or disables this action.
KRecentFilesAction(const TQString &text, const KShortcut &cut, TQObject *parent, const char *name=0, uint maxItems=10)
virtual bool isEnabled() const
Returns true if this action is enabled.
virtual void setText(const TQString &text)
Sets the text associated with this action.
TQString exclusiveGroup() const
virtual void changeItem(int index, const TQString &text)
Changes the text of item.
virtual int plug(TQWidget *widget, int index=-1)
"Plug" or insert this action into a given widget.
void setMaxItems(uint maxItems)
Sets the maximum of items in the recent files list.
static KURL fromPathOrURL(const TQString &text)
virtual TQString currentText() const
Returns the text of the currently selected item.
void setWindow(TQWidget *window)
Sets the window that will be related to this action.