home *** CD-ROM | disk | FTP | other *** search
/ Personal Computer World 2009 February / PCWFEB09.iso / Software / Linux / SLAX 6.0.8 / slax-6.0.8.iso / slax / base / 006-devel.lzm / usr / include / ksambashare.h < prev    next >
Encoding:
C/C++ Source or Header  |  2005-10-10  |  2.2 KB  |  86 lines

  1. /* This file is part of the KDE project
  2.    Copyright (c) 2004 Jan Schaefer <j_schaef@informatik.uni-kl.de>
  3.  
  4.    This library is free software; you can redistribute it and/or
  5.    modify it under the terms of the GNU Library General Public
  6.    License version 2 as published by the Free Software Foundation.
  7.  
  8.    This library is distributed in the hope that it will be useful,
  9.    but WITHOUT ANY WARRANTY; without even the implied warranty of
  10.    MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE.  See the GNU
  11.    Library General Public License for more details.
  12.  
  13.    You should have received a copy of the GNU Library General Public License
  14.    along with this library; see the file COPYING.LIB.  If not, write to
  15.    the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
  16.    Boston, MA 02110-1301, USA.
  17. */
  18.  
  19. #ifndef ksambashare_h
  20. #define ksambashare_h
  21.  
  22. #include <qobject.h>
  23.  
  24. #include <kdelibs_export.h>
  25.  
  26. class KSambaSharePrivate;
  27.  
  28. /**
  29.  * Similar functionality like KFileShare, 
  30.  * but works only for Samba and do not need 
  31.  * any suid script.
  32.  * Singleton class, call instance() to get an instance.
  33.  */
  34. class KIO_EXPORT KSambaShare : public QObject 
  35. {
  36. Q_OBJECT
  37. public:
  38.   /**
  39.    * Returns the one and only instance of KSambaShare
  40.    */
  41.   static KSambaShare* instance();
  42.  
  43.   /**
  44.    * Whether or not the given path is shared by Samba.
  45.    * @param path the path to check if it is shared by Samba.
  46.    * @return whether the given path is shared by Samba.
  47.    */
  48.   bool isDirectoryShared( const QString & path ) const;
  49.   
  50.   /**
  51.    * Returns a list of all directories shared by Samba.
  52.    * The resulting list is not sorted.
  53.    * @return a list of all directories shared by Samba.
  54.    */
  55.   QStringList sharedDirectories() const;
  56.   
  57.   /**
  58.    * KSambaShare destructor. 
  59.    * Do not call!
  60.    * The instance is destroyed automatically!
  61.    */ 
  62.   virtual ~KSambaShare();
  63.   
  64.   /**
  65.    * Returns the path to the used smb.conf file
  66.    * or null if no file was found
  67.    */
  68.   QString smbConfPath() const;
  69.   
  70. signals:
  71.   /**
  72.    * Emitted when the smb.conf file has changed
  73.    */
  74.   void changed();  
  75.   
  76. private:
  77.   KSambaShare();
  78.   static KSambaShare* _instance;
  79.   KSambaSharePrivate* d;
  80.   
  81. private slots:
  82.   void slotFileChange(const QString&);  
  83. };
  84.  
  85. #endif
  86.