File: k3bapplication.h

package info (click to toggle)
k3b 0.12.17-8
  • links: PTS
  • area: main
  • in suites: etch, etch-m68k
  • size: 17,560 kB
  • ctags: 11,120
  • sloc: cpp: 86,413; ansic: 25,752; sh: 9,055; perl: 2,731; makefile: 810
file content (138 lines) | stat: -rw-r--r-- 2,892 bytes parent folder | download
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
/* 
 *
 * $Id: k3bapplication.h 471081 2005-10-16 10:55:47Z trueg $
 * Copyright (C) 2003 Sebastian Trueg <trueg@k3b.org>
 *
 * This file is part of the K3b project.
 * Copyright (C) 1998-2004 Sebastian Trueg <trueg@k3b.org>
 *
 * This program is free software; you can redistribute it and/or modify
 * it under the terms of the GNU General Public License as published by
 * the Free Software Foundation; either version 2 of the License, or
 * (at your option) any later version.
 * See the file "COPYING" for the exact licensing terms.
 */


#ifndef _K3B_APPLICATION_H_
#define _K3B_APPLICATION_H_

#include <kuniqueapplication.h>
#include <k3bcore.h>

#define k3bappcore K3bApplication::Core::k3bAppCore()


class K3bMainWindow;
class K3bInterface;
class K3bAudioServer;
class K3bThemeManager;
class K3bProjectManager;


class K3bApplication : public KUniqueApplication
{
  Q_OBJECT

 public:
  K3bApplication();
  ~K3bApplication();

  int newInstance();

  class Core;

 public slots:
  void init();

 signals:
  void initializationInfo( const QString& );
  void initializationDone();

 private slots:
  void slotShutDown();

 private:
  bool processCmdLineArgs();

  K3bInterface* m_interface;
  Core* m_core;
  K3bAudioServer* m_audioServer;
  K3bMainWindow* m_mainWindow;

  bool m_needToInit;
};


class K3bApplication::Core : public K3bCore
{
  Q_OBJECT

 public:
  Core( QObject* parent );
  ~Core();

  void init();

  // make sure the libk3b uses the same configuration
  // needed since the lib still depends on K3bCore::config
  // the goal is to make the lib independant from the config
  KConfig* config() const;

  void readSettings( KConfig* c = 0 );
  void saveSettings( KConfig* c = 0 );

  K3bThemeManager* themeManager() const { return m_themeManager; }

  K3bProjectManager* projectManager() const { return m_projectManager; }

  K3bMainWindow* k3bMainWindow() const { return m_mainWindow; }

  static Core* k3bAppCore() { return s_k3bAppCore; }

 public slots:
  /**
   * This will just emit the busyInfoRequested signal
   * Anyone may connect to it and show the string to the
   * user in some way.
   *
   * FIXME: this is bad design
   */
  void requestBusyInfo( const QString& );

  /**
   * FIXME: this is bad design
   */
  void requestBusyFinish();

 signals:
  /**
   * This is used for showing info in the K3b splashscreen
   */
  void initializationInfo( const QString& );

  /**
   * Any component may request busy info
   * In the K3b main app this will be displayed
   * as a moving square in the taskbar
   *
   * FIXME: this is bad design
   */
  void busyInfoRequested( const QString& );

  /**
   * FIXME: this is bad design
   */
  void busyFinishRequested();

 private:
  K3bThemeManager* m_themeManager;
  K3bMainWindow* m_mainWindow;
  K3bProjectManager* m_projectManager;

  static Core* s_k3bAppCore;

  friend class K3bApplication;
};

#endif