~ubuntu-branches/ubuntu/precise/smb4k/precise

« back to all changes in this revision

Viewing changes to core/smb4kglobal.h

  • Committer: Bazaar Package Importer
  • Author(s): Richard A. Johnson
  • Date: 2008-11-23 12:14:34 UTC
  • mfrom: (1.1.14 upstream)
  • Revision ID: james.westby@ubuntu.com-20081123121434-88cpidapbcqteud1
Tags: 0.10.1-0ubuntu1
* New upstream release for KDE 4
* Closes
  - (LP: #238011)
  - (LP: #248510)
  - (LP: #261803)
  - (LP: #262225)
  - (LP: #275539)
* Updated debian/
  - control: updated for new deps and removed old deps, bumped versions,
    modified Maintainer
  - rules: removed all but the kde4.mk for cdbs

Show diffs side-by-side

added added

removed removed

Lines of Context:
 
1
/***************************************************************************
 
2
    smb4kglobal  -  This is the global namespace for Smb4K.
 
3
                             -------------------
 
4
    begin                : Sa Apr 2 2005
 
5
    copyright            : (C) 2005-2008 by Alexander Reinholdt
 
6
    email                : dustpuppy@users.berlios.de
 
7
 ***************************************************************************/
 
8
 
 
9
/***************************************************************************
 
10
 *   This program is free software; you can redistribute it and/or modify  *
 
11
 *   it under the terms of the GNU General Public License as published by  *
 
12
 *   the Free Software Foundation; either version 2 of the License, or     *
 
13
 *   (at your option) any later version.                                   *
 
14
 *                                                                         *
 
15
 *   This program is distributed in the hope that it will be useful, but   *
 
16
 *   WITHOUT ANY WARRANTY; without even the implied warranty of            *
 
17
 *   MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU     *
 
18
 *   General Public License for more details.                              *
 
19
 *                                                                         *
 
20
 *   You should have received a copy of the GNU General Public License     *
 
21
 *   along with this program; if not, write to the                         *
 
22
 *   Free Software Foundation, Inc., 59 Temple Place, Suite 330, Boston,   *
 
23
 *   MA  02111-1307 USA                                                    *
 
24
 ***************************************************************************/
 
25
 
 
26
#ifndef SMB4KGLOBAL_H
 
27
#define SMB4KGLOBAL_H
 
28
 
 
29
// Qt includes
 
30
#include <QString>
 
31
 
 
32
// KDE includes
 
33
#include <kdemacros.h>
 
34
 
 
35
// forward declarations
 
36
class Smb4KWorkgroup;
 
37
class Smb4KHost;
 
38
class Smb4KShare;
 
39
 
 
40
/**
 
41
 * This is the global namespace for the core classes of Smb4K.
 
42
 *
 
43
 * @author    Alexander Reinholdt <dustpuppy@users.berlios.de>
 
44
 */
 
45
 
 
46
namespace Smb4KGlobal
 
47
{
 
48
  /**
 
49
   * This function returns the interval of the timer.
 
50
   *
 
51
   * @returns           The interval of the timer in msec.
 
52
   */
 
53
  KDE_EXPORT int timerInterval();
 
54
 
 
55
  /**
 
56
   * This function creates a temporary directory and returns its name. If it already
 
57
   * exists, only the name will be returned. If an failure occurrs, an error message
 
58
   * will be shown and an empty string is returned.
 
59
   *
 
60
   * @returns           the name of the temporary directory.
 
61
   */
 
62
  KDE_EXPORT const QString &tempDir();
 
63
 
 
64
  /**
 
65
   * This function returns the global list of workgroups that were discovered by
 
66
   * Smb4K. Use this if you want to access and modify the list with your code.
 
67
   *
 
68
   * @returns the global list of known workgroups.
 
69
   */
 
70
  KDE_EXPORT QList<Smb4KWorkgroup *> *workgroupsList();
 
71
 
 
72
  /**
 
73
   * This function returns the global list of hosts that were discovered by
 
74
   * Smb4K. Use this if you want to access and modify the list with your code.
 
75
   *
 
76
   * @returns the global list of known hosts.
 
77
   */
 
78
  KDE_EXPORT QList<Smb4KHost *> *hostsList();
 
79
 
 
80
  /**
 
81
   * This function returns the global list of mounted shares that were discovered by
 
82
   * Smb4K. Use this if you want to access and modify the list with your code.
 
83
   *
 
84
   * @returns the global list of known mounted shares.
 
85
   */
 
86
  KDE_EXPORT QList<Smb4KShare *> *mountedSharesList();
 
87
 
 
88
  /**
 
89
   * This function returns the workgroup or domain that matches the name @p name or
 
90
   * NULL if there is no such workgroup.
 
91
   *
 
92
   * @returns a pointer to the workgroup with name @p name.
 
93
   */
 
94
  KDE_EXPORT Smb4KWorkgroup *findWorkgroup( const QString &name );
 
95
 
 
96
  /**
 
97
   * This function returns the host matching the name @p name or NULL if there is no
 
98
   * such host. The name of the host is mandatory. The workgroup may be empty, but
 
99
   * should be given, because this will speed up the search process.
 
100
   *
 
101
   * @param name          The name of the host
 
102
   *
 
103
   * @param workgroup     The workgroup where the host is located
 
104
   *
 
105
   * @returns an Smb4KHost item of NULL if none was found that matches @p name.
 
106
   */
 
107
  KDE_EXPORT Smb4KHost *findHost( const QString &name,
 
108
                                  const QString &workgroup = QString() );
 
109
 
 
110
  /**
 
111
   * Find a mounted share by its path (i.e. mount point).
 
112
   *
 
113
   * @returns the share that is mounted to @p path.
 
114
   */
 
115
  KDE_EXPORT Smb4KShare *findShareByPath( const QByteArray &path );
 
116
 
 
117
  /**
 
118
   * Find all mounts of a particular share with UNC @p unc on the system.
 
119
   * The UNC has to be defined as //[USER@]HOST/SHARE.
 
120
   *
 
121
   * @param unc         The UNC of the share
 
122
   *
 
123
   * @returns the complete list of mounts with the UNC @p unc.
 
124
   */
 
125
  KDE_EXPORT QList<Smb4KShare *> findShareByUNC( const QString &unc );
 
126
 
 
127
  /**
 
128
   * This function returns the list of inaccessible shares.
 
129
   *
 
130
   * @returns the list of inaccessible shares.
 
131
   */
 
132
  KDE_EXPORT QList<Smb4KShare *> findInaccessibleShares();
 
133
};
 
134
 
 
135
#endif