00001
00002
00003
00004
00005
00006
00007
00008
00009
00010
00011
00012
00013
00014
00015
00016
00017
00018
00019
00020
00021
#include "katedocumenthelpers.h"
00022
#include "katedocumenthelpers.moc"
00023
00024
#include "katedocument.h"
00025
00026
#include <kpopupmenu.h>
00027
#include <klocale.h>
00028
00029 KateBrowserExtension::KateBrowserExtension( KateDocument* doc )
00030 : KParts::BrowserExtension( doc,
"katepartbrowserextension" ),
00031 m_doc (doc)
00032 {
00033 connect( doc, SIGNAL( selectionChanged() ),
00034
this, SLOT( slotSelectionChanged() ) );
00035 emit enableAction(
"print",
true );
00036 }
00037
00038
void KateBrowserExtension::copy()
00039 {
00040 m_doc->copy();
00041 }
00042
00043
void KateBrowserExtension::print()
00044 {
00045 m_doc->printDialog();
00046 }
00047
00048
void KateBrowserExtension::slotSelectionChanged()
00049 {
00050 emit enableAction(
"copy", m_doc->hasSelection() );
00051 }
00052
00053
void KateExportAction::init()
00054 {
00055 filter.clear();
00056 filter<<
QString(
"kate_html_export");
00057 popupMenu()->insertItem (i18n(
"&HTML..."),0);
00058 connect(popupMenu(),SIGNAL(activated(
int)),
this,SLOT(filterChoosen(
int)));
00059 m_doc=0L;
00060 }
00061
00062
void KateExportAction::updateMenu (
Kate::Document *doc)
00063 {
00064 m_doc = doc;
00065 }
00066
00067
void KateExportAction::filterChoosen(
int id)
00068 {
00069
Kate::Document *doc = m_doc;
00070
00071
if (!doc)
00072
return;
00073
00074 doc->
exportAs(*filter.at(
id));
00075 }
00076
00077