2
2
smb4khomesshareshandler - This class handles the homes shares.
4
4
begin : Do Aug 10 2006
5
copyright : (C) 2006-2008 by Alexander Reinholdt
6
email : dustpuppy@users.berlios.de
5
copyright : (C) 2006-2011 by Alexander Reinholdt
6
email : alexander.reinholdt@kdemail.net
7
7
***************************************************************************/
9
9
/***************************************************************************
20
20
* You should have received a copy of the GNU General Public License *
21
21
* along with this program; if not, write to the *
22
* Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston, *
22
* Free Software Foundation, 51 Franklin Street, Suite 500, Boston, *
24
24
***************************************************************************/
26
26
#ifndef SMB4KHOMESSHARESHANDLER_H
44
44
// forward declarations
46
46
class Smb4KAuthInfo;
47
class Smb4KHomesUsers;
48
class Smb4KHomesSharesHandlerPrivate;
50
52
* This class belongs to the core of Smb4K and takes care of the
51
53
* user names that are/were defined for a certain 'homes' share.
53
* @author Alexander Reinholdt <dustpuppy@users.berlios.de>
55
* @author Alexander Reinholdt <alexander.reinholdt@kdemail.net>
56
58
class KDE_EXPORT Smb4KHomesSharesHandler : public QObject
69
71
* This function will open a dialog where the user has to define a
70
* user name to access a 'homes' share. The name of @p share will be set accordingly.
72
* user name to access a 'homes' share. You also can define if the
73
* user name should be overwritten in case one has already been set
76
* In case that a new username is set by this function, the password
72
79
* @param share The share that is representing the homes share
81
* @param overwrite Overwrite user name or not
74
* @param parent The parent widget. If you go with the default value 0 and
75
* @ref kapp->activeWindow() is not NULL, it will be used as parent.
83
* @param parent The parent widget
77
85
* @returns TRUE if user has been chosen and FALSE otherwise.
79
bool specifyUser( Smb4KShare *share,
87
bool specifyUser( Smb4KShare *share,
88
bool overwrite = true,
80
89
QWidget *parent = 0 );
83
* Read and set the user names that are defined for the 'homes' share represented
84
* by @p share. In most cases you do not need to use this function, because the 'homes'
85
* share will already carry the list of users with it.
87
* @param share The 'homes' share
89
* @returns the list of user names for this homes share.
91
void setHomesUsers( Smb4KShare *share );
94
* Read and set the user names that are defined for the 'homes' share represented
95
* by @p authInfo. In most cases you do not need to use this function, because the
96
* authentication information will already carry the homes users.
98
* If this authentication information does not represent a homes share, this function
101
* @param authInfo The authentication information
103
void setHomesUsers( Smb4KAuthInfo *authInfo );
92
* Return the list of users defined for a certain homes share.
94
* @param share The share
96
* @returns a list of users
98
QStringList homesUsers( Smb4KShare *share );
107
* Is connected to the textChanged() signal of the combo box
108
* in the "Specify User" dialog.
110
* @param text The text in the combo box
112
void slotTextChanged( const QString &text );
115
* This slot is called if the User1 button, i.e. the "Clear" button
116
* in the "Specify User" dialog has been clicked. It removes all
117
* entries from the combo box.
119
void slotClearClicked();
102
* Called when the application goes down
104
void slotAboutToQuit();
138
123
* Save the host and user names.
140
125
void writeUserNames();
143
* Find a particular share in the list. This function takes @p share,
144
* extracts the needed information and searches the list if a homes
145
* share with the same workgroup and host name is defined. If it cannot
146
* find such a share, NULL is returns and the share otherwise.
148
* @param share The share that is searched
150
* @returns a pointer to the share carrying the needed information or NULL.
152
Smb4KShare *findShare( Smb4KShare *share );
155
* Find a particular share in the list. This function takes @p authInfo,
156
* extracts the needed information and searches the list if a homes
157
* share with the same workgroup and host name is defined. If it cannot
158
* find such a share, NULL is returns and the share otherwise.
160
* @param authInfo The authentication information
162
* @returns a pointer to the share carrying the needed information or NULL.
164
Smb4KShare *findShare( Smb4KAuthInfo *authInfo );
167
* This is the dialog that's shown the user when he/she has to
168
* provide a user name.
173
* This map carries all information about the homes shares.
175
QList<Smb4KShare> m_list;
128
* Find the homes user for a specific share
130
void findHomesUsers( Smb4KShare *share,
131
QStringList *users );
134
* Add user to a homes share
136
void addHomesUsers( Smb4KShare *share,
137
QStringList *users );
140
* The list of shares with homes users
142
QList<Smb4KHomesUsers> m_homes_users;