summaryrefslogtreecommitdiffstats
path: root/bibletime/bibletimeinterface_skel.cpp
blob: 6b3b2b3d9f93def05dde4beb44356d815e4e9d9c (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
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
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
/****************************************************************************
**
** DCOP Skeleton generated by dcopidl2cpp from bibletimeinterface.kidl
**
** WARNING! All changes made in this file will be lost!
**
*****************************************************************************/

#include "./bibletimeinterface.h"

#include <kdatastream.h>
#include <tqasciidict.h>


static const int BibleTimeInterface_fhash = 17;
static const char* const BibleTimeInterface_ftable[14][3] = {
    { "void", "syncAllBibles(TQString)", "syncAllBibles(TQString key)" },
    { "void", "syncAllCommentaries(TQString)", "syncAllCommentaries(TQString key)" },
    { "void", "syncAllLexicons(TQString)", "syncAllLexicons(TQString key)" },
    { "void", "syncAllVerseBasedModules(TQString)", "syncAllVerseBasedModules(TQString key)" },
    { "void", "reloadModules()", "reloadModules()" },
    { "void", "openWindow(TQString,TQString)", "openWindow(TQString moduleName,TQString key)" },
    { "void", "openDefaultBible(TQString)", "openDefaultBible(TQString key)" },
    { "void", "closeAllModuleWindows()", "closeAllModuleWindows()" },
    { TQSTRING_OBJECT_NAME_STRING, "getCurrentReference()", "getCurrentReference()" },
    { TQSTRINGLIST_OBJECT_NAME_STRING, "searchInModule(TQString,TQString)", "searchInModule(TQString moduleName,TQString searchText)" },
    { TQSTRINGLIST_OBJECT_NAME_STRING, "searchInOpenModules(TQString)", "searchInOpenModules(TQString searchText)" },
    { TQSTRINGLIST_OBJECT_NAME_STRING, "searchInDefaultBible(TQString)", "searchInDefaultBible(TQString searchText)" },
    { TQSTRINGLIST_OBJECT_NAME_STRING, "getModulesOfType(TQString)", "getModulesOfType(TQString type)" },
    { 0, 0, 0 }
};
static const int BibleTimeInterface_ftable_hiddens[13] = {
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
    0,
};

bool BibleTimeInterface::process(const TQCString &fun, const TQByteArray &data, TQCString& replyType, TQByteArray &replyData)
{
    static TQAsciiDict<int>* fdict = 0;
    if ( !fdict ) {
	fdict = new TQAsciiDict<int>( BibleTimeInterface_fhash, true, false );
	for ( int i = 0; BibleTimeInterface_ftable[i][1]; i++ )
	    fdict->insert( BibleTimeInterface_ftable[i][1],  new int( i ) );
    }
    int* fp = fdict->find( fun );
    switch ( fp?*fp:-1) {
    case 0: { // void syncAllBibles(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = BibleTimeInterface_ftable[0][0]; 
	syncAllBibles(arg0 );
    } break;
    case 1: { // void syncAllCommentaries(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = BibleTimeInterface_ftable[1][0]; 
	syncAllCommentaries(arg0 );
    } break;
    case 2: { // void syncAllLexicons(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = BibleTimeInterface_ftable[2][0]; 
	syncAllLexicons(arg0 );
    } break;
    case 3: { // void syncAllVerseBasedModules(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = BibleTimeInterface_ftable[3][0]; 
	syncAllVerseBasedModules(arg0 );
    } break;
    case 4: { // void reloadModules()
	replyType = BibleTimeInterface_ftable[4][0]; 
	reloadModules( );
    } break;
    case 5: { // void openWindow(TQString,TQString)
	TQString arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = BibleTimeInterface_ftable[5][0]; 
	openWindow(arg0, arg1 );
    } break;
    case 6: { // void openDefaultBible(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = BibleTimeInterface_ftable[6][0]; 
	openDefaultBible(arg0 );
    } break;
    case 7: { // void closeAllModuleWindows()
	replyType = BibleTimeInterface_ftable[7][0]; 
	closeAllModuleWindows( );
    } break;
    case 8: { // TQString getCurrentReference()
	replyType = BibleTimeInterface_ftable[8][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << getCurrentReference( );
    } break;
    case 9: { // TQStringList searchInModule(TQString,TQString)
	TQString arg0;
	TQString arg1;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	if (arg.atEnd()) return false;
	arg >> arg1;
	replyType = BibleTimeInterface_ftable[9][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << searchInModule(arg0, arg1 );
    } break;
    case 10: { // TQStringList searchInOpenModules(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = BibleTimeInterface_ftable[10][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << searchInOpenModules(arg0 );
    } break;
    case 11: { // TQStringList searchInDefaultBible(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = BibleTimeInterface_ftable[11][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << searchInDefaultBible(arg0 );
    } break;
    case 12: { // TQStringList getModulesOfType(TQString)
	TQString arg0;
	TQDataStream arg( data, IO_ReadOnly );
	if (arg.atEnd()) return false;
	arg >> arg0;
	replyType = BibleTimeInterface_ftable[12][0]; 
	TQDataStream _replyStream( replyData, IO_WriteOnly );
	_replyStream << getModulesOfType(arg0 );
    } break;
    default: 
	return DCOPObject::process( fun, data, replyType, replyData );
    }
    return true;
}

QCStringList BibleTimeInterface::interfaces()
{
    QCStringList ifaces = DCOPObject::interfaces();
    ifaces += "BibleTimeInterface";
    return ifaces;
}

QCStringList BibleTimeInterface::functions()
{
    QCStringList funcs = DCOPObject::functions();
    for ( int i = 0; BibleTimeInterface_ftable[i][2]; i++ ) {
	if (BibleTimeInterface_ftable_hiddens[i])
	    continue;
	TQCString func = BibleTimeInterface_ftable[i][0];
	func += ' ';
	func += BibleTimeInterface_ftable[i][2];
	funcs << func;
    }
    return funcs;
}