tdeioslave/mbox

urlinfo.h
1/*
2 * This is a simple tdeioslave to handle mbox-files.
3 * Copyright (C) 2004 Mart Kelder (mart.kde@hccnet.nl)
4 *
5 * This library is free software; you can redistribute it and/or
6 * modify it under the terms of the GNU Lesser General Public
7 * License as published by the Free Software Foundation; either
8 * version 2 of the License, or (at your option) any later version.
9 *
10 * This library is distributed in the hope that it will be useful,
11 * but WITHOUT ANY WARRANTY; without even the implied warranty of
12 * MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
13 * Lesser General Public License for more details.
14 *
15 * You should have received a copy of the GNU Lesser General Public
16 * License along with this library; if not, write to the Free Software
17 * Foundation, Inc., 51 Franklin Street, Fifth Floor, Boston, MA 02110-1301 USA
18 */
19#ifndef URLINFO_H
20#define URLINFO_H
21class KURL;
22
23class TQString;
24
25class UrlInfo
26{
27public:
31 enum UrlType { invalid = 0, message = 1, directory = 2 };
32
39 UrlInfo( const KURL &url, const UrlType type = (UrlType)( message | directory ) );
40
44 ~UrlInfo();
45
50 UrlType type() const { return m_type; }
51
55 TQString mimetype() const;
56
60 TQString filename() const;
64 TQString id() const;
65
69 TQString url() const;
70private:
71 void calculateInfo( const KURL& url, const UrlType type );
72
73 bool isDirectory( const KURL& url );
74 bool isMessage( const KURL& url );
75
76private:
77 UrlType m_type;
78 TQString *m_filename;
79 TQString *m_id;
80};
81
82#endif