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

tdeio/tdeio

  • tdeio
  • tdeio
kservice.h
1/* This file is part of the KDE project
2 Copyright (C) 1998, 1999 Torben Weis <weis@kde.org>
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 as published by the Free Software Foundation; either
7 version 2 of the License, or (at your option) any later version.
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#ifndef __kservices_h__
21#define __kservices_h__
22
23#include <tqstringlist.h>
24#include <tqmap.h>
25#include <tqvariant.h>
26#include <kicontheme.h>
27
28#include "tdesycocaentry.h"
29
30class TQDataStream;
31class KDesktopFile;
32class KService;
33class KBuildSycoca;
34class TQWidget;
35
48class TDEIO_EXPORT KService : public KSycocaEntry
49{
50 K_SYCOCATYPE( KST_KService, KSycocaEntry )
51
52 friend class KBuildSycoca;
53
54public:
55 typedef TDESharedPtr<KService> Ptr;
56 typedef TQValueList<Ptr> List;
57public:
64 KService( const TQString & _name, const TQString &_exec, const TQString &_icon);
65
71 explicit KService( const TQString & _fullpath );
72
77 KService( KDesktopFile *config ); // KDE-4.0: make explicit
78
84 KService( TQDataStream& _str, int offset );
85
86 virtual ~KService();
87
92 virtual TQString type() const { return m_strType; }
98 virtual TQString name() const { return m_strName; }
104 TQString exec() const { return m_strExec; }
111 TQString library() const { return m_strLibrary; }
118 TQString init() const { return m_strInit; }
119
125 TQString icon() const { return m_strIcon; }
132 TQPixmap pixmap( TDEIcon::Group _group, int _force_size = 0, int _state = 0,
133 TQString * _path = 0L ) const;
138 bool terminal() const { return m_bTerminal; }
147 TQString terminalOptions() const { return m_strTerminalOptions; }
153 bool substituteUid() const;
161 TQString username() const;
162
174 TQString desktopEntryPath() const { return entryPath(); }
175
182 TQString desktopEntryName() const { return m_strDesktopEntryName; }
183
190 TQString menuId() const;
191
199 TQString storageId() const;
200
213 enum DCOPServiceType_t { DCOP_None = 0, DCOP_Unique, DCOP_Multi, DCOP_Wait };
214
219 DCOPServiceType_t DCOPServiceType() const { return m_DCOPServiceType; }
220
226 TQString path() const { return m_strPath; }
227
233 TQString comment() const { return m_strComment; }
234
241 TQString genericName() const { return m_strGenName; }
242
251 TQString untranslatedGenericName() const;
252
257 TQStringList keywords() const { return m_lstKeywords; }
258
264 TQStringList categories() const;
265
270 TQStringList serviceTypes() const { return m_lstServiceTypes; }
271
280 bool hasServiceType( const TQString& _service ) const;
281
292 bool allowAsDefault() const { return m_bAllowAsDefault; }
293
300 bool allowMultipleFiles() const;
301
308 int initialPreference() const { return m_initialPreference; }
309
318 int initialPreferenceForMimeType( const TQString& mimeType ) const;
319
323 void setInitialPreference( int i ) { m_initialPreference = i; }
324
329 bool noDisplay() const;
333 bool SuSEunimportant() const;
334
341 TQString parentApp() const;
342
355 virtual TQVariant property( const TQString& _name ) const;
356
366 TQVariant property( const TQString& _name, TQVariant::Type t ) const;
367
373 virtual TQStringList propertyNames() const;
374
379 bool isValid() const { return m_bValid; }
380
387 TQString locateLocal();
388
393 virtual void load( TQDataStream& );
398 virtual void save( TQDataStream& );
403 void setMenuId(const TQString &menuId);
408 void setTerminal(bool b) { m_bTerminal = b; }
413 void setTerminalOptions(const TQString &options) { m_strTerminalOptions = options; }
414
424 static Ptr serviceByName( const TQString& _name );
425
435 static Ptr serviceByDesktopPath( const TQString& _path );
436
451 static Ptr serviceByDesktopName( const TQString& _name );
452
462 static Ptr serviceByMenuId( const TQString& _menuId );
463
474 static Ptr serviceByStorageId( const TQString& _storageId );
475
485 static List allServices();
486
493 static List allInitServices();
494
510 static TQString newServicePath(bool showInMenu, const TQString &suggestedName,
511 TQString *menuId = 0,
512 const TQStringList *reservedMenuIds = 0);
513
514
520 static void rebuildKSycoca(TQWidget *parent);
521
522protected:
523
524 void init(KDesktopFile *config);
525
526 TQStringList &accessServiceTypes() { return m_lstServiceTypes; }
527
528
529private:
530 KService( const KService& ); // forbidden
531 KService& operator=(const KService&);
532
533 TQString m_strType;
534 TQString m_strName;
535 TQString m_strExec;
536 TQString m_strIcon;
537 TQString m_strTerminalOptions;
538 TQString m_strPath;
539 TQString m_strComment;
540 TQString m_strLibrary;
541 TQStringList m_lstServiceTypes;
542 bool m_bAllowAsDefault;
543 int m_initialPreference;
544 bool m_bTerminal;
545 //bool m_bSuid;
546 //TQString m_strUsername;
547 TQString m_strDesktopEntryName;
548 //TQString m_docPath;
549 //bool m_bHideFromPanel;
550 DCOPServiceType_t m_DCOPServiceType;
551 TQStringVariantMap m_mapProps;
552 bool m_bValid;
553 TQStringList m_lstKeywords;
554 TQString m_strInit;
555 TQString m_strGenName;
556protected:
557 virtual void virtual_hook( int id, void* data );
558private:
559 class KServicePrivate;
560 KServicePrivate* d;
561};
562#endif
KService
Represent a service, i.e.
Definition: kservice.h:49
KService::path
TQString path() const
Returns the working directory to run the program in.
Definition: kservice.h:226
KService::comment
TQString comment() const
Returns the descriptive comment for the service, if there is one.
Definition: kservice.h:233
KService::terminal
bool terminal() const
Checks whethe the service should be run in a terminal.
Definition: kservice.h:138
KService::library
TQString library() const
Returns the name of the service's library.
Definition: kservice.h:111
KService::desktopEntryPath
TQString desktopEntryPath() const
Returns the path to the location where the service desktop entry is stored.
Definition: kservice.h:174
KService::DCOPServiceType_t
DCOPServiceType_t
Describes the DCOP type of the service.
Definition: kservice.h:213
KService::keywords
TQStringList keywords() const
Returns a list of descriptive keywords the service, if there are any.
Definition: kservice.h:257
KService::isValid
bool isValid() const
Checks whether the service is valid.
Definition: kservice.h:379
KService::init
TQString init() const
Returns the name of the init function to call (KControl modules).
Definition: kservice.h:118
KService::genericName
TQString genericName() const
Returns the generic name for the service, if there is one (e.g.
Definition: kservice.h:241
KService::name
virtual TQString name() const
Returns the name of the service.
Definition: kservice.h:98
KService::icon
TQString icon() const
Returns the name of the icon.
Definition: kservice.h:125
KService::desktopEntryName
TQString desktopEntryName() const
Returns the filename of the service desktop entry without any extension.
Definition: kservice.h:182
KService::initialPreference
int initialPreference() const
What preference to associate with this service initially (before the user has had any chance to defin...
Definition: kservice.h:308
KService::type
virtual TQString type() const
Returns the type of the service.
Definition: kservice.h:92
KService::serviceTypes
TQStringList serviceTypes() const
Returns the service types that this service supports.
Definition: kservice.h:270
KService::allowAsDefault
bool allowAsDefault() const
Set to true if it is allowed to use this service as the default (main) action for the files it suppor...
Definition: kservice.h:292
KService::DCOPServiceType
DCOPServiceType_t DCOPServiceType() const
Returns the DCOPServiceType supported by this service.
Definition: kservice.h:219
KService::exec
TQString exec() const
Returns the executable.
Definition: kservice.h:104
KService::terminalOptions
TQString terminalOptions() const
Returns any options associated with the terminal the service runs in, if it requires a terminal.
Definition: kservice.h:147

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.9.4
This website is maintained by Timothy Pearson.