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