summaryrefslogtreecommitdiff
path: root/libopie2/opiepim/core/opimresolver.h
Unidiff
Diffstat (limited to 'libopie2/opiepim/core/opimresolver.h') (more/less context) (ignore whitespace changes)
-rw-r--r--libopie2/opiepim/core/opimresolver.h52
1 files changed, 43 insertions, 9 deletions
diff --git a/libopie2/opiepim/core/opimresolver.h b/libopie2/opiepim/core/opimresolver.h
index 86ae3eb..1ce1619 100644
--- a/libopie2/opiepim/core/opimresolver.h
+++ b/libopie2/opiepim/core/opimresolver.h
@@ -4,6 +4,8 @@
4#include <qstring.h> 4#include <qstring.h>
5#include <qvaluelist.h> 5#include <qvaluelist.h>
6 6
7#include <opie/otemplatebase.h>
8
7/** 9/**
8 * OPimResolver is a MetaClass to access 10 * OPimResolver is a MetaClass to access
9 * available backends read only. 11 * available backends read only.
@@ -15,7 +17,7 @@
15 * THE PERFORMANCE will depend on THE BACKEND 17 * THE PERFORMANCE will depend on THE BACKEND
16 * USING XML is a waste of memory!!!!! 18 * USING XML is a waste of memory!!!!!
17 */ 19 */
18class OPimResolver : public QObject { 20class OPimResolver {
19public: 21public:
20 enum BuiltIn { TodoList = 0, 22 enum BuiltIn { TodoList = 0,
21 DateBook, 23 DateBook,
@@ -24,33 +26,65 @@ public:
24 static OPimResolver* self(); 26 static OPimResolver* self();
25 27
26 28
27 /* 29 /**
28 * return a record for a uid 30 * return a record for a uid
29 * and an app 31 * and an service
32 * You've THE OWNERSHIP NOW!
30 */ 33 */
31 OPimRecord &record( const QString& service, int uid ); 34 OPimRecord *record( const QString& service, int uid );
32 35
33 /** 36 /**
34 * return the QCopChannel for service 37 * return the QCopChannel for service
35 * When we will use Qtopia Services it will be used here 38 * When we will use Qtopia Services it will be used here
36 */ 39 */
37 QString qcopChannel( enum BuiltIn& )const; 40 QCString qcopChannel( enum BuiltIn& )const;
38 QString qcopChannel( const QString& service ); 41 QCString qcopChannel( const QString& service )const;
42
43 /**
44 * The Application channel (QPE/Application/name)
45 */
46 QCString applicationChannel( enum BuiltIn& )const;
47 QCString applicationChannel( const QString& service )const;
39 48
40 /** 49 /**
41 * return a list of available services 50 * return a list of available services
42 */ 51 */
43 QStringList services()const; 52 QStringList services()const;
44 53 inline QString serviceName(int rrti )const;
54 int serviceId( const QString& Service);
45 /** 55 /**
46 * add a record to a service... ;) 56 * add a record to a service... ;)
47 */ 57 */
48 bool add( const QString& service, const OPimRecord& ); 58 bool add( const QString& service, const OPimRecord& );
49 59
60
61 /**
62 * record returns an empty record for a given service.
63 * Be sure to delete it!!!
64 *
65 */
66 OPimRecord* record( const QString& service );
67 OPimRecord* record( int rtti );
68
69 /**
70 * you can cast to your
71 */
72 OPimBase* backend( const QString& service );
73 OPimBase* backend( int rtti );
50private: 74private:
51 OPimResolver(); 75 OPimResolver();
52 OPimRecord *m_last; 76 void loadData();
77 inline bool isBuiltIn( const QString& )const;
78 OPimRecord* recordExtern( const QString&, int );
79 OPimRecord* recordExtern( const QString& );
80
81 static OPimResolver* m_self;
82 struct Data;
83 class Private;
53 84
54}: 85 Data* data;
86 Private* d;
87 QStringList m_builtIns;
88};
55 89
56#endif 90#endif