]> git.lyx.org Git - lyx.git/blob - src/author.h
Add GTK bibitem dialog
[lyx.git] / src / author.h
1 // -*- C++ -*-
2 /**
3  * \file author.h
4  * This file is part of LyX, the document processor.
5  * Licence details can be found in the file COPYING.
6  *
7  * \author John Levon
8  *
9  * Full author contact details are available in file CREDITS.
10  */
11
12 #ifndef AUTHOR_H
13 #define AUTHOR_H
14
15 #include <map>
16 #include <iosfwd>
17 #include <string>
18
19
20 class Author {
21 public:
22         Author() {}
23
24         Author(std::string const & name, std::string const & email)
25                 : name_(name), email_(email) {}
26
27         std::string const name() const {
28                 return name_;
29         }
30
31         std::string const email() const {
32                 return email_;
33         }
34
35         friend  std::istream & operator>>(std::istream & os, Author & a);
36
37 private:
38         std::string name_;
39
40         std::string email_;
41 };
42
43
44 class AuthorList {
45 public:
46         AuthorList();
47
48         int record(Author const & a);
49
50         void record(int id, Author const & a);
51
52         Author const & get(int id);
53
54         typedef std::map<int, Author> Authors;
55
56         Authors::const_iterator begin() const;
57
58         Authors::const_iterator end() const;
59
60 private:
61         int last_id_;
62
63         Authors authors_;
64 };
65
66 bool operator==(Author const & l, Author const & r);
67
68 std::ostream & operator<<(std::ostream & os, Author const & a);
69
70 std::istream & operator>>(std::istream & os, Author & a);
71
72 #endif // AUTHOR_H