2015-05-03 22:32:37 +03:00
|
|
|
/* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
|
|
|
|
/* vim: set ts=8 sts=2 et sw=2 tw=80: */
|
2012-05-17 23:42:38 +04:00
|
|
|
/* This Source Code Form is subject to the terms of the Mozilla Public
|
|
|
|
* License, v. 2.0. If a copy of the MPL was not distributed with this file,
|
|
|
|
* You can obtain one at http://mozilla.org/MPL/2.0/. */
|
2011-11-21 02:40:53 +04:00
|
|
|
|
2013-03-01 12:38:47 +04:00
|
|
|
#ifndef mozilla_dom_mobilemessage_SmsParent_h
|
|
|
|
#define mozilla_dom_mobilemessage_SmsParent_h
|
2011-11-21 02:40:53 +04:00
|
|
|
|
2013-03-01 12:38:47 +04:00
|
|
|
#include "mozilla/dom/mobilemessage/PSmsParent.h"
|
|
|
|
#include "mozilla/dom/mobilemessage/PSmsRequestParent.h"
|
2013-04-09 20:36:04 +04:00
|
|
|
#include "mozilla/dom/mobilemessage/PMobileMessageCursorParent.h"
|
|
|
|
#include "nsIDOMDOMCursor.h"
|
2013-04-09 20:41:27 +04:00
|
|
|
#include "nsIMobileMessageCallback.h"
|
2013-04-09 20:36:04 +04:00
|
|
|
#include "nsIMobileMessageCursorCallback.h"
|
2011-11-24 15:45:55 +04:00
|
|
|
#include "nsIObserver.h"
|
2011-11-21 02:40:53 +04:00
|
|
|
|
2012-11-07 01:29:30 +04:00
|
|
|
namespace mozilla {
|
|
|
|
namespace dom {
|
|
|
|
|
|
|
|
class ContentParent;
|
|
|
|
|
2013-03-01 12:38:47 +04:00
|
|
|
namespace mobilemessage {
|
|
|
|
|
2011-11-21 02:40:53 +04:00
|
|
|
class SmsParent : public PSmsParent
|
2011-11-24 15:45:55 +04:00
|
|
|
, public nsIObserver
|
2011-11-21 02:40:53 +04:00
|
|
|
{
|
2012-11-07 01:29:30 +04:00
|
|
|
friend class mozilla::dom::ContentParent;
|
|
|
|
|
2011-11-24 15:45:55 +04:00
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIOBSERVER
|
|
|
|
|
2012-11-07 01:29:30 +04:00
|
|
|
protected:
|
2013-07-30 02:50:21 +04:00
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
RecvAddSilentNumber(const nsString& aNumber) override;
|
2013-07-30 02:50:21 +04:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
RecvRemoveSilentNumber(const nsString& aNumber) override;
|
2013-07-30 02:50:21 +04:00
|
|
|
|
2011-11-24 15:45:55 +04:00
|
|
|
SmsParent();
|
2013-04-09 20:36:04 +04:00
|
|
|
virtual ~SmsParent()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(SmsParent);
|
|
|
|
}
|
2011-11-24 15:45:55 +04:00
|
|
|
|
2012-11-07 01:29:30 +04:00
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
ActorDestroy(ActorDestroyReason aWhy) override;
|
2012-11-07 01:29:30 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvPSmsRequestConstructor(PSmsRequestParent* aActor,
|
2015-03-21 19:28:04 +03:00
|
|
|
const IPCSmsRequest& aRequest) override;
|
2012-11-07 01:29:30 +04:00
|
|
|
|
|
|
|
virtual PSmsRequestParent*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPSmsRequestParent(const IPCSmsRequest& aRequest) override;
|
2012-11-07 01:29:30 +04:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPSmsRequestParent(PSmsRequestParent* aActor) override;
|
2013-04-09 20:36:04 +04:00
|
|
|
|
|
|
|
virtual bool
|
|
|
|
RecvPMobileMessageCursorConstructor(PMobileMessageCursorParent* aActor,
|
2015-03-21 19:28:04 +03:00
|
|
|
const IPCMobileMessageCursor& aCursor) override;
|
2013-04-09 20:36:04 +04:00
|
|
|
|
|
|
|
virtual PMobileMessageCursorParent*
|
2015-03-21 19:28:04 +03:00
|
|
|
AllocPMobileMessageCursorParent(const IPCMobileMessageCursor& aCursor) override;
|
2013-04-09 20:36:04 +04:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
DeallocPMobileMessageCursorParent(PMobileMessageCursorParent* aActor) override;
|
2013-04-10 16:18:41 +04:00
|
|
|
|
2013-07-30 02:50:21 +04:00
|
|
|
private:
|
|
|
|
nsTArray<nsString> mSilentNumbers;
|
2012-11-07 01:29:30 +04:00
|
|
|
};
|
|
|
|
|
|
|
|
class SmsRequestParent : public PSmsRequestParent
|
2013-04-09 20:41:27 +04:00
|
|
|
, public nsIMobileMessageCallback
|
2012-11-07 01:29:30 +04:00
|
|
|
{
|
|
|
|
friend class SmsParent;
|
|
|
|
|
2013-04-09 20:41:27 +04:00
|
|
|
bool mActorDestroyed;
|
2012-11-07 01:29:30 +04:00
|
|
|
|
|
|
|
public:
|
2013-04-09 20:41:27 +04:00
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMOBILEMESSAGECALLBACK
|
2011-11-24 15:45:55 +04:00
|
|
|
|
|
|
|
protected:
|
2013-04-09 20:41:27 +04:00
|
|
|
SmsRequestParent()
|
|
|
|
: mActorDestroyed(false)
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(SmsRequestParent);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~SmsRequestParent()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(SmsRequestParent);
|
|
|
|
}
|
2012-11-07 01:29:30 +04:00
|
|
|
|
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
ActorDestroy(ActorDestroyReason aWhy) override;
|
2012-11-07 01:29:30 +04:00
|
|
|
|
|
|
|
bool
|
|
|
|
DoRequest(const SendMessageRequest& aRequest);
|
|
|
|
|
2013-04-10 16:18:43 +04:00
|
|
|
bool
|
|
|
|
DoRequest(const RetrieveMessageRequest& aRequest);
|
|
|
|
|
2012-11-07 01:29:30 +04:00
|
|
|
bool
|
|
|
|
DoRequest(const GetMessageRequest& aRequest);
|
|
|
|
|
|
|
|
bool
|
|
|
|
DoRequest(const DeleteMessageRequest& aRequest);
|
|
|
|
|
|
|
|
bool
|
2013-04-09 20:36:04 +04:00
|
|
|
DoRequest(const MarkMessageReadRequest& aRequest);
|
2013-04-09 20:41:27 +04:00
|
|
|
|
2013-08-09 17:25:53 +04:00
|
|
|
bool
|
|
|
|
DoRequest(const GetSegmentInfoForTextRequest& aRequest);
|
|
|
|
|
2013-09-16 06:12:38 +04:00
|
|
|
bool
|
|
|
|
DoRequest(const GetSmscAddressRequest& aRequest);
|
|
|
|
|
2015-04-29 05:42:00 +03:00
|
|
|
bool
|
|
|
|
DoRequest(const SetSmscAddressRequest& aRequest);
|
|
|
|
|
2013-04-09 20:41:27 +04:00
|
|
|
nsresult
|
|
|
|
SendReply(const MessageReply& aReply);
|
2013-04-09 20:36:04 +04:00
|
|
|
};
|
2012-11-14 23:49:56 +04:00
|
|
|
|
2013-04-09 20:36:04 +04:00
|
|
|
class MobileMessageCursorParent : public PMobileMessageCursorParent
|
|
|
|
, public nsIMobileMessageCursorCallback
|
|
|
|
{
|
|
|
|
friend class SmsParent;
|
|
|
|
|
|
|
|
nsCOMPtr<nsICursorContinueCallback> mContinueCallback;
|
|
|
|
|
|
|
|
public:
|
|
|
|
NS_DECL_ISUPPORTS
|
|
|
|
NS_DECL_NSIMOBILEMESSAGECURSORCALLBACK
|
|
|
|
|
|
|
|
protected:
|
|
|
|
MobileMessageCursorParent()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_CTOR(MobileMessageCursorParent);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual ~MobileMessageCursorParent()
|
|
|
|
{
|
|
|
|
MOZ_COUNT_DTOR(MobileMessageCursorParent);
|
|
|
|
}
|
|
|
|
|
|
|
|
virtual void
|
2015-03-21 19:28:04 +03:00
|
|
|
ActorDestroy(ActorDestroyReason aWhy) override;
|
2013-04-09 20:36:04 +04:00
|
|
|
|
|
|
|
virtual bool
|
2015-03-21 19:28:04 +03:00
|
|
|
RecvContinue() override;
|
2013-04-09 06:21:59 +04:00
|
|
|
|
|
|
|
bool
|
2013-04-09 20:36:04 +04:00
|
|
|
DoRequest(const CreateMessageCursorRequest& aRequest);
|
2013-04-09 20:37:58 +04:00
|
|
|
|
|
|
|
bool
|
|
|
|
DoRequest(const CreateThreadCursorRequest& aRequest);
|
2011-11-21 02:40:53 +04:00
|
|
|
};
|
|
|
|
|
2013-03-01 12:38:47 +04:00
|
|
|
} // namespace mobilemessage
|
2011-11-21 02:40:53 +04:00
|
|
|
} // namespace dom
|
|
|
|
} // namespace mozilla
|
|
|
|
|
2013-03-01 12:38:47 +04:00
|
|
|
#endif // mozilla_dom_mobilemessage_SmsParent_h
|