summaryrefslogtreecommitdiffstats
path: root/kview/modules/template/kviewtemplate.cpp
blob: f8277162be14068f6517bdc9d9776d56ccc33aca (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
/* This file is in the public domain */

// $Id$

#include "kviewtemplate.h"

#include <tqobjectlist.h>

#include <kaction.h>
/*#include <klocale.h>*/
#include <kgenericfactory.h>
#include <kdebug.h>
#include <kimageviewer/viewer.h>

typedef KGenericFactory<KViewTemplate> KViewTemplateFactory;
K_EXPORT_COMPONENT_FACTORY( kview_templateplugin, KViewTemplateFactory( "kviewtemplateplugin" ) )

KViewTemplate::KViewTemplate( TQObject* parent, const char* name, const TQStringList & )
	: Plugin( parent, name )
{
	TQObjectList * viewerList = parent->queryList( 0, "KImageViewer Part", false, false );
	m_pViewer = static_cast<KImageViewer::Viewer *>( viewerList->getFirst() );
	delete viewerList;
	if( m_pViewer )
	{
		(void) new KAction( /*i18n(*/ "&Do Something" /*)*/, 0, 0,
							this, TQT_SLOT( yourSlot() ),
							actionCollection(), "plugin_template" );
	}
	else
		kdWarning( 4630 ) << "no KImageViewer interface found - the template plugin won't work" << endl;
}

KViewTemplate::~KViewTemplate()
{
}

void KViewTemplate::yourSlot()
{
}

// vim:sw=4:ts=4:cindent
#include "kviewtemplate.moc"