KDELibs4Support

kcomponentdata.h
1 /* This file is part of the KDE libraries
2  Copyright (C) 1999 Torben Weis <[email protected]>
3  Copyright (C) 2007 Matthias Kretz <[email protected]>
4 
5  This library is free software; you can redistribute it and/or
6  modify it under the terms of the GNU Library General Public
7  License version 2 as published by the Free Software Foundation.
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 #ifndef KCOMPONENTDATA_H
20 #define KCOMPONENTDATA_H
21 
22 #include <kdelibs4support_export.h>
23 
24 #ifdef KDELIBS4SUPPORT_NO_DEPRECATED_NOISE
25 #warning "This file is deprecated."
26 #endif
27 
28 #include <ksharedconfig.h>
29 #include <kaboutdata.h>
30 
31 class QByteArray;
32 class QString;
33 class K4AboutData;
34 class KComponentDataPrivate;
35 
51 class KDELIBS4SUPPORT_DEPRECATED_EXPORT_NOISE KComponentData // krazy:exclude=dpointer (implicitly shared)
52 {
53 public:
60 
67 
77  KComponentData &operator=(const KComponentData &);
78 
82  bool operator==(const KComponentData &) const;
83 
87  bool operator!=(const KComponentData &rhs) const;
88 
89  enum MainComponentRegistration {
90  RegisterAsMainComponent,
91  SkipMainComponentRegistration
92  };
93 
105  KDELIBS4SUPPORT_DEPRECATED explicit KComponentData(const QByteArray &componentName, const QByteArray &catalogName = QByteArray(),
106  MainComponentRegistration registerAsMain = RegisterAsMainComponent);
107 
121  KDELIBS4SUPPORT_DEPRECATED explicit KComponentData(const K4AboutData &aboutData, MainComponentRegistration registerAsMain = RegisterAsMainComponent);
122  KDELIBS4SUPPORT_DEPRECATED explicit KComponentData(const K4AboutData *aboutData, MainComponentRegistration registerAsMain = RegisterAsMainComponent);
123 
127  virtual ~KComponentData();
128 
133  operator KAboutData() const;
134 
141  bool isValid() const;
142 
147  const KSharedConfig::Ptr &config() const; //krazy:exclude=constref
148 
156  KDELIBS4SUPPORT_DEPRECATED const K4AboutData *aboutData() const;
157 
163  KDELIBS4SUPPORT_DEPRECATED void setAboutData(const K4AboutData &aboutData);
164 
170  QString componentName() const;
171 
177  QString catalogName() const;
178 
184  static bool hasMainComponent();
185 
190  static const KComponentData &mainComponent(); //krazy:exclude=constref (don't mess up ref-counting)
191 
205  static const KComponentData &activeComponent(); //krazy:exclude=constref (don't mess up ref-counting)
206 
217  static void setActiveComponent(const KComponentData &d);
218 
219 protected:
220  friend class KApplicationPrivate;
221 
226  void setConfigName(const QString &name);
227 
229  virtual void virtual_hook(int id, void *data);
230 
231 private:
232  // Ref-counted data
233  KComponentDataPrivate *d;
234  friend class KComponentDataPrivate;
235 };
236 
237 #endif // KCOMPONENTDATA_H
This class is used to store information about a program.
Definition: k4aboutdata.h:199
Per component data.
This file is part of the KDE documentation.
Documentation copyright © 1996-2020 The KDE developers.
Generated on Thu Aug 13 2020 22:58:29 by doxygen 1.8.11 written by Dimitri van Heesch, © 1997-2006

KDE's Doxygen guidelines are available online.