summaryrefslogtreecommitdiffstats
path: root/smb4k/core/smb4kauthinfo.h
blob: dd0f05cd9e267d42ea896256e04006d7b43e5290 (plain)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
/***************************************************************************
    smb4kauthinfo.h  -  This class provides a container for the
    authentication data.
                             -------------------
    begin                : Sa Feb 28 2004
    copyright            : (C) 2004-2007 by Alexander Reinholdt
    email                : dustpuppy@users.berlios.de
 ***************************************************************************/

/***************************************************************************
 *   This program is free software; you can redistribute it and/or modify  *
 *   it under the terms of the GNU General Public License as published by  *
 *   the Free Software Foundation; either version 2 of the License, or     *
 *   (at your option) any later version.                                   *
 *                                                                         *
 *   This program is distributed in the hope that it will be useful, but   *
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 *   General Public License for more details.                              *
 *                                                                         *
 *   You should have received a copy of the GNU General Public License     *
 *   along with this program; if not, write to the                         *
 *   Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston,   *
 *   MA  02110-1301 USA                                                    *
 ***************************************************************************/

#ifndef SMB4KAUTHINFO_H
#define SMB4KAUTHINFO_H

// TQt includes
#include <tqstring.h>
#include <tqcstring.h>

/**
 * This class provides a container for the authentication data.
 *
 * @author Alexander Reinholdt <dustpuppy@users.berlios.de>
 */


class Smb4KAuthInfo
{
  public:
    /**
     * The constructor.
     *
     * @param workgroup The workgroup of the share the auth info is for.
     *
     * @param hosts     The host's name
     *
     * @param share     The share's name
     *
     * @param user      The username that's used for authentication. Default is TQString().
     *
     * @param password  The password that's used for authentication. Default is TQString().
     */
    Smb4KAuthInfo( const TQString &workgroup,
                   const TQString &host,
                   const TQString &share,
                   const TQString &user = TQString(),
                   const TQString &password = TQString() );
    /**
     * The empty constructor.
     */
    Smb4KAuthInfo() {}
    /**
     * The copy constructor.
     *
     * @param info      The Smb4KAuthInfo object that will be copied.
     */
    Smb4KAuthInfo( Smb4KAuthInfo &info );
    /**
     * The destructor
     */
    ~Smb4KAuthInfo();
    /**
     * Returns the name of the workgroup.
     *
     * @returns         The workgroup of the server/share for which this
     *                  authentication data is for.
     */
    const TQString &workgroup() const { return m_workgroup; }
    /**
     * Returns the name of the server (host).
     *
     * @returns         The server name
     */
    const TQString &host() const { return m_host; }
    /**
     * Returns the name of the share.
     *
     * @returns         The share name
     */
    const TQString &share() const { return m_share; }
    /**
     * Returns the user's name.
     *
     * @returns         The user name
     */
    const TQCString &user() const { return m_user; }
    /**
     * Returns the (unescaped) password.
     */
    const TQCString &password() const { return m_password; }
    /**
     * Sets the user name.
     *
     * @param user      The user name for the server/share
     */
    void setUser( const TQString &user );
    /**
     * Sets the password.
     *
     * @param passwd    The password for the server/share
     */
    void setPassword( const TQString &passwd );
    /**
     * Sets the share name.
     *
     * @param share     The name of the share
     */
    void setShare( const TQString &share );

  private:
    /**
     * The workgroup object.
     */
    TQString m_workgroup;
    /**
     * The host object.
     */
    TQString m_host;
    /**
     * The share object.
     */
    TQString m_share;
    /**
     * The user name for this share.
     */
    TQCString m_user;
    /**
     * The password object for this share.
     */
    TQCString m_password;

};

#endif