28#include <Carbon/Carbon.h>
29#include <AddressBook/ABAddressBookC.h>
38void manageDuplicateGroups(std::vector<MacabGroup *> _xGroups)
44 std::vector<MacabGroup *>::reverse_iterator iter1, iter2;
47 for(iter1 = _xGroups.rbegin(); iter1 != _xGroups.rend(); ++iter1)
53 if( (*iter1)->getName() == MacabAddressBook::getDefaultTableName() )
59 for( ++iter2; iter2 != _xGroups.rend(); ++iter2)
61 if( (*iter1)->getName() == (*iter2)->getName() )
70 OUString
sName = (*iter1)->getName() +
" (" +
71 OUString::number(count) +
73 (*iter1)->setName(sName);
80MacabAddressBook::MacabAddressBook( )
81 : m_aAddressBook(ABGetSharedAddressBook()),
82 m_xMacabRecords(nullptr),
83 m_bRetrievedGroups(false)
89 throw RuntimeException(
90 "failed to access the macOS address book - permission not granted?" );
116 static const OUString aDefaultTableName
117 (OUString(
"Address Book"));
119 return aDefaultTableName;
178 sal_Int32 nGroups = CFArrayGetCount(allGroups);
185 for(
i = 0;
i < nGroups;
i++)
187 xGroup =
static_cast<ABGroupRef
>(
const_cast<void *
>(CFArrayGetValueAtIndex(allGroups,
i)));
191 CFRelease(allGroups);
211 for(
i = 0;
i < nGroups;
i++)
235 for(
i = 0;
i < nGroups;
i++)
static const OUString & getDefaultTableName()
MacabRecords * getMacabRecords()
MacabGroup * getMacabGroup(std::u16string_view _groupName)
MacabRecords * getMacabRecordsMatch(const OUString &_tableName)
MacabRecords * m_xMacabRecords
MacabGroup * getMacabGroupMatch(const OUString &_groupName)
std::vector< MacabGroup * > m_xMacabGroups
std::vector< MacabGroup * > getMacabGroups()
ABAddressBookRef m_aAddressBook
void setName(const OUString &_sName)
bool match(const sal_Unicode *pWild, const sal_Unicode *pStr, const sal_Unicode cEscape)