• Skip to content
  • Skip to link menu
Trinity API Reference
  • Trinity API Reference
  • kdecore
 

kdecore

  • kdecore
kstandarddirs.h
1 /*
2  This file is part of the KDE libraries
3  Copyright (C) 1999 Sirtaj Singh Kang <taj@kde.org>
4  Copyright (C) 1999 Stephan Kulow <coolo@kde.org>
5  Copyright (C) 1999 Waldo Bastian <bastian@kde.org>
6 
7  This library is free software; you can redistribute it and/or
8  modify it under the terms of the GNU Library General Public
9  License as published by the Free Software Foundation; either
10  version 2 of the License, or (at your option) any later version.
11 
12  This library is distributed in the hope that it will be useful,
13  but WITHOUT ANY WARRANTY; without even the implied warranty of
14  MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the GNU
15  Library General Public License for more details.
16 
17  You should have received a copy of the GNU Library General Public License
18  along with this library; see the file COPYING.LIB. If not, write to
19  the Free Software Foundation, Inc., 51 Franklin Street, Fifth Floor,
20  Boston, MA 02110-1301, USA.
21 */
22 
23 #ifndef SSK_KSTDDIRS_H
24 #define SSK_KSTDDIRS_H
25 
26 #include <tqstring.h>
27 #include <tqdict.h>
28 #include <tqstringlist.h>
29 #include <kglobal.h>
30 
31 class KConfig;
32 class KStandardDirsPrivate;
33 
125 class KDECORE_EXPORT KStandardDirs
126 {
127 public:
131  KStandardDirs( );
132 
136  virtual ~KStandardDirs();
137 
147  void addPrefix( const TQString& dir );
148 
156  void addXdgConfigPrefix( const TQString& dir );
157 
165  void addXdgDataPrefix( const TQString& dir );
166 
186  bool addResourceType( const char *type,
187  const TQString& relativename );
188 
204  bool addResourceDir( const char *type,
205  const TQString& absdir);
206 
225  TQString findResource( const char *type,
226  const TQString& filename ) const;
227 
243  bool isRestrictedResource( const char *type,
244  const TQString& relPath=TQString::null ) const;
245 
258  TQ_UINT32 calcResourceHash( const char *type,
259  const TQString& filename, bool deep) const;
260 
277  TQStringList findDirs( const char *type,
278  const TQString& reldir ) const;
279 
300  TQString findResourceDir( const char *type,
301  const TQString& filename) const;
302 
303 
323  TQStringList findAllResources( const char *type,
324  const TQString& filter = TQString::null,
325  bool recursive = false,
326  bool unique = false) const;
327 
350  TQStringList findAllResources( const char *type,
351  const TQString& filter,
352  bool recursive,
353  bool unique,
354  TQStringList &relPaths) const;
355 
365  static TQStringList systemPaths( const TQString& pstr=TQString::null );
366 
384  static TQString findExe( const TQString& appname,
385  const TQString& pathstr=TQString::null,
386  bool ignoreExecBit=false );
387 
406  static int findAllExe( TQStringList& list, const TQString& appname,
407  const TQString& pathstr=TQString::null,
408  bool ignoreExecBit=false );
409 
419  void addKDEDefaults();
420 
430  bool addCustomized(KConfig *config);
431 
443  TQStringList resourceDirs(const char *type) const;
444 
451  TQStringList allTypes() const;
452 
470  TQString saveLocation(const char *type,
471  const TQString& suffix = TQString::null,
472  bool create = true) const;
473 
489  TQString relativeLocation(const char *type, const TQString &absPath);
490 
501  static bool makeDir(const TQString& dir, int mode = 0755);
502 
530  static TQString kde_default(const char *type);
531 
535  TQString kfsstnd_prefixes();
536 
540  TQString kfsstnd_xdg_conf_prefixes();
541 
545  TQString kfsstnd_xdg_data_prefixes();
546 
553  TQString localkdedir() const;
554 
559  static TQString kfsstnd_defaultprefix();
560 
565  static TQString kfsstnd_defaultbindir();
566 
571  TQString localxdgdatadir() const;
572 
577  TQString localxdgconfdir() const;
578 
586  static bool exists(const TQString &fullPath);
587 
596  static TQString realPath(const TQString &dirname);
597 
606  static TQString realFilePath(const TQString &filename);
607 
608  private:
609 
610  TQStringList prefixes;
611 
612  // Directory dictionaries
613  TQDict<TQStringList> absolutes;
614  TQDict<TQStringList> relatives;
615 
616  mutable TQDict<TQStringList> dircache;
617  mutable TQDict<TQString> savelocations;
618 
619  // Disallow assignment and copy-construction
620  KStandardDirs( const KStandardDirs& );
621  KStandardDirs& operator= ( const KStandardDirs& );
622 
623  bool addedCustoms;
624 
625  class KStandardDirsPrivate;
626  KStandardDirsPrivate *d;
627 
628  void checkConfig() const;
629  void applyDataRestrictions(const TQString &) const;
630  void createSpecialResource(const char*);
631 
632  // Like their public counter parts but with an extra priority argument
633  // If priority is true, the directory is added directly after
634  // $KDEHOME/$XDG_DATA_HOME/$XDG_CONFIG_HOME
635  void addPrefix( const TQString& dir, bool priority );
636  void addXdgConfigPrefix( const TQString& dir, bool priority );
637  void addXdgDataPrefix( const TQString& dir, bool priority );
638 
639  // If priority is true, the directory is added before any other,
640  // otherwise after
641  bool addResourceType( const char *type,
642  const TQString& relativename, bool priority );
643  bool addResourceDir( const char *type,
644  const TQString& absdir, bool priority);
645 };
646 
703 KDECORE_EXPORT TQString locate( const char *type, const TQString& filename, const KInstance* instance = KGlobal::instance() );
704 
714 KDECORE_EXPORT TQString locateLocal( const char *type, const TQString& filename, const KInstance* instance = KGlobal::instance() );
715 
725 KDECORE_EXPORT TQString locateLocal( const char *type, const TQString& filename, bool createDir, const KInstance* instance = KGlobal::instance() );
726 
729 #endif // SSK_KSTDDIRS_H
KStandardDirs::locate
TQString locate(const char *type, const TQString &filename, const KInstance *instance=KGlobal::instance())
Definition: kstandarddirs.cpp:1689
KStandardDirs::locateLocal
TQString locateLocal(const char *type, const TQString &filename, const KInstance *instance=KGlobal::instance())
Definition: kstandarddirs.cpp:1695
KStandardDirs
Site-independent access to standard KDE directories.
Definition: kstandarddirs.h:125
KInstance
Access to KDE global objects for use in shared libraries.
Definition: kinstance.h:43
KGlobal::instance
static KInstance * instance()
Returns the global instance.
Definition: kglobal.cpp:82
KConfig
Access KDE Configuration entries.
Definition: kconfig.h:43

kdecore

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

kdecore

Skip menu "kdecore"
  • arts
  • dcop
  • dnssd
  • interfaces
  •     interface
  •     library
  •   kspeech
  •   ktexteditor
  • kabc
  • kate
  • kcmshell
  • kdecore
  • kded
  • kdefx
  • kdeprint
  • kdesu
  • kdeui
  • kdoctools
  • khtml
  • kimgio
  • kinit
  • kio
  •   bookmarks
  •   httpfilter
  •   kfile
  •   kio
  •   kioexec
  •   kpasswdserver
  •   kssl
  • kioslave
  •   http
  • kjs
  • kmdi
  •   kmdi
  • knewstuff
  • kparts
  • krandr
  • kresources
  • kspell2
  • kunittest
  • kutils
  • kwallet
  • libkmid
  • libkscreensaver
Generated for kdecore by doxygen 1.8.8
This website is maintained by Timothy Pearson.
KDE® and the K Desktop Environment® logo are registered trademarks of KDE e.V. |