• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • tdeio/tdeio
 

tdeio/tdeio

  • tdeio
  • tdeio
kprotocolinfo.cpp
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Torben Weis <weis@kde.org>
3  Copyright (C) 2003 Waldo Bastian <bastian@kde.org>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
8 
9  This library is distributed in the hope that it will be useful,
10  but WITHOUT ANY WARRANTY; without even the implied warranty of
11  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
12  Library General Public License for more details.
13 
14  You should have received a copy of the GNU Library General Public License
15  along with this library; see the file COPYING.LIB. If not, write to
16  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
17  Boston, MA 02110-1301, USA.
18 */
19 
20 #ifdef MAKE_TDECORE_LIB //needed for proper linkage (win32)
21 #undef TDEIO_EXPORT
22 #define TDEIO_EXPORT KDE_EXPORT
23 #endif
24 
25 #include "kprotocolinfo.h"
26 #include "kprotocolinfofactory.h"
27 #include "tdeprotocolmanager.h"
28 
29 // Most of this class is implemented in tdecore/kprotocolinfo_tdecore.cpp
30 // This file only contains a few static class-functions that depend on
31 // KProtocolManager
32 
33 KProtocolInfo* KProtocolInfo::findProtocol(const KURL &url)
34 {
35 #ifdef MAKE_TDECORE_LIB
36  return 0;
37 #else
38  TQString protocol = url.protocol();
39 
40  if ( !KProtocolInfo::proxiedBy( protocol ).isEmpty() )
41  {
42  TQString dummy;
43  protocol = KProtocolManager::slaveProtocol(url, dummy);
44  }
45 
46  return KProtocolInfoFactory::self()->findProtocol(protocol);
47 #endif
48 }
49 
50 
51 KProtocolInfo::Type KProtocolInfo::inputType( const KURL &url )
52 {
53  KProtocolInfo::Ptr prot = findProtocol(url);
54  if ( !prot )
55  return T_NONE;
56 
57  return prot->m_inputType;
58 }
59 
60 KProtocolInfo::Type KProtocolInfo::outputType( const KURL &url )
61 {
62  KProtocolInfo::Ptr prot = findProtocol(url);
63  if ( !prot )
64  return T_NONE;
65 
66  return prot->m_outputType;
67 }
68 
69 
70 bool KProtocolInfo::isSourceProtocol( const KURL &url )
71 {
72  KProtocolInfo::Ptr prot = findProtocol(url);
73  if ( !prot )
74  return false;
75 
76  return prot->m_isSourceProtocol;
77 }
78 
79 bool KProtocolInfo::isFilterProtocol( const KURL &url )
80 {
81  return isFilterProtocol (url.protocol());
82 }
83 
84 bool KProtocolInfo::isFilterProtocol( const TQString &protocol )
85 {
86  // We call the findProtocol (const TQString&) to bypass any proxy settings.
87  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(protocol);
88  if ( !prot )
89  return false;
90 
91  return !prot->m_isSourceProtocol;
92 }
93 
94 bool KProtocolInfo::isHelperProtocol( const KURL &url )
95 {
96  return isHelperProtocol (url.protocol());
97 }
98 
99 bool KProtocolInfo::isHelperProtocol( const TQString &protocol )
100 {
101  // We call the findProtocol (const TQString&) to bypass any proxy settings.
102  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(protocol);
103  if ( !prot )
104  return false;
105 
106  return prot->m_isHelperProtocol;
107 }
108 
109 bool KProtocolInfo::isKnownProtocol( const KURL &url )
110 {
111  return isKnownProtocol (url.protocol());
112 }
113 
114 bool KProtocolInfo::isKnownProtocol( const TQString &protocol )
115 {
116  // We call the findProtocol (const TQString&) to bypass any proxy settings.
117  KProtocolInfo::Ptr prot = KProtocolInfoFactory::self()->findProtocol(protocol);
118  return ( prot != 0);
119 }
120 
121 bool KProtocolInfo::supportsListing( const KURL &url )
122 {
123  KProtocolInfo::Ptr prot = findProtocol(url);
124  if ( !prot )
125  return false;
126 
127  return prot->m_supportsListing;
128 }
129 
130 TQStringList KProtocolInfo::listing( const KURL &url )
131 {
132  KProtocolInfo::Ptr prot = findProtocol(url);
133  if ( !prot )
134  return TQStringList();
135 
136  return prot->m_listing;
137 }
138 
139 bool KProtocolInfo::supportsReading( const KURL &url )
140 {
141  KProtocolInfo::Ptr prot = findProtocol(url);
142  if ( !prot )
143  return false;
144 
145  return prot->m_supportsReading;
146 }
147 
148 bool KProtocolInfo::supportsWriting( const KURL &url )
149 {
150  KProtocolInfo::Ptr prot = findProtocol(url);
151  if ( !prot )
152  return false;
153 
154  return prot->m_supportsWriting;
155 }
156 
157 bool KProtocolInfo::supportsMakeDir( const KURL &url )
158 {
159  KProtocolInfo::Ptr prot = findProtocol(url);
160  if ( !prot )
161  return false;
162 
163  return prot->m_supportsMakeDir;
164 }
165 
166 bool KProtocolInfo::supportsDeleting( const KURL &url )
167 {
168  KProtocolInfo::Ptr prot = findProtocol(url);
169  if ( !prot )
170  return false;
171 
172  return prot->m_supportsDeleting;
173 }
174 
175 bool KProtocolInfo::supportsLinking( const KURL &url )
176 {
177  KProtocolInfo::Ptr prot = findProtocol(url);
178  if ( !prot )
179  return false;
180 
181  return prot->m_supportsLinking;
182 }
183 
184 bool KProtocolInfo::supportsMoving( const KURL &url )
185 {
186  KProtocolInfo::Ptr prot = findProtocol(url);
187  if ( !prot )
188  return false;
189 
190  return prot->m_supportsMoving;
191 }
192 
193 bool KProtocolInfo::canCopyFromFile( const KURL &url )
194 {
195  KProtocolInfo::Ptr prot = findProtocol(url);
196  if ( !prot )
197  return false;
198 
199  return prot->m_canCopyFromFile;
200 }
201 
202 
203 bool KProtocolInfo::canCopyToFile( const KURL &url )
204 {
205  KProtocolInfo::Ptr prot = findProtocol(url);
206  if ( !prot )
207  return false;
208 
209  return prot->m_canCopyToFile;
210 }
211 
212 bool KProtocolInfo::canRenameFromFile( const KURL &url )
213 {
214  KProtocolInfo::Ptr prot = findProtocol(url);
215  if ( !prot )
216  return false;
217 
218  return prot->canRenameFromFile();
219 }
220 
221 
222 bool KProtocolInfo::canRenameToFile( const KURL &url )
223 {
224  KProtocolInfo::Ptr prot = findProtocol(url);
225  if ( !prot )
226  return false;
227 
228  return prot->canRenameToFile();
229 }
230 
231 bool KProtocolInfo::canDeleteRecursive( const KURL &url )
232 {
233  KProtocolInfo::Ptr prot = findProtocol(url);
234  if ( !prot )
235  return false;
236 
237  return prot->canDeleteRecursive();
238 }
239 
240 KProtocolInfo::FileNameUsedForCopying KProtocolInfo::fileNameUsedForCopying( const KURL &url )
241 {
242  KProtocolInfo::Ptr prot = findProtocol(url);
243  if ( !prot )
244  return FromURL;
245 
246  return prot->fileNameUsedForCopying();
247 }
248 
249 TQString KProtocolInfo::defaultMimetype( const KURL &url )
250 {
251  KProtocolInfo::Ptr prot = findProtocol(url);
252  if ( !prot )
253  return TQString::null;
254 
255  return prot->m_defaultMimetype;
256 }
257 

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • Main Page
  • Modules
  • Namespace List
  • Class Hierarchy
  • Alphabetical List
  • Class List
  • File List
  • Namespace Members
  • Class Members
  • Related Pages

tdeio/tdeio

Skip menu "tdeio/tdeio"
  • arts
  • dcop
  • dnssd
  • interfaces
  •   kspeech
  •     interface
  •     library
  •   tdetexteditor
  • kate
  • kded
  • kdoctools
  • kimgio
  • kjs
  • libtdemid
  • libtdescreensaver
  • tdeabc
  • tdecmshell
  • tdecore
  • tdefx
  • tdehtml
  • tdeinit
  • tdeio
  •   bookmarks
  •   httpfilter
  •   kpasswdserver
  •   kssl
  •   tdefile
  •   tdeio
  •   tdeioexec
  • tdeioslave
  •   http
  • tdemdi
  •   tdemdi
  • tdenewstuff
  • tdeparts
  • tdeprint
  • tderandr
  • tderesources
  • tdespell2
  • tdesu
  • tdeui
  • tdeunittest
  • tdeutils
  • tdewallet
Generated for tdeio/tdeio by doxygen 1.8.1.2
This website is maintained by Timothy Pearson.