Bug 1888590 - Mark some subtests on trusted-types-event-handlers.html as failing...
[gecko.git] / toolkit / components / find / nsWebBrowserFind.h
blob0c846d2f175ec2107b658081733520f0251a9c81
1 /* -*- Mode: C++; tab-width: 8; indent-tabs-mode: nil; c-basic-offset: 2 -*- */
2 /* vim: set ts=8 sts=2 et sw=2 tw=80: */
3 /* This Source Code Form is subject to the terms of the Mozilla Public
4 * License, v. 2.0. If a copy of the MPL was not distributed with this
5 * file, You can obtain one at http://mozilla.org/MPL/2.0/. */
7 #ifndef nsWebBrowserFindImpl_h__
8 #define nsWebBrowserFindImpl_h__
10 #include "nsIWebBrowserFind.h"
12 #include "nsCOMPtr.h"
13 #include "nsIWeakReferenceUtils.h"
14 #include "nsPIDOMWindow.h"
16 #include "nsString.h"
18 class nsIDOMWindow;
19 class nsIDocShell;
20 class nsRange;
22 namespace mozilla {
23 namespace dom {
24 class Document;
25 class Element;
26 class Selection;
27 } // namespace dom
28 } // namespace mozilla
30 //*****************************************************************************
31 // class nsWebBrowserFind
32 //*****************************************************************************
34 class nsWebBrowserFind : public nsIWebBrowserFind,
35 public nsIWebBrowserFindInFrames {
36 public:
37 nsWebBrowserFind();
39 // nsISupports
40 NS_DECL_ISUPPORTS
42 // nsIWebBrowserFind
43 NS_DECL_NSIWEBBROWSERFIND
45 // nsIWebBrowserFindInFrames
46 NS_DECL_NSIWEBBROWSERFINDINFRAMES
48 protected:
49 virtual ~nsWebBrowserFind();
51 bool CanFindNext() { return mSearchString.Length() != 0; }
53 MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult
54 SearchInFrame(nsPIDOMWindowOuter* aWindow, bool aWrapping, bool* aDidFind);
56 nsresult OnStartSearchFrame(nsPIDOMWindowOuter* aWindow);
57 nsresult OnEndSearchFrame(nsPIDOMWindowOuter* aWindow);
59 already_AddRefed<mozilla::dom::Selection> GetFrameSelection(
60 nsPIDOMWindowOuter* aWindow);
61 MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult
62 ClearFrameSelection(nsPIDOMWindowOuter* aWindow);
64 MOZ_CAN_RUN_SCRIPT_BOUNDARY nsresult OnFind(nsPIDOMWindowOuter* aFoundWindow);
66 MOZ_CAN_RUN_SCRIPT_BOUNDARY void SetSelectionAndScroll(
67 nsPIDOMWindowOuter* aWindow, nsRange* aRange);
69 nsresult GetRootNode(mozilla::dom::Document* aDomDoc,
70 mozilla::dom::Element** aNode);
71 nsresult GetSearchLimits(nsRange* aRange, nsRange* aStartPt, nsRange* aEndPt,
72 mozilla::dom::Document* aDoc,
73 mozilla::dom::Selection* aSel, bool aWrap);
74 nsresult SetRangeAroundDocument(nsRange* aSearchRange, nsRange* aStartPoint,
75 nsRange* aEndPoint,
76 mozilla::dom::Document* aDoc);
78 protected:
79 nsString mSearchString;
81 bool mFindBackwards;
82 bool mWrapFind;
83 bool mEntireWord;
84 bool mMatchCase;
85 bool mMatchDiacritics;
87 bool mSearchSubFrames;
88 bool mSearchParentFrames;
90 // These are all weak because who knows if windows can go away during our
91 // lifetime.
92 nsWeakPtr mCurrentSearchFrame;
93 nsWeakPtr mRootSearchFrame;
94 nsWeakPtr mLastFocusedWindow;
97 #endif