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

tdeui

  • tdeui
tdemainwindowiface.cpp
1 /* This file is part of the KDE project
2  Copyright (C) 2001 Ian Reinhart Geiser <geiseri@yahoo.com>
3 
4  This program is free software; you can redistribute it and/or
5  modify it under the terms of the Lesser GNU General Public
6  License as published by the Free Software Foundation; either
7  version 2 of the License, or (at your option) any later version.
8 
9  This program is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  General Public License for more details.
13 
14  You should have received a copy of the Lesser GNU General Public License
15  along with this program; see the file COPYING. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #include "tdemainwindowiface.h"
21 
22 #include <dcopclient.h>
23 #include <tdeapplication.h>
24 #include <kdcopactionproxy.h>
25 #include <kdcoppropertyproxy.h>
26 #include <tdemainwindow.h>
27 #include <tdeaction.h>
28 #include <tqclipboard.h>
29 
30 
31 TDEMainWindowInterface::TDEMainWindowInterface(TDEMainWindow * mainWindow)
32  : DCOPObject( mainWindow->name())
33 {
34  m_MainWindow = mainWindow;
35  m_dcopActionProxy = new KDCOPActionProxy( m_MainWindow->actionCollection(), this );
36  m_dcopPropertyProxy = new KDCOPPropertyProxy(TQT_TQOBJECT(m_MainWindow));
37 }
38 
39 TDEMainWindowInterface::~TDEMainWindowInterface()
40 {
41  delete m_dcopActionProxy;
42  delete m_dcopPropertyProxy;
43 }
44 
45 QCStringList TDEMainWindowInterface::actions()
46 {
47  delete m_dcopActionProxy;
48  m_dcopActionProxy = new KDCOPActionProxy( m_MainWindow->actionCollection(), this );
49  QCStringList tmp_actions;
50  TQValueList<TDEAction *> lst = m_dcopActionProxy->actions();
51  TQValueList<TDEAction *>::ConstIterator it = lst.begin();
52  TQValueList<TDEAction *>::ConstIterator end = lst.end();
53  for (; it != end; ++it )
54  if ((*it)->isPlugged())
55  tmp_actions.append( (TQCString)(*it)->name() );
56  return tmp_actions;
57 }
58 bool TDEMainWindowInterface::activateAction( TQCString action)
59 {
60  delete m_dcopActionProxy;
61  m_dcopActionProxy = new KDCOPActionProxy( m_MainWindow->actionCollection(), this );
62  TDEAction *tmp_Action = m_dcopActionProxy->action(action);
63  if (tmp_Action)
64  {
65  tmp_Action->activate();
66  return true;
67  }
68  else
69  return false;
70 }
71 bool TDEMainWindowInterface::disableAction( TQCString action)
72 {
73  delete m_dcopActionProxy;
74  m_dcopActionProxy = new KDCOPActionProxy( m_MainWindow->actionCollection(), this );
75  TDEAction *tmp_Action = m_dcopActionProxy->action(action);
76  if (tmp_Action)
77  {
78  tmp_Action->setEnabled(false);
79  return true;
80  }
81  else
82  return false;
83 }
84 bool TDEMainWindowInterface::enableAction( TQCString action)
85 {
86  delete m_dcopActionProxy;
87  m_dcopActionProxy = new KDCOPActionProxy( m_MainWindow->actionCollection(), this );
88  TDEAction *tmp_Action = m_dcopActionProxy->action(action);
89  if (tmp_Action)
90  {
91  tmp_Action->setEnabled(true);
92  return true;
93  }
94  else
95  return false;
96 }
97 bool TDEMainWindowInterface::actionIsEnabled( TQCString action)
98 {
99  delete m_dcopActionProxy;
100  m_dcopActionProxy = new KDCOPActionProxy( m_MainWindow->actionCollection(), this );
101  TDEAction *tmp_Action = m_dcopActionProxy->action(action);
102  if (tmp_Action)
103  {
104  return tmp_Action->isEnabled();
105  }
106  else
107  return false;
108 }
109 TQCString TDEMainWindowInterface::actionToolTip( TQCString action)
110 {
111  delete m_dcopActionProxy;
112  m_dcopActionProxy = new KDCOPActionProxy( m_MainWindow->actionCollection(), this );
113  TDEAction *tmp_Action = m_dcopActionProxy->action(action);
114  if (tmp_Action)
115  {
116  return tmp_Action->toolTip().utf8();
117  }
118  else
119  return "Error no such object!";
120 }
121 
122 DCOPRef TDEMainWindowInterface::action( const TQCString &name )
123 {
124  return DCOPRef( kapp->dcopClient()->appId(), m_dcopActionProxy->actionObjectId( name ) );
125 }
126 
127 TQMap<TQCString,DCOPRef> TDEMainWindowInterface::actionMap()
128 {
129  return m_dcopActionProxy->actionMap();
130 }
131 
132 int TDEMainWindowInterface::getWinID()
133 {
134  return (int) m_MainWindow->winId();
135 }
136 void TDEMainWindowInterface::grabWindowToClipBoard()
137 {
138  TQClipboard *clipboard = TQApplication::clipboard();
139  clipboard->setPixmap(TQPixmap::grabWidget(m_MainWindow));
140 }
141 void TDEMainWindowInterface::hide()
142 {
143  m_MainWindow->hide();
144 }
145 void TDEMainWindowInterface::maximize()
146 {
147  m_MainWindow->showMaximized();
148 }
149 void TDEMainWindowInterface::minimize()
150 {
151  m_MainWindow->showMinimized();
152 }
153 void TDEMainWindowInterface::resize(int newX, int newY)
154 {
155  m_MainWindow->resize(newX, newY);
156 }
157 void TDEMainWindowInterface::move(int newX, int newY)
158 {
159  m_MainWindow->move(newX, newY);
160 }
161 void TDEMainWindowInterface::setGeometry(int newX, int newY, int newWidth, int newHeight)
162 {
163  m_MainWindow->setGeometry(newX, newY, newWidth, newHeight);
164 }
165 void TDEMainWindowInterface::raise()
166 {
167  m_MainWindow->raise();
168 }
169 void TDEMainWindowInterface::lower()
170 {
171  m_MainWindow->lower();
172 }
173 void TDEMainWindowInterface::restore()
174 {
175  m_MainWindow->showNormal();
176 }
177 void TDEMainWindowInterface::close()
178 {
179  m_MainWindow->close();
180 }
181 void TDEMainWindowInterface::show()
182 {
183  m_MainWindow->show();
184 }
185 QCStringList TDEMainWindowInterface::functionsDynamic()
186 {
187  return m_dcopPropertyProxy->functions();
188 }
189 bool TDEMainWindowInterface::processDynamic(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
190 {
191  return m_dcopPropertyProxy->processPropertyRequest( fun, data, replyType, replyData);
192 
193 }
194 

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
  • knewstuff
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeui by doxygen 1.8.3.1
This website is maintained by Timothy Pearson.