3 /// A class that creates a list of Evolution data sources.
7 Copyright (C) 2011-2012, Net Direct Inc. (http://www.netdirect.ca/)
8 Based on evolution2_sync.h and list_sources.c from evolution opensync plugin
10 Copyright (C) 2009, Ian Martin, licensed under LGPL 2.1
12 This program is free software; you can redistribute it and/or modify
13 it under the terms of the GNU General Public License as published by
14 the Free Software Foundation; either version 2 of the License, or
15 (at your option) any later version.
17 This program is distributed in the hope that it will be useful,
18 but WITHOUT ANY WARRANTY; without even the implied warranty of
19 MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.
21 See the GNU General Public License in the COPYING file at the
22 root directory of this project for more details.
25 #ifndef __BARRY_EVO_SOURCES_H__
26 #define __BARRY_EVO_SOURCES_H__
35 std::string m_GroupName
;
36 std::string m_SourceName
;
37 std::string m_SourcePath
;
45 /// Instatiating this class does the work of filling the list. Just
46 /// probe the data with the member functions as needed.
48 class EvoSources
//: public DlOpen
51 typedef std::vector
<EvoSource
> List
;
54 std::auto_ptr
<EvoFunctions
> m_funcs
;
72 /// This is automatically run from inside the constructor.
73 /// It can be called again to retry detection with the same instance,
74 /// but note that any previous results will be Clear()'d.
77 /// Returns true if this class has built-in support for talking
78 /// to the Evolution data server. False if a dummy wrapper was
79 /// built at compile time due to lack of proper libraries.
80 bool IsSupported() const;
82 /// Returns true if all list are empty
85 /// Returns true if minimum 3 paths are available, and if there is
86 /// only 1 path in each list.
87 bool IsDefaultable() const;
89 const List
& GetAddressBook() const { return m_addressbook
; }
90 const List
& GetEvents() const { return m_events
; }
91 const List
& GetTasks() const { return m_tasks
; }
92 const List
& GetMemos() const { return m_memos
; }
94 static bool PathExists(const std::string
&path
);