21 #include "kmainwindowiface_p.h"
27 #include <QtGui/QClipboard>
30 KMainWindowInterface::KMainWindowInterface(
KXmlGuiWindow * mainWindow)
33 m_MainWindow = mainWindow;
36 KMainWindowInterface::~KMainWindowInterface()
45 if (it->associatedWidgets().count()>0)
46 tmp_actions.append( it->objectName() );
51 bool KMainWindowInterface::activateAction(
const QString& action )
53 QAction *tmp_Action = m_MainWindow->actionCollection()->action(action);
56 tmp_Action->trigger();
63 bool KMainWindowInterface::disableAction(
const QString& action)
65 QAction *tmp_Action = m_MainWindow->actionCollection()->action(action);
68 tmp_Action->setEnabled(
false);
75 bool KMainWindowInterface::enableAction(
const QString& action)
77 QAction *tmp_Action = m_MainWindow->actionCollection()->action(action);
80 tmp_Action->setEnabled(
true);
87 bool KMainWindowInterface::actionIsEnabled(
const QString& action)
89 QAction *tmp_Action = m_MainWindow->actionCollection()->action(action);
92 return tmp_Action->isEnabled();
98 QString KMainWindowInterface::actionToolTip(
const QString& action)
100 QAction *tmp_Action = m_MainWindow->actionCollection()->action(action);
103 return tmp_Action->toolTip().toUtf8();
106 return "Error no such object!";
109 qlonglong KMainWindowInterface::winId()
111 return qlonglong(m_MainWindow->winId());
114 void KMainWindowInterface::grabWindowToClipBoard()
116 QClipboard *clipboard = QApplication::clipboard();
117 clipboard->setPixmap(QPixmap::grabWidget(m_MainWindow));
120 #include "kmainwindowiface_p.moc"
KDE top level main window with predefined action layout