knotes

resourcelocal_plugin.cpp
1 /*******************************************************************
2  This file is part of KNotes.
3 
4  Copyright (c) 2004, Bo Thorsen <bo@sonofthor.dk>
5 
6  This program is free software; you can redistribute it and/or modify
7  it under the terms of the GNU General Public License as published by
8  the Free Software Foundation; either version 2 of the License, or
9  (at your option) any later version.
10 
11  This program is distributed in the hope that it will be useful,
12  but WITHOUT ANY WARRANTY; without even the implied warranty of
13  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
14  GNU General Public License for more details.
15 
16  You should have received a copy of the GNU General Public License
17  along with this program; if not, write to the Free Software
18  Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,
19  MA 02110-1301, USA.
20 
21  In addition, as a special exception, the copyright holders give
22  permission to link the code of this program with any edition of
23  the TQt library by Trolltech AS, Norway (or with modified versions
24  of TQt that use the same license as TQt), and distribute linked
25  combinations including the two. You must obey the GNU General
26  Public License in all respects for all of the code used other than
27  TQt. If you modify this file, you may extend this exception to
28  your version of the file, but you are not obligated to do so. If
29  you do not wish to do so, delete this exception statement from
30  your version.
31 *******************************************************************/
32 
33 #include "resourcelocal.h"
34 #include "resourcelocalconfig.h"
35 
36 
37 class LocalNotesFactory
38  : public KRES::PluginFactoryBase
39 {
40 public:
41  KRES::Resource *resource( const TDEConfig *config )
42  {
43  return new ResourceLocal( config );
44  }
45 
46  KRES::ConfigWidget *configWidget( TQWidget *parent )
47  {
48  return new ResourceLocalConfig(parent);
49  }
50 };
51 
52 extern "C"
53 {
54  void *init_knotes_local()
55  {
56  return new LocalNotesFactory();
57  }
58 
59  KRES::ConfigWidget *config_widget( TQWidget* parent )
60  {
61  return new ResourceLocalConfig( parent, "Configure Local Resource" );
62  }
63 
64  KRES::Resource *resource( const TDEConfig* config )
65  {
66  return new ResourceLocal( config );
67  }
68 }