Diffstat (limited to 'libopie2/opiepim/core/ocontactaccess.h') (more/less context) (ignore whitespace changes)
-rw-r--r-- | libopie2/opiepim/core/ocontactaccess.h | 37 |
1 files changed, 29 insertions, 8 deletions
diff --git a/libopie2/opiepim/core/ocontactaccess.h b/libopie2/opiepim/core/ocontactaccess.h index 691ece2..bd85b4e 100644 --- a/libopie2/opiepim/core/ocontactaccess.h +++ b/libopie2/opiepim/core/ocontactaccess.h | |||
@@ -51,71 +51,92 @@ namespace Opie { | |||
51 | * This is just a frontend for the real database handling which is | 51 | * This is just a frontend for the real database handling which is |
52 | * done by the backend. | 52 | * done by the backend. |
53 | * This class is used to access the Contacts on a system. This class as any OPIE PIM | 53 | * This class is used to access the Contacts on a system. This class as any OPIE PIM |
54 | * class is backend independent. | 54 | * class is backend independent. |
55 | * @author Stefan Eilers, Holger Freyther | 55 | * @author Stefan Eilers, Holger Freyther |
56 | * @see OPimAccessTemplate | 56 | * @see OPimAccessTemplate |
57 | */ | 57 | */ |
58 | class OPimContactAccess: public QObject, public OPimAccessTemplate<OPimContact> | 58 | class OPimContactAccess: public QObject, public OPimAccessTemplate<OPimContact> |
59 | { | 59 | { |
60 | Q_OBJECT | 60 | Q_OBJECT |
61 | 61 | ||
62 | public: | 62 | public: |
63 | /** | ||
64 | * Filter for sorted() | ||
65 | * @see SortFilterBase in OPimBase | ||
66 | */ | ||
63 | enum SortFilter { | 67 | enum SortFilter { |
64 | DoNotShowNoneChildren = FilterCustom<<1, | 68 | /** Don't return entries who don't have children */ |
65 | DoNotShowNoneAnniversary = FilterCustom<<2, | 69 | DoNotShowWithoutChildren = FilterCustom<<1, |
66 | DoNotShowNoneBirthday = FilterCustom<<3, | 70 | /** Don't return entries who don't have an anniversary */ |
67 | DoNotShowNoHomeAddress = FilterCustom<<4, | 71 | DoNotShowWithoutAnniversary = FilterCustom<<2, |
68 | DoNotShowNoBusinessAddress = FilterCustom<<5 | 72 | /** Don't return entries who don't have a birthday */ |
73 | DoNotShowWithoutBirthday = FilterCustom<<3, | ||
74 | /** Don't return entries who don't have a home address */ | ||
75 | DoNotShowWithoutHomeAddress = FilterCustom<<4, | ||
76 | /** Don't return entries who don't have a business address */ | ||
77 | DoNotShowWithoutBusinessAddress = FilterCustom<<5, | ||
78 | /** Don't return entries which hava any category */ | ||
79 | DoNotShowWithCategory = FilterCustom << 6 | ||
69 | }; | 80 | }; |
70 | 81 | ||
82 | /** | ||
83 | * Sort order for sorted() | ||
84 | * @see SortOrderBase in OPimBase | ||
85 | */ | ||
71 | enum SortOrder { | 86 | enum SortOrder { |
72 | SortTitle = SortCustom, | 87 | SortTitle = SortCustom, |
73 | SortFirstName, | 88 | SortFirstName, |
74 | SortMiddleName, | 89 | SortMiddleName, |
90 | SortLastName, | ||
75 | SortSuffix, | 91 | SortSuffix, |
76 | SortEmail, | 92 | SortEmail, |
77 | SortNickname, | 93 | SortNickname, |
94 | SortFileAsName, | ||
78 | SortAnniversary, | 95 | SortAnniversary, |
79 | SortBirthday, | 96 | SortBirthday, |
80 | SortGender | 97 | SortGender |
81 | }; | 98 | }; |
82 | 99 | ||
83 | /** | 100 | /** |
84 | * Create Database with contacts (addressbook). | 101 | * Create Database with contacts (addressbook). |
85 | * @param appname Name of application which wants access to the database | 102 | * @param appname Name of application which wants access to the database |
86 | * (i.e. "todolist") | 103 | * (i.e. "todolist") |
87 | * @param filename The name of the database file. If not set, the default one | 104 | * @param filename The name of the database file. If not set, the default one |
88 | * is used. | 105 | * is used. |
89 | * @param backend Pointer to an alternative Backend. If not set, we will use | 106 | * @param backend Pointer to an alternative Backend. If not set, we will use |
90 | * the default backend. | 107 | * the default backend. |
91 | * @param handlesync If <b>true</b> the database stores the current state | 108 | * @param handlesync If <b>true</b> the database stores the current state |
92 | * automatically if it receives the signals <i>flush()</i> and <i>reload()</i> | 109 | * automatically if it receives the signals <i>flush()</i> and <i>reload()</i> |
93 | * which are used before and after synchronisation. If the application wants | 110 | * which are used before and after synchronisation. If the application wants |
94 | * to react itself, it should be disabled by setting it to <b>false</b> | 111 | * to react itself, it should be disabled by setting it to <b>false</b> |
95 | * @see OPimContactAccessBackend | 112 | * @see OPimContactAccessBackend |
96 | */ | 113 | */ |
97 | OPimContactAccess (const QString appname, const QString filename = 0l, | 114 | OPimContactAccess (const QString appname, const QString filename = 0l, |
98 | OPimContactAccessBackend* backend = 0l, bool handlesync = true); | 115 | OPimContactAccessBackend* backend = 0l, bool handlesync = true); |
99 | ~OPimContactAccess (); | 116 | ~OPimContactAccess (); |
100 | 117 | ||
101 | 118 | ||
102 | /** Return all possible settings. | 119 | /** |
120 | * Return all possible settings for queryByExample(). | ||
103 | * @return All settings provided by the current backend | 121 | * @return All settings provided by the current backend |
104 | * (i.e.: query_WildCards & query_IgnoreCase) | 122 | * (i.e.: WildCards & IgnoreCase) |
123 | * @see QuerySettings in OPimBase for details of the parameter | ||
105 | */ | 124 | */ |
106 | const uint querySettings(); | 125 | const uint querySettings(); |
107 | 126 | ||
108 | /** Check whether settings are correct. | 127 | /** |
128 | * Check whether settings are correct for queryByExample(). | ||
109 | * @return <i>true</i> if the given settings are correct and possible. | 129 | * @return <i>true</i> if the given settings are correct and possible. |
130 | * @see QuerySettings in OPimBase for details of the parameter | ||
110 | */ | 131 | */ |
111 | bool hasQuerySettings ( int querySettings ) const; | 132 | bool hasQuerySettings ( int querySettings ) const; |
112 | 133 | ||
113 | /** | 134 | /** |
114 | * if the resource was changed externally. | 135 | * if the resource was changed externally. |
115 | * You should use the signal instead of polling possible changes ! | 136 | * You should use the signal instead of polling possible changes ! |
116 | */ | 137 | */ |
117 | bool wasChangedExternally()const; | 138 | bool wasChangedExternally()const; |
118 | 139 | ||
119 | 140 | ||
120 | /** Save contacts database. | 141 | /** Save contacts database. |
121 | * Save is more a "commit". After calling this function, all changes are public available. | 142 | * Save is more a "commit". After calling this function, all changes are public available. |