• 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 <kpopupmenu.h>
28 #include <klocale.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 }
55 
56 // kate: space-indent on; indent-width 2; replace-tabs on;
KParts
klocale.h
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
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
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kate by doxygen 1.8.8
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |