20#include "tdemainwindowiface.h"
22#include <dcopclient.h>
23#include <tdeapplication.h>
24#include <kdcopactionproxy.h>
25#include <kdcoppropertyproxy.h>
26#include <tdemainwindow.h>
28#include <tqclipboard.h>
35 m_MainWindow = mainWindow;
36 m_dcopActionProxy =
new KDCOPActionProxy( m_MainWindow->actionCollection(),
this );
42 delete m_dcopActionProxy;
43 delete m_dcopPropertyProxy;
48 delete m_dcopActionProxy;
49 m_dcopActionProxy =
new KDCOPActionProxy( m_MainWindow->actionCollection(),
this );
50 QCStringList tmp_actions;
51 TQValueList<TDEAction *> lst = m_dcopActionProxy->actions();
52 TQValueList<TDEAction *>::ConstIterator it = lst.begin();
53 TQValueList<TDEAction *>::ConstIterator end = lst.end();
54 for (; it != end; ++it )
55 if ((*it)->isPlugged())
56 tmp_actions.
append( (TQCString)(*it)->name() );
61 delete m_dcopActionProxy;
62 m_dcopActionProxy =
new KDCOPActionProxy( m_MainWindow->actionCollection(),
this );
74 delete m_dcopActionProxy;
75 m_dcopActionProxy =
new KDCOPActionProxy( m_MainWindow->actionCollection(),
this );
87 delete m_dcopActionProxy;
88 m_dcopActionProxy =
new KDCOPActionProxy( m_MainWindow->actionCollection(),
this );
100 delete m_dcopActionProxy;
101 m_dcopActionProxy =
new KDCOPActionProxy( m_MainWindow->actionCollection(),
this );
112 delete m_dcopActionProxy;
113 m_dcopActionProxy =
new KDCOPActionProxy( m_MainWindow->actionCollection(),
this );
117 return tmp_Action->
toolTip().utf8();
120 return "Error no such object!";
125 return DCOPRef( kapp->dcopClient()->appId(), m_dcopActionProxy->actionObjectId( name ) );
130 return m_dcopActionProxy->actionMap();
135 return (
int) m_MainWindow->winId();
139 TQClipboard *clipboard = TQApplication::clipboard();
140 clipboard->setPixmap(TQPixmap::grabWidget(m_MainWindow));
142void TDEMainWindowInterface::hide()
144 m_MainWindow->
hide();
146void TDEMainWindowInterface::maximize()
148 m_MainWindow->showMaximized();
150void TDEMainWindowInterface::minimize()
152 m_MainWindow->showMinimized();
154void TDEMainWindowInterface::resize(
int newX,
int newY)
156 m_MainWindow->resize(newX, newY);
158void TDEMainWindowInterface::move(
int newX,
int newY)
160 m_MainWindow->move(newX, newY);
162void TDEMainWindowInterface::setGeometry(
int newX,
int newY,
int newWidth,
int newHeight)
164 m_MainWindow->setGeometry(newX, newY, newWidth, newHeight);
166void TDEMainWindowInterface::raise()
168 m_MainWindow->raise();
170void TDEMainWindowInterface::lower()
172 m_MainWindow->lower();
174void TDEMainWindowInterface::restore()
176 m_MainWindow->showNormal();
178void TDEMainWindowInterface::close()
180 m_MainWindow->close();
182void TDEMainWindowInterface::show()
184 m_MainWindow->show();
186void TDEMainWindowInterface::setActiveWindow()
188 m_MainWindow->setActiveWindow();
190void TDEMainWindowInterface::setActiveWindowFocused()
193 m_MainWindow->raise();
194 m_MainWindow->setActiveWindow();
201 return m_dcopPropertyProxy->functions();
203bool TDEMainWindowInterface::processDynamic(
const TQCString &fun,
const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
205 return m_dcopPropertyProxy->processPropertyRequest( fun, data, replyType, replyData);
virtual QCStringList functionsDynamic()
A proxy class publishing a DCOP interface for actions.
static void forceActiveWindow(WId win, long time=0)
Class to encapsulate user-driven action or event.
virtual void activate()
Emulate user's interaction programmatically, by activating the action.
virtual void setEnabled(bool enable)
Enables or disables this action.
virtual bool isEnabled() const
Returns true if this action is enabled.
virtual TQString toolTip() const
Get the tooltip text for the action.
int getWinID()
Returns the ID of the current main window.
bool disableAction(TQCString action)
Disables the requested action.
~TDEMainWindowInterface()
Destructor Cleans up the dcop action proxy object.
void grabWindowToClipBoard()
Copies a pixmap representation of the current main window to the clipboard.
TDEMainWindowInterface(TDEMainWindow *mainWindow)
Construct a new interface object.
QCStringList actions()
Return a list of actions available to the application's window.
TQMap< TQCString, DCOPRef > actionMap()
Returns and action map.
bool enableAction(TQCString action)
Enables the requested action.
bool activateAction(TQCString action)
Activates the requested action.
TQCString actionToolTip(TQCString action)
Returns the tool tip text of the requested action.
bool actionIsEnabled(TQCString action)
Returns the status of the requested action.
DCOPRef action(const TQCString &name)
Returns a dcop reference to the selected TDEAction.
KDE top level main window
virtual void hide()
Reimplementation of TQMainWindow::hide().
bool append(const KKeySequence &keySeq)