Skip to content
Skip to link menu
Trinity API Reference
Trinity API Reference
kate
kate
kate
part
katedocumenthelpers.cpp
1
/* This file is part of the KDE libraries
2
Copyright (C) 2001 Christoph Cullmann <cullmann@kde.org>
3
Copyright (C) 2001 Joseph Wenninger <jowenn@kde.org>
4
Copyright (C) 1999 Jochen Wilhelmy <digisnap@cs.tu-berlin.de>
5
6
This library is free software; you can redistribute it and/or
7
modify it under the terms of the GNU Library General Public
8
License version 2 as published by the Free Software Foundation.
9
10
This library is distributed in the hope that it will be useful,
11
but WITHOUT ANY WARRANTY; without even the implied warranty of
12
MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13
Library General Public License for more details.
14
15
You should have received a copy of the GNU Library General Public License
16
along with this library; see the file COPYING.LIB. If not, write to
17
the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
18
Boston, MA 02110-1301, USA.
19
*/
20
21
#include "katedocumenthelpers.h"
22
#include "katedocumenthelpers.moc"
23
24
#include "katedocument.h"
25
#include "kateview.h"
26
27
#include <tdepopupmenu.h>
28
#include <
tdelocale.h
>
29
30
KateBrowserExtension::KateBrowserExtension
( KateDocument* doc )
31
:
KParts
::BrowserExtension( doc,
"katepartbrowserextension"
),
32
m_doc (doc)
33
{
34
connect( doc, TQT_SIGNAL( selectionChanged() ),
35
this
, TQT_SLOT(
slotSelectionChanged
() ) );
36
emit
enableAction
(
"print"
,
true
);
37
}
38
39
void
KateBrowserExtension::copy
()
40
{
41
if
(m_doc->activeView())
42
m_doc->activeView()->copy();
43
}
44
45
void
KateBrowserExtension::print
()
46
{
47
m_doc->printDialog();
48
}
49
50
void
KateBrowserExtension::slotSelectionChanged
()
51
{
52
if
(m_doc->activeView())
53
emit
enableAction
(
"copy"
, m_doc->activeView()->hasSelection() );
54
}
KParts
KateBrowserExtension::copy
void copy()
copy text to clipboard
Definition:
katedocumenthelpers.cpp:39
KParts::BrowserExtension::enableAction
void enableAction(const char *name, bool enabled)
KateBrowserExtension::slotSelectionChanged
void slotSelectionChanged()
selection has changed
Definition:
katedocumenthelpers.cpp:50
tdelocale.h
KateBrowserExtension::print
void print()
print the current file
Definition:
katedocumenthelpers.cpp:45
KateBrowserExtension::KateBrowserExtension
KateBrowserExtension(KateDocument *doc)
Constructor.
Definition:
katedocumenthelpers.cpp:30
kate
Skip menu "kate"
Main Page
Namespace List
Class Hierarchy
Alphabetical List
Class List
File List
Namespace Members
Class Members
Related Pages
kate
Skip menu "kate"
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