Diffstat (limited to 'libopie2/opiepim/core/opimresolver.h') (more/less context) (show whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/opimresolver.h | 12 |
1 files changed, 8 insertions, 4 deletions
diff --git a/libopie2/opiepim/core/opimresolver.h b/libopie2/opiepim/core/opimresolver.h index adc7c16..dd6f07f 100644 --- a/libopie2/opiepim/core/opimresolver.h +++ b/libopie2/opiepim/core/opimresolver.h | |||
@@ -5,69 +5,72 @@ | |||
5 | .=l. | 5 | .=l. |
6 | .>+-= | 6 | .>+-= |
7 | _;:, .> :=|. This program is free software; you can | 7 | _;:, .> :=|. This program is free software; you can |
8 | .> <`_, > . <= redistribute it and/or modify it under | 8 | .> <`_, > . <= redistribute it and/or modify it under |
9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public | 9 | :`=1 )Y*s>-.-- : the terms of the GNU Library General Public |
10 | .="- .-=="i, .._ License as published by the Free Software | 10 | .="- .-=="i, .._ License as published by the Free Software |
11 | - . .-<_> .<> Foundation; either version 2 of the License, | 11 | - . .-<_> .<> Foundation; either version 2 of the License, |
12 | ._= =} : or (at your option) any later version. | 12 | ._= =} : or (at your option) any later version. |
13 | .%`+i> _;_. | 13 | .%`+i> _;_. |
14 | .i_,=:_. -<s. This program is distributed in the hope that | 14 | .i_,=:_. -<s. This program is distributed in the hope that |
15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; | 15 | + . -:. = it will be useful, but WITHOUT ANY WARRANTY; |
16 | : .. .:, . . . without even the implied warranty of | 16 | : .. .:, . . . without even the implied warranty of |
17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A | 17 | =_ + =;=|` MERCHANTABILITY or FITNESS FOR A |
18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU | 18 | _.=:. : :=>`: PARTICULAR PURPOSE. See the GNU |
19 | ..}^=.= = ; Library General Public License for more | 19 | ..}^=.= = ; Library General Public License for more |
20 | ++= -. .` .: details. | 20 | ++= -. .` .: details. |
21 | : = ...= . :.=- | 21 | : = ...= . :.=- |
22 | -. .:....=;==+<; You should have received a copy of the GNU | 22 | -. .:....=;==+<; You should have received a copy of the GNU |
23 | -_. . . )=. = Library General Public License along with | 23 | -_. . . )=. = Library General Public License along with |
24 | -- :-=` this library; see the file COPYING.LIB. | 24 | -- :-=` this library; see the file COPYING.LIB. |
25 | If not, write to the Free Software Foundation, | 25 | If not, write to the Free Software Foundation, |
26 | Inc., 59 Temple Place - Suite 330, | 26 | Inc., 59 Temple Place - Suite 330, |
27 | Boston, MA 02111-1307, USA. | 27 | Boston, MA 02111-1307, USA. |
28 | */ | 28 | */ |
29 | #ifndef OPIE_PIM_RESOLVER | 29 | #ifndef OPIMRESOLVER_H |
30 | #define OPIE_PIM_RESOLVER | 30 | #define OPIMRESOLVER_H |
31 | 31 | ||
32 | /* OPIE */ | ||
33 | #include <opie2/otemplatebase.h> | ||
34 | |||
35 | /* QT */ | ||
32 | #include <qstring.h> | 36 | #include <qstring.h> |
33 | #include <qvaluelist.h> | 37 | #include <qvaluelist.h> |
34 | 38 | ||
35 | #include <opie2/otemplatebase.h> | ||
36 | |||
37 | namespace Opie { | 39 | namespace Opie { |
38 | /** | 40 | /** |
39 | * OPimResolver is a MetaClass to access | 41 | * OPimResolver is a MetaClass to access |
40 | * available backends read only. | 42 | * available backends read only. |
41 | * It will be used to resolve uids + app names | 43 | * It will be used to resolve uids + app names |
42 | * to full informations | 44 | * to full informations |
43 | * to traverse through a list of alarms, reminders | 45 | * to traverse through a list of alarms, reminders |
44 | * to get access to built in PIM functionality | 46 | * to get access to built in PIM functionality |
45 | * and to more stuff | 47 | * and to more stuff |
46 | * THE PERFORMANCE will depend on THE BACKEND | 48 | * THE PERFORMANCE will depend on THE BACKEND |
47 | * USING XML is a waste of memory!!!!! | 49 | * USING XML is a waste of memory!!!!! |
48 | */ | 50 | */ |
49 | class OPimResolver { | 51 | class OPimResolver { |
52 | |||
50 | public: | 53 | public: |
51 | enum BuiltIn { TodoList = 0, | 54 | enum BuiltIn { TodoList = 0, |
52 | DateBook, | 55 | DateBook, |
53 | AddressBook | 56 | AddressBook |
54 | }; | 57 | }; |
55 | static OPimResolver* self(); | 58 | static OPimResolver* self(); |
56 | 59 | ||
57 | 60 | ||
58 | /** | 61 | /** |
59 | * return a record for a uid | 62 | * return a record for a uid |
60 | * and an service | 63 | * and an service |
61 | * You've THE OWNERSHIP NOW! | 64 | * You've THE OWNERSHIP NOW! |
62 | */ | 65 | */ |
63 | OPimRecord *record( const QString& service, int uid ); | 66 | OPimRecord *record( const QString& service, int uid ); |
64 | 67 | ||
65 | /** | 68 | /** |
66 | * return the QCopChannel for service | 69 | * return the QCopChannel for service |
67 | * When we will use Qtopia Services it will be used here | 70 | * When we will use Qtopia Services it will be used here |
68 | */ | 71 | */ |
69 | QCString qcopChannel( enum BuiltIn& )const; | 72 | QCString qcopChannel( enum BuiltIn& )const; |
70 | QCString qcopChannel( const QString& service )const; | 73 | QCString qcopChannel( const QString& service )const; |
71 | 74 | ||
72 | /** | 75 | /** |
73 | * The Application channel (QPE/Application/name) | 76 | * The Application channel (QPE/Application/name) |
@@ -79,43 +82,44 @@ public: | |||
79 | * return a list of available services | 82 | * return a list of available services |
80 | */ | 83 | */ |
81 | QStringList services()const; | 84 | QStringList services()const; |
82 | inline QString serviceName(int rrti )const; | 85 | inline QString serviceName(int rrti )const; |
83 | int serviceId( const QString& Service); | 86 | int serviceId( const QString& Service); |
84 | /** | 87 | /** |
85 | * add a record to a service... ;) | 88 | * add a record to a service... ;) |
86 | */ | 89 | */ |
87 | bool add( const QString& service, const OPimRecord& ); | 90 | bool add( const QString& service, const OPimRecord& ); |
88 | 91 | ||
89 | 92 | ||
90 | /** | 93 | /** |
91 | * record returns an empty record for a given service. | 94 | * record returns an empty record for a given service. |
92 | * Be sure to delete it!!! | 95 | * Be sure to delete it!!! |
93 | * | 96 | * |
94 | */ | 97 | */ |
95 | OPimRecord* record( const QString& service ); | 98 | OPimRecord* record( const QString& service ); |
96 | OPimRecord* record( int rtti ); | 99 | OPimRecord* record( int rtti ); |
97 | 100 | ||
98 | /** | 101 | /** |
99 | * you can cast to your | 102 | * you can cast to your |
100 | */ | 103 | */ |
101 | OPimBase* backend( const QString& service ); | 104 | OPimBase* backend( const QString& service ); |
102 | OPimBase* backend( int rtti ); | 105 | OPimBase* backend( int rtti ); |
106 | |||
103 | private: | 107 | private: |
104 | OPimResolver(); | 108 | OPimResolver(); |
105 | void loadData(); | 109 | void loadData(); |
106 | inline bool isBuiltIn( const QString& )const; | 110 | inline bool isBuiltIn( const QString& )const; |
107 | OPimRecord* recordExtern( const QString&, int ); | 111 | OPimRecord* recordExtern( const QString&, int ); |
108 | OPimRecord* recordExtern( const QString& ); | 112 | OPimRecord* recordExtern( const QString& ); |
109 | 113 | ||
110 | static OPimResolver* m_self; | 114 | static OPimResolver* m_self; |
111 | struct Data; | 115 | struct Data; |
112 | class Private; | 116 | class Private; |
113 | 117 | ||
114 | Data* data; | 118 | Data* data; |
115 | Private* d; | 119 | Private* d; |
116 | QStringList m_builtIns; | 120 | QStringList m_builtIns; |
117 | }; | 121 | }; |
118 | 122 | ||
119 | } | 123 | } |
120 | 124 | ||
121 | #endif | 125 | #endif |