delay a few things on startup, such as setting the visibility mode, which ensures...
[personal-kdebase.git] / runtime / kioslave / smb / kio_smb_internal.h
blobb895b81bfc75d7b7ae4fad07b7b7c250948ba94b
1 /////////////////////////////////////////////////////////////////////////////
2 //
3 // Project: SMB kioslave for KDE2
4 //
5 // File: kio_smb_internal.h
6 //
7 // Abstract: Utility classes used by SMBSlave
8 //
9 // Author(s): Matthew Peterson <mpeterson@caldera.com>
10 // Frank Schwanz <schwanz@fh-brandenburg.de>
11 //---------------------------------------------------------------------------
13 // Copyright (c) 2000 Caldera Systems, Inc.
15 // This program is free software; you can redistribute it and/or modify it
16 // under the terms of the GNU General Public License as published by the
17 // Free Software Foundation; either version 2.1 of the License, or
18 // (at your option) any later version.
20 // This program is distributed in the hope that it will be useful,
21 // but WITHOUT ANY WARRANTY; without even the implied warranty of
22 // MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
23 // GNU Lesser General Public License for more details.
25 // You should have received a copy of the GNU General Public License
26 // along with this program; see the file COPYING. If not, please obtain
27 // a copy from http://www.gnu.org/copyleft/gpl.html
29 /////////////////////////////////////////////////////////////////////////////
31 #ifndef KIO_SMB_INTERNAL_H_INCLUDED
32 #define KIO_SMB_INTERNAL_H_INCLUDED
34 #include <kio/authinfo.h>
35 //Added by qt3to4:
36 #include <QByteArray>
38 /**
39 * Types of a SMBURL :
40 * SMBURLTYPE_UNKNOWN - Type could not be determined. Bad SMB Url.
41 * SMBURLTYPE_ENTIRE_NETWORK - "smb:/" is entire network
42 * SMBURLTYPE_WORKGROUP_OR_SERVER - "smb:/mygroup" or "smb:/myserver"
43 * URLTYPE_SHARE_OR_PATH - "smb:/mygroupe/mymachine/myshare/mydir"
45 enum SMBUrlType {
46 SMBURLTYPE_UNKNOWN = 0, SMBURLTYPE_ENTIRE_NETWORK = 1,
47 SMBURLTYPE_WORKGROUP_OR_SERVER = 2, SMBURLTYPE_SHARE_OR_PATH = 3
51 //===========================================================================
52 /**
53 * Class to handle URL's
54 * it can convert KUrl to smbUrl
55 * and Handle UserInfo
56 * it also check the correctness of the URL
58 class SMBUrl : public KUrl
62 public:
63 SMBUrl();
64 SMBUrl(const KUrl & kurl);
66 /**
67 * Appends the specified file and dir to this SMBUrl
68 * "smb://server/share" --> "smb://server/share/filedir"
70 void addPath(const QString &filedir);
72 bool cd(const QString &dir);
74 /**
75 * Returns the type of this SMBUrl:
76 * SMBURLTYPE_UNKNOWN - Type could not be determined. Bad SMB Url.
77 * SMBURLTYPE_ENTIRE_NETWORK - "smb:/" is entire network
78 * SMBURLTYPE_WORKGROUP_OR_SERVER - "smb:/mygroup" or "smb:/myserver"
79 * URLTYPE_SHARE_OR_PATH - "smb:/mygroupe/mymachine/myshare/mydir"
81 SMBUrlType getType() const;
83 void setPass( const QString& _txt ) { KUrl::setPass(_txt); updateCache(); }
84 void setUser( const QString& _txt ) { KUrl::setUser(_txt); updateCache(); }
85 void setHost( const QString& _txt ) { KUrl::setHost(_txt); updateCache(); }
87 /**
88 * Returns the workgroup if it given in url
90 // QString getWorkgroup() const;
92 /**
93 * Returns path after workgroup
95 // QString getServerShareDir() const;
97 /**
98 * Return a URL that is suitable for libsmbclient
100 QByteArray toSmbcUrl() const { return m_surl; }
102 private:
104 * Change from QString to QCString (MS Windows's character encoding)
106 QByteArray fromUnicode( const QString &_str ) const;
108 void updateCache();
109 QByteArray m_surl;
112 * Type of URL
113 * @see _SMBUrlType
115 mutable SMBUrlType m_type;
119 #endif