summaryrefslogtreecommitdiffabout
path: root/microkde/kresources/factory.h
Unidiff
Diffstat (limited to 'microkde/kresources/factory.h') (more/less context) (ignore whitespace changes)
-rw-r--r--microkde/kresources/factory.h5
1 files changed, 4 insertions, 1 deletions
diff --git a/microkde/kresources/factory.h b/microkde/kresources/factory.h
index a265bc8..0e4231b 100644
--- a/microkde/kresources/factory.h
+++ b/microkde/kresources/factory.h
@@ -13,48 +13,51 @@
13 This library is distributed in the hope that it will be useful, 13 This library is distributed in the hope that it will be useful,
14 but WITHOUT ANY WARRANTY; without even the implied warranty of 14 but WITHOUT ANY WARRANTY; without even the implied warranty of
15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU 15 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
16 Library General Public License for more details. 16 Library General Public License for more details.
17 17
18 You should have received a copy of the GNU Library General Public License 18 You should have received a copy of the GNU Library General Public License
19 along with this library; see the file COPYING.LIB. If not, write to 19 along with this library; see the file COPYING.LIB. If not, write to
20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330, 20 the Free Software Foundation, Inc., 59 Temple Place - Suite 330,
21 Boston, MA 02111-1307, USA. 21 Boston, MA 02111-1307, USA.
22*/ 22*/
23 23
24#ifndef KRESOURCES_FACTORY_H 24#ifndef KRESOURCES_FACTORY_H
25#define KRESOURCES_FACTORY_H 25#define KRESOURCES_FACTORY_H
26 26
27#include <qdict.h> 27#include <qdict.h>
28#include <qstring.h> 28#include <qstring.h>
29 29
30#include <kconfig.h> 30#include <kconfig.h>
31 31
32 32
33#include "resource.h" 33#include "resource.h"
34 34
35namespace KRES { 35namespace KRES {
36 36
37class SyncWidgetContainer;
38class ConfigWidget;
39
37//US 40//US
38struct PluginInfo 41struct PluginInfo
39{ 42{
40 QString library; 43 QString library;
41 QString nameLabel; 44 QString nameLabel;
42 QString descriptionLabel; 45 QString descriptionLabel;
43}; 46};
44 47
45 48
46/** 49/**
47 * Class for loading resource plugins. 50 * Class for loading resource plugins.
48 * Do not use this class directly. Use ResourceManager instead 51 * Do not use this class directly. Use ResourceManager instead
49 * 52 *
50 * Example: 53 * Example:
51 * 54 *
52 * <pre> 55 * <pre>
53 * KABC::Factory<Calendar> *factory = KABC::Factory<Calendar>::self(); 56 * KABC::Factory<Calendar> *factory = KABC::Factory<Calendar>::self();
54 * 57 *
55 * QStringList list = factory->resources(); 58 * QStringList list = factory->resources();
56 * QStringList::Iterator it; 59 * QStringList::Iterator it;
57 * for ( it = list.begin(); it != list.end(); ++it ) { 60 * for ( it = list.begin(); it != list.end(); ++it ) {
58 * Resource<Calendar> *resource = factory->resource( (*it), 61 * Resource<Calendar> *resource = factory->resource( (*it),
59 * KABC::StdAddressBook::self(), 0 ); 62 * KABC::StdAddressBook::self(), 0 );
60 * // do something with resource 63 * // do something with resource
@@ -71,49 +74,49 @@ class Factory
71 */ 74 */
72 static Factory *self( const QString& resourceFamily ); 75 static Factory *self( const QString& resourceFamily );
73 76
74 ~Factory(); 77 ~Factory();
75 78
76 /** 79 /**
77 * Returns the config widget for the given resource type, 80 * Returns the config widget for the given resource type,
78 * or a null pointer if resource type doesn't exist. 81 * or a null pointer if resource type doesn't exist.
79 * 82 *
80 * @param type The type of the resource, returned by @ref resources() 83 * @param type The type of the resource, returned by @ref resources()
81 * @param resource The resource to be editted. 84 * @param resource The resource to be editted.
82 * @param parent The parent widget 85 * @param parent The parent widget
83 */ 86 */
84 ConfigWidget *configWidget( const QString& type, QWidget *parent = 0 ); 87 ConfigWidget *configWidget( const QString& type, QWidget *parent = 0 );
85 88
86 /** 89 /**
87 * Returns the sync widget for the given resource type, 90 * Returns the sync widget for the given resource type,
88 * or a null pointer if resource type doesn't exist, 91 * or a null pointer if resource type doesn't exist,
89 * or a null pointer if resource does not support syncing. 92 * or a null pointer if resource does not support syncing.
90 * 93 *
91 * @param type The type of the resource, returned by @ref resources() 94 * @param type The type of the resource, returned by @ref resources()
92 * @param resource The resource to be editted. 95 * @param resource The resource to be editted.
93 * @param parent The parent widget 96 * @param parent The parent widget
94 */ 97 */
95 SyncWidget *syncWidget( const QString& type, QWidget *parent = 0 ); 98 SyncWidgetContainer *syncWidgetContainer( const QString& type );
96 99
97 /** 100 /**
98 * Returns a pointer to a resource object or a null pointer 101 * Returns a pointer to a resource object or a null pointer
99 * if resource type doesn't exist. 102 * if resource type doesn't exist.
100 * 103 *
101 * @param type The type of the resource, returned by @ref resources() 104 * @param type The type of the resource, returned by @ref resources()
102 * @param ab The address book, the resource should belong to 105 * @param ab The address book, the resource should belong to
103 * @param config The config object where the resource get it settings from, or 0 if a new resource should be created. 106 * @param config The config object where the resource get it settings from, or 0 if a new resource should be created.
104 * @param syncable If the resource should support syncing capabilities. 107 * @param syncable If the resource should support syncing capabilities.
105 */ 108 */
106 Resource *resource( const QString& type, const KConfig *config, bool syncable ); 109 Resource *resource( const QString& type, const KConfig *config, bool syncable );
107 110
108 /** 111 /**
109 * Returns a list of all available resource types. 112 * Returns a list of all available resource types.
110 */ 113 */
111 QStringList typeNames() const; 114 QStringList typeNames() const;
112 115
113 /** 116 /**
114 * Returns the name for a special type. 117 * Returns the name for a special type.
115 */ 118 */
116 QString typeName( const QString &type ) const; 119 QString typeName( const QString &type ) const;
117 120
118 /** 121 /**
119 * Returns the description for a special type. 122 * Returns the description for a special type.