1 /* -*- Mode: C++; tab-width: 2; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* This Source Code Form is subject to the terms of the Mozilla Public
3 * License, v. 2.0. If a copy of the MPL was not distributed with this
4 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
6 #ifndef mozilla_dom_mobilemessage_MobileMessageCursorCallback_h
7 #define mozilla_dom_mobilemessage_MobileMessageCursorCallback_h
9 #include "mozilla/Attributes.h"
10 #include "mozilla/dom/DOMCursor.h"
11 #include "nsIMobileMessageCursorCallback.h"
12 #include "nsCycleCollectionParticipant.h"
14 #include "nsAutoPtr.h"
16 class nsICursorContinueCallback
;
21 class MobileMessageManager
;
23 namespace mobilemessage
{
24 class MobileMessageCursorCallback
;
25 } // namespace mobilemessage
27 class MobileMessageCursor MOZ_FINAL
: public DOMCursor
29 friend class mobilemessage::MobileMessageCursorCallback
;
32 NS_DECL_ISUPPORTS_INHERITED
34 NS_DECL_CYCLE_COLLECTION_CLASS_INHERITED(MobileMessageCursor
, DOMCursor
)
36 MobileMessageCursor(nsPIDOMWindow
* aWindow
,
37 nsICursorContinueCallback
* aCallback
);
39 // Override XPIDL continue function to suppress -Werror,-Woverloaded-virtual.
41 Continue(void) MOZ_OVERRIDE
;
44 Continue(ErrorResult
& aRv
) MOZ_OVERRIDE
;
47 // MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
48 ~MobileMessageCursor() {}
51 // List of read-ahead results in reversed order.
52 nsTArray
<nsCOMPtr
<nsISupports
>> mPendingResults
;
55 FireSuccessWithNextPendingResult();
58 namespace mobilemessage
{
60 class MobileMessageCursorCallback MOZ_FINAL
: public nsIMobileMessageCursorCallback
62 friend class mozilla::dom::MobileMessageManager
;
65 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
66 NS_DECL_NSIMOBILEMESSAGECURSORCALLBACK
68 NS_DECL_CYCLE_COLLECTION_CLASS(MobileMessageCursorCallback
)
70 MobileMessageCursorCallback()
72 MOZ_COUNT_CTOR(MobileMessageCursorCallback
);
76 // MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
77 ~MobileMessageCursorCallback()
79 MOZ_COUNT_DTOR(MobileMessageCursorCallback
);
82 nsRefPtr
<MobileMessageCursor
> mDOMCursor
;
85 } // namespace mobilemessage
87 } // namespace mozilla
89 #endif // mozilla_dom_mobilemessage_MobileMessageCursorCallback_h