~lightdm-team/lightdm/1.4

« back to all changes in this revision

Viewing changes to liblightdm-qt/QLightDM/user.h

  • Committer: David Edmundson
  • Date: 2011-05-21 19:47:27 UTC
  • mfrom: (458.1.7 fix_namespace)
  • Revision ID: david@davidedmundson.co.uk-20110521194727-c3wmqlx2n4wjdiqb
Merge branch that puts Qt LightDM into a namespace, removes possibility of file clash. 

Show diffs side-by-side

added added

removed removed

Lines of Context:
1
 
#ifndef LDMUSER_H
2
 
#define LDMUSER_H
 
1
#ifndef QLIGTHDM_USER_H
 
2
#define QLIGTHDM_USER_H
3
3
 
4
4
#include <QString>
5
5
#include <QtDBus/QtDBus>
6
6
 
7
 
class LdmUserPrivate;
 
7
class UserPrivate;
8
8
 
9
 
//public facing User class
10
 
class Q_DECL_EXPORT LdmUser
 
9
namespace QLightDM
11
10
{
12
 
public:
13
 
    explicit LdmUser();
14
 
    LdmUser(const QString &name, const QString &realName, const QString &homeDirectory, const QString &image, bool isLoggedIn);
15
 
    LdmUser(const LdmUser& other);
16
 
    ~LdmUser();
17
 
    LdmUser &operator=(const LdmUser& other);
18
 
 
19
 
    bool update(const QString &realName, const QString &homeDirectory, const QString &image, bool isLoggedIn);
20
 
 
21
 
    /** The name to display (the real name if available, otherwise use the username */
22
 
    QString displayName() const;
23
 
 
24
 
    /** The username of the user*/
25
 
    QString name() const;
26
 
    /** The user's real name, use this for displaying*/
27
 
    QString realName() const;
28
 
 
29
 
    /** Returns the home directory of this user*/
30
 
    QString homeDirectory() const;
31
 
 
32
 
    /** Returns the path to an avatar of this user*/
33
 
    QString image() const;
34
 
 
35
 
    /** Returns true if this user is already logged in on another session*/
36
 
    bool isLoggedIn() const;
37
 
 
38
 
//    LdmUser &operator=(const LdmUser user);
39
 
private:
40
 
    LdmUserPrivate* d;
41
 
};
42
 
 
43
 
Q_DECLARE_METATYPE(LdmUser);
44
 
Q_DECLARE_METATYPE(QList<LdmUser>);
 
11
    //public facing User class
 
12
    class Q_DECL_EXPORT User
 
13
    {
 
14
    public:
 
15
        explicit User();
 
16
        User(const QString &name, const QString &realName, const QString &homeDirectory, const QString &image, bool isLoggedIn);
 
17
        User(const User& other);
 
18
        ~User();
 
19
        User &operator=(const User& other);
 
20
 
 
21
        bool update(const QString &realName, const QString &homeDirectory, const QString &image, bool isLoggedIn);
 
22
 
 
23
        /** The name to display (the real name if available, otherwise use the username */
 
24
        QString displayName() const;
 
25
 
 
26
        /** The username of the user*/
 
27
        QString name() const;
 
28
        /** The user's real name, use this for displaying*/
 
29
        QString realName() const;
 
30
 
 
31
        /** Returns the home directory of this user*/
 
32
        QString homeDirectory() const;
 
33
 
 
34
        /** Returns the path to an avatar of this user*/
 
35
        QString image() const;
 
36
 
 
37
        /** Returns true if this user is already logged in on another session*/
 
38
        bool isLoggedIn() const;
 
39
 
 
40
    //    LdmUser &operator=(const LdmUser user);
 
41
    private:
 
42
        UserPrivate* d;
 
43
    };
 
44
}
 
45
 
 
46
Q_DECLARE_METATYPE(QLightDM::User);
 
47
Q_DECLARE_METATYPE(QList<QLightDM::User>);
45
48
 
46
49
#endif // LDMUSER_H