Bumping gaia.json for 1 gaia revision(s) a=gaia-bump
[gecko.git] / dom / mobilemessage / MobileMessageCursorCallback.h
blob890de232694859b791aa2ee8ab0878935e4d8881
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"
13 #include "nsCOMPtr.h"
14 #include "nsAutoPtr.h"
16 class nsICursorContinueCallback;
18 namespace mozilla {
19 namespace dom {
21 class MobileMessageManager;
23 namespace mobilemessage {
24 class MobileMessageCursorCallback;
25 } // namespace mobilemessage
27 class MobileMessageCursor MOZ_FINAL : public DOMCursor
29 friend class mobilemessage::MobileMessageCursorCallback;
31 public:
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.
40 NS_IMETHOD
41 Continue(void) MOZ_OVERRIDE;
43 virtual void
44 Continue(ErrorResult& aRv) MOZ_OVERRIDE;
46 private:
47 // MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
48 ~MobileMessageCursor() {}
50 private:
51 // List of read-ahead results in reversed order.
52 nsTArray<nsCOMPtr<nsISupports>> mPendingResults;
54 nsresult
55 FireSuccessWithNextPendingResult();
58 namespace mobilemessage {
60 class MobileMessageCursorCallback MOZ_FINAL : public nsIMobileMessageCursorCallback
62 friend class mozilla::dom::MobileMessageManager;
64 public:
65 NS_DECL_CYCLE_COLLECTING_ISUPPORTS
66 NS_DECL_NSIMOBILEMESSAGECURSORCALLBACK
68 NS_DECL_CYCLE_COLLECTION_CLASS(MobileMessageCursorCallback)
70 MobileMessageCursorCallback()
72 MOZ_COUNT_CTOR(MobileMessageCursorCallback);
75 private:
76 // MOZ_FINAL suppresses -Werror,-Wdelete-non-virtual-dtor
77 ~MobileMessageCursorCallback()
79 MOZ_COUNT_DTOR(MobileMessageCursorCallback);
82 nsRefPtr<MobileMessageCursor> mDOMCursor;
85 } // namespace mobilemessage
86 } // namespace dom
87 } // namespace mozilla
89 #endif // mozilla_dom_mobilemessage_MobileMessageCursorCallback_h