1 : //
2 : // Automatically generated by ipdlc.
3 : // Edit at your own risk
4 : //
5 :
6 : #ifndef PSmsChild_h
7 : #define PSmsChild_h
8 :
9 : #include "mozilla/dom/sms/PSms.h"
10 : namespace mozilla {
11 : namespace dom {
12 : class PContentChild;
13 : } // namespace dom
14 : } // namespace mozilla
15 :
16 : #ifdef DEBUG
17 : #include "prenv.h"
18 : #endif // DEBUG
19 : #include "base/id_map.h"
20 : #include "mozilla/ipc/RPCChannel.h"
21 :
22 :
23 : namespace mozilla {
24 : namespace dom {
25 : class PContentChild;
26 : } // namespace dom
27 : } // namespace mozilla
28 :
29 : namespace mozilla {
30 : namespace dom {
31 : namespace sms {
32 :
33 :
34 : class /*NS_ABSTRACT_CLASS*/ PSmsChild :
35 : protected mozilla::ipc::RPCChannel::RPCListener,
36 : protected mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>
37 : {
38 : friend class mozilla::dom::PContentChild;
39 :
40 : protected:
41 : typedef mozilla::ipc::ActorHandle ActorHandle;
42 : typedef mozilla::dom::sms::SmsMessageData SmsMessageData;
43 : typedef mozilla::dom::sms::SmsFilterData SmsFilterData;
44 : typedef mozilla::ipc::Shmem Shmem;
45 : typedef mozilla::dom::PContentChild PContentChild;
46 : typedef base::ProcessId ProcessId;
47 : typedef mozilla::ipc::ProtocolId ProtocolId;
48 : typedef mozilla::ipc::Transport Transport;
49 : typedef mozilla::ipc::TransportDescriptor TransportDescriptor;
50 :
51 : typedef PSms::State State;
52 :
53 : virtual bool
54 : RecvNotifyReceivedMessage(const SmsMessageData& aMessageData) = 0;
55 : virtual bool
56 : RecvNotifySentMessage(const SmsMessageData& aMessageData) = 0;
57 : virtual bool
58 : RecvNotifyDeliveredMessage(const SmsMessageData& aMessageData) = 0;
59 : virtual bool
60 : RecvNotifyRequestSmsSent(
61 : const SmsMessageData& aMessageData,
62 : const PRInt32& aRequestId,
63 : const PRUint64& aProcessId) = 0;
64 : virtual bool
65 : RecvNotifyRequestSmsSendFailed(
66 : const PRInt32& aError,
67 : const PRInt32& aRequestId,
68 : const PRUint64& aProcessId) = 0;
69 : virtual bool
70 : RecvNotifyRequestGotSms(
71 : const SmsMessageData& aMessageData,
72 : const PRInt32& aRequestId,
73 : const PRUint64& aProcessId) = 0;
74 : virtual bool
75 : RecvNotifyRequestGetSmsFailed(
76 : const PRInt32& aError,
77 : const PRInt32& aRequestId,
78 : const PRUint64& aProcessId) = 0;
79 : virtual bool
80 : RecvNotifyRequestSmsDeleted(
81 : const bool& aDeleted,
82 : const PRInt32& aRequestId,
83 : const PRUint64& aProcessId) = 0;
84 : virtual bool
85 : RecvNotifyRequestSmsDeleteFailed(
86 : const PRInt32& aError,
87 : const PRInt32& aRequestId,
88 : const PRUint64& aProcessId) = 0;
89 : virtual bool
90 : RecvNotifyRequestNoMessageInList(
91 : const PRInt32& aRequestId,
92 : const PRUint64& aProcessId) = 0;
93 : virtual bool
94 : RecvNotifyRequestCreateMessageList(
95 : const PRInt32& aListId,
96 : const SmsMessageData& aMessageData,
97 : const PRInt32& aRequestId,
98 : const PRUint64& aProcessId) = 0;
99 : virtual bool
100 : RecvNotifyRequestGotNextMessage(
101 : const SmsMessageData& aMessageData,
102 : const PRInt32& aRequestId,
103 : const PRUint64& aProcessId) = 0;
104 : virtual bool
105 : RecvNotifyRequestReadListFailed(
106 : const PRInt32& aError,
107 : const PRInt32& aRequestId,
108 : const PRUint64& aProcessId) = 0;
109 :
110 : virtual void
111 : ActorDestroy(ActorDestroyReason why);
112 :
113 : public:
114 : typedef IPC::Message Message;
115 : typedef mozilla::ipc::RPCChannel Channel;
116 : typedef mozilla::ipc::RPCChannel::RPCListener ChannelListener;
117 : typedef base::ProcessHandle ProcessHandle;
118 : typedef mozilla::ipc::AsyncChannel AsyncChannel;
119 : typedef mozilla::ipc::SharedMemory SharedMemory;
120 : typedef mozilla::ipc::Trigger Trigger;
121 :
122 : public:
123 : PSmsChild();
124 :
125 : virtual ~PSmsChild();
126 :
127 : PContentChild*
128 : Manager();
129 :
130 : PSms::State
131 : state();
132 :
133 : bool
134 : SendHasSupport(bool* aHasSupport);
135 :
136 : bool
137 : SendGetNumberOfMessagesForText(
138 : const nsString& aText,
139 : PRUint16* aNumber);
140 :
141 : bool
142 : SendSendMessage(
143 : const nsString& aNumber,
144 : const nsString& aMessage,
145 : const PRInt32& aRequestId,
146 : const PRUint64& aProcessId);
147 :
148 : bool
149 : SendSaveReceivedMessage(
150 : const nsString& aSender,
151 : const nsString& aBody,
152 : const PRUint64& aDate,
153 : PRInt32* aId);
154 :
155 : bool
156 : SendSaveSentMessage(
157 : const nsString& aReceiver,
158 : const nsString& aBody,
159 : const PRUint64& aDate,
160 : PRInt32* aId);
161 :
162 : bool
163 : SendGetMessage(
164 : const PRInt32& aMessageId,
165 : const PRInt32& aRequestId,
166 : const PRUint64& aProcessId);
167 :
168 : bool
169 : SendDeleteMessage(
170 : const PRInt32& aMessageId,
171 : const PRInt32& aRequestId,
172 : const PRUint64& aProcessId);
173 :
174 : bool
175 : SendCreateMessageList(
176 : const SmsFilterData& aFilter,
177 : const bool& aReverse,
178 : const PRInt32& aRequestId,
179 : const PRUint64& aProcessId);
180 :
181 : bool
182 : SendGetNextMessageInList(
183 : const PRInt32& aListId,
184 : const PRInt32& aRequestId,
185 : const PRUint64& aProcessId);
186 :
187 : bool
188 : SendClearMessageList(const PRInt32& aListId);
189 :
190 : static bool
191 : Send__delete__(PSmsChild* actor);
192 :
193 : virtual int32
194 : Register(ChannelListener* aRouted);
195 : virtual int32
196 : RegisterID(
197 : ChannelListener* aRouted,
198 : int32 aId);
199 : virtual ChannelListener*
200 : Lookup(int32 aId);
201 : virtual void
202 : Unregister(int32 aId);
203 : virtual void
204 : RemoveManagee(
205 : int32 aProtocolId,
206 : ChannelListener* aListener);
207 : virtual Shmem::SharedMemory*
208 : CreateSharedMemory(
209 : size_t aSize,
210 : Shmem::SharedMemory::SharedMemoryType type,
211 : bool unsafe,
212 : Shmem::id_t* aId);
213 : virtual bool
214 : AdoptSharedMemory(
215 : Shmem::SharedMemory* segment,
216 : Shmem::id_t* aId);
217 : virtual Shmem::SharedMemory*
218 : LookupSharedMemory(Shmem::id_t aId);
219 : virtual bool
220 : IsTrackingSharedMemory(Shmem::SharedMemory* segment);
221 : virtual bool
222 : DestroySharedMemory(Shmem& aShmem);
223 : virtual ProcessHandle
224 : OtherProcess() const;
225 : virtual AsyncChannel*
226 : GetIPCChannel();
227 :
228 : virtual Result
229 : OnMessageReceived(const Message& __msg);
230 :
231 : virtual Result
232 : OnMessageReceived(
233 : const Message& __msg,
234 : Message*& __reply);
235 :
236 : virtual Result
237 : OnCallReceived(
238 : const Message& __msg,
239 : Message*& __reply);
240 :
241 : void
242 : OnProcessingError(Result code);
243 :
244 : bool
245 : OnReplyTimeout();
246 :
247 : void
248 : OnChannelClose();
249 :
250 : void
251 : OnChannelError();
252 :
253 : void
254 : OnChannelConnected(int32 pid);
255 :
256 : // Methods for managing shmem
257 : bool
258 : AllocShmem(
259 : size_t aSize,
260 : Shmem::SharedMemory::SharedMemoryType aType,
261 : Shmem* aMem);
262 :
263 : bool
264 : AllocUnsafeShmem(
265 : size_t aSize,
266 : Shmem::SharedMemory::SharedMemoryType aType,
267 : Shmem* aMem);
268 :
269 : bool
270 : AdoptShmem(
271 : Shmem& aMem,
272 : Shmem* aOutMem);
273 :
274 : bool
275 : DeallocShmem(Shmem& aMem);
276 :
277 : private:
278 : virtual void
279 : FatalError(const char* const msg) const;
280 :
281 : void
282 : DestroySubtree(ActorDestroyReason why);
283 :
284 : void
285 : DeallocSubtree();
286 :
287 : template<typename T>
288 : void
289 0 : Write(
290 : const T& __v,
291 : Message* __msg)
292 : {
293 0 : IPC::WriteParam(__msg, __v);
294 0 : }
295 :
296 : template<typename T>
297 : bool
298 0 : Read(
299 : T* __v,
300 : const Message* __msg,
301 : void** __iter)
302 : {
303 0 : return IPC::ReadParam(__msg, __iter, __v);
304 : }
305 :
306 : void
307 : Write(
308 : const SmsMessageData& __v,
309 : Message* __msg);
310 :
311 : bool
312 : Read(
313 : SmsMessageData* __v,
314 : const Message* __msg,
315 : void** __iter) NS_WARN_UNUSED_RESULT;
316 :
317 : void
318 : Write(
319 : const SmsFilterData& __v,
320 : Message* __msg);
321 :
322 : bool
323 : Read(
324 : SmsFilterData* __v,
325 : const Message* __msg,
326 : void** __iter) NS_WARN_UNUSED_RESULT;
327 :
328 : void
329 : Write(
330 : PSmsChild* __v,
331 : Message* __msg,
332 : bool __nullable);
333 :
334 : bool
335 : Read(
336 : PSmsChild** __v,
337 : const Message* __msg,
338 : void** __iter,
339 : bool __nullable) NS_WARN_UNUSED_RESULT;
340 :
341 : Channel* mChannel;
342 : int32 mId;
343 : mozilla::ipc::IProtocolManager<mozilla::ipc::RPCChannel::RPCListener>* mManager;
344 : State mState;
345 : };
346 :
347 :
348 : } // namespace sms
349 : } // namespace dom
350 : } // namespace mozilla
351 :
352 : #if 0
353 :
354 : //-----------------------------------------------------------------------------
355 : // Skeleton implementation of abstract actor class
356 :
357 : // Header file contents
358 : namespace mozilla {
359 : namespace dom {
360 : namespace sms {
361 : class SmsChild :
362 : public PSmsChild
363 : {
364 : virtual bool
365 : RecvNotifyReceivedMessage(const SmsMessageData& aMessageData);
366 :
367 : virtual bool
368 : RecvNotifySentMessage(const SmsMessageData& aMessageData);
369 :
370 : virtual bool
371 : RecvNotifyDeliveredMessage(const SmsMessageData& aMessageData);
372 :
373 : virtual bool
374 : RecvNotifyRequestSmsSent(
375 : const SmsMessageData& aMessageData,
376 : const PRInt32& aRequestId,
377 : const PRUint64& aProcessId);
378 :
379 : virtual bool
380 : RecvNotifyRequestSmsSendFailed(
381 : const PRInt32& aError,
382 : const PRInt32& aRequestId,
383 : const PRUint64& aProcessId);
384 :
385 : virtual bool
386 : RecvNotifyRequestGotSms(
387 : const SmsMessageData& aMessageData,
388 : const PRInt32& aRequestId,
389 : const PRUint64& aProcessId);
390 :
391 : virtual bool
392 : RecvNotifyRequestGetSmsFailed(
393 : const PRInt32& aError,
394 : const PRInt32& aRequestId,
395 : const PRUint64& aProcessId);
396 :
397 : virtual bool
398 : RecvNotifyRequestSmsDeleted(
399 : const bool& aDeleted,
400 : const PRInt32& aRequestId,
401 : const PRUint64& aProcessId);
402 :
403 : virtual bool
404 : RecvNotifyRequestSmsDeleteFailed(
405 : const PRInt32& aError,
406 : const PRInt32& aRequestId,
407 : const PRUint64& aProcessId);
408 :
409 : virtual bool
410 : RecvNotifyRequestNoMessageInList(
411 : const PRInt32& aRequestId,
412 : const PRUint64& aProcessId);
413 :
414 : virtual bool
415 : RecvNotifyRequestCreateMessageList(
416 : const PRInt32& aListId,
417 : const SmsMessageData& aMessageData,
418 : const PRInt32& aRequestId,
419 : const PRUint64& aProcessId);
420 :
421 : virtual bool
422 : RecvNotifyRequestGotNextMessage(
423 : const SmsMessageData& aMessageData,
424 : const PRInt32& aRequestId,
425 : const PRUint64& aProcessId);
426 :
427 : virtual bool
428 : RecvNotifyRequestReadListFailed(
429 : const PRInt32& aError,
430 : const PRInt32& aRequestId,
431 : const PRUint64& aProcessId);
432 :
433 : SmsChild();
434 : virtual ~SmsChild();
435 : };
436 : } // namespace sms
437 : } // namespace dom
438 : } // namespace mozilla
439 :
440 :
441 : // C++ file contents
442 : namespace mozilla {
443 : namespace dom {
444 : namespace sms {
445 : bool
446 : SmsChild::RecvNotifyReceivedMessage(const SmsMessageData& aMessageData)
447 : {
448 : return false;
449 : }
450 :
451 : bool
452 : SmsChild::RecvNotifySentMessage(const SmsMessageData& aMessageData)
453 : {
454 : return false;
455 : }
456 :
457 : bool
458 : SmsChild::RecvNotifyDeliveredMessage(const SmsMessageData& aMessageData)
459 : {
460 : return false;
461 : }
462 :
463 : bool
464 : SmsChild::RecvNotifyRequestSmsSent(
465 : const SmsMessageData& aMessageData,
466 : const PRInt32& aRequestId,
467 : const PRUint64& aProcessId)
468 : {
469 : return false;
470 : }
471 :
472 : bool
473 : SmsChild::RecvNotifyRequestSmsSendFailed(
474 : const PRInt32& aError,
475 : const PRInt32& aRequestId,
476 : const PRUint64& aProcessId)
477 : {
478 : return false;
479 : }
480 :
481 : bool
482 : SmsChild::RecvNotifyRequestGotSms(
483 : const SmsMessageData& aMessageData,
484 : const PRInt32& aRequestId,
485 : const PRUint64& aProcessId)
486 : {
487 : return false;
488 : }
489 :
490 : bool
491 : SmsChild::RecvNotifyRequestGetSmsFailed(
492 : const PRInt32& aError,
493 : const PRInt32& aRequestId,
494 : const PRUint64& aProcessId)
495 : {
496 : return false;
497 : }
498 :
499 : bool
500 : SmsChild::RecvNotifyRequestSmsDeleted(
501 : const bool& aDeleted,
502 : const PRInt32& aRequestId,
503 : const PRUint64& aProcessId)
504 : {
505 : return false;
506 : }
507 :
508 : bool
509 : SmsChild::RecvNotifyRequestSmsDeleteFailed(
510 : const PRInt32& aError,
511 : const PRInt32& aRequestId,
512 : const PRUint64& aProcessId)
513 : {
514 : return false;
515 : }
516 :
517 : bool
518 : SmsChild::RecvNotifyRequestNoMessageInList(
519 : const PRInt32& aRequestId,
520 : const PRUint64& aProcessId)
521 : {
522 : return false;
523 : }
524 :
525 : bool
526 : SmsChild::RecvNotifyRequestCreateMessageList(
527 : const PRInt32& aListId,
528 : const SmsMessageData& aMessageData,
529 : const PRInt32& aRequestId,
530 : const PRUint64& aProcessId)
531 : {
532 : return false;
533 : }
534 :
535 : bool
536 : SmsChild::RecvNotifyRequestGotNextMessage(
537 : const SmsMessageData& aMessageData,
538 : const PRInt32& aRequestId,
539 : const PRUint64& aProcessId)
540 : {
541 : return false;
542 : }
543 :
544 : bool
545 : SmsChild::RecvNotifyRequestReadListFailed(
546 : const PRInt32& aError,
547 : const PRInt32& aRequestId,
548 : const PRUint64& aProcessId)
549 : {
550 : return false;
551 : }
552 :
553 : SmsChild::SmsChild()
554 : {
555 : MOZ_COUNT_CTOR(SmsChild);
556 : }
557 :
558 : SmsChild::~SmsChild()
559 : {
560 : MOZ_COUNT_DTOR(SmsChild);
561 : }
562 :
563 : } // namespace sms
564 : } // namespace dom
565 : } // namespace mozilla
566 : #endif // if 0
567 :
568 : #endif // ifndef PSmsChild_h
|