Bug 1885565 - Part 1: Add mozac_ic_avatar_circle_24 to ui-icons r=android-reviewers...
[gecko.git] / editor / spellchecker / nsComposeTxtSrvFilter.h
blobb2de83451b7650c014c4ca17efa324747f9a52d3
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 nsComposeTxtSrvFilter_h__
7 #define nsComposeTxtSrvFilter_h__
9 #include "mozilla/UniquePtr.h"
11 class nsINode;
13 /**
14 * This class enables those using it to skip over certain nodes when
15 * traversing content.
17 * This filter is used to skip over various form control nodes and
18 * mail's cite nodes
20 class nsComposeTxtSrvFilter final {
21 public:
22 static mozilla::UniquePtr<nsComposeTxtSrvFilter> CreateNormalFilter() {
23 return CreateHelper(false);
25 static mozilla::UniquePtr<nsComposeTxtSrvFilter> CreateMailFilter() {
26 return CreateHelper(true);
29 /**
30 * Indicates whether the content node should be skipped by the iterator
31 * @param aNode - node to skip
33 bool Skip(nsINode* aNode) const;
35 private:
36 // Helper - Intializer
37 void Init(bool aIsForMail) { mIsForMail = aIsForMail; }
39 static mozilla::UniquePtr<nsComposeTxtSrvFilter> CreateHelper(
40 bool aIsForMail);
42 bool mIsForMail = false;
45 #endif