aboutsummaryrefslogtreecommitdiff
path: root/tests/stubs/mextensionwatcher_stub.h
blob: f11e9384b2f2deef644028f52b1dd59cefdff197 (plain)
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
#ifndef MEXTENSIONWATCHER_STUB
#define MEXTENSIONWATCHER_STUB

#include "mextensionwatcher.h"
#include <stubbase.h>


// 1. DECLARE STUB
// FIXME - stubgen is not yet finished
class MExtensionWatcherStub : public StubBase {
  public:
  virtual void MExtensionWatcherConstructor();
  virtual void MExtensionWatcherDestructor();
  virtual void addExtension(QSharedPointer<const MDesktopEntry> extension);
  virtual void removeExtension(const QString &fileName);
  virtual void notifyDataChanged(const QString &path) const;
   QFileSystemWatcher watcher ;
   QHash<QString, QSharedPointer<const MDesktopEntry> > extensionsToWatch ;
}; 

// 2. IMPLEMENT STUB
void MExtensionWatcherStub::MExtensionWatcherConstructor() {

}
void MExtensionWatcherStub::MExtensionWatcherDestructor() {

}
void MExtensionWatcherStub::addExtension(QSharedPointer<const MDesktopEntry> extension) {
  QList<ParameterBase*> params;
  params.append( new Parameter<QSharedPointer<const MDesktopEntry> >(extension));
  stubMethodEntered("addExtension",params);
}

void MExtensionWatcherStub::removeExtension(const QString &fileName) {
  QList<ParameterBase*> params;
  params.append( new Parameter<const QString & >(fileName));
  stubMethodEntered("removeExtension",params);
}

void MExtensionWatcherStub::notifyDataChanged(const QString &path) const {
  QList<ParameterBase*> params;
  params.append( new Parameter<const QString & >(path));
  stubMethodEntered("notifyDataChanged",params);
}



// 3. CREATE A STUB INSTANCE
MExtensionWatcherStub gDefaultMExtensionWatcherStub;
MExtensionWatcherStub* gMExtensionWatcherStub = &gDefaultMExtensionWatcherStub;


// 4. CREATE A PROXY WHICH CALLS THE STUB
MExtensionWatcher::MExtensionWatcher() {
  gMExtensionWatcherStub->MExtensionWatcherConstructor();
}

MExtensionWatcher::~MExtensionWatcher() {
  gMExtensionWatcherStub->MExtensionWatcherDestructor();
}

void MExtensionWatcher::addExtension(QSharedPointer<const MDesktopEntry> extension) {
  gMExtensionWatcherStub->addExtension(extension);
}

void MExtensionWatcher::removeExtension(const QString &fileName) {
  gMExtensionWatcherStub->removeExtension(fileName);
}

void MExtensionWatcher::notifyDataChanged(const QString &path) const {
  gMExtensionWatcherStub->notifyDataChanged(path);
}


#endif